Skip to content

qmlui: draw the smoke that Smoke and Hazer fixtures put in the air - #2162

Open
CristianDeluxe wants to merge 2 commits into
mcallegari:masterfrom
spectalive:pr/3d-smoke
Open

CristianDeluxe wants to merge 2 commits into
mcallegari:masterfrom
spectalive:pr/3d-smoke

Conversation

@CristianDeluxe

@CristianDeluxe CristianDeluxe commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Description

Summary of Changes:
The 3D view had one scene-wide smoke amount, so firing a fog machine changed nothing on screen. MainView3D now reads each Smoke and Hazer fixture's output channel every 100 ms and publishes up to eight emitters to the shaders (position, density, direction, reach and the colour of the machine's own LEDs). Density rises in 1.5 s and clears in 3 s for a jet or 30 s for a hazer; nothing is published while there is no smoke, so an on-demand scene stays idle.

A jet leaves the nozzle of smoke.dae along the mesh's +Z, widens, rises and breaks up at its tip; a hazer is a soft cloud around the machine. The light pass ray-marches each plume only inside a cylinder around the jet's axis, so the jet glows in its LED colour plus ambient light, and the spotlight scattering pass thickens beams that cross it. The plume code is shared through an #include that makeShader now expands from the resources.

Related Issues:
Depends on #2160 (it touches the same line of spotlight_scattering.frag); this branch contains that commit, so review only the last one.

Checklist

  • I have read and followed the QLC+ Coding Guidelines.
  • My code adheres to the project's coding style, including:
    • Placing opening braces { on a new line for functions and class definitions.
    • Consistent use of spaces and indentation.
  • I have tested my changes on the following platforms:
    • Linux
    • Windows
    • macOS
  • I have added or updated documentation as necessary.

Testing

Test Cases:
Four jet fog machines with RGB LEDs and one hazer in a rig, fired from a Virtual Console button while moving heads crossed the plumes.

Test Results:
The plumes appear, take the LED colour, rise and clear on the timings above, and beams crossing them brighten. The cylinder bound brings the heaviest pass from 9.5 ms (bounding sphere) to 4 ms a frame on an M1.

Additional Notes

Tested on macOS 27 with an Apple M1 (Qt 6.11.2) only; not on Windows or Linux. The branch builds on its own from master. The engine and fixture-definition unit tests pass apart from InputOutputMap_Test::profileDirectories, which fails the same way on master in a non-bundled macOS build.

The gobo mask used only the red channel times alpha, so a colour gobo lost
its colour and a photographic one lost most of its contrast, and the texture
was sampled unfiltered with no mipmaps, so the projection aliased once
minified. Tint the beam and the lit surface with the gobo's RGB, and give
the texture mipmaps, trilinear filtering and anisotropy.
The 3D view had a single scene-wide smokeAmount, so firing a fog machine
changed nothing on screen. Every 100 ms MainView3D now reads each Smoke
and Hazer fixture's output channel and publishes up to eight emitters to
the shaders: position, density, direction, reach and the colour of the
machine's own LEDs. Density rises in 1.5 s and clears in 3 s for a jet
or 30 s for a hazer; nothing is published while no smoke is in the air,
so an OnDemand scene stays idle.

A jet leaves smoke.dae's nozzle along the mesh's +Z, widens, rises and
breaks up at its tip; a hazer is a soft cloud around the machine. The
light pass ray-marches each plume only inside a cylinder around the
jet's axis, clipped between nozzle and tip (a bounding sphere covered
half the screen and cost 9.5 ms a frame on an M1; the cylinder brings
the heaviest pass to 4 ms), so a jet glows in its own LED colour plus
ambient light, and the spotlight scattering pass thickens beams that
cross it. The plume code is shared through an #include that makeShader
expands from the resources.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant