Obi Official Forum
Bug / Crash New Obi Rope Chain Renderer URP version 7 - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: Bug / Crash New Obi Rope Chain Renderer URP version 7 (/thread-4319.html)



New Obi Rope Chain Renderer URP version 7 - vrtraining - 06-08-2024

Hi,

I'm unable to get any visuals of the chain in New Obi Rope Chain Renderer in URP. Even the sample demo that came with the project only works with Built-In pipeline, it does not work in URP even I don't see any pink shader for the chain, when I upgrade its materials to URP I still don't see any chain, not even a pink error shader. Its just blank. I have tried everything including GPU Instancing. I'm on Android Platform for Quest 2. Using Unity 2023.2.19f.

Step to reproduce

Create a new URP Project (2023.2.19f)
Import OBI version 7
Open Chains Demo from OBI
(upgrade pink shaders to URP)


RE: New Obi Rope Chain Renderer URP version 7 - josemendez - 06-08-2024

(06-08-2024, 08:48 AM)vrtraining Wrote: Hi,

I'm unable to get any visuals of the chain in New Obi Rope Chain Renderer in URP. Even the sample demo that came with the project only works with Built-In pipeline, it does not work in URP even I don't see any pink shader for the chain, when I upgrade its materials to URP I still don't see any chain, not even a pink error shader. Its just blank. I have tried everything including GPU Instancing. I'm on Android Platform for Quest 2. Using Unity 2023.2.19f.

Step to reproduce

Create a new URP Project (2023.2.19f)
Import OBI version 7
Open Chains Demo from OBI
(upgrade pink shaders to URP)

Hi,

Thanks for reporting this! We could reproduce and find the issue. This is due to a bug in Unity: initializing a RenderParams struct using the default constructor results in it having an invalid renderingLayerMask value. This parameter is unused in the built-in pipeline, but used by URP to determine whether an object should be rendered or not. As a result, the built-in pipeline renders instances just fine but URP fails to do so.

The workaround is to explicitly set the value of renderingLayerMask after creating the RenderParams instance. Open up BurstChainRopeRenderSystem.cs and in line 56, add this:

Code:
rp.renderingLayerMask = UnityEngine.Rendering.GraphicsSettings.defaultRenderingLayerMask;

The vicinity of that line should look like this:

Code:
var rp = batch.renderParams;
rp.renderingLayerMask = UnityEngine.Rendering.GraphicsSettings.defaultRenderingLayerMask;
rp.material = batch.material;
rp.worldBounds = m_Solver.bounds;
rp.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.On;
rp.receiveShadows = true;

let me know if I can be of further help,

kind regards


RE: New Obi Rope Chain Renderer URP version 7 - vrtraining - 06-08-2024

Thanks for the quick response. The fix you provided did the job. Its working well now