Added automatic procedural level of detail to planets

This commit is contained in:
2024-02-29 09:00:00 -05:00
parent c2399094c4
commit ec869732ba
14 changed files with 326 additions and 237 deletions

View File

@ -0,0 +1,18 @@
shader_type spatial;
uniform float min_elevation;
uniform float max_elevation;
uniform sampler2D elevation_color;
varying float height;
void vertex() {
height = length(VERTEX);
}
void fragment() {
float t = height/(max_elevation-min_elevation)- (min_elevation / (max_elevation-min_elevation));
vec3 color = texture(elevation_color, vec2(t, 0.0)).rgb;
ALBEDO = color;
}