Post Game jam commit
This commit is contained in:
commit
6db2131520
164 changed files with 172524 additions and 0 deletions
22
shaders/pixelate_screen.gdshader
Normal file
22
shaders/pixelate_screen.gdshader
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
shader_type canvas_item;
|
||||
|
||||
// SUPER IMPORTANT, ELSE WE APPLY LIGHTNING TWICE!!
|
||||
render_mode unshaded;
|
||||
|
||||
uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest;
|
||||
uniform vec2 cam_pos;// move by a "sub_pixel" which is actually a full res pixel
|
||||
uniform vec2 scaling;
|
||||
|
||||
void fragment() {
|
||||
// move by a "sub_pixel" which is actually a full res pixel
|
||||
vec2 sub_uv = SCREEN_UV + (cam_pos * SCREEN_PIXEL_SIZE);
|
||||
|
||||
// number of downscaled pixles in UV coords
|
||||
vec2 pixels = SCREEN_PIXEL_SIZE * scaling;
|
||||
|
||||
// round down and read in the center of the pixel
|
||||
vec2 pixel_uv = floor(sub_uv / pixels) + 0.5;
|
||||
|
||||
COLOR = texture(screen_texture, pixel_uv * pixels) ;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue