Objective: learn how to create a custom skybox, apply it and how it acts as a source of light
Today we’re going to give a boost to our scene. Since now we’ve learned about self-luminance and light probes that help illuminate the scene with good performances. We also noticed that static lights like those have to be “baked” in order to see the effects of any changes, since they’re not dynamic and evaluated at runtime.
If you take a look at the final scene (“main”) you can see a beautiful New York landscape around the objects. This is the so called skybox. The name is not random, it acts literally like the sky: something colourful and, if needed, illuminating for far, far away. Somehow unreachable. Skyboxes can be of several types, from solid colour to complex materials.
In order to recreate that NY-by-night feeling, we’re going to create a skybox material. We should have a bit of experience now.
In the shader dropdown menu, let’s select Skybox, 6 Sided. We want to create a sort of cube surrounding our scene.
The six faces should be images create for that specific purpose, so the borders would blend seamlessly. We have them among the imported assets. Let’s find the cubemap images and put them in place, in the material inspector.
As you can see, the 6 sides are labelled with the corresponding directions (like +/- Z…) if we drag and drop the images (textures) we can admire the preview building up before our eyes
Now what? We have a cool skybox, but we have to apply and exploit it. We have to reach the lighting settings. Window, Rendering, Lighting.
Here we have a bunch of settings, but we’ll focus on the Environment tab. As you can see there is already a sort of default/vanilla skybox material, and we’re going to replace it with our NY skybox.
There’s more to be pointed out. Here we can find the reason why this skybox will be a game changer. Environment Lighting and Reflections rely on the Skybox! This means that apart from our only real light source (directional), environment will be illuminated by the skybox, with its colours!
If you’re curious you can try and experiment a little, just to see which role this setting has, by changing the source from skybox to solid colour.
Once you chose the setting, the scene lights have to be baked again and after a while this is the result of choosing solid red colour:
So, the skybox is now NY but the room is illuminated with red lights. Let’s go back to a Skybox source and enjoy the view!