mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +00:00
Merge pull request #1238 from Azaezel/defaultNormal
https://github.com/GarageGames/Torque3D/issues/770 resolution
This commit is contained in:
commit
7e7025d1ca
2 changed files with 12 additions and 0 deletions
|
|
@ -92,6 +92,12 @@ void GBufferConditionerGLSL::processVert( Vector<ShaderComponent*> &componentLis
|
||||||
|
|
||||||
// grab incoming vert normal
|
// grab incoming vert normal
|
||||||
Var *inNormal = (Var*) LangElement::find( "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." );
|
AssertFatal( inNormal, "Something went bad with ShaderGen. The normal should be already defined." );
|
||||||
|
|
||||||
// grab output for gbuffer normal
|
// grab output for gbuffer normal
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,12 @@ void GBufferConditionerHLSL::processVert( Vector<ShaderComponent*> &componentLis
|
||||||
|
|
||||||
// grab incoming vert normal
|
// grab incoming vert normal
|
||||||
Var *inNormal = (Var*) LangElement::find( "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." );
|
AssertFatal( inNormal, "Something went bad with ShaderGen. The normal should be already defined." );
|
||||||
|
|
||||||
// grab output for gbuffer normal
|
// grab output for gbuffer normal
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue