Initial Commit
This commit is contained in:
commit
cf76e5c9b2
43 changed files with 1779 additions and 0 deletions
32
shaders/planet.gdshader
Normal file
32
shaders/planet.gdshader
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
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.
|
||||
//}
|
||||
Loading…
Add table
Add a link
Reference in a new issue