You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
716 B
Plaintext
31 lines
716 B
Plaintext
|
8 months ago
|
shader_type spatial;
|
||
|
|
render_mode unshaded;
|
||
|
|
uniform bool is_open = false;
|
||
|
|
uniform int mark_type = 0; //0空气墙 1黑块 2绿幕
|
||
|
|
|
||
|
|
uniform sampler2D tex : source_color;
|
||
|
|
uniform sampler2D tex_sub1 : source_color;
|
||
|
|
|
||
|
|
void fragment() {
|
||
|
|
if (is_open){
|
||
|
|
if (mark_type == 0){
|
||
|
|
discard;
|
||
|
|
}else if (mark_type == 1){
|
||
|
|
ALBEDO = vec3(0.0);
|
||
|
|
}else if (mark_type == 2){
|
||
|
|
vec3 color = vec3(0.0);
|
||
|
|
vec4 background = textureLod(tex, SCREEN_UV, 0.0);
|
||
|
|
vec4 background_sub1 = textureLod(tex_sub1, SCREEN_UV, 0.0);
|
||
|
|
if (background.a > 0.0){
|
||
|
|
color.rgb = background.rgb;
|
||
|
|
}
|
||
|
|
if (background_sub1.a > 0.0){
|
||
|
|
color.rgb = background_sub1.rgb;
|
||
|
|
}
|
||
|
|
ALBEDO = color;
|
||
|
|
}
|
||
|
|
}else{
|
||
|
|
ALBEDO = COLOR.rgb;
|
||
|
|
}
|
||
|
|
}
|