I’m using Unity 5 and it’s new procedural skybox. It looks amazing!
In my game, I have a day/night cycle. I can’t find a way to use a night skybox which will slowly appear (blend) to replace the procedural skybox when the night comes.
I know a shader exists to blend between two skyboxes, but it won’t work with the new procedural skybox.
I want to be able to keep the procedural skybox, so I can keep my amaizing sunrise/sunset, but be able to add stars at night.
Is there a way to replace the “Black” color at night with a standard skybox? An image?
Should I add a huge sphere to my game to act like a skybox and make it transparent on day time?
I really have no idea how to achieve that. There must be a way to change the night sky…
If you just want to add stars then particles could work very nicely. Make a particle emitter emit in a circle from the edge, make the circle really big, and make the particles spawn a lot more often and live longer. You can attach the particles to the directional light and they rotate with your sun!
Yes, I tought about that, but it wont appear if the particles are further than the camera clip distance. If I make it follow the position of the player, the particles will sometimes appear over walls or mountains far away.
My goal is to add more complex sky, like the old skyboxes, at night.
You could have another camera be only looking at the stars and put that camera on a different layer than the players. When you set it up the stars can be rendered in front of the skybox, but behind the everything else.
to simulate a skybox, I made a cube in blender, inverted the normals so I can see it from inside.
I created a Cubemap and applyed it to my cube with the Skybox>Cubemap shader.
I can’t find a way to play with this object’s transparency, to make it fully transparent at day time.
Shader “Unlit/UnlitAlphaWithFade”
{
Properties
{
_Color(“Color Tint”, Color) = (1,1,1,1)
_MainTex(“Base (RGB) Alpha (A)”, 2D) = “white”
}
Category
{
Lighting Off
ZWrite Off
//ZWrite On // uncomment if you have problems like the sprite disappear in some rotations.
Cull back
Blend SrcAlpha OneMinusSrcAlpha
//AlphaTest Greater 0.001 // uncomment if you have problems like the sprites or 3d text have white quads instead of alpha pixels.
Tags {Queue = Transparent}
SubShader
{
Pass
{
SetTexture[_MainTex]
{
ConstantColor[_Color]
Combine Texture * constant
}
}
}
}
}
Now, how do you use it? There is no accessible material for the procedural skybox; it seems to apply automatically if I drop it in the project but how do you control it?