sunbokeh partly fix, still needs work

This commit is contained in:
Duion 2016-06-21 12:05:21 +02:00
parent 5b62df81c7
commit 5f2ab23fac
6 changed files with 83 additions and 21 deletions

View file

@ -42,7 +42,6 @@
#include "materials/sceneData.h"
#include "environment/timeOfDay.h"
ConsoleDocClass( ScatterSky,
"@brief Represents both the sun and sky for scenes with a dynamic time of day.\n\n"
@ -655,11 +654,6 @@ 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 )