mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-01 16:45:35 +00:00
terrain lod morph fix
This commit is contained in:
parent
8c8228a15c
commit
3feb4ce61b
1 changed files with 3 additions and 3 deletions
|
@ -55,7 +55,7 @@
|
||||||
shUniform(float2, lodMorph) @shAutoConstant(lodMorph, custom, 1001)
|
shUniform(float2, lodMorph) @shAutoConstant(lodMorph, custom, 1001)
|
||||||
|
|
||||||
shVertexInput(float2, uv0)
|
shVertexInput(float2, uv0)
|
||||||
shVertexInput(float2, delta) // lodDelta, lodThreshold
|
shVertexInput(float2, uv1) // lodDelta, lodThreshold
|
||||||
|
|
||||||
#if SHADOWS
|
#if SHADOWS
|
||||||
shUniform(float4x4, texViewProjMatrix0) @shAutoConstant(texViewProjMatrix0, texture_viewproj_matrix)
|
shUniform(float4x4, texViewProjMatrix0) @shAutoConstant(texViewProjMatrix0, texture_viewproj_matrix)
|
||||||
|
@ -85,11 +85,11 @@
|
||||||
// result is negative (it will only be -1 in fact, since after that
|
// result is negative (it will only be -1 in fact, since after that
|
||||||
// the vertex will never be indexed), we will achieve our aim.
|
// the vertex will never be indexed), we will achieve our aim.
|
||||||
// sign(vertexLOD - targetLOD) == -1 is to morph
|
// sign(vertexLOD - targetLOD) == -1 is to morph
|
||||||
float toMorph = -min(0, sign(delta.y - lodMorph.y));
|
float toMorph = -min(0, sign(uv1.y - lodMorph.y));
|
||||||
|
|
||||||
// morph
|
// morph
|
||||||
// this assumes XZ terrain alignment
|
// this assumes XZ terrain alignment
|
||||||
worldPos.y += delta.x * toMorph * lodMorph.x;
|
worldPos.y += uv1.x * toMorph * lodMorph.x;
|
||||||
|
|
||||||
|
|
||||||
shOutputPosition = shMatrixMult(viewProjMatrix, worldPos);
|
shOutputPosition = shMatrixMult(viewProjMatrix, worldPos);
|
||||||
|
|
Loading…
Reference in a new issue