Global Illumination In Godot - Printable Version +- Sick Gaming (https://www.sickgaming.net) +-- Forum: Programming (https://www.sickgaming.net/forum-76.html) +--- Forum: Game Development (https://www.sickgaming.net/forum-80.html) +--- Thread: Global Illumination In Godot (/thread-93718.html) |
Global Illumination In Godot - xSicKxBot - 02-22-2020 Global Illumination In Godot <div style="margin: 5px 5% 10px 5%;"><img src="https://www.sickgaming.net/blog/wp-content/uploads/2020/02/global-illumination-in-godot.png" width="432" height="178" title="" alt="" /></div><div><p>Global Illumination describes several algorithms used to calculate non-direct lights in game engines. In Godot, it’s implemented using the GIProbe node, which can calculate emissive lights and secondary reflections, giving you more accurate lighting in your scene at the cost of performance. In this tutorial we will go step by step through the process of setting up a GIProbe. You can learn more in the <a href="https://youtu.be/W19zgasQK-c">video</a> embedded below.</p> <p>The first step for setting up global illumination is to go through the scene, select each model that will participate in the calculations and select Use in Baked Lighting in the Geometry Instance section.</p> <p><a href="https://www.gamefromscratch.com/image.axd?picture=image_3480.png"><img width="432" height="178" title="image" alt="image" src="https://www.sickgaming.net/blog/wp-content/uploads/2020/02/global-illumination-in-godot.png" border="0"></a></p> <p>Once you have your models set to participate, it’s time to create a GIProbe node. Add a new Node to the Scene (doesn’t matter who it is parented to) of type GIProbe.</p> <p><a href="https://www.gamefromscratch.com/image.axd?picture=image_3481.png"><img width="263" height="189" title="image" alt="image" src="https://www.sickgaming.net/blog/wp-content/uploads/2020/02/global-illumination-in-godot-1.png" border="0"></a></p> <p>Now size the GIProbe box using the red/pink control handles, so that it envelops your scene. You can have multiple GIProbes per scene and having them overlap serves no purpose.</p> <p><a href="https://www.gamefromscratch.com/image.axd?picture=image_3482.png"><img width="604" height="426" title="image" alt="image" src="https://www.sickgaming.net/blog/wp-content/uploads/2020/02/global-illumination-in-godot-2.png" border="0"></a></p> <p>Now with at least one light source in the scene, with GIProbe selected, click Bake GI Probe in the menubar.</p> <p><a href="https://www.gamefromscratch.com/image.axd?picture=image_3483.png"><img width="661" height="66" title="image" alt="image" src="https://www.sickgaming.net/blog/wp-content/uploads/2020/02/global-illumination-in-godot-3.png" border="0"></a></p> <p>This will calculate the indirect lights in your scene. You can also have a GIProbe calculate the effects of emissive lights in your scene. Emissive lights are lights that are projected from textures. In a SpatialMaterial you can turn emissive on in the Emission tab by selecting Enabled. Emission is the color of the light emitted, while energy is the strength of the energy emitted.</p> <p><a href="https://www.gamefromscratch.com/image.axd?picture=image_3484.png"><img width="428" height="208" title="image" alt="image" src="https://www.sickgaming.net/blog/wp-content/uploads/2020/02/global-illumination-in-godot-4.png" border="0"></a></p> <p>Emissive lights will only be shown after being baked by a GIProbe. Emissive lights cannot move without baking the scene again. You can cause a GIProbe to bake lights in code using the following code:</p> <pre> <span>get_node</span><span>(</span><span>"../GIProbe"</span><span>).</span><span>bake</span><span>()</span> </pre> <p>This is an expensive operation and should not be performed lightly.</p> <p>There are a couple of ways to control the quality of the lighting generated by a GIProbe. The first is by setting the Subdiv property in the GIProbe.</p> <p><a href="https://www.gamefromscratch.com/image.axd?picture=image_3485.png"><img width="441" height="359" title="image" alt="image" src="https://www.sickgaming.net/blog/wp-content/uploads/2020/02/global-illumination-in-godot-5.png" border="0"></a></p> <p>The higher the resolution, the better the results but more expensive the calculations. You can also change the quality of lighting in Project Settings by enabling High Quality in Voxel Cone Tracing. </p> <p><a href="https://www.gamefromscratch.com/image.axd?picture=image_3486.png"><img width="754" height="607" title="image" alt="image" src="https://www.sickgaming.net/blog/wp-content/uploads/2020/02/global-illumination-in-godot-6.png" border="0"></a></p> <p>Once again, this is a trade off between quality and performance. Finally I should point out that GIProbe only works with the OpenGL ES3 renderer, not in ES2. On ES2 you are instead stuck with traditional Light Baking, which takes less processing power, but produces inferior and less dynamic results.</p> <p>Another thing to be aware of is dealing with the GIProbe inside the Godot Editor. The GIProbe, as shown above, is a giant green lattice, which can make viewing your scene somewhat difficulty. You may be tempted to hide the GIProbe like so:</p> <p><a href="https://www.gamefromscratch.com/image.axd?picture=image_3487.png"><img width="352" height="76" title="image" alt="image" src="https://www.sickgaming.net/blog/wp-content/uploads/2020/02/global-illumination-in-godot-7.png" border="0"></a></p> <p>Unfortunately this turns the GI off completely! If instead you want to hide the GIProbe in the viewport, you turn it off in the viewport menu. In the viewport, select View->Gizmoes->GIProbe.</p> <p><a href="https://www.gamefromscratch.com/image.axd?picture=image_3488.png"><img width="478" height="410" title="image" alt="image" src="https://www.sickgaming.net/blog/wp-content/uploads/2020/02/global-illumination-in-godot-8.png" border="0"></a></p> <p>This value is a toggle and controls ALL GIProbes in the scene.</p> <p>You can learn more about Global Illumination and GI Probes in the video below.</p> <p align="center">[embedded content]</p> <p class="under"> <span class="categories"><a href="https://www.gamefromscratch.com/category/Programming.aspx">Programming</a> <a href="https://www.gamefromscratch.com/category/Design.aspx">Design</a></span> <span class="tags"><a href="https://www.gamefromscratch.com/?tag=/Godot" rel="tag">Godot</a> <a href="https://www.gamefromscratch.com/?tag=/Tutorial" rel="tag">Tutorial</a></span> </p> <hr> <p> <!–</p> <p>–></p> </div> https://www.sickgaming.net/blog/2020/02/21/global-illumination-in-godot/ |