Make some test with terrain generator
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
shader_type spatial;
|
||||
render_mode cull_disabled;
|
||||
render_mode cull_back;
|
||||
|
||||
group_uniforms textures;
|
||||
uniform sampler2D texture_top : source_color, filter_linear_mipmap, repeat_enable;
|
||||
@@ -11,6 +11,8 @@ uniform float slope_threshold : hint_range(0.0, 1.0) = 0.7;
|
||||
|
||||
group_uniforms uv_scaling;
|
||||
uniform vec3 uv_scale = vec3(0.1, 0.1, 0.1);
|
||||
uniform vec2 texture_top_tiling = vec2(1.0, 1.0);
|
||||
uniform vec2 texture_side_tiling = vec2(1.0, 1.0);
|
||||
|
||||
varying vec3 world_pos;
|
||||
varying vec3 world_normal;
|
||||
@@ -23,9 +25,9 @@ void vertex() {
|
||||
void fragment() {
|
||||
vec3 abs_normal = abs(world_normal);
|
||||
|
||||
vec2 uv_xz = world_pos.xz * uv_scale.x;
|
||||
vec2 uv_xy = world_pos.xy * uv_scale.y;
|
||||
vec2 uv_zy = world_pos.zy * uv_scale.z;
|
||||
vec2 uv_xz = world_pos.xz * uv_scale.x * texture_top_tiling;
|
||||
vec2 uv_xy = world_pos.xy * uv_scale.y * texture_side_tiling;
|
||||
vec2 uv_zy = world_pos.zy * uv_scale.z * texture_side_tiling;
|
||||
|
||||
vec3 weights = pow(abs_normal, vec3(blend_sharpness));
|
||||
weights /= (weights.x + weights.y + weights.z);
|
||||
|
||||
Reference in New Issue
Block a user