[examples] Add new example: shaders_vertex_displacement (#4186)
* shaders-vertex_displacement init * implement simulation of wave in ocean * update examples/README & add some comments * update comments * add gl100 shaders
This commit is contained in:
parent
92f60a99f6
commit
43b0c9410e
1 changed files with 261 additions and 11 deletions
|
|
@ -0,0 +1,16 @@
|
|||
#version 330
|
||||
|
||||
// Input fragment attributes (from fragment shader)
|
||||
in vec2 fragTexCoord;
|
||||
in float height;
|
||||
|
||||
// Output fragment color
|
||||
out vec4 finalColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 darkblue = vec4(0.0, 0.13, 0.18, 1.0);
|
||||
vec4 lightblue = vec4(1.0, 1.0, 1.0, 1.0);
|
||||
// interplate between two colors based on height
|
||||
finalColor = mix(darkblue, lightblue, height);
|
||||
}
|
||||
Loading…
Reference in a new issue