mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-22 08:03:45 +00:00
Consider zoom when culling billboards.
screenScale represents the current zoom factor, but may need some revision because I'm not sure if what it's doing is technically correct. It is used to multiply the culling distance for cells, as well as the fading distance.
This commit is contained in:
parent
88cc4129af
commit
74bd05030d
1 changed files with 4 additions and 2 deletions
|
|
@ -1550,8 +1550,10 @@ void GroundCover::prepRenderImage( SceneRenderState *state )
|
|||
{
|
||||
PROFILE_SCOPE( GroundCover_RenderBillboards );
|
||||
|
||||
F32 screenScale = state->getWorldToScreenScale().y / state->getViewport().extent.y;
|
||||
|
||||
// Set the far distance for billboards.
|
||||
mCuller.setFarDist( mRadius );
|
||||
mCuller.setFarDist( mRadius * screenScale );
|
||||
|
||||
F32 cullScale = 1.0f;
|
||||
if ( state->isReflectPass() )
|
||||
|
|
@ -1560,7 +1562,7 @@ void GroundCover::prepRenderImage( SceneRenderState *state )
|
|||
// Setup our shader const data.
|
||||
// Must be done prior to submitting our render instance.
|
||||
|
||||
mShaderConstData.fadeInfo.set( mFadeRadius * cullScale, mRadius * cullScale );
|
||||
mShaderConstData.fadeInfo.set( mFadeRadius * cullScale * screenScale, mRadius * cullScale * screenScale );
|
||||
|
||||
const F32 simTime = Sim::getCurrentTime() * 0.001f;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue