diff options
Diffstat (limited to 'demo/first_person/height.fs')
-rw-r--r-- | demo/first_person/height.fs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/demo/first_person/height.fs b/demo/first_person/height.fs new file mode 100644 index 0000000..19315b9 --- /dev/null +++ b/demo/first_person/height.fs @@ -0,0 +1,18 @@ +#version 330 core + +in vec3 pos; +in vec3 normal; +in vec2 uv; + +uniform sampler2D grass; + +out vec4 fragment_color; + + +void main() +{ + vec4 tex = texture(grass, uv); + vec4 grey = vec4(0.3, 0.3, 0.3, 1.0); + float steepness = dot(vec3(0, 1, 0), normal); + fragment_color = mix(tex, grey, steepness); +} |