Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  ObiFluid_7.0b installation issue
#1
Hi.
I created a new project, set it for Android then import the ObiFluid_7.0b.
Burst and Mathematics had been included already so I imported Collections package.
According to this page, Jobs package was replaced (included?) in the Collections now, so I have never imported Jobs to the project.
At this moment, I have two errors.
   
  • NullReferenceException: Object reference not set to an instance of an object
    Obi.ComputeFluidMesherSystem..ctor (Obi.ObiSolver solver) (at Assets/Obi/Scripts/Common/Backends/Compute/Rendering/Fluid/ComputeFluidMesherSystem.cs:105)
    Obi.ObiFluidSurfaceMesher.Obi.ObiRenderer<Obi.ObiFluidSurfaceMesher>.CreateRenderSystem (Obi.ObiSolver solver) (at Assets/Obi/Scripts/Fluid/Rendering/ObiFluidSurfaceMesher.cs:53)
    Obi.ObiRenderer`1[T].RegisterRenderer (Obi.ObiSolver solver) (at Assets/Obi/Scripts/Common/Rendering/ObiRenderer.cs:47)
    Obi.ObiActorRenderer`1[T].EnableRenderer () (at Assets/Obi/Scripts/Common/Rendering/ObiActorRenderer.cs:20)
    Obi.ObiFluidSurfaceMesher.OnEnable () (at Assets/Obi/Scripts/Fluid/Rendering/ObiFluidSurfaceMesher.cs:23)
  • Assets\Obi\Scripts\Common\Backends\Burst\DataStructures\ConstraintBatcher\ConstraintSorter.cs(144,27): error CS1501: No overload for method 'Sort' takes 1 arguments
The first one appeared right after I imported the ObiFluid_7.0b and the second one appeared after I imported the Collections to the project.
How should I do from here?

Thanks!

Unity 2022.3.13f1 (Android/URP)
Burst 1.8.9
Collections 2.1.4
Mathematics 1.2.6
Reply
#2
(29-11-2023, 03:56 AM)Snail921 Wrote: NullReferenceException: Object reference not set to an instance of an object
Obi.ComputeFluidMesherSystem..ctor (Obi.ObiSolver solver) (at Assets/Obi/Scripts/Common/Backends/Compute/Rendering/Fluid/ComputeFluidMesherSystem.cs:105)

Hi!

Seems like a shader is either missing or has an error. Check that Obi/Resources/ObiMaterials/Fluid/Compute/IndirectThickness.shader exists, and whether it shows any errors in the inspector when you select it.

(29-11-2023, 03:56 AM)Snail921 Wrote: Obi.ObiFluidSurfaceMesher.Obi.ObiRenderer<Obi.ObiFluidSurfaceMesher>.CreateRenderSystem (Obi.ObiSolver solver) (at Assets/Obi/Scripts/Fluid/Rendering/ObiFluidSurfaceMesher.cs:53)
Obi.ObiRenderer`1[T].RegisterRenderer (Obi.ObiSolver solver) (at Assets/Obi/Scripts/Common/Rendering/ObiRenderer.cs:47)

This seems like a bug/documentation issue in Collections 2.1.4. The Sort() method is declared in the static class NativeSortExtension, however it does not seem to be an extension method as the documentation states.

So instead of calling it directly on a NativeSlice, it needs to be called as a regular static method. Replace line 144 in Obi/Scripts/Common/Backends/Burst/DataStructures/ConstraintBatcher/ConstraintSorter.cs with

Code:
NativeSortExtension.Sort(slice, comparer);

Also, in line 12 of the same file change the declaration to this:

Quote:public class ConstraintSorter<T> where T : unmanaged, IConstraint
Reply
#3
josemendez
Hi!

Seems like a shader is either missing or has an error. Check that Obi/Resources/ObiMaterials/Fluid/Compute/IndirectThickness.shader exists, and whether it shows any errors in the inspector when you select it.


This seems like a bug/documentation issue in Collections 2.1.4. The Sort() method is declared in the static class NativeSortExtension, however it does not seem to be an extension method as the documentation states.

So instead of calling it directly on a NativeSlice, it needs to be called as a regular static method. Replace line 144 in Obi/Scripts/Common/Backends/Burst/DataStructures/ConstraintBatcher/ConstraintSorter.cs with

Code:
NativeSortExtension.Sort(slice, comparer);

Also, in line 12 of the same file change the declaration to this:

   
By modifying ConstraintSorter.cs according to your instruction, the second error is gone now.
But for the first one, as far as I checked the shader in the editor, it existed and had no error appeared in the inspector. What am I missing?
Reply
#4
(29-11-2023, 04:05 PM)Snail921 Wrote: By modifying ConstraintSorter.cs according to your instruction, the second error is gone now.
But for the first one, as far as I checked the shader in the editor, it existed and had no error appeared in the inspector. What am I missing?

That's strange, I'm unable to reproduce this issue except by deleting the shader file entirely. No similar reports from other users yet, either. Could you try reimporting the shader (right click->Reimport) just in case Unity is getting confused?

let me know how it goes, in case we need to dig deeper into this.

kind regards,
Reply
#5
(29-11-2023, 04:35 PM)josemendez Wrote: That's strange, I'm unable to reproduce this issue except by deleting the shader file entirely. No similar reports from other users yet, either. Could you try reimporting the shader (right click->Reimport) just in case Unity is getting confused?

let me know how it goes, in case we need to dig deeper into this.

kind regards,
After reimporting shader, it seems the error is gone!
Thank you so much for your advice!
Reply