mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-07-04 20:31:16 +00:00
Added shaders
This commit is contained in:
parent
45f3e9514d
commit
7414ff51c8
106 changed files with 2642 additions and 0 deletions
30
Shaders/ursc/canvas_item/dithering.gdshader
Normal file
30
Shaders/ursc/canvas_item/dithering.gdshader
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#pragma disable_preprocessor
|
||||
|
||||
shader_type canvas_item;
|
||||
|
||||
// 0: bypass
|
||||
uniform float color_depth: hint_range(0, 32, 8) = 24;
|
||||
|
||||
uniform sampler2D dithering_pattern_texture:
|
||||
hint_default_white, repeat_enable, filter_nearest;
|
||||
|
||||
void fragment()
|
||||
{
|
||||
vec3 base_color = texture(TEXTURE, UV).rgb;
|
||||
|
||||
if (color_depth > 0.0)
|
||||
{
|
||||
vec2 dpt_size = vec2(textureSize(dithering_pattern_texture, 0));
|
||||
vec2 texture_size = vec2(textureSize(TEXTURE, 0));
|
||||
|
||||
vec3 dithering = texture(
|
||||
dithering_pattern_texture, UV * (texture_size / dpt_size)).rgb - 0.5;
|
||||
|
||||
COLOR.rgb = round(
|
||||
base_color.rgb * color_depth + dithering) / color_depth;
|
||||
}
|
||||
else
|
||||
{
|
||||
COLOR.rgb = base_color;
|
||||
}
|
||||
}
|
||||
1
Shaders/ursc/canvas_item/dithering.gdshader.uid
Normal file
1
Shaders/ursc/canvas_item/dithering.gdshader.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://di7y6sooqe3t4
|
||||
16
Shaders/ursc/canvas_item/fade.gdshader
Normal file
16
Shaders/ursc/canvas_item/fade.gdshader
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#pragma disable_preprocessor
|
||||
|
||||
shader_type canvas_item;
|
||||
|
||||
uniform sampler2D SCREEN_TEXTURE: hint_screen_texture, filter_nearest, repeat_disable;
|
||||
|
||||
// 1: white
|
||||
// -1: black
|
||||
uniform int mode: hint_range(-1, 1, 2) = -1;
|
||||
|
||||
void fragment()
|
||||
{
|
||||
vec3 screen_color = texture(SCREEN_TEXTURE, SCREEN_UV).rgb;
|
||||
COLOR.rgb = screen_color + COLOR.a * float(mode);
|
||||
COLOR.a = 1.0;
|
||||
}
|
||||
1
Shaders/ursc/canvas_item/fade.gdshader.uid
Normal file
1
Shaders/ursc/canvas_item/fade.gdshader.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://ddas7a15ugrdn
|
||||
Loading…
Add table
Add a link
Reference in a new issue