Jump to content

Water causes exceptions in Unity 6 (0000.09)


Recommended Posts

Hello,

 

since upgrading my project successfully from Unity 2023 to Untiy 6 then installing the latest version of Gaia 2023 (not pro) I do not see reflections for my water anymore and always get the follwing errors (each frame)

 

MissingReferenceException: The object of type 'UnityEngine.Camera' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Object+MarshalledUnityObject.TryThrowEditorNullExceptionObject (UnityEngine.Object unityObj, System.String parameterName) (at <a03c9c355507492d864df64eb1f41495>:0)
UnityEngine.Bindings.ThrowHelper.ThrowNullReferenceException (System.Object obj) (at <a03c9c355507492d864df64eb1f41495>:0)
UnityEngine.Camera.set_worldToCameraMatrix (UnityEngine.Matrix4x4 value) (at <a03c9c355507492d864df64eb1f41495>:0)
Gaia.PWS_WaterSystem.UpdateBuiltInPlanarReflections (System.Boolean reflectionsEnabled) (at Assets/Procedural Worlds/Packages - Install/Gaia/Scripts/Core/Water System/Reflections/PWS_WaterSystem.cs:1702)
Gaia.PWS_WaterSystem.GenerateReflection (System.Boolean reflectionsEnabled, System.Boolean refreshRenderPipeline) (at Assets/Procedural Worlds/Packages - Install/Gaia/Scripts/Core/Water System/Reflections/PWS_WaterSystem.cs:1630)
Gaia.PWS_WaterSystem.BuildReflection (System.Boolean refreshRenderPipeline) (at Assets/Procedural Worlds/Packages - Install/Gaia/Scripts/Core/Water System/Reflections/PWS_WaterSystem.cs:1483)
Gaia.PWS_WaterSystem.OnRenderObjectUpdate (UnityEngine.Camera overrideCam, System.Boolean refreshRenderPipeline) (at Assets/Procedural Worlds/Packages - Install/Gaia/Scripts/Core/Water System/Reflections/PWS_WaterSystem.cs:500)
Gaia.PWS_WaterSystem.OnWillRenderObject () (at Assets/Procedural Worlds/Packages - Install/Gaia/Scripts/Core/Water System/Reflections/PWS_WaterSystem.cs:270)
UnityEngine.Experimental.Rendering.ScriptableRuntimeReflectionSystemWrapper:Internal_ScriptableRuntimeReflectionSystemWrapper_TickRealtimeProbes(Boolean&)
MissingReferenceException: The object of type 'UnityEngine.Camera' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Object+MarshalledUnityObject.TryThrowEditorNullExceptionObject (UnityEngine.Object unityObj, System.String parameterName) (at <a03c9c355507492d864df64eb1f41495>:0)
UnityEngine.Bindings.ThrowHelper.ThrowNullReferenceException (System.Object obj) (at <a03c9c355507492d864df64eb1f41495>:0)
UnityEngine.Camera.set_worldToCameraMatrix (UnityEngine.Matrix4x4 value) (at <a03c9c355507492d864df64eb1f41495>:0)
Gaia.PWS_WaterSystem.UpdateBuiltInPlanarReflections (System.Boolean reflectionsEnabled) (at Assets/Procedural Worlds/Packages - Install/Gaia/Scripts/Core/Water System/Reflections/PWS_WaterSystem.cs:1702)
Gaia.PWS_WaterSystem.GenerateReflection (System.Boolean reflectionsEnabled, System.Boolean refreshRenderPipeline) (at Assets/Procedural Worlds/Packages - Install/Gaia/Scripts/Core/Water System/Reflections/PWS_WaterSystem.cs:1630)
Gaia.PWS_WaterSystem.BuildReflection (System.Boolean refreshRenderPipeline) (at Assets/Procedural Worlds/Packages - Install/Gaia/Scripts/Core/Water System/Reflections/PWS_WaterSystem.cs:1483)
Gaia.PWS_WaterSystem.OnRenderObjectUpdate (UnityEngine.Camera overrideCam, System.Boolean refreshRenderPipeline) (at Assets/Procedural Worlds/Packages - Install/Gaia/Scripts/Core/Water System/Reflections/PWS_WaterSystem.cs:510)
Gaia.PWS_WaterSystem.OnWillRenderObject () (at Assets/Procedural Worlds/Packages - Install/Gaia/Scripts/Core/Water System/Reflections/PWS_WaterSystem.cs:270)
UnityEngine.Experimental.Rendering.ScriptableRuntimeReflectionSystemWrapper:Internal_ScriptableRuntimeReflectionSystemWrapper_TickRealtimeProbes(Boolean&)

