summaryrefslogtreecommitdiff
path: root/demo/first_person/height.fs
blob: 19315b997a44270a7c46272056c4aac566090985 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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);
}