diff --git a/Engine/source/lighting/advanced/glsl/gBufferConditionerGLSL.cpp b/Engine/source/lighting/advanced/glsl/gBufferConditionerGLSL.cpp index 9a76d471b..6e5795e83 100644 --- a/Engine/source/lighting/advanced/glsl/gBufferConditionerGLSL.cpp +++ b/Engine/source/lighting/advanced/glsl/gBufferConditionerGLSL.cpp @@ -92,6 +92,12 @@ void GBufferConditionerGLSL::processVert( Vector &componentLis // grab incoming vert normal Var *inNormal = (Var*) LangElement::find( "normal" ); + if (!inNormal) + { + inNormal = new Var("normal", "vec3"); + meta->addStatement(new GenOp(" @ = vec3( 0.0, 0.0, 1.0 );\r\n", new DecOp(inNormal))); + Con::errorf("ShagerGen: Something went bad with ShaderGen. The normal should be already defined."); + } AssertFatal( inNormal, "Something went bad with ShaderGen. The normal should be already defined." ); // grab output for gbuffer normal diff --git a/Engine/source/lighting/advanced/hlsl/gBufferConditionerHLSL.cpp b/Engine/source/lighting/advanced/hlsl/gBufferConditionerHLSL.cpp index ed946e944..93f9477e9 100644 --- a/Engine/source/lighting/advanced/hlsl/gBufferConditionerHLSL.cpp +++ b/Engine/source/lighting/advanced/hlsl/gBufferConditionerHLSL.cpp @@ -92,6 +92,12 @@ void GBufferConditionerHLSL::processVert( Vector &componentLis // grab incoming vert normal Var *inNormal = (Var*) LangElement::find( "normal" ); + if (!inNormal) + { + inNormal = new Var("normal", "float3"); + meta->addStatement(new GenOp(" @ = float3( 0.0, 0.0, 1.0 );\r\n", new DecOp(inNormal))); + Con::errorf("ShagerGen: Something went bad with ShaderGen. The normal should be already defined."); + } AssertFatal( inNormal, "Something went bad with ShaderGen. The normal should be already defined." ); // grab output for gbuffer normal