Jump to content

Reflection Settings-Custom Render Distance does not work. Killing performance. (SOLVED)


homicide
Go to solution Solved by Peter,

Recommended Posts

Hi. Im not sure why, but under reflection settings in Gaia (fully updated), unity 2021.3.5f the setting for custom render distance does not work at all.  No sooner do i change it in a custom profile (or default) and select any thing or do anything, its back to 0.  When i run the app, and adjust this at runtime, it works, and wow the performance gain is incredible, as i would have expected, but unfortunately , it just can not be set at all so at the moment , its completely not working and i have no idea what to do.

I did examine the scripts PlanarReflection/Settings etc, at a glance, it appears to be 500 unit default distance, but i don't really want to tamper with anything directly, so instead i attempted to access and set the value at runtime in a script, but no luck (i'm not even sure i was accessing the correct data). It can only be changed in the inspector from the GaiaSceneWater settings, under reflection settings 'at / during runtime'.

So, what can i do to get this to hold , save a value, and or work as it was intended to? I dont mind by script, but in this case, im not sure how.

 

Thanks.

Link to comment
Share on other sites

  • homicide changed the title to Reflection Settings-Custom Render Distance does not work. Killing me performance :(

Hi @homicide, we reviewed the issue and were unable to reproduce the behavior: When we change the value during design time, the value "sticks" and stays like it was entered. I tried changing multiple water settings for reflection, the water shader, and swapping profiles, but the value survived those changes. 
When the value is entered during runtime in the editor and playmode stops, then the value is reset to what it was before runtime started (as with most unity components, depending on how they store their values)

What I could imagine plays into this might be the setting for "Enable Multi Layer Distances." When multi-layer distances are enabled, those will override the single custom render distance to have individual distances per unity layer that you can tune. If you try to set a custom distance from a script while "Enable Multi Layer Distances" is active, the custom distance might reset.

Could you please tell us the render pipeline used and one of the changes you made to the water settings that reset the custom render distance during design time?

Link to comment
Share on other sites

standard pipeline, and i have not changed anything in regards to Gaia .  It just will not hold its value.  I will upload a video of it live if you need , just tell me where.  It literally zeros out on every action taken after its set.  Even with the inspector open, saving, and than clicking in empty space, looking back at inspector shows its zero.

There is no use of custom layers enabled, just the single enable custom distance is on. But on that note, i did try all the custom layers, they dont hold the values either.  It all just zeros out.  As i said, in runtime, changing it works, so, i would really appreciate just setting it via code (that works better for me anyways).

If you could just tell me in code how to set it at runtime, i would be fine with that thanks. I would HUGELY appreciate that. In fact it would be better that way.  And it would beat playing forum tag across days into weeks over an issue that i would rather seek resolve to rather quickly.  Thanks much.

Link to comment
Share on other sites

  • Solution
5 hours ago, homicide said:

If you could just tell me in code how to set it at runtime, i would be fine with that thanks.

Hi @homicide, you can set the value in runtime via code like this:
GaiaGlobal.Instance.SceneProfile.m_customRenderDistance = 1234;

Hope this helps! It is overall a bit strange though, as you describe it, it sounds like there might be something else in the scene that might constantly reset the water settings for some reason.

Link to comment
Share on other sites

Well damn, i already tried that, didnt work. Only thing that works is the inspector field at runtime. So, im at a loss. Sigh. 😞 90+ frames toast as a result though - so , meh, it is what it is.

Link to comment
Share on other sites

Hmm, this definitely sounds like there is something else at play here. If you are still interested in investigating, you could try the following:
 

  • Try to set up a new scene and create a terrain with default settings, and add the runtime to it. It would be interesting to see if the same thing happens there, and we would know if the problem is project-wide or in that specific scene only.
  • In visual studio, you can right-click on m_customRenderDistance and select to show all references, then look for references with write access. This should give you all places in the code where that value is being changed. If you set a breakpoint on each line, it might allow you to catch the unwanted reset and see where it is coming from in the stack trace.
Link to comment
Share on other sites

Well, as i said, i dont know, i only know that this is what it is doing, and the result has been catastrophic to my rendering.  heres a video , with a fresh new scene, only gaia in it.

Does the same thing.  (might take a minute to process in google.)

 

https://drive.google.com/file/d/1tHoJZNMce-Qzs2w3SO8Luxb_RNottb0h/view?usp=share_link

 

As for walking through with Visual Studio , ive been there done that,  Its how i saw the code, the 500 unit default distance etc... I just 'forced' myself not to tamper with the code, becaue honestly, i dont want to waste time back and forthing with all the newb 101 suggests and recommends... this isnt like that. So i changed and modified nothing within the current project related to Gaia that wasnt undone after my following tests. However, i most definitely DID walk through that code, and , even made backups, attempted to force the value at runtime, nothing. It does not work.

So alas, i come here as a last resort, because 100 frames on average eaten is killing my project.  And i can not for the life of me understand why i can get results at runtime changing the value, but nothing else at all works.  This is, in fact, exactly the opposite of a value at runtime overriding any attempt at settings the value.  No, in this case, only any value set in that field at runtime works. ...   O,o

 

For reference, there is no other 'script' based assets in my project other than PixelCrushers, and i know for a fact, nothing from PixelCrushers is causing these issues. Everything works great, even Gaia once the hiccups are overcome... except the water reflection render distance setting.  And its game breaking, literally.  If i have to remove the reflections then honestly, Gaia might as well be removed completely , as its the sole reason i wanted the Gaia Water. It just looks real good.

😞 Sad Dayum Panda.

 

PS: Fun Fact, Gaia Crashed unity 3 times creating that simple scene. This is not unique to this project either, this  has been happening for a good long while i have used Gaia (which isnt often anymore as it started feeling far to unstable).  Always at the exact same point too. Create Runtime...

image.thumb.png.51bfdf718a4b9f221782053766074731.png

 

Make that 4*

Link to comment
Share on other sites

Ohhh Dayum, i misread your post above mate.

Turns out that runtime set via script does work, i 'was' indeed accessing the wrong data.  Its working via script. Yay.

Cheers dude, seriously appreciate that. I will post back with any further griefs, rest assured, lol. But as is now, i am a happy camper, Thanks much.

 

 

EDIT: Yup - all holding good, strong, and reliably now.  HAPPY!

Link to comment
Share on other sites

  • homicide changed the title to Reflection Settings-Custom Render Distance does not work. Killing performance. (SOLVED)

Glad to hear it is working via script now! I looked at the video, and it is still a mystery what is happening. I noticed there does not seem to be a camera in the scene, but even when I tried to delete all cameras from the scene, I could not reproduce the behavior.

RE - Unity crashing - This is, of course, not Gaia's default behavior. You would need to check in the Editor log file to see if you can get any indication of why the Editor crashed. What we did experience in the past with the runtime creation was that some versions/constellations of unity tend to crash when the reflection probe data is recalculated when Gaia applies the new skybox to the scene. In that case, you can disable all light and reflection probe baking in the Rendering >Lighting dialog while setting up the runtime.
Unfortunately, issues like these are difficult to fix for us, as we cannot consistently reproduce the behavior and the location where the Editor crashes are outside the scope of the Unity API.

Link to comment
Share on other sites

34 minutes ago, Peter said:

I noticed there does not seem to be a camera in the scene

This is indeed true, there are a few persistent pre-scene-load objects set up via a static class at runtime in any scene i launch so that i dont have to continuously go to a 'start scene' for eg.   The main camera is amongst the objects that are loaded this way in any sene at runtime.  However, Gaia seems to have no issue detecting and managing when it kicks in as those objects are all there before it even gets a chance.  That all works great.

As for the runtime generation crashes, yea, i havent dug into it too much , as it isnt exactly a game ender, its just annoying, lol.  But that render distance issue, well , meh, who knows. All i know is the script works just jim dandy peachy.  Thank you sir.

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...