mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-12 19:31:41 +00:00
adds alphatest shadows for translucent objects
leverage the fact shadergen spits out a modified material per pass, in this instance the shadow pass, to basically flip the translucent aspect off if you've got both translucency and alphatesting flipped on.
This commit is contained in:
parent
9c381caea2
commit
ff4b025c2c
5 changed files with 7 additions and 3 deletions
|
|
@ -260,7 +260,7 @@ void ShadowRenderPassManager::addInst( RenderInst *inst )
|
|||
return;
|
||||
|
||||
const BaseMaterialDefinition *mat = meshRI->matInst->getMaterial();
|
||||
if ( !mat->castsShadows() || mat->isTranslucent() )
|
||||
if ( !mat->castsShadows() || (mat->isTranslucent() && !mat->isAlphatest()))
|
||||
{
|
||||
// Do not add this instance, return here and avoid the default behavior
|
||||
// of calling up to Parent::addInst()
|
||||
|
|
|
|||
|
|
@ -190,6 +190,8 @@ void ShadowMaterialHook::_overrideFeatures( ProcessedMaterial *mat,
|
|||
fd.features.removeFeature( MFT_TexAnim );
|
||||
fd.features.removeFeature( MFT_DiffuseMap );
|
||||
}
|
||||
else
|
||||
fd.features.removeFeature(MFT_IsTranslucent);
|
||||
|
||||
// HACK: Need to figure out how to enable these
|
||||
// suckers without this override call!
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue