Efficient Lighting Technique
Been a while since I have posted any tips in this thread, however thought I would share some of the things I have learnt about lighting over the past couple of years. When undertaking game development, there is a balance between scene lighting realism and render convergence.
The most realistic way to light a scene is via emissives, simulating each of the light sources in the scene. Many of the environment assets you can purchase utilise this option. The problem however is that this setup is pretty much the worst alternative for render convergence. This may see you needing to utilise tens of thousands of iterations, down-sampling and denoising.
Another viewpoint you hear from many game developers is to utilise spotlights and methods such as 3-point lighting. Whilst this converges well and the lighting of the object in the center of the scene is fairly good, the lighting of the background is unrealistic. This method also requires you to tweak the lighting every time the camera angle changes.
The other main method uses is the application of a HDRI. While this is generally the accepted method for lighting outdoor scenes, it is rarely used by developers for indoor scenes. Much of this is because of the general unfamiliarity with the
You must be registered to see the links
. This tool has the effect of pulling exterior lighting from external HDRI through scene walls.
After experimentation with a number of lighting setups, the method I utilise for the majority of renders in my game is as follows. I utilise a combination of a HDRI with emissive light sources. The HDRI provides the majority of light within a scene, whilst the emissives provide local highlights. An example of this is as below.
You can see the emissives used on Lia (central character) and the light in the back left. The majority of the light however comes from utilising a HDRI and an iRay Interior Camera. When selecting the HDRI you need to have once that approximates the colours that would occur after a white light is reflected off the surfaces in the scene. As the room is predominately blue / grey with a wood floor I use the HDRI as below.
To pull light through the walls you need to use an iRay Interior Camera. This camera has all of the same functionality of a normal Daz camera, however also incorporates what I believe are emissive planes to drag light through the walls.
You can see above that I have played around with the frame width and am also using Depth of Field. Also I have shown the light planes used with the camera. From what I can tell these planes are far larger than what is represented by the graphic.
- I would note that you need to ensure that none of the planes intersect with characters or other hollow objects. This gives the effect of creating an internal light inside the character. To fix, just move these planes outwards so they no longer intersect the object.
- Also you need to play around with the HDRI rotation such that it is in the correct orientation in respect to the camera. Generally you want to have the brighter portion of the HDRI coming from behind the camera. You can check this by applying a spherical lens to the iRay Interior Camera and then rendering the HDRI with all the objects in the scene hidden. The brighter portions should appear on the sides (behind).
- The one hiccup of this method in a scene is when you have visible mirror in the scene. The reflection will show the iRay Camera emissive plane rather than the room.
Whilst I still utilise other methods on occasion, I use the method above for the bulk of the renders. It provides the best compromise I have found between realism and speed. As an example, below is the scene rendered at 1080p for only 100 iterations (about 1min render). This is a raw render output with no post processing.
In practice I render at higher resolution and more iterations than above. The general settings I use are as follows.
- Render at 3920 x 2160
- 500 Iterations
- Down sample to 1080p
On a RTX2060 this renders the scene above (as seen in 1st image) in about 20-30 minutes.
If you are on more modest hardware I would recommend the following settings.
- Render at 3920 x 2160
- 100 Iterations
- Apply either the nVidia or Intel Denoiser
- Down sample to 1080p
As a final note, when developing a game, you should be familiar with several lighting techniques. I am not suggesting the above is the only method to employ, however it will allow the developer to render a large number of good quality images very quickly. It is also a boon should you wish to create a number of animations. For example, in the v0.50 of Callisto the animations added were formed from about 14,000 renders.