Skip to content

Add coherent gobo presentation experiment (FogVolume / Vector Prism / Native Shadow) and fix projector + Visual Settings regressions - #95

Open
PeramatoG wants to merge 5 commits into
mainfrom
codex/implement-gobo-visualization-experiments
Open

Add coherent gobo presentation experiment (FogVolume / Vector Prism / Native Shadow) and fix projector + Visual Settings regressions#95
PeramatoG wants to merge 5 commits into
mainfrom
codex/implement-gobo-visualization-experiments

Conversation

@PeramatoG

Copy link
Copy Markdown
Owner

Motivation

  • Surface gobo projection was failing on Godot 4.7 because lights used for fixture beams were left with shadow_enabled = false, which produces black/stale light_projector output in this engine version.
  • Visual Settings refresh could zero live beams by reconstructing scaled intensity from optional metadata (peraviz_beam_base_intensity) with a 0.0 default instead of falling back to held authoritative dimmer state.
  • Provide an experiment to present gobo transmission coherently without creating per-gobo polygon explosion, while preserving the existing vector-prism fallback and a native-shadow workaround for fog shaping.

Description

  • Ensure crisp surface projection by assigning the composed gobo texture to SpotLight3D.light_projector, enabling shadows only while a projector is active and restoring the previous shadow state on clear; add a reusable shadows-only aperture quad for the native-shadow experiment. (modified scripts/fixture_gobo_projector.gd)
  • Add a Fog Volume presentation backend that places a per-emitter FogVolume cone, aligns it to Peraviz local -Z, projects the composed gobo texture through the volume, and uses an emission-based, zero-density presentation approximation to avoid cross-light fog coupling. (added/modified scripts/fog_volume_gobo_beam_controller.gd, scripts/shaders/fog_volume_gobo_beam.gdshader)
  • Wire a selectable presentation mode into the volumetric renderer with three modes: Fog Volume Gobo (Experimental), Vector Gobo Prism (Reference), and Native Fog + Shadow Gobo (Experimental), and move deprecated/unused shader parameter writes out of the hot path. (modified scripts/beam_renderers/volumetric_beam_renderer.gd, scripts/beam_optics_controller.gd)
  • Redesign Visual Settings UI to expose a single descriptive Beam presentation choice, rename Beam intensity to Beam / volume intensity, replace the old quick presets with experiment-oriented presets, and stop using the dead generic Beam quality control. (modified scripts/ui/visual/renderer_settings_panel.gd, scripts/visual_settings_window.gd)
  • Fix Visual Settings refresh to use the last authoritative normalized_dimmer stored with the beam when recomputing scaled_intensity, and ensure presentation switches clean up previous backend resources (FogVolumes, mask quads) without leaking. (modified scripts/load_scene.gd)
  • Add a headless GDScript test exercising projector lifecycle, open-slot clearing, shadows-only mask creation, and repeated A→B→C→A mode switching, plus documentation and release-note updates describing the experiment and Godot 4.7 limitations. (added tests/gdscript/test_gobo_presentation_modes.gd, updated docs/BEAM_RENDERING_MODES.md and docs/release-notes-draft.md)
  • Small lifecycle/cleanup fixes: ensure FogVolume removal uses remove_child() before queue_free(), guard native-shadow preference per-presentation-mode, and avoid unnecessary vector fallback when no runtime gobo is present. (multiple script changes)

Files touched (high level): scripts/fixture_gobo_projector.gd, scripts/fog_volume_gobo_beam_controller.gd, scripts/beam_renderers/volumetric_beam_renderer.gd, scripts/beam_optics_controller.gd, scripts/load_scene.gd, scripts/ui/visual/renderer_settings_panel.gd, scripts/visual_settings_window.gd, scripts/shaders/fog_volume_gobo_beam.gdshader, tests/gdscript/test_gobo_presentation_modes.gd, docs/BEAM_RENDERING_MODES.md, docs/release-notes-draft.md (commit f2bb610).

Testing

  • Ran repository checks tests/check_no_large_files.sh (passed with existing advisory warnings) and tests/check_runtime_architecture.sh (passed).
  • Ran git diff --check (passed) and local static/grep validations to confirm removed dead UI/shader parameters; results OK.
  • Added tests/gdscript/test_gobo_presentation_modes.gd covering projector shadow lifecycle, open-slot clearing, native-shadow mask creation, FogVolume ownership, and repeated-mode switching, but headless Godot execution in this environment failed because neither godot nor godot4 is installed (so the new GDScript test could not be executed here).
  • Notes on environment test limitations: attempted headless execution with godot --headless --path . --script tests/gdscript/test_gobo_presentation_modes.gd and godot4 --headless --path . --script tests/gdscript/test_gobo_presentation_modes.gd, both returned not-found in CI environment.

If you want, I can: run the new headless test locally where Godot 4.7 is available, expand the tests to assert additional mode-specific visual/shader parameters, or trim/rename any UI labels before merging.


Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant