Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shaders Interessantes aplicados em TextureRect contendo texuras em branco Godot 4 ~>
- ################################################## 1- BLUR ##################################################
- shader_type canvas_item;
- uniform float amount : hint_range(0.0, 5.0);
- uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;
- void fragment() {
- COLOR = textureLod(SCREEN_TEXTURE, SCREEN_UV, amount);
- }
- ################################################ 2- Pixelize #################################################
- shader_type canvas_item;
- uniform float size_x = 0.008;
- uniform float size_y = 0.008;
- uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;
- void fragment() {
- vec2 uv = SCREEN_UV;
- uv -= mod(uv, vec2(size_x, size_y));
- COLOR.rgb = textureLod(SCREEN_TEXTURE, uv, 0.0).rgb;
- }
- ################################################ 3- Contrasted #################################################
- shader_type canvas_item;
- uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;
- void fragment() {
- vec3 c = textureLod(SCREEN_TEXTURE, SCREEN_UV, 0.0).rgb;
- c = mod(c + vec3(0.5), vec3(1.0));
- COLOR.rgb = c;
- }
- ################################################ 3- Negative #################################################
- shader_type canvas_item;
- uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;
- void fragment() {
- vec3 c = textureLod(SCREEN_TEXTURE, SCREEN_UV, 0.0).rgb;
- c = vec3(1.0) - c;
- COLOR.rgb = c;
- }
- ##################################### 4- EFEITO DENTRO D'ÁGUA ( EM COLORRECT BRANOCO) #################################################
- shader_type canvas_item;
- uniform float wave_count : hint_range(1.0, 20.0, 1.0) = 20.0;
- uniform float speed : hint_range(0.0, 10.0, 0.1) = 3.0;
- uniform float height : hint_range(0.0, 0.1, 0.001) = 0.003;
- uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;
- uniform vec4 water_tint : source_color = vec4(0.2, 0.6, 1.0, 0.1);
- void fragment() {
- vec2 cPos = -1.0 + 2.0 * UV / (1.0 / TEXTURE_PIXEL_SIZE);
- float cLength = length(cPos);
- vec2 uv = FRAGCOORD.xy / (1.0 / SCREEN_PIXEL_SIZE).xy + (cPos/cLength) * cos(cLength * wave_count - TIME * speed) * height;
- vec3 col = texture(SCREEN_TEXTURE,uv).xyz;
- COLOR = vec4(col,1.0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement