Cool VL Viewer forum

View unanswered posts | View active topics It is currently 2024-03-29 13:40:53



Reply to topic  [ 2 posts ] 
Infinite/NaN values during shadows render 
Author Message

Joined: 2011-10-07 10:39:20
Posts: 181
Reply with quote
Trapped one of those denormals/infinity messages. Seems the windows build sometimes gets denormals in there:

Quote:
CoolVLViewer.exe!LLCoordFrame::setOrigin(const LLVector3 & new_origin)
CoolVLViewer.exe!LLCoordFrame::lookAt(const LLVector3 & origin={...}, const LLVector3 & point_of_interest={...}, const LLVector3 & up_direction={...})
[Inlineframe] CoolVLViewer.exe!LLCoordFrame::setOriginAndLookAt(const LLVector3 &)
CoolVLViewer.exe!LLPipeline::generateSunShadow(LLCamera & camera={...})
CoolVLViewer.exe!display(bool rebuild=192, float zoom_factor, int subfield=0, bool for_snapshot)
CoolVLViewer.exe!LLAppViewer::frame(LLEventPump & mainloop)
CoolVLViewer.exe!LLAppViewer::mainLoop()


Looking at the data, in the setOrigin() frame the origin vector and two of the axes have denormal data inside as well (in this->)

Quote:
- mOrigin {mV=0x0000025dcc3bf9c0 {3.08612698e-07, 4.591e-41#DEN, 3.08607696e-07} } LLVector3
+ mXAxis {mV=0x0000025dcc3bf9cc {4.591e-41#DEN, 0.000000000, 0.000000000} } LLVector3
+ mYAxis {mV=0x0000025dcc3bf9d8 {0.000000000, 0.000000000, -49276736.0} } LLVector3
+ mZAxis {mV=0x0000025dcc3bf9e4 {8.478e-43#DEN, -49276768.0, 8.478e-43#DEN} } LLVector3


This gets caused by "eye" being full of NaNs in LLPipeline::generateSunShadow().

Quote:
+ eye {mV=0x000000721473e570 {-nan(ind), -nan(ind), -nan(ind)} } LLVector3
+ center {mV=0x000000721473f320 {-nan, -nan, 1.03363099e-07} } LLVector3


Which is a bit surprising, as both both values setting eye (as far as i can see) seem to be okay afterwards. But camera is non const, so could have changed in between.

a) camera.getOrigin();
Quote:
- camera {mProjectionMatrix={mMatrix=0x00007ff7353d9140 {0x00007ff7353d9140 {0.825374007, 0.000000000, 0.000000000, ...}, ...} } ...} LLCamera & {LLViewerCamera}
+ mOrigin {mV=0x00007ff7353d8e60 {33.3343849, 183.891296, 1008.34149} } LLVector3


b) origin_agent.v
Quote:
- origin_agent {...} glh::ns_float::vec3
+ v 0x000000721473e590 {0.000000000, 0.000000000, -110.805481} float[3]


(-nan(ind) => https://devblogs.microsoft.com/oldnewthing/?p=5183
pretty good read on denormals and performance implications is here:
https://randomascii.wordpress.com/2012/ ... dd-floats/ )

This was from an /arch:AVX2 build, but all with /fp:fast, so i guess the normal build is similar.
According to my historic logs, these warnings happens since nearly forever (2016 at least).


2019-10-30 00:26:17
Profile

Joined: 2009-03-17 18:42:51
Posts: 5523
Reply with quote
OK, I made a separate topic for this one, since it does not relate with the other render bug you reported.

I double-checked with LL's code, and did not find any discrepancy that could explain that my code would break. So, I suspect LL's viewer is behaving the same.
I did not notice this issue, simply because (beside using Linux only), I do not use deferred rendering (but for short tests, when I modify stuff that could potentially affect it)...

There are also a few places in LLPipeline::generateSunShadow() where NaNs could be generated (no checks for divide by zero in some places). I will add code (checks for NaNs where appropriate and abortion of the corresponding shadow render when found), so that such cases get plugged. I also spotted (and fixed) a potential issue with the current camera not being properly restored at generateSunShadow() exit...


2019-10-30 09:32:20
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 41 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.