Kuwahara Shader

by PeterEve

22

godot-kuwahara

This is a gdshader implementation of the Kuwahara filter, tuned to produce an oil-painting aesthetic. It is available as both a canvas_item and spatial shader.

Parliament Hill, Ottawa

(https://commons.wikimedia.org/wiki/File:Tulip_festival_in_Ottawa_-_2019_(47925742658).jpg)

Le Mont-Saint-Michel

(https://commons.wikimedia.org/wiki/File:Mont-Saint-Michel_vu_du_ciel.jpg)

Dallol

(https://commons.wikimedia.org/wiki/File:The_hydrothermal_system_of_Dallol.png)

Chateau de Chillon and Dents

(https://commons.wikimedia.org/wiki/File:001_Chateau_de_Chillon_and_Dents_du_Midi_Photo_by_Giles_Laurent.jpg)

Godot Third Person Shooter Demo

(https://godotengine.org/asset-library/asset/678)

Notes

Changing Kernel Size

The shader comes with 4 pre-made circular kernels to choose from: 3, 4, 5 and 6 pixels wide. The examples above were captured using the default 4 pixel kernel. To use a different kernel size, rename at lines 15, 17 and 55. The larger the kernel, the slower the shader.

Use in Spatial Scenes

Follow the Full Screen Quad instructions found in this tutorial. The shader has undergone significant optimisation and should be able to achieve 1920x1080 60fps on any modern computer at the supplied kernel sizes.

Modifications to the Basic Algorithm

  • Circular kernels to reduce block artifacts
  • Approximate standard deviation to improve performance

Version

1.0

Engine

3.4

Category

Shaders

Download

Version1.0
Download

Support

If you need help or have questions about this plugin, please contact the author.

Contact Author