Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.x] Implement shadowmask for DirectionalLight in BakedLightmap #68702

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from

Conversation

DearthDev
Copy link
Contributor

Finished implementing #51330.

This is my first ever PR. Please go easy on me, I'm very nervous about messing up in front of Juan senpai.

There are two known bugs that have been documented and only effect people who have shadowmasking on.

  1. When using GLES2 and using shadowmasking with color and without HDR, there are visual bugs. After extensive debugging, I believe the problem is how RGBA8 images are uploaded to the graphics card in the GLES2 renderer. I feel fixing this is outside the scope of this PR because the resulting lightmap is correct and the shader appears to be bug free as well.
  2. Shadowmasking doesn't work when using HDR without color because Godot doesn't support one color channel + alpha channel half float textures (RAH). Adding "Image::FORMAT_RAH" seems outside the scope of this PR. Currently a warning is printed when using HDR without color and the alpha channel is stripped, therefore removing shadowmasking but everything else still works fine.

@Calinou
Copy link
Member

Calinou commented Nov 16, 2022

Shadowmasking doesn't work when using HDR without color because Godot doesn't support one color channel + alpha channel half float textures (RAH). Adding "Image::FORMAT_RAH" seems outside the scope of this PR. Currently a warning is printed when using HDR without color and the alpha channel is stripped, therefore removing shadowmasking but everything else still works fine.

I think we'll have to move the shadowmask to a separate L8 texture to avoid this issue. HDR + alpha formats are poorly supported across the board.

@jcostello
Copy link
Contributor

jcostello commented Nov 16, 2022

@DearthDev Is this valid for 4.0 as well?

@Calinou
Copy link
Member

Calinou commented Nov 16, 2022

@DearthDev Is this valid for 4.0 as well?

Yes, but it needs to be redone from scratch on the master branch with an entirely different GPU-based lightmapper. It won't be done for 4.0 at this point, since it's in feature freeze.

@akien-mga akien-mga changed the title Implement shadowmask for DirectionalLight in BakedLightmap [3.x] Implement shadowmask for DirectionalLight in BakedLightmap Jan 5, 2024
@lawnjelly lawnjelly modified the milestones: 3.6, 3.7 Sep 11, 2024
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.

4 participants