32 lines
1.2 KiB
Plaintext
32 lines
1.2 KiB
Plaintext
shader_type canvas_item;
|
|
//render_mode unshaded;
|
|
//uniform vec2 light_direction = vec2(0.2, 1);
|
|
//uniform sampler2D grab_texture: source_color;
|
|
uniform sampler2D SCREEN_TEXTURE: hint_screen_texture, filter_linear_mipmap;
|
|
|
|
//void vertex() {
|
|
//}
|
|
void fragment(){
|
|
//vec4 texture_color = texture(TEXTURE, UV);
|
|
////depth in alpha channel
|
|
//float depth = texture_color.w;
|
|
//vec2 sample_point = UV - LIGHT_DIRECTION * depth;
|
|
//vec4 grab_color = texture(grab_texture, sample_point);
|
|
//if (grab_color.a > 0.0) COLOR.xyz *= 0.5;
|
|
//vec4 color = texture(SCREEN_TEXTURE, SCREEN_UV);
|
|
vec4 color = textureLod(SCREEN_TEXTURE, SCREEN_UV, 0.0);
|
|
if (color.a > 0.0 && color.a < 1.0) COLOR = vec4(color.r, 0.7, 0.7, 1.0);
|
|
else if (color.a != 0.0) COLOR = vec4(0.7, color.g, 0.7, 1.0);
|
|
else COLOR = color;
|
|
}
|
|
//void light() {
|
|
//vec4 color = texture(SCREEN_TEXTURE, SCREEN_UV);
|
|
//float depth = 1.0;
|
|
//vec2 sample_point = UV - LIGHT_DIRECTION.xy * depth;
|
|
//if (SHADOW_MODULATE.w == 0.5) COLOR = vec4(COLOR.rgb, 1.0);
|
|
//vec4 grab_color = texture(grab_texture, sample_point);
|
|
//COLOR = LIGHT_DIRECTION
|
|
//float cNdotL = max(0.0, dot(NORMAL, LIGHT_DIRECTION));
|
|
//LIGHT = vec4(LIGHT_COLOR.rgb * COLOR.rgb * LIGHT_ENERGY * cNdotL, LIGHT_COLOR.a);
|
|
//}
|