sunBokeh feature added

This commit is contained in:
Duion 2016-06-02 20:52:46 +02:00
parent 5d52864c9f
commit 637a804fd7
6 changed files with 29 additions and 1 deletions

View file

@ -655,6 +655,11 @@ void ScatterSky::prepRenderImage( SceneRenderState *state )
state->getRenderPass()->addInst( ri );
}
*/
// Screen flare occlusion fix //sunBokeh feature
F32 screenRadius = GFX->getViewport().extent.y * mFlareScale * 0.01f;
Point3F lightWorldPos = state->getCameraPosition() - state->getFarPlane() * mLight->getDirection() * 0.9f;
F32 dist = ( lightWorldPos - state->getCameraPosition() ).len();
mFlareState.worldRadius = screenRadius * dist / state->getWorldToScreenScale().y;
// Light flare effect render instance.
if ( mFlareData && mNightInterpolant != 1.0f )