Closed CommanderRT closed 1 week ago
Hi, can you briefly describe what you need to do with the clouds so that I could help?
I assume you're trying to offset the clouds so that the appearance stays the same after moving the camera (changing origin).
You can refer to this HDRP Volumetric Clouds discussion thread to know more about applying the offset.
but I have found no way to serialize the clouds in my own script
Not sure if I understand it correctly, but an example (untested) to change the Shape Offset property could be like this:
using UnityEngine.Rendering;
// Get the interpolated volume stack from current scene
var stack = VolumeManager.instance.stack;
// Get the volumetric clouds volume
VolumetricClouds cloudsVolume = stack.GetComponent<VolumetricClouds>();
bool isValid = cloudsVolume != null && cloudsVolume.IsActive();
// Apply your offset value
if (isValid)
{
cloudsVolume.shapeOffset.value = newShapeOffset;
}
Hope this helps!
Hi, I was trying to implement the offset in my own script and was looking for a way to serialize the clouds in my script and I haven't found a way to do so. I will test out your solutions and get back with the results I hope it will work, thanks for help!
And it worked! Thanks for the solution, it was also an issue with my origin shift script, after I pasted this code to the script it gave me the same error but after pasting it to another much simplier code it worked! Thank you again, and your URP port of clouds is amazing!
I was trying to move the clouds in my own floating origin script but I have found no way to serialize the clouds in my own script, any suggestions? Any help would be appreciated.