Shader/GlslWriter: Fix gl_Position.z remapping
This commit is contained in:
parent
1b271a29ef
commit
d040cc6767
|
|
@ -1151,11 +1151,12 @@ namespace Nz
|
|||
AppendLine(targetName, " = ", outputStructVarName, ".", name, ";");
|
||||
if (isOutputPosition)
|
||||
{
|
||||
// https://veldrid.dev/articles/backend-differences.html
|
||||
if (m_environment.flipYPosition)
|
||||
AppendLine(targetName, ".y *= ", s_flipYUniformName, ";");
|
||||
|
||||
if (m_environment.remapZPosition)
|
||||
AppendLine(targetName, ".z = ", targetName, ".z * 2.0 - 1.0;");
|
||||
AppendLine(targetName, ".z = ", targetName, ".z * 2.0 - ", targetName, ".w; ");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue