30 lines
579 B
Plaintext
30 lines
579 B
Plaintext
shader_type spatial;
|
|
render_mode blend_mix, depth_prepass_alpha;
|
|
|
|
uniform vec4 albedo_color : source_color;
|
|
instance uniform float built_amount = 2.0;
|
|
|
|
varying float model_y;
|
|
|
|
// Called for every vertex the material is visible on.
|
|
void vertex() {
|
|
model_y = VERTEX.y;
|
|
}
|
|
|
|
// Called for every pixel the material is visible on.
|
|
void fragment() {
|
|
float base_opacity = 0.25;
|
|
|
|
if (model_y > built_amount) {
|
|
ALPHA = base_opacity;
|
|
} else {
|
|
ALPHA = 1.0;
|
|
}
|
|
|
|
ALBEDO.rgb = albedo_color.rgb;
|
|
}
|
|
|
|
// Called for every pixel for every light affecting the material.
|
|
//void light() {
|
|
//}
|