Cool VL Viewer forum

View unanswered posts | View active topics It is currently 2025-07-21 15:57:45



Reply to topic  [ 13 posts ]  Go to page 1, 2  Next
Cool VL Viewer v1.32.2.0 crashes attempting to turn PBR on. 
Author Message

Joined: 2012-01-19 03:18:40
Posts: 218
Location: Sydney, Australia (UTC +10)
Reply with quote
I built and tested Cool VL Viewer v1.32.2.0 on Mac this evening. Unfortunately it crashes when I try to turn PBR on in Properties/Graphics. Logs attached.


Attachments:
File comment: Application log and crash dump
CoolVLViewer1.32.2.0.zip [40.64 KiB]
Downloaded 138 times
2024-06-17 13:14:52
Profile

Joined: 2009-03-17 18:42:51
Posts: 6016
Reply with quote
Well, it would have been better to test v1.32.1 in time and report the bug back then... If I do publish experimental versions, it is to get them tested by others than myself and get a chance to plug all bugs before they get promoted as a stable release version. :roll:

The problem is again with macOS shitty drivers:
Code:
2024-06-17 12:01:15Z INFO: LLGLSLShader::createShader: Creating shader: Deferred PBR terrain shader 0 flat - Level: 3 - File: deferred/pbrterrainF.glsl
2024-06-17 12:01:15Z WARNING: LLShaderMgr::linkProgramObject: GLSL linker error:
2024-06-17 12:01:15Z WARNING: LLShaderMgr::dumpObjectLog: WARNING: Could not find vertex shader attribute 'texcoord0' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'texcoord3' to match BindAttributeLocation request.
.../...
ERROR: Implementation limit of 16 active fragment shader samplers (e.g., maximum number of supported image units) exceeded, fragment shader uses 17 samplers


Try and set "RenderMaxTextureIndex" to 15, or even 12, before trying to turn on PBR rendering...


2024-06-17 14:15:03
Profile WWW

Joined: 2009-03-17 18:42:51
Posts: 6016
Reply with quote
I investigated deeper, and it appears indeed like a macOS OpenGL driver bug (which, for an unknown reason, wants to use one more image unit than any other non-macOS drivers for the PBR terrain fragment shader).

Yet, the viewer should not have crashed and should instead have reverted to the EE renderer; a missing flag reset in my retry code is the culprit for the failure to do so.

I changed the code to account for an extraneous reserved image unit for macOS, and fixed the failure to restart the renderer in EE mode. I also added a "RenderPBRReservedImageUnits" setting (clamped down to 8 units, and 9 for macOS) to allow increasing the reserved units number, just in case...

I sent you a PM with the corresponding sources: please compile and test the viewer on your system, and report any issue.


2024-06-18 11:52:15
Profile WWW

Joined: 2012-01-19 03:18:40
Posts: 218
Location: Sydney, Australia (UTC +10)
Reply with quote
I built the sources you sent. The viewer no longer crashes when I try to activate PBR. Instead, the viewer beachballs for a few seconds, and then simply unchecks the PBR checkbox. PBR mode does not engage. I tried setting RenderMaxTextureIndex as low as 12, but it didn't seem to make any difference. Log attached.


Attachments:
CoolVLViewer1.32.2.1-test.zip [40.27 KiB]
Downloaded 127 times
2024-06-18 14:58:55
Profile

