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