Skip to content

Implement cull_mask for decals and lights in mobile and compatibility backends#72810

Merged
akien-mga merged 1 commit into
godotengine:masterfrom
clayjohn:cull_mask
Feb 6, 2023
Merged

Implement cull_mask for decals and lights in mobile and compatibility backends#72810
akien-mga merged 1 commit into
godotengine:masterfrom
clayjohn:cull_mask

Conversation

@clayjohn

@clayjohn clayjohn commented Feb 6, 2023

Copy link
Copy Markdown
Member

Fixes: #65848

cull_mask works in the clustered renderer because it is checked in the fragment shader at draw time. But for the other renderers, it was being ignored completely.

The Mobile and gl_compatibility renderers "pair" decals and lights with GeometryInstances. The pairing happens in RendererSceneCull when either of the objects are updated. Previously, the pairing logic only checked if the objects overlapped and if they were the type of objects that can pair (i.e. a light can't pair with a decal, but it can pair with a GeometryInstance). The pairing logic needs to avoid pairing objects with incompatible cull masks. And it needs to update when the cull_mask is changed.

This PR just adds the cull_mask to the pair culling logic

@clayjohn clayjohn added this to the 4.0 milestone Feb 6, 2023
@clayjohn clayjohn requested a review from BastiaanOlij February 6, 2023 20:18
@clayjohn clayjohn requested a review from a team as a code owner February 6, 2023 20:18
@akien-mga akien-mga merged commit 33a83a5 into godotengine:master Feb 6, 2023
@akien-mga

Copy link
Copy Markdown
Member

Thanks!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vulkan Mobile: Decal and light Cull Mask is not working

2 participants