Obi Official Forum
Bug / Crash Obi Fluid 6 not render on Window build - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Fluid (https://obi.virtualmethodstudio.com/forum/forum-3.html)
+--- Thread: Bug / Crash Obi Fluid 6 not render on Window build (/thread-4197.html)



Obi Fluid 6 not render on Window build - spikebor - 02-05-2024

Hi, I have this bug when test build on PC Window the Obi Fluid
Obi Fluid 6.5.4, works well on Editor using the Obi/URP/Particles.shader, but not work on PC build (x64 window).
Unity URP 2022.3.16f1
Do I miss any setup step?

Log:
Code:
Particle rendering shader not suported.
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogWarning(Object)
Obi.ObiParticleRenderer:CreateMaterialIfNeeded()
Obi.ObiParticleRenderer:DrawParticles(ObiActor)
Obi.ObiActor:Interpolate()
Obi.ObiSolver:Interpolate(Single, Single)
Obi.ObiUpdater:Interpolate(Single, Single)
Obi.ObiFixedUpdater:Update()

--Stack Trace--
Obi Fluid Renderer not supported in this platform.
UnityEngine.Debug:LogWarning(Object)
Obi.ObiFluidRendererFeature:AddRenderPasses(ScriptableRenderer, RenderingData&)
UnityEngine.Rendering.RenderPipelineManager:DoRenderLoop_Internal(RenderPipelineAsset, IntPtr, Object)



RE: Obi Fluid 6 not render on Window build - spikebor - 02-05-2024

I found a culprit.
This Shader "Obi/URP/Fluid/FluidShading" is added to the AlwaysIncludedShaders list, but somehow still be skipped from build.
The result is this code still create a null material.
Code:
if (fluid_Material == null) fluid_Material= FluidRenderingUtils.CreateMaterial(Shader.Find("Obi/URP/Fluid/FluidShading"));



RE: Obi Fluid 6 not render on Window build - josemendez - 02-05-2024

(02-05-2024, 06:16 PM)spikebor Wrote: I found a culprit.
This Shader "Obi/URP/Fluid/FluidShading" is added to the AlwaysIncludedShaders list, but somehow still be skipped from build.
The result is this code still create a null material.
Code:
if (fluid_Material == null) fluid_Material= FluidRenderingUtils.CreateMaterial(Shader.Find("Obi/URP/Fluid/FluidShading"));

Hi Spikebor,

Open up that shader file and change its “UniversalRenderPipeline” tag to “UniversalPipeline”. Some URP versions use the former, while others use the latter (just for fun, I suppose :/).

Using the incorrect tag will still work in the Editor, but will silently fail in builds. This is a bug in Unity that hasn’t been addressed yet.

Let me know whether this works for you, or if you need further help.

Kind regards.


RE: Obi Fluid 6 not render on Window build - spikebor - 02-05-2024

(02-05-2024, 06:53 PM)josemendez Wrote: Hi Spikebor,

Open up that shader file and change its “UniversalRenderPipeline” tag to “UniversalPipeline”. Some URP versions use the former, while others use the latter (just for fun, I suppose :/).

Using the incorrect tag will still work in the Editor, but will silently fail in builds. This is a bug in Unity that hasn’t been addressed yet.

Let me know whether this works for you, or if you need further help.

Kind regards.

Thank you! It rendered now.
Are those 3 shaders in the URP folder are the only ones I need to change?
Wow, that Tag change the URP team made is not fun, they really hate those who writes shaders in text Enfadado