Light Indoor - RosoVRgarden/VRgarden-tutorials GitHub Wiki
-
Create a new project using the 3D URP template.
-
Go to the Asset Store and get the Pack Gesta (free)
-
Open the scene called ‘scene’. All will be pink, it’s because the project was done in the basic render pipeline, but it can be changed. In Unity 2020, you need to go to Edit > Render Pipeline > Universal Render Pipeline > Upgrade Object Materials.
- Open the Lighting tab in Window > Rendering > Lighting (I usually put it in next to the inspector) at the bottom, click on the arrow next to Generate Lighting and select Clear Baked Data.
- Delete the Directional Light (DL), Reflection and Camera from the Hierarchy.
-
Go to GameObject and add a Camera. Choose the view by moving the camera then, make sure that the camera is selected, and press control-shift-f (command-shift-f on Mac) to copy the scene view position to your camera position.
-
Add Directional Light (GameObject>Light>Direction Light). The position doesn’t matter, use the rotation to place the reflexion of the window in the room (e.g.: Rotation 22, -67, -27). You can choose the colour for the time of day and the intensity (e.g.: 3).
-
Bake the light in the scene allows you calculate complex lighting and save it into the texture. First change the objects to static (see image below) and check that every object in your scene has been imported with the Generate Lightmap UV’s option (in this example, they have). Find the object in the asset folder.
- You can see the Lightmap by selecting Shade under the Scene window. Select Baked Lightmap and show Lightmap Resolution. Big squares mean low resolution and small square mean high resolution.
-
You select the resolution in the Lighting tab under lightmap resolution (try 5 then 20) and click Generate Lighting to test.
-
In order to improve lighting (indirect diffuse and specular lighting), it’s recommended to have good quality lighting environment. Download this HDR file from here https://polyhaven.com/a/ruckenkreuz (free). The HDR / 2k is well enough in terms of quality. Import in Unity and change the Texture Shape to Cube (1). Then go to Assets menu and create a Material (2). Change the shader to Skybox > Cubemap (3) then assign the HDR image to the Cubemap slot (4).
Go to the Lighting tab, select Environment and drag the New Material into Skybox Material and drag the Directional Light to Sun Source.
- Create a reflexion probe to capture the reflection inside the scene. Move the reflection probe to the center of the scene. Then Click the edit bounding volume button at the top (make sure the Gizmo is on) so you can make the box to the size of the house or slightly larger. Box Projection needs to be one as well.
- Here are some suggestions for the lighting. You can Generate Lighting to test them.
- You could also add an Area Light (GameObject>Light) where the light is just outside the window and the orientation (blue) is towards the inside. Range needs to be 25 so it can reach the end of the flat. General Lighting and check the Lightmap by selecting Shade under the Scene window, then Baked Lightmap.