This works by aliasing CUSTOM0 - CUSTOM7 to morphing attributes, and by extending our existing skinning variant. This PR was tested against some upcoming changes to gltfio. Issue #1149, #1417
21 lines
730 B
GLSL
21 lines
730 B
GLSL
// 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 = getPosition();
|
|
#else
|
|
MaterialVertexInputs material;
|
|
initMaterialVertex(material);
|
|
materialVertex(material);
|
|
gl_Position = getClipFromWorldMatrix() * getWorldPosition(material);
|
|
#endif
|
|
|
|
#if defined(TARGET_VULKAN_ENVIRONMENT)
|
|
// In Vulkan, clip-space Z is [0,w] rather than [-w,+w] and Y is flipped.
|
|
gl_Position.y = -gl_Position.y;
|
|
gl_Position.z = (gl_Position.z + gl_Position.w) * 0.5;
|
|
#endif
|
|
}
|