mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-25 23:29:24 +00:00
sunbokeh partly fix, still needs work
This commit is contained in:
parent
5b62df81c7
commit
5f2ab23fac
6 changed files with 83 additions and 21 deletions
|
|
@ -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 )
|
||||
|
|
|
|||
|
|
@ -109,11 +109,7 @@ public:
|
|||
F32 getAzimuth() const { return mSunAzimuth; }
|
||||
///
|
||||
F32 getElevation() const { return mSunElevation; }
|
||||
/// sunBokeh feature
|
||||
F32 getSunVisibility() const { if (mFlareData) return mFlareData->getVisibility(); else return 0; }
|
||||
// Same method as above, but also checks if the data is valid, needs more CPU time, only use if above method fails
|
||||
//F32 getSunVisibility() const { if dynamic_cast<LightFlareData*>(mFlareData) return mFlareData->getVisibility(); else return 0; }
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
void _render( ObjectRenderInst *ri, SceneRenderState *state, BaseMatInstance *overrideMat );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue