just like the title, I’d be appreciated if someone tell me the way to make skybox slowly move.
you need to post more details.
Do you want the clouds to move, the sun?
skyboxes per se don’t move. There are various tricks to simulate movement. You can do blending of different skyboxes, you can do skydomes, particle-clouds and many others. Without knowing more in detail what you want, it’s impossible to help you.
You can’t move / rotate the built in skybox but I can think of a couple workarounds that will achieve the same result:
- Put your sky box and a camera on a separate layer, then rotate the camera through script and have it on a lower camera depth than your main camera.
- Create a separate sky box or sky sphere 3D object and use that instead of the built in sky box.
1 Like
Thanks for this, it’s nice trick.
You CAN rotate the skybox, but only by shader.
vertexOutput vert(vertexInput _input)
{
vertexOutput output;
output.vertex = mul(UNITY_MATRIX_MVP, mul(_SunRotation,-_input.vertex));
output.texcoord = -_input.texcoord;
output.vertexWorld = mul(_Object2World, -_input.vertex);
return output;
}
fixed4 frag(vertexOutput _input) : COLOR
{
...
float4 vertexDir = normalize(mul(_SunRotation, _input.vertexWorld)); // Rotierter Vertex
...
}
To Upload you need something like this
RenderSettings.skybox.SetMatrix("_SunRotation", Matrix4x4.TRS(Vector3.zero, m_sunballRenderer.transform.rotation, Vector3.one));