Firle Posted July 10, 2024 Posted July 10, 2024 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)
Bryan Posted July 10, 2024 Posted July 10, 2024 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.
Firle Posted July 26, 2024 Author Posted July 26, 2024 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
Peter Posted July 26, 2024 Posted July 26, 2024 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:
Firle Posted August 2, 2024 Author Posted August 2, 2024 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: Interesting also looks this warning: Thanks!
Peter Posted August 2, 2024 Posted August 2, 2024 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: 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? (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)
Firle Posted August 3, 2024 Author Posted August 3, 2024 Hello Peter, thanks for the hint with he debug mode, that feature is new for me, now I learned something in general 🙂 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.
Firle Posted August 3, 2024 Author Posted August 3, 2024 I am using Enviro 3 (Sky & Weather) too but until now I had no problems with both together...
Firle Posted August 6, 2024 Author Posted August 6, 2024 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: In Unity Editor it looks like this:
Bryan Posted August 9, 2024 Posted August 9, 2024 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?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now