Skip to content

Fix 2D light for masking feature - #9033

Open
Raiguri wants to merge 3 commits into
4ian:masterfrom
Raiguri:2dlight-mask-fix
Open

Fix 2D light for masking feature#9033
Raiguri wants to merge 3 commits into
4ian:masterfrom
Raiguri:2dlight-mask-fix

Conversation

@Raiguri

@Raiguri Raiguri commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

This fix intended for people who want to use 2D light as mask using SpriteMasking extension, while using different texture shape for 2D light instead of default radial one.

Added discard for every fragment that should be visually transparent, in both the textured and default light shaders. This makes the light's mesh only occupy the stencil buffer where it's actually visible the cone texture's real silhouette, or the circle's radius instead of the whole quad.

Before fix

Screencast_20260829_233308.webm

After

Screencast_20260829_233809.webm
Added discard for every fragment that should be visually transparent, in both the textured and default light shaders. This makes the light's mesh only occupy the stencil buffer where it's actually visible the cone texture's real silhouette, or the circle's radius instead of the whole quad.
@Raiguri
Raiguri requested a review from 4ian as a code owner August 29, 2026 20:41
@4ian

4ian commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Look at https://github.com/4ian/GDevelop/pull/9033/changes and notice what's wrong, then see how you can fix it :)
(it's fairly obvious and related to git usage, so I'm not telling it explicitly because it's important you get this right for future contributions)

@Raiguri
Raiguri marked this pull request as draft August 31, 2026 09:23
@Raiguri
Raiguri marked this pull request as ready for review August 31, 2026 09:32
@Raiguri

Raiguri commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

Look at https://github.com/4ian/GDevelop/pull/9033/changes and notice what's wrong, then see how you can fix it :) (it's fairly obvious and related to git usage, so I'm not telling it explicitly because it's important you get this right for future contributions)

My bad, I fixed it, but for some reason semaphore few tests got timed out, how to force it to recheck it?

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

Labels

None yet

2 participants