This is basically a MR description but this commit covers a lot of things so I'll include it so you don't have to look at the MR: This allows us to use BC6H and BC7 textures as is, provided the used OSG revision and hardware support them DDS images are unflipped by default, non-DDS bottom-left convention images are flipped (TGA, BMP, PNG, JPG) 3D DDS images always used top-left convention if they were used in post-processing Numerous things flipped in this commit to guarantee the same visual results are: - Terrain UV and blend maps - Water UV, normal map and simple water ripple alignment - NiTriShapeData and BSTriShape UV (unflipped), NiUVController vertical offset - NIF particles are NOT flipped, they remain flipped for Morrowind compatibility - GUI widget texture UV and convention - Cursor - Character preview inventory doll and race menu head UV and display - Loading screen scene image UV - Local and global map UVs (fog of war, unexplored and explored maps) - Saved game screenshot UV - Video widget UV - Rain particle alignment - Sun and moon UV - Tangent space handedness (bitangent direction) - Parallax vertical offset Things where this is a breaking change - Collada geometry UV (Example Suite and anything else affected must adopt the changes) - Compressed non-S3TC images that should but can't be flipped (this is KTX which we don't technically support yet) - Any forward pass shader replacements that currently still use the original tangent space handedness and parallax convention
13 lines
263 B
GLSL
13 lines
263 B
GLSL
#ifndef LIB_MATERIAL_PARALLAX
|
|
#define LIB_MATERIAL_PARALLAX
|
|
|
|
#define PARALLAX_SCALE 0.04
|
|
#define PARALLAX_BIAS -0.02
|
|
|
|
vec2 getParallaxOffset(vec3 eyeDir, float height)
|
|
{
|
|
return vec2(eyeDir.x, eyeDir.y) * ( height * PARALLAX_SCALE + PARALLAX_BIAS );
|
|
}
|
|
|
|
#endif
|