1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-22 10:53:54 +00:00
openmw/files/shaders/compatibility/water.vert

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
733 B
GLSL
Raw Normal View History

#version 120
2023-02-25 19:03:39 +00:00
#include "lib/core/vertex.h.glsl"
varying vec4 position;
2020-03-14 12:39:32 +00:00
varying float linearDepth;
#include "shadows_vertex.glsl"
2023-02-25 19:03:39 +00:00
#include "lib/view/depth.glsl"
uniform vec3 nodePosition;
uniform vec3 playerPos;
varying vec3 worldPos;
varying vec2 rippleMapUV;
void main(void)
{
2023-02-25 19:03:39 +00:00
gl_Position = modelToClip(gl_Vertex);
position = gl_Vertex;
worldPos = position.xyz + nodePosition.xyz;
rippleMapUV = (worldPos.xy - playerPos.xy + (@ripple_map_size * @ripple_map_world_scale / 2.0)) / @ripple_map_size / @ripple_map_world_scale;
2023-02-25 19:03:39 +00:00
vec4 viewPos = modelToView(gl_Vertex);
linearDepth = getLinearDepth(gl_Position.z, viewPos.z);
2021-06-01 19:15:25 +00:00
setupShadowCoords(viewPos, normalize((gl_NormalMatrix * gl_Normal).xyz));
}