Joined: 2009-03-17 18:42:51
Posts: 6016
Reply with quote
linyifei wrote:
I tried setting RenderMaxTextureIndex as low as 12, but it didn't seem to make any difference. Log attached.
Instead, leave RenderMaxTextureIndex at 16, but increase RenderPBRReservedImageUnits, please. Try 10, 11, 12, 13, 14 (the latter value seems in use by LL's viewer v7.1.8, but looks enormous to me, leaving only two texture units for indexed textures); I will adopt the value that works for you (instead of 9 for now) as the default clamping for macOS...


2024-06-18 15:08:51
Profile WWW

Joined: 2012-01-19 03:18:40
Posts: 218
Location: Sydney, Australia (UTC +10)
Reply with quote
OK... I tried each of the values for RenderPBRReservedImageUnits you suggested. The viewer responded the same in each case. It attempts to engage PBR mode, beachballs, and then unchecks the PBR checkbox. Log for RenderPBRReservedImageUnits = 14 attached.


Attachments:
CoolVLViewer.log.zip [43.21 KiB]
Downloaded 138 times
2024-06-19 12:18:12
Profile

Joined: 2009-03-17 18:42:51
Posts: 6016
Reply with quote
Well, it looks like macOS just cannot render PBR terrain properly... I found a commit in LL's viewer git that basically drops some PBR maps to render PBR terrain on macOS.

Try this: set "RenderTerrainPBRDetail" to 0, then try activating PBR rendering...

If it indeed works (it should), I'm interested to know what is the lowest value of "RenderPBRReservedImageUnits" that allows you to render properly shadows and reflections on macOS.

Then try increasing "RenderTerrainPBRDetail" again, and see at which point the viewer crashes (there will be no automatic fallback to EE when changing the value this way, so the shader will fail to compile at some point and a crash will ensue)... I'm interested to know what is the max value you can use without crashing (you might have to increase RenderPBRReservedImageUnits again); in theory (from LL's code), it should be possible to increase RenderTerrainPBRDetail to 3 (i.e. rendering all but the PBR emissive map).


2024-06-19 14:42:10
Profile WWW

Joined: 2012-01-19 03:18:40
Posts: 218
Location: Sydney, Australia (UTC +10)
Reply with quote
Quote:
Try this: set "RenderTerrainPBRDetail" to 0, then try activating PBR rendering... If it indeed works (it should), I'm interested to know what is the lowest value of "RenderPBRReservedImageUnits" that allows you to render properly shadows and reflections on macOS.

That worked fine, and PBR activated. Reflections and shadows were visible, even with RenderPBRReservedImageUnits set at the default 8.
Quote:
Then try increasing "RenderTerrainPBRDetail" again, and see at which point the viewer crashes (there will be no automatic fallback to EE when changing the value this way, so the shader will fail to compile at some point and a crash will ensue)... I'm interested to know what is the max value you can use without crashing (you might have to increase RenderPBRReservedImageUnits again); in theory (from LL's code), it should be possible to increase RenderTerrainPBRDetail to 3 (i.e. rendering all but the PBR emissive map).

I was indeed able to take RenderTerrainPBRDetail up to 3 without problems, but as soon as I tried 4, my viewer crashed. I could go up to 3 without increasing RenderPBRReservedImageUnits above the default of 8. I could not go above RenderTerrainPBRDetail of 3, regardless of how high I set RenderPBRReservedImageUnits.

In each case the viewer displayed the message "Unrecoverable error. ERROR: LLVertexBuffer::setBuffer: No bound shader !" when I tried to take RenderTerrainPBRDetail above 3, and then crashed after I closed the message.


2024-06-19 23:14:39
Profile

Joined: 2009-03-17 18:42:51
Posts: 6016
Reply with quote
OK, this confirms what I came up with...

I sent to you a link to new viewer sources for testing: they include a limitation of the PBR terrain rendering quality based on the available texture units, and a lower bound for RenderPBRReservedImageUnits (it was clamped at 9 for macOS with the previous sources you tested, and now can go down to 8 for macOS as well): please verify that everything works fine (shadows, reflections, mirrors, terrain) with RenderPBRReservedImageUnits set at 8, and that whatever value you choose for RenderTerrainPBRDetail, you cannot crash the viewer any more.


2024-06-19 23:55:22
Profile WWW

Joined: 2012-01-19 03:18:40
Posts: 218
Location: Sydney, Australia (UTC +10)
Reply with quote
I built from your new sources and tested.
Quote:
please verify that everything works fine (shadows, reflections, mirrors, terrain) with RenderPBRReservedImageUnits set at 8, and that whatever value you choose for RenderTerrainPBRDetail, you cannot crash the viewer any more.
I can confirm that I could push RenderTerrainPBRDetail to 4 (and indeed 5 or 6 but I don't think that does anything since 4 is supposed to be the maximum) without the viewer crashing. With RenderPBRReservedImageUnits set at 8, shadows and PBR surface reflective textures seem to work fine. I haven't tested mirrors yet, because I don't know where to go to find any, and I haven't worked out how to create my own. I'll see what I can do tomorrow.


2024-06-20 15:11:06
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 13 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users and 2 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:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.