VoxelGI.xml 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="VoxelGI" inherits="VisualInstance3D" version="4.0">
  3. <brief_description>
  4. Real-time global illumination (GI) probe.
  5. </brief_description>
  6. <description>
  7. [VoxelGI]s are used to provide high-quality real-time indirect light to scenes. They precompute the effect of objects that emit light and the effect of static geometry to simulate the behavior of complex light in real-time. [VoxelGI]s need to be baked before using, however, once baked, dynamic objects will receive light from them. Further, lights can be fully dynamic or baked.
  8. Having [VoxelGI]s in a scene can be expensive, the quality of the probe can be turned down in exchange for better performance in the [ProjectSettings] using [member ProjectSettings.rendering/global_illumination/voxel_gi/quality].
  9. [b]Note:[/b] Meshes should have sufficiently thick walls to avoid light leaks (avoid one-sided walls). For interior levels, enclose your level geometry in a sufficiently large box and bridge the loops to close the mesh.
  10. </description>
  11. <tutorials>
  12. <link title="GI probes">https://docs.godotengine.org/en/latest/tutorials/3d/gi_probes.html</link>
  13. <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
  14. </tutorials>
  15. <methods>
  16. <method name="bake">
  17. <return type="void" />
  18. <argument index="0" name="from_node" type="Node" default="null" />
  19. <argument index="1" name="create_visual_debug" type="bool" default="false" />
  20. <description>
  21. Bakes the effect from all [GeometryInstance3D]s marked with [constant GeometryInstance3D.GI_MODE_BAKED] and [Light3D]s marked with either [constant Light3D.BAKE_DYNAMIC] or [constant Light3D.BAKE_STATIC]. If [code]create_visual_debug[/code] is [code]true[/code], after baking the light, this will generate a [MultiMesh] that has a cube representing each solid cell with each cube colored to the cell's albedo color. This can be used to visualize the [VoxelGI]'s data and debug any issues that may be occurring.
  22. </description>
  23. </method>
  24. <method name="debug_bake">
  25. <return type="void" />
  26. <description>
  27. Calls [method bake] with [code]create_visual_debug[/code] enabled.
  28. </description>
  29. </method>
  30. </methods>
  31. <members>
  32. <member name="data" type="VoxelGIData" setter="set_probe_data" getter="get_probe_data">
  33. The [VoxelGIData] resource that holds the data for this [VoxelGI].
  34. </member>
  35. <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3(10, 10, 10)">
  36. The size of the area covered by the [VoxelGI]. If you make the extents larger without increasing the subdivisions with [member subdiv], the size of each cell will increase and result in lower detailed lighting.
  37. </member>
  38. <member name="subdiv" type="int" setter="set_subdiv" getter="get_subdiv" enum="VoxelGI.Subdiv" default="1">
  39. Number of times to subdivide the grid that the [VoxelGI] operates on. A higher number results in finer detail and thus higher visual quality, while lower numbers result in better performance.
  40. </member>
  41. </members>
  42. <constants>
  43. <constant name="SUBDIV_64" value="0" enum="Subdiv">
  44. Use 64 subdivisions. This is the lowest quality setting, but the fastest. Use it if you can, but especially use it on lower-end hardware.
  45. </constant>
  46. <constant name="SUBDIV_128" value="1" enum="Subdiv">
  47. Use 128 subdivisions. This is the default quality setting.
  48. </constant>
  49. <constant name="SUBDIV_256" value="2" enum="Subdiv">
  50. Use 256 subdivisions.
  51. </constant>
  52. <constant name="SUBDIV_512" value="3" enum="Subdiv">
  53. Use 512 subdivisions. This is the highest quality setting, but the slowest. On lower-end hardware this could cause the GPU to stall.
  54. </constant>
  55. <constant name="SUBDIV_MAX" value="4" enum="Subdiv">
  56. Represents the size of the [enum Subdiv] enum.
  57. </constant>
  58. </constants>
  59. </class>