1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 06:35:30 +00:00
OpenMW/files/shaders/lib/material/parallax.glsl

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

13 lines
360 B
Plaintext
Raw Normal View History

2023-02-25 11:03:39 -08:00
#ifndef LIB_MATERIAL_PARALLAX
#define LIB_MATERIAL_PARALLAX
2016-03-22 21:15:20 +01:00
#define PARALLAX_SCALE 0.04
#define PARALLAX_BIAS -0.02
vec2 getParallaxOffset(vec3 eyeDir, mat3 tbnTranspose, float height, float flipY)
2016-03-22 21:15:20 +01:00
{
vec3 TSeyeDir = normalize(eyeDir * tbnTranspose);
return vec2(TSeyeDir.x, TSeyeDir.y * flipY) * ( height * PARALLAX_SCALE + PARALLAX_BIAS );
2016-03-22 21:15:20 +01:00
}
2023-02-25 11:03:39 -08:00
#endif