1
\$\begingroup\$

I'm currently using the Volumetric Clouds feature with the HDRP in Unity. My game world has gotten a little too big, so I'm trying to implement a "floating origin"-type system to fix floating-point glitches. The thing is, I'm using local clouds, which the player can actually move around. So when I shift all the game objects, I need to also be able to shift the clouds.

Is there any way to translate/move/teleport the clouds exactly as they are to a different location?

Things I've tried

The position property of the transform doesn't seem to do anything (in either a local or global volume).

The closest easy option I can find is the "shape offset" property (disabled in image):
Volumetric Clouds properties

When I enable the "Shape Offset" override, I can sort of move the clouds around but they shift and change. I'm moving the "large noise" pattern around, but there is other noise at play that changes their shape, an that noise is not being offset.

I tried using the wind parameters to move the clouds, thinking that I could maybe set it fast enough to move the clouds a large distance in a single frame, but no matter how I tweaked the settings, the clouds still seem to change as they move. (In the clip below, the camera is moving with the clouds in the wind): Camera moving with clouds in the wind

"Cloud Map Offset" seemed promising, but it too doesn't seem to work quite right. It seems to move the "areas" where clouds are or aren't, but it doesn't move the clouds themselves. So if there's an area where there currently isn't a cloud, and you use this to "offset" an existing cloud spot, instead of actually moving the existing cloud, a new, slightly different cloud appears in the offset position.

Anyone have any ideas on how to move the entire noise system to move all the clouds exactly as they are? Maybe some advanced setting I have figured out yet?

\$\endgroup\$

2 Answers 2

2
\$\begingroup\$

Since HDRP 17 it has feature to offset visual environment including volumetric clouds.

https://docs.unity3d.com/Packages/[email protected]/manual/visual-environment-volume-override-reference.html#planet

This post on forum helped me to fix the same issue you had

https://forum.unity.com/threads/volumetric-clouds.1078811/page-16#post-9596413

Here is example how I used it

 if (!clonedVolumeProfile.TryGet(out VisualEnvironment visualEnvironment)) return; visualEnvironment.centerMode.value = VisualEnvironment.PlanetMode.Manual; // it is in km, but offset is meters, convert it visualEnvironment.planetCenter.value -= offset / 1000f; 
\$\endgroup\$
1
  • \$\begingroup\$ Was waiting until the general release to test this in the actual game. Worked perfectly. Guess the answer was "you can't do it until they add the feature". \$\endgroup\$ Commented Dec 18, 2024 at 5:09
0
\$\begingroup\$

You could try adding the opposite of your current speed vector to the clouds scrolling speed.

After experimenting I've come to the same conclusion as you. :(

My testing involved teleporting the camera to coordinates and changing the shapeoffset to match. Since the shapeoffset isn't in metres, I found the unit conversion by moving the camera and offset at different rates*deltatime on the same axis until they both appeared to be standing still.

1m world space = ~0.00005f in cloud offset space.

The main 'cloud shapes' stay in the same relative positions, but the rest of the noise doesn't seem to be accessible.

I found this post from a dev saying that shape offset should be enough: https://forum.unity.com/threads/volumetric-clouds.1078811/page-10#post-7600129 - so maybe some recent features have made this not possible to do.

The only ideas I have left are to try putting your own Cloud Map and Lut under Manual Cloud Control, and then see if the ShapeOffset and/or CloudMapOffset get nice results.
Could also try scrolling the texture UV's. (I wish I could test it but couldn't find out how to make those textures, or find pre-made ones)

\$\endgroup\$
5
  • \$\begingroup\$ How would that help with teleportation, which is not speed-based? \$\endgroup\$ Commented Apr 22, 2023 at 20:31
  • \$\begingroup\$ Oh my bad I was thinking that you would be keeping the player at origin and moving the world around them. Ill go look through the docs again. \$\endgroup\$ Commented Apr 22, 2023 at 21:17
  • \$\begingroup\$ link Cloud Map Offset sounds promising \$\endgroup\$ Commented Apr 22, 2023 at 21:24
  • \$\begingroup\$ Sounds like you might want to spin up a quick test, and edit your answer post to update it if that works. \$\endgroup\$ Commented Apr 22, 2023 at 21:55
  • \$\begingroup\$ @DMGregory I've updated my question. I've tried both the wind/scroll, and the "cloud map offset" settings, and haven't quite gotten it to work. \$\endgroup\$ Commented Apr 22, 2023 at 22:11

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.