2026-03-02 15:04:15 +02:00
|
|
|
shader_type spatial;
|
|
|
|
|
render_mode unshaded;
|
|
|
|
|
|
|
|
|
|
uniform int mode = 1;
|
|
|
|
|
uniform sampler2D gradient;
|
|
|
|
|
varying vec3 world_position;
|
2026-03-03 13:38:25 +02:00
|
|
|
varying float color;
|
2026-03-02 15:04:15 +02:00
|
|
|
void vertex() {
|
|
|
|
|
// Called for every vertex the material is visible on.
|
|
|
|
|
world_position = VERTEX;
|
|
|
|
|
color = COLOR.r;
|
2026-03-03 13:38:25 +02:00
|
|
|
VERTEX += VERTEX * COLOR.q * 0.1f;
|
2026-03-02 15:04:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void fragment() {
|
|
|
|
|
// Called for every pixel the material is visible on.
|
|
|
|
|
float temp = sin((world_position.y-95.0) / 60.0);
|
|
|
|
|
|
|
|
|
|
temp = clamp(temp, 0.0, 1)*28.0;
|
|
|
|
|
if (mode == 1) {
|
|
|
|
|
ALBEDO = vec3(COLOR.r, COLOR.g, COLOR.b);
|
|
|
|
|
}
|
|
|
|
|
if (mode == 2)
|
|
|
|
|
{
|
|
|
|
|
vec4 ree = texture(gradient, vec2(color));
|
|
|
|
|
ALBEDO = vec3(ree.x, ree.y, ree.z);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//void light() {
|
|
|
|
|
// // Called for every pixel for every light affecting the material.
|
|
|
|
|
// // Uncomment to replace the default light processing function with this one.
|
|
|
|
|
//}
|