shader_type spatial; uniform vec3 target_position = vec3(0, 1.28, 1); varying vec3 world_position; uniform vec2 pixel_size = vec2(0.02, 0.02); void vertex() { world_position = (MODEL_MATRIX * vec4(VERTEX, 1.0)).xyz; } void fragment() { vec3 c = COLOR.rgb; float offset_x = floor((world_position.x-target_position.x) / 0.64) * 0.64; float offset_y = floor((world_position.y-target_position.y) / 0.64) * 0.64; float offset_z = floor((world_position.z-target_position.z) / 0.64) * 0.64; float brightness = clamp(1.0 + (offset_y)* 0.4,0.0,1.0); float contrast = 1.0 - (abs(offset_y)) * 0.05; float saturation = 1.0 - (abs(offset_y)) * 0.05; c.rgb = mix(vec3(0.0), c.rgb, brightness); c.rgb = mix(vec3(0.5), c.rgb, contrast); c.rgb = mix(vec3(dot(vec3(1.0), c.rgb) * 0.33333), c.rgb, saturation); ALBEDO = c.rgb; }