mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-09 23:40:42 +00:00
Fix lens flares in VR
This commit is contained in:
parent
14628e3937
commit
c6d2456a7c
3 changed files with 44 additions and 33 deletions
|
|
@ -667,11 +667,11 @@ void ScatterSky::prepRenderImage( SceneRenderState *state )
|
|||
mFlareState.scale = mFlareScale;
|
||||
mFlareState.lightInfo = mLight;
|
||||
|
||||
Point3F lightPos = state->getCameraPosition() - state->getFarPlane() * mLight->getDirection() * 0.9f;
|
||||
Point3F lightPos = state->getDiffuseCameraPosition() - state->getFarPlane() * mLight->getDirection() * 0.9f;
|
||||
mFlareState.lightMat.identity();
|
||||
mFlareState.lightMat.setPosition( lightPos );
|
||||
|
||||
F32 dist = ( lightPos - state->getCameraPosition( ) ).len( );
|
||||
F32 dist = ( lightPos - state->getDiffuseCameraPosition( ) ).len( );
|
||||
F32 coronaScale = 0.5f;
|
||||
F32 screenRadius = GFX->getViewport( ).extent.y * coronaScale * 0.5f;
|
||||
mFlareState.worldRadius = screenRadius * dist / state->getWorldToScreenScale( ).y;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue