2016-03-22 20:15:20 +00:00
|
|
|
#define PARALLAX_SCALE 0.04
|
|
|
|
#define PARALLAX_BIAS -0.02
|
|
|
|
|
2016-06-16 16:07:10 +00:00
|
|
|
vec2 getParallaxOffset(vec3 eyeDir, mat3 tbnTranspose, float height, float flipY)
|
2016-03-22 20:15:20 +00:00
|
|
|
{
|
2016-06-16 15:31:17 +00:00
|
|
|
vec3 TSeyeDir = normalize(eyeDir * tbnTranspose);
|
2016-06-16 16:07:10 +00:00
|
|
|
return vec2(TSeyeDir.x, TSeyeDir.y * flipY) * ( height * PARALLAX_SCALE + PARALLAX_BIAS );
|
2016-03-22 20:15:20 +00:00
|
|
|
}
|