Fix SkatterSky flare occlusion.

This commit is contained in:
LuisAntonRebollo 2014-12-08 23:31:22 +01:00 committed by Daniel Buckmaster
parent 6338b8cc82
commit 190f68b998
5 changed files with 105 additions and 40 deletions

View file

@ -658,6 +658,11 @@ void ScatterSky::prepRenderImage( SceneRenderState *state )
mFlareState.lightMat.identity();
mFlareState.lightMat.setPosition( lightPos );
F32 dist = ( lightPos - state->getCameraPosition( ) ).len( );
F32 coronaScale = 0.5f;
F32 screenRadius = GFX->getViewport( ).extent.y * coronaScale * 0.5f;
mFlareState.worldRadius = screenRadius * dist / state->getWorldToScreenScale( ).y;
mFlareData->prepRender( state, &mFlareState );
}