Adetonics/planet.gdshader
2026-03-02 13:52:26 +02:00

32 lines
771 B
Text

shader_type spatial;
render_mode unshaded;
uniform int mode = 1;
uniform sampler2D gradient;
varying vec3 world_position;
varying flat float color;
void vertex() {
// Called for every vertex the material is visible on.
world_position = VERTEX;
color = COLOR.r;
}
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.
//}