Add Kuwahara Filter, implements #49
This commit is contained in:
parent
d512005b86
commit
632b4593aa
5 changed files with 167 additions and 0 deletions
BIN
examples/images/mountain.jpg
Normal file
BIN
examples/images/mountain.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 814 KiB |
34
examples/images/mountain.jpg.import
Normal file
34
examples/images/mountain.jpg.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://ben72llmopgaj"
|
||||
path="res://.godot/imported/mountain.jpg-c1b7de1e6557b826bc6f9324027e11af.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://examples/images/mountain.jpg"
|
||||
dest_files=["res://.godot/imported/mountain.jpg-c1b7de1e6557b826bc6f9324027e11af.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
16
examples/kuwahara.gdshader
Normal file
16
examples/kuwahara.gdshader
Normal file
|
@ -0,0 +1,16 @@
|
|||
shader_type canvas_item;
|
||||
|
||||
//!load ./images/mountain.jpg
|
||||
|
||||
#include "res://shaderlib/kuwahara.gdshaderinc"
|
||||
#include "res://shaderlib/hsv.gdshaderinc"
|
||||
|
||||
void fragment() {
|
||||
// Kuwahara
|
||||
COLOR.rgb = kuwahara(TEXTURE, UV, 20, 80.0, 18.0, 0.6, .15, 8);
|
||||
// A litte bit of color adjustments
|
||||
vec4 hsv = rgb2hsv(COLOR);
|
||||
hsv.x += .03;
|
||||
hsv.y *= 1.4;
|
||||
COLOR = hsv2rgb(hsv);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue