-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Add a debug draw mode for displaying UV2 (lightmap) texel density #96814
base: master
Are you sure you want to change the base?
Conversation
Will this work with #75164? |
Good question. Ideally it should take any lightmap or mesh texel scale into account |
Right now it will automatically take #75164 into account since it uses the scale that was calculated during lightmap baking. However, I need to refactor things so you can preview a new scale without re-baking. |
The checkerboard pattern in the screenshots looks a bit curious to me. Every 10 steps (when the large checkerboard changes color), it mirrors the pattern, which looks odd. The number of steps between each large checkerboard step is also not a power of 2, so I think 8 steps would make more sense than 10 (since a lot of things in level design work with powers of 2). Contrast may need to be lowered slightly as well so it doesn't look overbearing in the process. I'd expect it to look more like this instead (ignore the fact this is a 3-level checkerboard pattern, but look at the general contrast and the pattern not mirroring within each large checkerboard):
This is also interesting to see; do any other programs do something similar? This may be confusing if the pattern drawn by Godot works differently to the one drawn by other 3D applications. I believe most of the time, the checkerboard pattern is exactly aligned with the texel grid as opposed to being offset by half a texel. |
I originally had it like this, but it looks horrible with the 2-level checkerboard. the dark tiles of the light squares end up being close to the light tiles of the dark squares, so you see this weird pattern over everything. In your screenshot, the 3rd level really helps break it up
I think you misunderstand. This is exactly aligned with the texel grid. I don't know what other programs do, but I think the most intuitive thing is for the squares to a visual representation of the pixel (if you consider the pixel as a little square). So the center of the pixel should sit in the center of the square. |
Salvages and supersedes: #62987
This PR also implements instance uniforms for the Compatibility renderer as it was needed for the debug draw mode
Before merging:
maybe extract the change to add instance uniforms to a different PRDone Implement instance uniforms in Compatibility renderer #96819)texel_scale
property to LightmapGI #64908)Up close with bicubic filtering disabled so you can see individual texels. Note texels are aligned with the center of the square
Same as above but with bicubic on
Faint large scale checkerboard to easily tell scale
Looks fine from a distance