mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-26 18:13:47 +00:00
Shadow tests
only works on vectorLight (eg sun and scatter sky) for now
This commit is contained in:
parent
abbfb634f3
commit
239c7e58d2
9 changed files with 182 additions and 121 deletions
|
|
@ -807,7 +807,9 @@ void AdvancedLightBinManager::LightMaterialInfo::setLightParameters( const Light
|
|||
const F32 innerCone = getMin(lightInfo->getInnerConeAngle(), outerCone);
|
||||
const F32 outerCos = mCos(mDegToRad(outerCone / 2.0f));
|
||||
const F32 innerCos = mCos(mDegToRad(innerCone / 2.0f));
|
||||
Point2F spotParams(outerCos,innerCos - outerCos);
|
||||
const F32 lightAngleScale = 1.0f / getMax(0.001f, (innerCos - outerCos));
|
||||
const F32 lightAngleOffset = -outerCos * lightAngleScale;
|
||||
Point2F spotParams(lightAngleScale, lightAngleOffset);
|
||||
|
||||
matParams->setSafe( lightSpotParams, spotParams );
|
||||
matParams->setSafe( lightDirection, lightInfo->getDirection());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue