Author |
Message |
linyifei
Joined: 2012-01-19 03:18:40 Posts: 218 Location: Sydney, Australia (UTC +10)
|
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.
|
2024-06-17 13:14:52 |
|
 |
Henri Beauchamp
Joined: 2009-03-17 18:42:51 Posts: 6016
|
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. The problem is again with macOS shitty drivers: Try and set "RenderMaxTextureIndex" to 15, or even 12, before trying to turn on PBR rendering...
|
2024-06-17 14:15:03 |
|
 |
Henri Beauchamp
Joined: 2009-03-17 18:42:51 Posts: 6016
|
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 |
|
 |
linyifei
Joined: 2012-01-19 03:18:40 Posts: 218 Location: Sydney, Australia (UTC +10)
|
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.
|
2024-06-18 14:58:55 |
|
 |
Henri Beauchamp
Joined: 2009-03-17 18:42:51 Posts: 6016
|
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 |
|
 |
linyifei
Joined: 2012-01-19 03:18:40 Posts: 218 Location: Sydney, Australia (UTC +10)
|
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.
|
2024-06-19 12:18:12 |
|
 |
Henri Beauchamp
Joined: 2009-03-17 18:42:51 Posts: 6016
|
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 |
|
 |
linyifei
Joined: 2012-01-19 03:18:40 Posts: 218 Location: Sydney, Australia (UTC +10)
|
That worked fine, and PBR activated. Reflections and shadows were visible, even with RenderPBRReservedImageUnits set at the default 8. 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 |
|
 |
Henri Beauchamp
Joined: 2009-03-17 18:42:51 Posts: 6016
|
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 |
|
 |
linyifei
Joined: 2012-01-19 03:18:40 Posts: 218 Location: Sydney, Australia (UTC +10)
|
I built from your new sources and tested. 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 |
|
|