More work on maps and multiplayer
This commit is contained in:
18
visuals/materials/maptile.tres
Normal file
18
visuals/materials/maptile.tres
Normal file
@@ -0,0 +1,18 @@
|
||||
[gd_resource type="ShaderMaterial" load_steps=4 format=3 uid="uid://dljweksgxvqv6"]
|
||||
|
||||
[ext_resource type="Shader" uid="uid://dtq021j73hhht" path="res://visuals/shaders/maptile.gdshader" id="1_o0obt"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_2ho3f"]
|
||||
offsets = PackedFloat32Array(0, 0.245, 0.56, 0.8025, 1)
|
||||
colors = PackedColorArray(0, 0, 0.003921569, 1, 1.6845763e-06, 0, 0.54036456, 1, 0.0007814509, 0.22053, 0.7667125, 1, 0.00022246034, 0.29345024, 0.68059045, 1, 0, 0.49560964, 0.86397636, 1)
|
||||
|
||||
[sub_resource type="GradientTexture1D" id="GradientTexture1D_lvjv7"]
|
||||
gradient = SubResource("Gradient_2ho3f")
|
||||
width = 1024
|
||||
|
||||
[resource]
|
||||
render_priority = 0
|
||||
shader = ExtResource("1_o0obt")
|
||||
shader_parameter/height_gradient = SubResource("GradientTexture1D_lvjv7")
|
||||
shader_parameter/vertical_offset = 9999.0
|
||||
shader_parameter/vertical_range = 6.0
|
||||
24
visuals/shaders/maptile.gdshader
Normal file
24
visuals/shaders/maptile.gdshader
Normal file
@@ -0,0 +1,24 @@
|
||||
shader_type spatial;
|
||||
|
||||
uniform sampler2D height_gradient;
|
||||
uniform float vertical_offset;
|
||||
uniform float vertical_range : hint_range(1.0, 12.0, 1.0);
|
||||
varying vec3 world_position;
|
||||
|
||||
void vertex() {
|
||||
// Called for every vertex the material is visible on.
|
||||
world_position = (MODEL_MATRIX * vec4(VERTEX, 1)).xyz;
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
float h = (world_position.y - vertical_offset)/vertical_range;
|
||||
vec2 uv = vec2(clamp(h, 0.001, 1.0),0.5);
|
||||
vec4 color = texture(height_gradient, uv);
|
||||
ALBEDO = color.rgb;
|
||||
// Called for every pixel the material is visible on.
|
||||
}
|
||||
|
||||
//void light() {
|
||||
// // Called for every pixel for every light affecting the material.
|
||||
// // Uncomment to replace the default light processing function with this one.
|
||||
//}
|
||||
1
visuals/shaders/maptile.gdshader.uid
Normal file
1
visuals/shaders/maptile.gdshader.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dtq021j73hhht
|
||||
Reference in New Issue
Block a user