Files
filament/shaders/src/depth_main.vs
Philip Rideout 90c17ccbad Filament now supports GPU vertex morphing.
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
2019-07-26 17:53:46 -04:00

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
}