Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Fluid not rendering in build
#7
Hi,

Your FireRetardant prefab had several ObiParticleRenderer components with no materials. While this worked fine in the editor, it threw an exception in the build, skipping any further rendering. A quick workaround would be to simply disable the unused particle renderers.

However it stands to reason that any renderers using no material should be simply ignored -both in the editor as in builds- instead of raising an exception. We've patched this behavior. If you wish to apply the patch to your project, replace ProceduralRenderBatch.cs with the file you'll find attached to this post.

The reason why rendering worked in the editor but not in the build is because Unity's GetInstanceID() method -which we use to compare objects and build render batches- returns 0 for null in the editor, but instead raises a NullRefException in the build. This difference in behavior is not mentioned in the documentation and led us to assume it would behave the same in the editor and in a build. Furthermore, the documentation states that GetInstanceID() never returns 0 which is incorrect as it *does* return 0 for null objects in the editor.

We've reached out to Unity so that they correct GetInstanceID's documentation so that it matches its actual behavior.

kind regards


Attached Files
.cs   ProceduralRenderBatch.cs (Size: 6.97 KB / Downloads: 1)
Reply


Messages In This Thread
Fluid not rendering in build - by Barliesque - 01-08-2024, 03:01 AM
RE: Fluid not rendering in build - by josemendez - 01-08-2024, 07:58 AM
RE: Fluid not rendering in build - by Barliesque - 01-08-2024, 10:13 PM
RE: Fluid not rendering in build - by josemendez - 02-08-2024, 07:49 AM
RE: Fluid not rendering in build - by Barliesque - 03-08-2024, 10:54 PM
RE: Fluid not rendering in build - by josemendez - 05-08-2024, 08:41 AM
RE: Fluid not rendering in build - by Barliesque - 05-08-2024, 10:26 PM
RE: Fluid not rendering in build - by Barliesque - 02-08-2024, 12:10 AM