I tried to initialize it somehow or set it manually with Gaia.PWS_WaterSystem.Instance.Generate(true); but does not seem to help?

Why could the Camera or rendercamera be destroyed? Please help!

 

Best regards,

 

Firlefanz (Eric)

Link to comment
Share on other sites

Hey there, so we do not officially support Unity 6 as of yet due to it being still in beta. 
When that version fully releases we will support it. 

 

Link to comment
Share on other sites

  • 3 weeks later...

Hello,

 

I now installed the latest Gaia which said in released notes should fix unity 6 issues, my water has still exact the same problem as above, no reflections but exceptions.

Thanks 

Link to comment
Share on other sites

Hi @Firle, we are not able to reproduce this issue, it seems to work for us when we create a water surface in unity 6 in the built-in render pipeline. The error reads as if the script for calculating the reflections on the water surface was missing a camera. Could you please try to remove and then add the water again from the runtime tab?
If this does not help, could you please try to switch your inspector in debug mode and then look at the water surface and check if these camera fields are filled for you:


image.png

Link to comment
Share on other sites

Thanks Peter for the hints.

 

I removed water from runtime and re-added it but did not help.

Then I compared my debug during runtime PWS_Watersystem in the scene to your screen. It looks totally different. So I removed Gaia from my project and re-installed it with the package manager.

 

I have Unity 6.0000.12 (previous had the same problem) and Gaia 2023 4.0.9 the latest (not pro). BuiltIn (no hdrp or custom). Changing Reflection layers to mixed or everything does no change.

I still have the same problem. My water surface looks like this during runtime:

image.thumb.png.cfd728ba5077bf92454464a931826a38.png

Interesting also looks this warning:

image.thumb.png.7ac527fc4984e7a7606f8b5d2f802eaa.png

 

Thanks!

 

 

Link to comment
Share on other sites

Hi @Firle,

my water system looks so different because the inspector tab is set to debug mode - you can do this by right-clicking on the Inspector tab:


image.png

I noticed something curious though - in the error message you originally reported, it looks like it is trying to generate the water as if you were in the HD render pipeline, could you please check if you have a render pipeline asset assigned under Edit > Project Settings > Graphics?

image.png
 
(It should be "none" when you are in builtin, but the error message reads like it is trying to generate the reflections for HDRP, and this is where Gaia would check which pipeline you are in)

Link to comment
Share on other sites

Hello Peter,

thanks for the hint with he debug mode, that feature is new for me, now I learned something in general 🙂

image.thumb.png.12f4ae7e4a0d6c12b6f6fe1dc63c9389.png

 

the Default Render Pipeline is "None" as in your screen. But it looks like during runtime the render camera is wrong?

But maybe because of the error messages above? Before starting it was "Scene-Camera"....

 

Thanks and have a nice weekend!

 

PS: I made my water turn on / off and set some parameters (not the camera) a bit later now I got rid of all error messages! But now still both cameras point to the main camera and I see no reflections.

 

 

Link to comment
Share on other sites

I am using Enviro 3 (Sky & Weather) too but until now I had no problems with both together...

Link to comment
Share on other sites

One more thing, it looks way different in unity editor compared to running my build. In the build I think I see some reflections, but I am not sure the water is extremly bright and shiny...

Why are they different? May it be the additional gaia direct light I turned off does work in build additional to the enviro ligth and makes it look a bright and shiny?

Build Runtime Fullscreen it looks like this:

image.thumb.png.a80868b1e7e981922cbe81748ceba457.png

 

In Unity Editor it looks like this:

image.thumb.png.0cd5b869c5c9534ef39af0df5737a227.png

Link to comment
Share on other sites

hmmmm thats really interesting. 
From the looks of it its not just the water though, which could be the difference. 
The rocks, the UI, the water all of it is different. 
Maybe take a look at the post processing? 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...