Skip to content

Fix particle glow color interpolation (#1030) - #3080

Open
adrian-andrzjewski wants to merge 2 commits into
jMonkeyEngine:masterfrom
adrian-andrzjewski:codex/issue-1030-particle-glow-color
Open

adrian-andrzjewski wants to merge 2 commits into
jMonkeyEngine:masterfrom
adrian-andrzjewski:codex/issue-1030-particle-glow-color

Conversation

@adrian-andrzjewski

@adrian-andrzjewski adrian-andrzjewski commented Nov 13, 2026 •

Copy link
Copy Markdown

Closes #1030.

Change

The particle Glow technique uses a particle-aware fragment shader so interpolated particle color modulates GlowMap and GlowColor output. It now advertises GLSL 1.20 for both shader stages, matching the regular particle technique for desktop GL 2.1 point sprites. The regression test asserts that the material exposes this variant.

Validation

  • Reproduced before the fix: the framebuffer red channel was 255 instead of the expected 51.
  • Passed :jme3-screenshot-tests:jme3-screenshot-tests-desktop:screenshotTest --tests org.jmonkeyengine.screenshottests.effects.TestParticleGlowColor on the local OpenGL 4.5 renderer.
  • Passed :jme3-core:test :jme3-effects:test :jme3-screenshot-tests:jme3-screenshot-tests-desktop:test on the updated branch.
  • The local LWJGL3 test context does not exercise actual GL 2.1 shader compilation.

@adrian-andrzjewski

Copy link
Copy Markdown
Author

@riccardobl Could you please review this fix for #1030 when you have a chance? It adds framebuffer regression coverage for interpolated particle color across the glow output variants; the targeted screenshot test and relevant module suites passed locally.

@jaime-jmebot jaime-jmebot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for tackling the particle glow color regression. The dedicated particle glow shader is a good fit here: it reuses the particle vertex outputs, handles point-sprite UVs, and preserves the zero-output case when no glow parameters are set. The test also checks each of those parameter combinations, which gives this behavior useful regression coverage.

I found one compatibility issue in the technique shader declarations: unlike the standard particle technique, the glow technique omits GLSL120. That matters because the fragment shader explicitly rejects desktop GLSL versions below 1.20 when point sprites are enabled, but the available versions here are only 300, 150, and 100. A desktop GL 2.1 renderer can therefore end up with an unsupported GLSL100 shader instead of the viable GLSL120 variant. I left an inline suggestion to add GLSL120 for both stages, matching the regular particle technique.

Once that fallback is included, the approach and the regression test look good. Thanks!

@adrian-andrzjewski

Copy link
Copy Markdown
Author

@riccardobl I addressed the GLSL 1.20 compatibility feedback by adding the GLSL120 variant to both Glow shader stages and asserting that the material exposes it. The updated targeted framebuffer test and core/effects/desktop test suites pass locally. Could you review the updated PR when convenient?

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.

Particle.j3md glow color ignores color interpolation

2 participants