diff --git a/libs/filamat/src/shaders/ShaderGenerator.cpp b/libs/filamat/src/shaders/ShaderGenerator.cpp index 2de04ad1e8..c83cd9390f 100644 --- a/libs/filamat/src/shaders/ShaderGenerator.cpp +++ b/libs/filamat/src/shaders/ShaderGenerator.cpp @@ -249,8 +249,8 @@ std::string ShaderGenerator::createVertexProgram(filament::backend::ShaderModel cg.generateCommonMaterial(vs, ShaderType::VERTEX); if (variant.isDepthPass() && - (material.blendingMode != BlendingMode::MASKED) && - !hasCustomDepthShader()) { + (material.blendingMode != BlendingMode::MASKED) && + !hasCustomDepthShader()) { // these variants are special and are treated as DEPTH variants. Filament will never // request that variant for the color pass. cg.generateDepthShaderMain(vs, ShaderType::VERTEX); diff --git a/shaders/src/depth_main.vs b/shaders/src/depth_main.vs index 7c4e8a78ab..a1e1baf8f9 100644 --- a/shaders/src/depth_main.vs +++ b/shaders/src/depth_main.vs @@ -2,6 +2,8 @@ // and color vertex shader, thus working around a variance issue seen with NVIDIA drivers. void materialVertex(inout MaterialVertexInputs m) { } +// NOTE: This shader is only used when the user's material does not have custom vertex code. +// There is no need to check anything related to material inputs in this file. void main() { // World position is used to compute gl_Position, except for vertices already in the device domain. @@ -20,10 +22,6 @@ void main() { gl_Position = getClipFromWorldMatrix() * getWorldPosition(material); #endif -#ifdef MATERIAL_HAS_CLIP_SPACE_TRANSFORM - gl_Position = getClipSpaceTransform(material) * gl_Position; -#endif - #if defined(HAS_VSM) vertex_worldPosition = material.worldPosition.xyz; #endif diff --git a/shaders/src/main.vs b/shaders/src/main.vs index 2a501df7a3..abbb947817 100644 --- a/shaders/src/main.vs +++ b/shaders/src/main.vs @@ -108,7 +108,7 @@ void main() { gl_Position = getClipFromWorldMatrix() * getWorldPosition(material); #endif -#ifdef MATERIAL_HAS_CLIP_SPACE_TRANSFORM +#if defined(MATERIAL_HAS_CLIP_SPACE_TRANSFORM) gl_Position = getClipSpaceTransform(material) * gl_Position; #endif