Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug / Crash  ObiParticleRenderer is never lit in build.
#1
I am using URP. I am rendering the particles using ObiParticleRenderer with the Obi/URP/Particles shader. 

I got it looking exactly how I want in Editor, but for some reason, when building, the particles are always unlit, Which turns my nice white particles into an ugly grey. 

Any ideas what could be causing this?
Reply
#2
FIX: I found a fix for this problem, and it is a weird one, so I am keeping this up in case someone else runs into this problem.

I had a camera that was active at scene start, and disabled in another scripts start method.
I noticed that when the camera was turned on, the problem was fixed for the entire time that build was up (If i changed scenes and came back, it was still fixed).

So, the fix was making it so the camera was turned off 1 frame after the scene started, instead of on Start.

Not sure why this error happens, and why it doesnt happen in editor.
Reply
#3
(05-08-2021, 10:48 PM)Nathan_TRC Wrote: FIX: I found a fix for this problem, and it is a weird one, so I am keeping this up in case someone else runs into this problem.

I had a camera that was active at scene start, and disabled in another scripts start method.
I noticed that when the camera was turned on, the problem was fixed for the entire time that build was up (If i changed scenes and came back, it was still fixed).

So, the fix was making it so the camera was turned off 1 frame after the scene started, instead of on Start.

Not sure why this error happens, and why it doesnt happen in editor.

Sounds like a bug in URP to me. Particles are rendered using a pretty simple shader that makes use of Unity's built-in shader macros for lighting. There's no reason turning on/off a camera should affect lighting or shading in any way. Still, will try to reproduce it and raise a bug report with Unity if needed. thanks!
Reply