Advertisement
Zunesha

Shader Pixelização Godot 4

Sep 20th, 2024
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
GDScript 0.47 KB | Gaming | 0 0
  1. Shader Pixelização Godot 4
  2.  
  3. shader_type canvas_item;
  4. render_mode unshaded;
  5.  
  6. uniform sampler2D SCREEN_TEXTURE :hint_screen_texture,repeat_disable,filter_nearest;
  7. uniform float pixel_size: hint_range(1.0, 32.0, 1.0) = 1.0;
  8.  
  9. void fragment() {
  10.     float x = FRAGCOORD.x - mod(FRAGCOORD.x,pixel_size);
  11.     float y = FRAGCOORD.y - mod(FRAGCOORD.y,pixel_size);
  12.     float shift = floor(pixel_size/2.0);
  13.     COLOR = texture(SCREEN_TEXTURE,vec2(x + shift, y + shift) * SCREEN_PIXEL_SIZE);
  14.  
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement