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

Implement lightmap antialiasing for static shadows #10489

Closed
atirut-w opened this issue Aug 19, 2024 · 2 comments
Closed

Implement lightmap antialiasing for static shadows #10489

atirut-w opened this issue Aug 19, 2024 · 2 comments

Comments

@atirut-w
Copy link

Describe the project you are working on

N/A

Describe the problem or limitation you are having in your project

When baking lightmap for static lights, the lightmap resolution can sometimes be insufficient for especially thin objects. This is especially visible in godotengine/godot#89919 (review).

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Simply take a few more shadow samples when baking.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

When baking, instead of taking one sample, take multiple samples slightly offset on a plane perpendicular to light direction. This makes sure that a pixel in the lightmap averages out any sudden change in the area it covers and make the shadows a little more nice to look at.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No

Is there a reason why this should be core and not an add-on in the asset library?

Lightmap baking is core

@clayjohn
Copy link
Member

clayjohn commented Aug 19, 2024

I have a work in progress branch already: I should have a PR momentarily https://github.com/clayjohn/godot/tree/Lightmapper-AA-direct-light

Before bicubic bicubic + AA
Screenshot from 2024-08-18 19-48-09 Screenshot from 2024-08-18 19-48-24 Screenshot from 2024-08-18 19-47-50
Before After
Screenshot from 2024-08-19 11-38-01 Screenshot from 2024-08-19 11-37-33

Oh, also with bicubic:
image

@akien-mga
Copy link
Member

Implemented by godotengine/godot#95828.

@akien-mga akien-mga added this to the 4.4 milestone Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants