Manually set the WorldCenter / WorldOffset of Physically based Sky?

Good day!
So I’ve been working on my flight simulator for some time. Now I added floating origin, so that you can fly infinite distance and height. In case you dont know what floating origin is, it basicly centers the camera to new Vector3(0,0,0) and moves all other objects -camera.transform.position.

Okay so the issue that I now have is, that unity, or the physically based sky thinks I am always at 0 altitude. In unity 2021, there is just a value called “planetCenterPosition”, and you set that as your new worldPosition that you calculated from your floating origin.


But the issue is, I cant find anything like that here in unity6. Would be amazing if someone could help me. Thanks!

my first thought as a workaround is sending a global shader variable/property to the sky shader (if you’re fine with writing/editing shaders) that is the simulated position of the camera, and using that in whatever calculations utilize _WorldSpaceCameraPos.

After many hours and days of work, I finally figured it out. I was always trying to edit the shader, but the solution was to edit the scripts, add some values and thats it. It takes quite a lot of knowledge, but if you know how to do it, it works.





1 Like