Merge pull request #1238 from Azaezel/defaultNormal

https://github.com/GarageGames/Torque3D/issues/770 resolution
This commit is contained in:
Luis Anton Rebollo 2015-03-08 22:12:24 +01:00
commit 7e7025d1ca
2 changed files with 12 additions and 0 deletions

View file

@ -92,6 +92,12 @@ void GBufferConditionerGLSL::processVert( Vector<ShaderComponent*> &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

View file

@ -92,6 +92,12 @@ void GBufferConditionerHLSL::processVert( Vector<ShaderComponent*> &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