diff options
author | sanine <sanine.not@pm.me> | 2022-10-04 14:53:08 -0500 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2022-10-04 14:53:08 -0500 |
commit | 6d96b0e7ea1d98e44647d0bbbba232701a7d557e (patch) | |
tree | 15fa9d310f1db5767b662fb0bb4cad8a560d3650 /demo/first_person/height.fs | |
parent | 0c55c0e1b48de55fea401ea1b2b3f2280ef0f93c (diff) |
add first person demo
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); +} |