mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-06 07:50:22 +01:00
Merge pull request #758 from Calinou/improve-global-illumination-demo
Improve 3D global illumination demo (4.0)
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
# Global Illumination
|
# Global Illumination
|
||||||
|
|
||||||
This demo showcases Godot's global illumination systems:
|
This demo showcases Godot's global illumination systems:
|
||||||
VoxelGI, SDFGI, ReflectionProbe and screen-space effects like SSAO and SSIL.
|
LightmapGI, VoxelGI, SDFGI, ReflectionProbe and screen-space effects like SSAO and SSIL.
|
||||||
|
|
||||||
Use the mouse to look around, <kbd>W</kbd>/<kbd>A</kbd>/<kbd>S</kbd>/<kbd>D</kbd>
|
Use the mouse to look around, <kbd>W</kbd>/<kbd>A</kbd>/<kbd>S</kbd>/<kbd>D</kbd>
|
||||||
or arrow keys to move.
|
or arrow keys to move.
|
||||||
@@ -17,6 +17,10 @@ A ReflectionProbe is parented to the sphere to showcase real-time reflections.
|
|||||||
When the ReflectionProbe is hidden, it is disabled. In this case,
|
When the ReflectionProbe is hidden, it is disabled. In this case,
|
||||||
VoxelGI, SDFGI or environment lighting will be used to provide fallback reflections.
|
VoxelGI, SDFGI or environment lighting will be used to provide fallback reflections.
|
||||||
|
|
||||||
|
A Decal node is parented to the moving sphere and cube to provide simple shadows for them.
|
||||||
|
This is especially effective when using the LightmapGI (All) global illumination mode,
|
||||||
|
which doesn't allow dynamic objects to cast shadows on static surfaces.
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
@@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/cube.glb-ec927bc01951d93b2130ba52799eca7c.scn
|
|||||||
|
|
||||||
nodes/root_type="Spatial"
|
nodes/root_type="Spatial"
|
||||||
nodes/root_name="Scene Root"
|
nodes/root_name="Scene Root"
|
||||||
|
nodes/apply_root_scale=true
|
||||||
nodes/root_scale=1.0
|
nodes/root_scale=1.0
|
||||||
meshes/ensure_tangents=true
|
meshes/ensure_tangents=true
|
||||||
meshes/generate_lods=true
|
meshes/generate_lods=true
|
||||||
@@ -24,5 +25,6 @@ meshes/lightmap_texel_size=0.1
|
|||||||
skins/use_named_skins=true
|
skins/use_named_skins=true
|
||||||
animation/import=true
|
animation/import=true
|
||||||
animation/fps=15
|
animation/fps=15
|
||||||
|
animation/trimming=false
|
||||||
import_script/path=""
|
import_script/path=""
|
||||||
_subresources={}
|
_subresources={}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
[remap]
|
[remap]
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="StreamTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://q2k8m14vo3kr"
|
uid="uid://q2k8m14vo3kr"
|
||||||
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
|
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
@@ -11,7 +11,7 @@ metadata={
|
|||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://icon.png"
|
source_file="res://icon.png"
|
||||||
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"]
|
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
@@ -21,7 +21,6 @@ compress/hdr_compression=1
|
|||||||
compress/bptc_ldr=0
|
compress/bptc_ldr=0
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
compress/channel_pack=0
|
compress/channel_pack=0
|
||||||
compress/streamed=false
|
|
||||||
mipmaps/generate=false
|
mipmaps/generate=false
|
||||||
mipmaps/limit=-1
|
mipmaps/limit=-1
|
||||||
roughness/mode=0
|
roughness/mode=0
|
||||||
@@ -29,6 +28,7 @@ roughness/src_normal=""
|
|||||||
process/fix_alpha_border=true
|
process/fix_alpha_border=true
|
||||||
process/premult_alpha=false
|
process/premult_alpha=false
|
||||||
process/normal_map_invert_y=false
|
process/normal_map_invert_y=false
|
||||||
process/HDR_as_SRGB=false
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
process/size_limit=0
|
process/size_limit=0
|
||||||
detect_3d/compress_to=1
|
detect_3d/compress_to=1
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ config_version=5
|
|||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="Global Illumination"
|
config/name="Global Illumination"
|
||||||
|
config/description="This demo showcases Godot's global illumination systems: LightmapGI, VoxelGI, SDFGI, ReflectionProbe and screen-space effects like SSAO and SSIL."
|
||||||
run/main_scene="res://test.tscn"
|
run/main_scene="res://test.tscn"
|
||||||
config/features=PackedStringArray("4.0")
|
config/features=PackedStringArray("4.0")
|
||||||
config/icon="res://icon.png"
|
config/icon="res://icon.png"
|
||||||
@@ -20,6 +21,10 @@ config/icon="res://icon.png"
|
|||||||
window/stretch/mode="canvas_items"
|
window/stretch/mode="canvas_items"
|
||||||
window/stretch/aspect="expand"
|
window/stretch/aspect="expand"
|
||||||
|
|
||||||
|
[editor]
|
||||||
|
|
||||||
|
export/convert_text_resources_to_binary=true
|
||||||
|
|
||||||
[filesystem]
|
[filesystem]
|
||||||
|
|
||||||
import/blender/enabled=false
|
import/blender/enabled=false
|
||||||
@@ -31,7 +36,7 @@ cycle_gi_mode={
|
|||||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"unicode":0,"echo":false,"script":null)
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"unicode":0,"echo":false,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
toggle_reflection_probe={
|
cycle_reflection_probe_mode={
|
||||||
"deadzone": 0.5,
|
"deadzone": 0.5,
|
||||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":82,"unicode":0,"echo":false,"script":null)
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":82,"unicode":0,"echo":false,"script":null)
|
||||||
]
|
]
|
||||||
@@ -78,5 +83,7 @@ common/enable_pause_aware_picking=true
|
|||||||
|
|
||||||
[rendering]
|
[rendering]
|
||||||
|
|
||||||
|
anti_aliasing/quality/screen_space_aa=1
|
||||||
|
anti_aliasing/quality/use_debanding=true
|
||||||
quality/shadows/filter_mode=2
|
quality/shadows/filter_mode=2
|
||||||
environment/default_environment="res://default_env.tres"
|
environment/default_environment="res://default_env.tres"
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ extends Node3D
|
|||||||
|
|
||||||
enum GIMode {
|
enum GIMode {
|
||||||
NONE,
|
NONE,
|
||||||
# BAKED_LIGHTMAP_ALL,
|
LIGHTMAP_GI_ALL,
|
||||||
# BAKED_LIGHTMAP_INDIRECT,
|
LIGHTMAP_GI_INDIRECT,
|
||||||
VOXEL_GI,
|
VOXEL_GI,
|
||||||
SDFGI,
|
SDFGI,
|
||||||
MAX, # Maximum value of the enum, used internally.
|
MAX, # Maximum value of the enum, used internally.
|
||||||
@@ -12,12 +12,26 @@ enum GIMode {
|
|||||||
# Keep this in sync with the GIMode enum (except for MAX).
|
# Keep this in sync with the GIMode enum (except for MAX).
|
||||||
const GI_MODE_TEXTS = [
|
const GI_MODE_TEXTS = [
|
||||||
"Environment Lighting (Fastest)",
|
"Environment Lighting (Fastest)",
|
||||||
# "Baked Lightmap All (Fast)",
|
"Baked Lightmap All (Fast)",
|
||||||
# "Baked Lightmap Indirect (Average)",
|
"Baked Lightmap Indirect (Average)",
|
||||||
"VoxelGI (Slow)",
|
"VoxelGI (Slow)",
|
||||||
"SDFGI (Slow)",
|
"SDFGI (Slow)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
enum ReflectionProbeMode {
|
||||||
|
NONE,
|
||||||
|
ONCE,
|
||||||
|
ALWAYS,
|
||||||
|
MAX,
|
||||||
|
}
|
||||||
|
|
||||||
|
# Keep this in sync with the ReflectionProbeMode enum (except for MAX).
|
||||||
|
const REFLECTION_PROBE_MODE_TEXTS = [
|
||||||
|
"Disabled - Using environment, VoxelGI or SDFGI reflections (Fast)",
|
||||||
|
"Enabled - \"Once\" Update Mode (Average)",
|
||||||
|
"Enabled - \"Always\" Update Mode (Slow)",
|
||||||
|
]
|
||||||
|
|
||||||
enum SSILMode {
|
enum SSILMode {
|
||||||
NONE,
|
NONE,
|
||||||
SSAO,
|
SSAO,
|
||||||
@@ -35,7 +49,7 @@ const SSIL_MODE_TEXTS = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
var gi_mode = GIMode.NONE
|
var gi_mode = GIMode.NONE
|
||||||
var use_reflection_probe = false
|
var reflection_probe_mode = ReflectionProbeMode.NONE
|
||||||
var ssil_mode = SSILMode.NONE
|
var ssil_mode = SSILMode.NONE
|
||||||
|
|
||||||
@onready var environment = $WorldEnvironment.environment
|
@onready var environment = $WorldEnvironment.environment
|
||||||
@@ -44,10 +58,15 @@ var ssil_mode = SSILMode.NONE
|
|||||||
@onready var reflection_probe = $Camera/ReflectiveSphere/ReflectionProbe
|
@onready var reflection_probe = $Camera/ReflectiveSphere/ReflectionProbe
|
||||||
@onready var ssil_mode_label = $SSILMode
|
@onready var ssil_mode_label = $SSILMode
|
||||||
|
|
||||||
|
# Several copies of the level mesh are required to cycle between different GI modes.
|
||||||
|
@onready var zdm2_no_lightmap = $Zdm2NoLightmap
|
||||||
|
@onready var zdm2_lightmap_all = $Zdm2LightmapAll
|
||||||
|
@onready var zdm2_lightmap_indirect = $Zdm2LightmapIndirect
|
||||||
|
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
set_gi_mode(gi_mode)
|
set_gi_mode(gi_mode)
|
||||||
set_use_reflection_probe(use_reflection_probe)
|
set_reflection_probe_mode(reflection_probe_mode)
|
||||||
set_ssil_mode(ssil_mode)
|
set_ssil_mode(ssil_mode)
|
||||||
|
|
||||||
|
|
||||||
@@ -55,8 +74,8 @@ func _input(event):
|
|||||||
if event.is_action_pressed("cycle_gi_mode"):
|
if event.is_action_pressed("cycle_gi_mode"):
|
||||||
set_gi_mode(wrapi(gi_mode + 1, 0, GIMode.MAX))
|
set_gi_mode(wrapi(gi_mode + 1, 0, GIMode.MAX))
|
||||||
|
|
||||||
if event.is_action_pressed("toggle_reflection_probe"):
|
if event.is_action_pressed("cycle_reflection_probe_mode"):
|
||||||
set_use_reflection_probe(not use_reflection_probe)
|
set_reflection_probe_mode(wrapi(reflection_probe_mode + 1, 0, ReflectionProbeMode.MAX))
|
||||||
|
|
||||||
if event.is_action_pressed("cycle_ssil_mode"):
|
if event.is_action_pressed("cycle_ssil_mode"):
|
||||||
set_ssil_mode(wrapi(ssil_mode + 1, 0, SSILMode.MAX))
|
set_ssil_mode(wrapi(ssil_mode + 1, 0, SSILMode.MAX))
|
||||||
@@ -68,8 +87,14 @@ func set_gi_mode(p_gi_mode):
|
|||||||
|
|
||||||
match p_gi_mode:
|
match p_gi_mode:
|
||||||
GIMode.NONE:
|
GIMode.NONE:
|
||||||
# $BakedLightmapIndirect.visible = false
|
$Zdm2NoLightmap.visible = true
|
||||||
# $BakedLightmapAll.visible = false
|
$Zdm2LightmapAll.visible = false
|
||||||
|
$Zdm2LightmapIndirect.visible = false
|
||||||
|
|
||||||
|
# Halve sky contribution to prevent shaded areas from looking too bright and blue.
|
||||||
|
environment.ambient_light_sky_contribution = 0.5
|
||||||
|
$LightmapGIIndirect.visible = false
|
||||||
|
$LightmapGIAll.visible = false
|
||||||
$VoxelGI.visible = false
|
$VoxelGI.visible = false
|
||||||
environment.sdfgi_enabled = false
|
environment.sdfgi_enabled = false
|
||||||
|
|
||||||
@@ -80,71 +105,94 @@ func set_gi_mode(p_gi_mode):
|
|||||||
$GarageOmniLight.light_bake_mode = Light3D.BAKE_DYNAMIC
|
$GarageOmniLight.light_bake_mode = Light3D.BAKE_DYNAMIC
|
||||||
$CornerSpotLight.light_bake_mode = Light3D.BAKE_DYNAMIC
|
$CornerSpotLight.light_bake_mode = Light3D.BAKE_DYNAMIC
|
||||||
|
|
||||||
# GIMode.BAKED_LIGHTMAP_ALL:
|
GIMode.LIGHTMAP_GI_ALL:
|
||||||
# $BakedLightmapIndirect.visible = false
|
$Zdm2NoLightmap.visible = false
|
||||||
# $BakedLightmapAll.visible = true
|
$Zdm2LightmapAll.visible = true
|
||||||
# $VoxelGI.visible = false
|
$Zdm2LightmapIndirect.visible = false
|
||||||
# environment.sdfgi_enabled = false
|
|
||||||
#
|
|
||||||
# # Make lights not affect baked surfaces by setting their bake mode to All.
|
|
||||||
# $Sun.light_bake_mode = Light3D.BAKE_STATIC
|
|
||||||
# $GrateOmniLight.light_bake_mode = Light3D.BAKE_STATIC
|
|
||||||
# $GarageOmniLight.light_bake_mode = Light3D.BAKE_STATIC
|
|
||||||
# $CornerSpotLight.light_bake_mode = Light3D.BAKE_STATIC
|
|
||||||
|
|
||||||
# GIMode.BAKED_LIGHTMAP_INDIRECT:
|
# Halve sky contribution to prevent dynamic objects from looking too bright and blue.
|
||||||
# $BakedLightmapIndirect.visible = true
|
# (When using lightmaps, this property doesn't affect lightmapped surfaces.)
|
||||||
# $BakedLightmapAll.visible = false
|
environment.ambient_light_sky_contribution = 0.5
|
||||||
# $VoxelGI.visible = false
|
$LightmapGIIndirect.visible = false
|
||||||
# environment.sdfgi_enabled = false
|
$LightmapGIAll.visible = true
|
||||||
#
|
$VoxelGI.visible = false
|
||||||
# $Sun.light_bake_mode = Light3D.BAKE_DYNAMIC
|
environment.sdfgi_enabled = false
|
||||||
# $GrateOmniLight.light_bake_mode = Light3D.BAKE_DYNAMIC
|
|
||||||
# $GarageOmniLight.light_bake_mode = Light3D.BAKE_DYNAMIC
|
# Make lights not affect baked surfaces by setting their bake mode to All.
|
||||||
# $CornerSpotLight.light_bake_mode = Light3D.BAKE_DYNAMIC
|
$Sun.light_bake_mode = Light3D.BAKE_STATIC
|
||||||
|
$GrateOmniLight.light_bake_mode = Light3D.BAKE_STATIC
|
||||||
|
$GarageOmniLight.light_bake_mode = Light3D.BAKE_STATIC
|
||||||
|
$CornerSpotLight.light_bake_mode = Light3D.BAKE_STATIC
|
||||||
|
|
||||||
|
GIMode.LIGHTMAP_GI_INDIRECT:
|
||||||
|
$Zdm2NoLightmap.visible = false
|
||||||
|
$Zdm2LightmapAll.visible = false
|
||||||
|
$Zdm2LightmapIndirect.visible = true
|
||||||
|
|
||||||
|
# Halve sky contribution to prevent dynamic objects from looking too bright and blue.
|
||||||
|
# (When using lightmaps, this property doesn't affect lightmapped surfaces.)
|
||||||
|
environment.ambient_light_sky_contribution = 0.5
|
||||||
|
$LightmapGIIndirect.visible = true
|
||||||
|
$LightmapGIAll.visible = false
|
||||||
|
$VoxelGI.visible = false
|
||||||
|
environment.sdfgi_enabled = false
|
||||||
|
|
||||||
|
$Sun.light_bake_mode = Light3D.BAKE_DYNAMIC
|
||||||
|
$GrateOmniLight.light_bake_mode = Light3D.BAKE_DYNAMIC
|
||||||
|
$GarageOmniLight.light_bake_mode = Light3D.BAKE_DYNAMIC
|
||||||
|
$CornerSpotLight.light_bake_mode = Light3D.BAKE_DYNAMIC
|
||||||
|
|
||||||
GIMode.VOXEL_GI:
|
GIMode.VOXEL_GI:
|
||||||
# $BakedLightmapIndirect.visible = false
|
$Zdm2NoLightmap.visible = true
|
||||||
# $BakedLightmapAll.visible = false
|
$Zdm2LightmapAll.visible = false
|
||||||
|
$Zdm2LightmapIndirect.visible = false
|
||||||
|
|
||||||
|
environment.ambient_light_sky_contribution = 1.0
|
||||||
|
$LightmapGIIndirect.visible = false
|
||||||
|
$LightmapGIAll.visible = false
|
||||||
$VoxelGI.visible = true
|
$VoxelGI.visible = true
|
||||||
environment.sdfgi_enabled = false
|
environment.sdfgi_enabled = false
|
||||||
|
|
||||||
# Bake mode must be Indirect, not Disabled. Otherwise, GI will
|
# Bake mode must be Indirect, not Disabled. Otherwise, GI will
|
||||||
# not be visible for those lights.
|
# not be visible for those lights.
|
||||||
# Moving/blinking lights should generally have their bake mode set to Disabled
|
|
||||||
# to avoid visible GI pop-ins. This is because VoxelGI
|
|
||||||
# can take a while to update.
|
|
||||||
$Sun.light_bake_mode = Light3D.BAKE_DYNAMIC
|
$Sun.light_bake_mode = Light3D.BAKE_DYNAMIC
|
||||||
$GrateOmniLight.light_bake_mode = Light3D.BAKE_DYNAMIC
|
$GrateOmniLight.light_bake_mode = Light3D.BAKE_DYNAMIC
|
||||||
$GarageOmniLight.light_bake_mode = Light3D.BAKE_DYNAMIC
|
$GarageOmniLight.light_bake_mode = Light3D.BAKE_DYNAMIC
|
||||||
$CornerSpotLight.light_bake_mode = Light3D.BAKE_DYNAMIC
|
$CornerSpotLight.light_bake_mode = Light3D.BAKE_DYNAMIC
|
||||||
|
|
||||||
GIMode.SDFGI:
|
GIMode.SDFGI:
|
||||||
# $BakedLightmapIndirect.visible = false
|
$Zdm2NoLightmap.visible = true
|
||||||
# $BakedLightmapAll.visible = false
|
$Zdm2LightmapAll.visible = false
|
||||||
|
$Zdm2LightmapIndirect.visible = false
|
||||||
|
|
||||||
|
environment.ambient_light_sky_contribution = 1.0
|
||||||
|
$LightmapGIIndirect.visible = false
|
||||||
|
$LightmapGIAll.visible = false
|
||||||
$VoxelGI.visible = false
|
$VoxelGI.visible = false
|
||||||
environment.sdfgi_enabled = true
|
environment.sdfgi_enabled = true
|
||||||
|
|
||||||
# Bake mode must be Indirect, not Disabled. Otherwise, GI will
|
# Bake mode must be Indirect, not Disabled. Otherwise, GI will
|
||||||
# not be visible for those lights.
|
# not be visible for those lights.
|
||||||
# Moving/blinking lights should generally have their bake mode set to Disabled
|
|
||||||
# to avoid visible GI pop-ins. This is because SDFGI
|
|
||||||
# can take a while to update.
|
|
||||||
$Sun.light_bake_mode = Light3D.BAKE_DYNAMIC
|
$Sun.light_bake_mode = Light3D.BAKE_DYNAMIC
|
||||||
$GrateOmniLight.light_bake_mode = Light3D.BAKE_DYNAMIC
|
$GrateOmniLight.light_bake_mode = Light3D.BAKE_DYNAMIC
|
||||||
$GarageOmniLight.light_bake_mode = Light3D.BAKE_DYNAMIC
|
$GarageOmniLight.light_bake_mode = Light3D.BAKE_DYNAMIC
|
||||||
$CornerSpotLight.light_bake_mode = Light3D.BAKE_DYNAMIC
|
$CornerSpotLight.light_bake_mode = Light3D.BAKE_DYNAMIC
|
||||||
|
|
||||||
|
|
||||||
func set_use_reflection_probe(p_visible):
|
func set_reflection_probe_mode(p_reflection_probe_mode):
|
||||||
use_reflection_probe = p_visible
|
reflection_probe_mode = p_reflection_probe_mode
|
||||||
|
reflection_probe_mode_label.text = "Reflection probe: %s " % REFLECTION_PROBE_MODE_TEXTS[reflection_probe_mode]
|
||||||
|
|
||||||
if p_visible:
|
match p_reflection_probe_mode:
|
||||||
reflection_probe_mode_label.text = "Reflection probe: Enabled - Using reflection probe (Average)"
|
ReflectionProbeMode.NONE:
|
||||||
else:
|
reflection_probe.visible = false
|
||||||
reflection_probe_mode_label.text = "Reflection probe: Disabled - Using environment, VoxelGI or SDFGI reflections (Fast)"
|
reflection_probe.update_mode = ReflectionProbe.UPDATE_ONCE
|
||||||
|
ReflectionProbeMode.ONCE:
|
||||||
reflection_probe.visible = p_visible
|
reflection_probe.visible = true
|
||||||
|
reflection_probe.update_mode = ReflectionProbe.UPDATE_ONCE
|
||||||
|
ReflectionProbeMode.ALWAYS:
|
||||||
|
reflection_probe.visible = true
|
||||||
|
reflection_probe.update_mode = ReflectionProbe.UPDATE_ALWAYS
|
||||||
|
|
||||||
|
|
||||||
func set_ssil_mode(p_ssil_mode):
|
func set_ssil_mode(p_ssil_mode):
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
[gd_scene load_steps=13 format=3 uid="uid://dbm1npua7fq50"]
|
[gd_scene load_steps=17 format=3 uid="uid://dbm1npua7fq50"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://djbrxyh5s8j2o" path="res://zdm2.glb" id="1"]
|
[ext_resource type="PackedScene" uid="uid://djbrxyh5s8j2o" path="res://zdm2.glb" id="1"]
|
||||||
[ext_resource type="PackedScene" uid="uid://c2lbhsefub1o5" path="res://cube.glb" id="3"]
|
[ext_resource type="PackedScene" uid="uid://c2lbhsefub1o5" path="res://cube.glb" id="3"]
|
||||||
[ext_resource type="VoxelGIData" uid="uid://duykbpl6evu0r" path="res://test_VoxelGIData.res" id="3_1netx"]
|
[ext_resource type="VoxelGIData" uid="uid://duykbpl6evu0r" path="res://test_VoxelGIData.res" id="3_1netx"]
|
||||||
|
[ext_resource type="LightmapGIData" uid="uid://ct72rg4fnnes8" path="res://zdm2_all.lmbake" id="4_7vqwx"]
|
||||||
[ext_resource type="Script" path="res://test.gd" id="5"]
|
[ext_resource type="Script" path="res://test.gd" id="5"]
|
||||||
|
[ext_resource type="LightmapGIData" uid="uid://b78viqmkq8djh" path="res://zdm2_indirect.lmbake" id="5_14bmd"]
|
||||||
[ext_resource type="Script" path="res://camera.gd" id="6"]
|
[ext_resource type="Script" path="res://camera.gd" id="6"]
|
||||||
|
|
||||||
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_30v8t"]
|
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_30v8t"]
|
||||||
@@ -20,6 +22,7 @@ background_mode = 2
|
|||||||
sky = SubResource("Sky_4q314")
|
sky = SubResource("Sky_4q314")
|
||||||
tonemap_mode = 3
|
tonemap_mode = 3
|
||||||
tonemap_white = 6.0
|
tonemap_white = 6.0
|
||||||
|
ssao_intensity = 1.0
|
||||||
sdfgi_cascades = 3
|
sdfgi_cascades = 3
|
||||||
sdfgi_min_cell_size = 0.25
|
sdfgi_min_cell_size = 0.25
|
||||||
sdfgi_cascade0_distance = 16.0
|
sdfgi_cascade0_distance = 16.0
|
||||||
@@ -33,7 +36,18 @@ emission_energy_multiplier = 2.0
|
|||||||
|
|
||||||
[sub_resource type="BoxMesh" id="8"]
|
[sub_resource type="BoxMesh" id="8"]
|
||||||
|
|
||||||
|
[sub_resource type="Gradient" id="Gradient_3s4nj"]
|
||||||
|
colors = PackedColorArray(0, 0, 0, 1, 0, 0, 0, 0)
|
||||||
|
|
||||||
|
[sub_resource type="GradientTexture2D" id="GradientTexture2D_uu8pf"]
|
||||||
|
gradient = SubResource("Gradient_3s4nj")
|
||||||
|
fill = 1
|
||||||
|
fill_from = Vector2(0.5, 0.5)
|
||||||
|
fill_to = Vector2(0.5, 0.01)
|
||||||
|
|
||||||
[sub_resource type="SphereMesh" id="2"]
|
[sub_resource type="SphereMesh" id="2"]
|
||||||
|
radius = 1.0
|
||||||
|
height = 2.0
|
||||||
|
|
||||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_7doxp"]
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_7doxp"]
|
||||||
albedo_color = Color(0.811765, 1, 0.764706, 1)
|
albedo_color = Color(0.811765, 1, 0.764706, 1)
|
||||||
@@ -46,27 +60,46 @@ script = ExtResource("5")
|
|||||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||||
environment = SubResource("Environment_bau0c")
|
environment = SubResource("Environment_bau0c")
|
||||||
|
|
||||||
[node name="Zdm2" parent="." instance=ExtResource("1")]
|
[node name="Zdm2NoLightmap" parent="." instance=ExtResource("1")]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2)
|
||||||
|
|
||||||
|
[node name="Zdm2LightmapAll" parent="." instance=ExtResource("1")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2)
|
||||||
|
visible = false
|
||||||
|
|
||||||
|
[node name="Zdm2LightmapIndirect" parent="." instance=ExtResource("1")]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2)
|
||||||
|
visible = false
|
||||||
|
|
||||||
[node name="VoxelGI" type="VoxelGI" parent="."]
|
[node name="VoxelGI" type="VoxelGI" parent="."]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5, 6, 2.5)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5, 6, 2.5)
|
||||||
extents = Vector3(39, 18.5, 30)
|
extents = Vector3(39, 18.5, 30)
|
||||||
data = ExtResource("3_1netx")
|
data = ExtResource("3_1netx")
|
||||||
|
|
||||||
|
[node name="LightmapGIAll" type="LightmapGI" parent="."]
|
||||||
|
visible = false
|
||||||
|
quality = 3
|
||||||
|
light_data = ExtResource("4_7vqwx")
|
||||||
|
|
||||||
|
[node name="LightmapGIIndirect" type="LightmapGI" parent="."]
|
||||||
|
visible = false
|
||||||
|
quality = 3
|
||||||
|
light_data = ExtResource("5_14bmd")
|
||||||
|
|
||||||
[node name="Sun" type="DirectionalLight3D" parent="."]
|
[node name="Sun" type="DirectionalLight3D" parent="."]
|
||||||
transform = Transform3D(0.889832, -0.251497, 0.380722, 0, 0.834387, 0.551179, -0.456289, -0.490456, 0.742464, 4.47302, 6.47568, 8.72305)
|
transform = Transform3D(0.889832, -0.251497, 0.380722, 0, 0.834387, 0.551179, -0.456289, -0.490456, 0.742464, 4.47302, 6.47568, 8.72305)
|
||||||
shadow_enabled = true
|
shadow_enabled = true
|
||||||
shadow_blur = 1.5
|
shadow_bias = 0.04
|
||||||
|
shadow_blur = 2.0
|
||||||
directional_shadow_fade_start = 1.0
|
directional_shadow_fade_start = 1.0
|
||||||
directional_shadow_max_distance = 85.0
|
directional_shadow_max_distance = 75.0
|
||||||
|
|
||||||
[node name="GrateOmniLight" type="OmniLight3D" parent="."]
|
[node name="GrateOmniLight" type="OmniLight3D" parent="."]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 11.9461, -1.33084, -5.52646)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 11.9461, -1.33084, -5.52646)
|
||||||
light_color = Color(1, 0.905882, 0.470588, 1)
|
light_color = Color(1, 0.905882, 0.470588, 1)
|
||||||
shadow_enabled = true
|
shadow_enabled = true
|
||||||
shadow_bias = 0.03
|
shadow_bias = 0.03
|
||||||
shadow_blur = 1.5
|
shadow_blur = 2.0
|
||||||
omni_range = 10.0
|
omni_range = 10.0
|
||||||
omni_attenuation = 2.0
|
omni_attenuation = 2.0
|
||||||
|
|
||||||
@@ -76,7 +109,7 @@ light_color = Color(0.984314, 0.552941, 1, 1)
|
|||||||
light_energy = 15.0
|
light_energy = 15.0
|
||||||
shadow_enabled = true
|
shadow_enabled = true
|
||||||
shadow_bias = 0.03
|
shadow_bias = 0.03
|
||||||
shadow_blur = 1.5
|
shadow_blur = 2.0
|
||||||
omni_range = 10.0
|
omni_range = 10.0
|
||||||
omni_attenuation = 2.0
|
omni_attenuation = 2.0
|
||||||
|
|
||||||
@@ -100,8 +133,18 @@ script = ExtResource("6")
|
|||||||
|
|
||||||
[node name="Box" type="MeshInstance3D" parent="Camera"]
|
[node name="Box" type="MeshInstance3D" parent="Camera"]
|
||||||
transform = Transform3D(0.999999, -5.12227e-09, 9.68575e-08, 2.79397e-09, 0.999999, 8.9407e-08, 7.45058e-09, -1.11759e-07, 0.999999, -1.4, -0.999998, -3.99998)
|
transform = Transform3D(0.999999, -5.12227e-09, 9.68575e-08, 2.79397e-09, 0.999999, 8.9407e-08, 7.45058e-09, -1.11759e-07, 0.999999, -1.4, -0.999998, -3.99998)
|
||||||
|
layers = 2
|
||||||
mesh = SubResource("8")
|
mesh = SubResource("8")
|
||||||
|
|
||||||
|
[node name="BlobShadow" type="Decal" parent="Camera/Box"]
|
||||||
|
transform = Transform3D(-0.997524, -0.00613033, -0.0700699, -0.00719589, 0.999863, 0.0149653, 0.0699686, 0.015432, -0.997431, 0.0499506, -0.507917, -0.035697)
|
||||||
|
extents = Vector3(1.25, 2, 1.25)
|
||||||
|
texture_albedo = SubResource("GradientTexture2D_uu8pf")
|
||||||
|
albedo_mix = 0.9
|
||||||
|
upper_fade = 1.0
|
||||||
|
lower_fade = 1.0
|
||||||
|
cull_mask = 1048573
|
||||||
|
|
||||||
[node name="ReflectiveSphere" type="MeshInstance3D" parent="Camera"]
|
[node name="ReflectiveSphere" type="MeshInstance3D" parent="Camera"]
|
||||||
transform = Transform3D(-0.997523, -8.41886e-09, -0.0703376, -0.00719589, 0.994753, 0.102052, 0.0699685, 0.102305, -0.992289, 0.16733, -1.22931, -3.81225)
|
transform = Transform3D(-0.997523, -8.41886e-09, -0.0703376, -0.00719589, 0.994753, 0.102052, 0.0699685, 0.102305, -0.992289, 0.16733, -1.22931, -3.81225)
|
||||||
layers = 2
|
layers = 2
|
||||||
@@ -111,18 +154,27 @@ surface_material_override/0 = SubResource("StandardMaterial3D_7doxp")
|
|||||||
[node name="ReflectionProbe" type="ReflectionProbe" parent="Camera/ReflectiveSphere"]
|
[node name="ReflectionProbe" type="ReflectionProbe" parent="Camera/ReflectiveSphere"]
|
||||||
transform = Transform3D(1, -8.38189e-09, -8.9407e-08, 5.58791e-09, 1, -5.21541e-07, 4.47035e-08, 1.11759e-07, 1, 0, 0, 0)
|
transform = Transform3D(1, -8.38189e-09, -8.9407e-08, 5.58791e-09, 1, -5.21541e-07, 4.47035e-08, 1.11759e-07, 1, 0, 0, 0)
|
||||||
max_distance = 50.0
|
max_distance = 50.0
|
||||||
|
extents = Vector3(11, 11, 11)
|
||||||
box_projection = true
|
box_projection = true
|
||||||
enable_shadows = true
|
enable_shadows = true
|
||||||
ambient_mode = 0
|
ambient_mode = 0
|
||||||
|
|
||||||
|
[node name="BlobShadow" type="Decal" parent="Camera/ReflectiveSphere"]
|
||||||
|
transform = Transform3D(1, -1.37668e-14, 0, 1.33227e-15, 1, 1.42109e-14, 0, 0, 1, 0, -1, -1.90735e-06)
|
||||||
|
extents = Vector3(1.25, 2, 1.25)
|
||||||
|
texture_albedo = SubResource("GradientTexture2D_uu8pf")
|
||||||
|
albedo_mix = 0.9
|
||||||
|
upper_fade = 1.0
|
||||||
|
lower_fade = 1.0
|
||||||
|
cull_mask = 1048573
|
||||||
|
|
||||||
[node name="GIMode" type="Label" parent="."]
|
[node name="GIMode" type="Label" parent="."]
|
||||||
offset_left = 16.0
|
offset_left = 16.0
|
||||||
offset_top = 16.0
|
offset_top = 16.0
|
||||||
offset_right = 263.0
|
offset_right = 263.0
|
||||||
offset_bottom = 42.0
|
offset_bottom = 42.0
|
||||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||||
theme_override_constants/shadow_offset_x = 1
|
theme_override_constants/outline_size = 4
|
||||||
theme_override_constants/shadow_offset_y = 1
|
|
||||||
text = "Global illumination: None (Fastest)"
|
text = "Global illumination: None (Fastest)"
|
||||||
|
|
||||||
[node name="ReflectionProbeMode" type="Label" parent="."]
|
[node name="ReflectionProbeMode" type="Label" parent="."]
|
||||||
@@ -130,9 +182,8 @@ offset_left = 16.0
|
|||||||
offset_top = 48.0
|
offset_top = 48.0
|
||||||
offset_right = 148.0
|
offset_right = 148.0
|
||||||
offset_bottom = 74.0
|
offset_bottom = 74.0
|
||||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||||
theme_override_constants/shadow_offset_x = 1
|
theme_override_constants/outline_size = 4
|
||||||
theme_override_constants/shadow_offset_y = 1
|
|
||||||
text = "Reflection probe: Disabled - Using environment, VoxelGI or SDFGI reflections (Fast)"
|
text = "Reflection probe: Disabled - Using environment, VoxelGI or SDFGI reflections (Fast)"
|
||||||
|
|
||||||
[node name="SSILMode" type="Label" parent="."]
|
[node name="SSILMode" type="Label" parent="."]
|
||||||
@@ -140,9 +191,8 @@ offset_left = 16.0
|
|||||||
offset_top = 80.0
|
offset_top = 80.0
|
||||||
offset_right = 365.0
|
offset_right = 365.0
|
||||||
offset_bottom = 106.0
|
offset_bottom = 106.0
|
||||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||||
theme_override_constants/shadow_offset_x = 1
|
theme_override_constants/outline_size = 4
|
||||||
theme_override_constants/shadow_offset_y = 1
|
|
||||||
text = "Screen-space lighting effects: Disabled (Fast)"
|
text = "Screen-space lighting effects: Disabled (Fast)"
|
||||||
|
|
||||||
[node name="Label" type="Label" parent="."]
|
[node name="Label" type="Label" parent="."]
|
||||||
@@ -153,11 +203,10 @@ offset_left = 16.0
|
|||||||
offset_top = -120.0
|
offset_top = -120.0
|
||||||
offset_right = 537.0
|
offset_right = 537.0
|
||||||
offset_bottom = -16.0
|
offset_bottom = -16.0
|
||||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||||
theme_override_constants/shadow_offset_x = 1
|
theme_override_constants/outline_size = 4
|
||||||
theme_override_constants/shadow_offset_y = 1
|
|
||||||
text = "Space: Cycle between GI modes
|
text = "Space: Cycle between GI modes
|
||||||
R: Toggle reflection probe
|
R: Cycle between reflection probe modes
|
||||||
F: Cycle between screen-space lighting effect modes
|
F: Cycle between screen-space lighting effect modes
|
||||||
Escape or F10: Toggle mouse capture"
|
Escape or F10: Toggle mouse capture"
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -15,6 +15,7 @@ dest_files=["res://.godot/imported/zdm2.glb-c2f26c366324e083db1b83c037b80fc6.scn
|
|||||||
|
|
||||||
nodes/root_type="Spatial"
|
nodes/root_type="Spatial"
|
||||||
nodes/root_name="Zdm2"
|
nodes/root_name="Zdm2"
|
||||||
|
nodes/apply_root_scale=true
|
||||||
nodes/root_scale=1.0
|
nodes/root_scale=1.0
|
||||||
meshes/ensure_tangents=true
|
meshes/ensure_tangents=true
|
||||||
meshes/generate_lods=false
|
meshes/generate_lods=false
|
||||||
@@ -24,5 +25,6 @@ meshes/lightmap_texel_size=0.25
|
|||||||
skins/use_named_skins=true
|
skins/use_named_skins=true
|
||||||
animation/import=true
|
animation/import=true
|
||||||
animation/fps=15
|
animation/fps=15
|
||||||
|
animation/trimming=false
|
||||||
import_script/path=""
|
import_script/path=""
|
||||||
_subresources={}
|
_subresources={}
|
||||||
|
|||||||
BIN
3d/global_illumination/zdm2_all.exr
Normal file
BIN
3d/global_illumination/zdm2_all.exr
Normal file
Binary file not shown.
28
3d/global_illumination/zdm2_all.exr.import
Normal file
28
3d/global_illumination/zdm2_all.exr.import
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="2d_array_texture"
|
||||||
|
type="CompressedTexture2DArray"
|
||||||
|
uid="uid://dh810u2wvg8xg"
|
||||||
|
path.etc2="res://.godot/imported/zdm2_all.exr-90621151e6c7cdb548fd3797293f06e7.etc2.ctexarray"
|
||||||
|
path.s3tc="res://.godot/imported/zdm2_all.exr-90621151e6c7cdb548fd3797293f06e7.s3tc.ctexarray"
|
||||||
|
metadata={
|
||||||
|
"imported_formats": ["etc2", "s3tc"],
|
||||||
|
"vram_texture": true
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://zdm2_all.exr"
|
||||||
|
dest_files=["res://.godot/imported/zdm2_all.exr-90621151e6c7cdb548fd3797293f06e7.etc2.ctexarray", "res://.godot/imported/zdm2_all.exr-90621151e6c7cdb548fd3797293f06e7.s3tc.ctexarray"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=2
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/channel_pack=1
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
slices/horizontal=1
|
||||||
|
slices/vertical=1
|
||||||
BIN
3d/global_illumination/zdm2_all.lmbake
Normal file
BIN
3d/global_illumination/zdm2_all.lmbake
Normal file
Binary file not shown.
BIN
3d/global_illumination/zdm2_indirect.exr
Normal file
BIN
3d/global_illumination/zdm2_indirect.exr
Normal file
Binary file not shown.
28
3d/global_illumination/zdm2_indirect.exr.import
Normal file
28
3d/global_illumination/zdm2_indirect.exr.import
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="2d_array_texture"
|
||||||
|
type="CompressedTexture2DArray"
|
||||||
|
uid="uid://dv1sjg7a0m50l"
|
||||||
|
path.etc2="res://.godot/imported/zdm2_indirect.exr-1fd4bc76ec648c4d2e6230b7d974087b.etc2.ctexarray"
|
||||||
|
path.s3tc="res://.godot/imported/zdm2_indirect.exr-1fd4bc76ec648c4d2e6230b7d974087b.s3tc.ctexarray"
|
||||||
|
metadata={
|
||||||
|
"imported_formats": ["etc2", "s3tc"],
|
||||||
|
"vram_texture": true
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://zdm2_indirect.exr"
|
||||||
|
dest_files=["res://.godot/imported/zdm2_indirect.exr-1fd4bc76ec648c4d2e6230b7d974087b.etc2.ctexarray", "res://.godot/imported/zdm2_indirect.exr-1fd4bc76ec648c4d2e6230b7d974087b.s3tc.ctexarray"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=2
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/channel_pack=1
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
slices/horizontal=1
|
||||||
|
slices/vertical=1
|
||||||
BIN
3d/global_illumination/zdm2_indirect.lmbake
Normal file
BIN
3d/global_illumination/zdm2_indirect.lmbake
Normal file
Binary file not shown.
Reference in New Issue
Block a user