When a ScatterySky object is used with a Flare enabled it will not render if the LightFlareData datablock defines an 'occlusionRadius' value. This problem appears to be specific to the ScatterSky and does not seem to occur in Sun objects or lights. I'm unsure if this issue is specific to certain graphics cards similar to an earlier problem involving reflections: #747
Just like in the Sun object's flare code the flare is then sent to LightFlareData::prepRender. Except, unlike the Sun object's flare the ScatterSky flare exits the function here:
bool lightVisible = _testVisibility( state, flareState, &visDelta, &occlusionFade, &lightPosSS );
// We can only skip rendering if the light is not
// visible, and it has elapsed the fade out time.
if ( mIsZero( occlusionFade ) ||
!lightVisible && visDelta > FadeOutTime )
return;
_testVisibility will return false and the render will be skipped. By removing 'occlusionRadius' from the LightFlareData datablocks the issue seems fixed. Notably, LightFlareExample2 and SunPacificIsland do not have those values defined in script and therefore work fine without any changes.
My guess is that somehow the sky itself is blocking visibility of the flare position.
Thanks for the detailed report! I think Felix Westin ran into some similar issues. Have a search of the forums. He and deepscratch, I think, were looking at stuff. Though it was possibly due to other occluding objects.
When a ScatterySky object is used with a Flare enabled it will not render if the LightFlareData datablock defines an 'occlusionRadius' value. This problem appears to be specific to the ScatterSky and does not seem to occur in Sun objects or lights. I'm unsure if this issue is specific to certain graphics cards similar to an earlier problem involving reflections: #747
My original post about the issue can be found here: http://www.garagegames.com/community/forums/viewthread/138892 To sum-up the info from the post:
In scatterSky.cpp in the prepRenderImage function the flare data is setup with a position.
Just like in the Sun object's flare code the flare is then sent to LightFlareData::prepRender. Except, unlike the Sun object's flare the ScatterSky flare exits the function here:
_testVisibility will return false and the render will be skipped. By removing 'occlusionRadius' from the LightFlareData datablocks the issue seems fixed. Notably, LightFlareExample2 and SunPacificIsland do not have those values defined in script and therefore work fine without any changes.
My guess is that somehow the sky itself is blocking visibility of the flare position.
Here are links to the code I referenced:
https://github.com/GarageGames/Torque3D/blob/development/Engine/source/environment/scatterSky.cpp#L657
https://github.com/GarageGames/Torque3D/blob/development/Engine/source/T3D/lightFlareData.cpp#L447-L453
The text was updated successfully, but these errors were encountered: