Add workaround for depth invariance on NVIDIA.

Fixes #645.
This commit is contained in:
prideout
2019-01-18 13:08:45 -08:00
committed by Philip Rideout
parent 98d39b7e7e
commit 91c946cfbd

View File

@@ -1,9 +1,14 @@
// The sole purpose of this no-op function is to improve parity between the depth vertex shader
// and color vertex shader, thus working around a variance issue seen with NVIDIA drivers.
void materialVertex(inout MaterialVertexInputs m) { }
void main() {
#if defined(VERTEX_DOMAIN_DEVICE)
gl_Position = getSkinnedPosition();
#else
MaterialVertexInputs material;
initMaterialVertex(material);
materialVertex(material);
gl_Position = getClipFromWorldMatrix() * material.worldPosition;
#endif