mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +00:00
Let's fix the texcoord alignment for RT Lighting.
This commit is contained in:
parent
3fabbc651f
commit
e784b0140c
2 changed files with 12 additions and 16 deletions
|
|
@ -2090,12 +2090,15 @@ void RTLightingFeatGLSL::processVert( Vector<ShaderComponent*> &componentList,
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addOutWsPosition( componentList, fd.features[MFT_UseInstancing], meta );
|
||||||
|
getOutWorldToTangent(componentList, meta, fd);
|
||||||
|
|
||||||
|
output = meta;
|
||||||
|
|
||||||
// Find the incoming vertex normal.
|
// Find the incoming vertex normal.
|
||||||
Var *inNormal = (Var*)LangElement::find( "normal" );
|
Var *inNormal = (Var*)LangElement::find( "normal" );
|
||||||
|
|
||||||
// Skip out on realtime lighting if we don't have a normal
|
|
||||||
// or we're doing some sort of baked lighting.
|
|
||||||
if ( !inNormal ||
|
if ( !inNormal ||
|
||||||
fd.features[MFT_LightMap] ||
|
fd.features[MFT_LightMap] ||
|
||||||
fd.features[MFT_ToneMap] ||
|
fd.features[MFT_ToneMap] ||
|
||||||
|
|
@ -2119,11 +2122,6 @@ void RTLightingFeatGLSL::processVert( Vector<ShaderComponent*> &componentList,
|
||||||
meta->addStatement( new GenOp( " @ = tMul( @, vec4( normalize( @ ), 0.0 ) ).xyz;\r\n", outNormal, objTrans, inNormal ) );
|
meta->addStatement( new GenOp( " @ = tMul( @, vec4( normalize( @ ), 0.0 ) ).xyz;\r\n", outNormal, objTrans, inNormal ) );
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
addOutWsPosition( componentList, fd.features[MFT_UseInstancing], meta );
|
|
||||||
|
|
||||||
getOutWorldToTangent(componentList, meta, fd);
|
|
||||||
|
|
||||||
output = meta;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTLightingFeatGLSL::processPix( Vector<ShaderComponent*> &componentList,
|
void RTLightingFeatGLSL::processPix( Vector<ShaderComponent*> &componentList,
|
||||||
|
|
|
||||||
|
|
@ -2178,11 +2178,14 @@ void RTLightingFeatHLSL::processVert( Vector<ShaderComponent*> &componentList,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addOutWsPosition( componentList, fd.features[MFT_UseInstancing], meta );
|
||||||
|
getOutWorldToTangent(componentList, meta, fd);
|
||||||
|
output = meta;
|
||||||
|
|
||||||
|
|
||||||
// Find the incoming vertex normal.
|
// Find the incoming vertex normal.
|
||||||
Var *inNormal = (Var*)LangElement::find( "normal" );
|
Var *inNormal = (Var*)LangElement::find( "normal" );
|
||||||
|
|
||||||
// Skip out on realtime lighting if we don't have a normal
|
|
||||||
// or we're doing some sort of baked lighting.
|
|
||||||
if ( !inNormal ||
|
if ( !inNormal ||
|
||||||
fd.features[MFT_LightMap] ||
|
fd.features[MFT_LightMap] ||
|
||||||
fd.features[MFT_ToneMap] ||
|
fd.features[MFT_ToneMap] ||
|
||||||
|
|
@ -2205,11 +2208,6 @@ void RTLightingFeatHLSL::processVert( Vector<ShaderComponent*> &componentList,
|
||||||
// Transform the normal to world space.
|
// Transform the normal to world space.
|
||||||
meta->addStatement( new GenOp( " @ = mul( @, float4( normalize( @ ), 0.0 ) ).xyz;\r\n", outNormal, objTrans, inNormal ) );
|
meta->addStatement( new GenOp( " @ = mul( @, float4( normalize( @ ), 0.0 ) ).xyz;\r\n", outNormal, objTrans, inNormal ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
addOutWsPosition( componentList, fd.features[MFT_UseInstancing], meta );
|
|
||||||
getOutWorldToTangent(componentList, meta, fd);
|
|
||||||
|
|
||||||
output = meta;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTLightingFeatHLSL::processPix( Vector<ShaderComponent*> &componentList,
|
void RTLightingFeatHLSL::processPix( Vector<ShaderComponent*> &componentList,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue