mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-14 04:03:46 +00:00
Add support for both ies and cookie
Both ies and cookies can now exist on a light We are still not using all the capabilities of an IES profile, such as candela and luminance values we are just using them as a mask for the moment Issues compiling on mac and linux, will need to update the ies-loader to use torque methods instead of std::
This commit is contained in:
parent
a12d915180
commit
4417462499
10 changed files with 142 additions and 27 deletions
|
|
@ -277,6 +277,7 @@ void AdvancedLightManager::_initLightFields()
|
|||
DEFINE_LIGHT_FIELD( attenuationRatio, TypePoint3F, NULL );
|
||||
DEFINE_LIGHT_FIELD( shadowType, TYPEID< ShadowType >(), ConsoleBaseType::getType( TYPEID< ShadowType >() )->getEnumTable() );
|
||||
DEFINE_LIGHT_FIELD( texSize, TypeS32, NULL );
|
||||
DEFINE_LIGHT_FIELD( iesProfile, TypeStringFilename, NULL );
|
||||
DEFINE_LIGHT_FIELD( cookie, TypeStringFilename, NULL );
|
||||
DEFINE_LIGHT_FIELD( numSplits, TypeS32, NULL );
|
||||
DEFINE_LIGHT_FIELD( logWeight, TypeF32, NULL );
|
||||
|
|
@ -300,6 +301,9 @@ void AdvancedLightManager::_initLightFields()
|
|||
ADD_LIGHT_FIELD( "shadowType", TYPEID< ShadowType >(), shadowType,
|
||||
"The type of shadow to use on this light." );
|
||||
|
||||
ADD_LIGHT_FIELD("iesProfile", TypeStringFilename, iesProfile,
|
||||
"A photometric profile for the light.");
|
||||
|
||||
ADD_LIGHT_FIELD( "cookie", TypeStringFilename, cookie,
|
||||
"A custom pattern texture which is projected from the light." );
|
||||
|
||||
|
|
@ -496,6 +500,17 @@ bool AdvancedLightManager::setTextureStage( const SceneData &sgData,
|
|||
|
||||
return true;
|
||||
}
|
||||
else if (currTexFlag == Material::PhotometricMask)
|
||||
{
|
||||
S32 reg = lsc->mIesProfileSC->getSamplerRegister();
|
||||
if (reg != -1 && sgData.lights[0])
|
||||
{
|
||||
ShadowMapParams* p = sgData.lights[0]->getExtended<ShadowMapParams>();
|
||||
GFX->setTexture(reg, p->getIesProfileTex());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue