Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/shaders/glsl/water_high.vs
Show All 23 Lines | |||||
varying vec3 worldPos; | varying vec3 worldPos; | ||||
varying float waterDepth; | varying float waterDepth; | ||||
varying vec2 waterInfo; | varying vec2 waterInfo; | ||||
varying vec3 v; | varying vec3 v; | ||||
varying vec4 normalCoords; | varying vec4 normalCoords; | ||||
#if USE_REFLECTION | |||||
varying vec3 reflectionCoords; | varying vec3 reflectionCoords; | ||||
#endif | |||||
#if USE_REFRACTION | |||||
varying vec3 refractionCoords; | varying vec3 refractionCoords; | ||||
#endif | |||||
varying vec2 losCoords; | varying vec2 losCoords; | ||||
varying float fwaviness; | varying float fwaviness; | ||||
varying vec2 WindCosSin; | varying vec2 WindCosSin; | ||||
#if USE_SHADOW && USE_SHADOWS_ON_WATER | #if USE_SHADOW && USE_SHADOWS_ON_WATER | ||||
varying vec4 v_shadow; | varying vec4 v_shadow; | ||||
#endif | #endif | ||||
Show All 11 Lines | void main() | ||||
WindCosSin = vec2(cos(-windAngle), sin(-windAngle)); | WindCosSin = vec2(cos(-windAngle), sin(-windAngle)); | ||||
float newX = a_vertex.x * WindCosSin.x - a_vertex.z * WindCosSin.y; | float newX = a_vertex.x * WindCosSin.x - a_vertex.z * WindCosSin.y; | ||||
float newY = a_vertex.x * WindCosSin.y + a_vertex.z * WindCosSin.x; | float newY = a_vertex.x * WindCosSin.y + a_vertex.z * WindCosSin.x; | ||||
normalCoords = vec4(newX, newY, time, 0.0); | normalCoords = vec4(newX, newY, time, 0.0); | ||||
normalCoords.xy *= repeatScale; | normalCoords.xy *= repeatScale; | ||||
// Projective texturing | // Projective texturing | ||||
#if USE_REFLECTION | |||||
reflectionCoords = (reflectionMatrix * vec4(a_vertex, 1.0)).rga; | reflectionCoords = (reflectionMatrix * vec4(a_vertex, 1.0)).rga; | ||||
#endif | |||||
#if USE_REFRACTION | |||||
refractionCoords = (refractionMatrix * vec4(a_vertex, 1.0)).rga; | refractionCoords = (refractionMatrix * vec4(a_vertex, 1.0)).rga; | ||||
#endif | |||||
losCoords = (losMatrix * vec4(a_vertex, 1.0)).rg; | losCoords = (losMatrix * vec4(a_vertex, 1.0)).rg; | ||||
#if USE_SHADOW && USE_SHADOWS_ON_WATER | #if USE_SHADOW && USE_SHADOWS_ON_WATER | ||||
v_shadow = shadowTransform * vec4(a_vertex, 1.0); | v_shadow = shadowTransform * vec4(a_vertex, 1.0); | ||||
#if USE_SHADOW_SAMPLER && USE_SHADOW_PCF | #if USE_SHADOW_SAMPLER && USE_SHADOW_PCF | ||||
v_shadow.xy *= shadowScale.xy; | v_shadow.xy *= shadowScale.xy; | ||||
#endif | #endif | ||||
#endif | #endif | ||||
Show All 10 Lines |
Wildfire Games · Phabricator