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

Smooth Lighting for emissive blocks #2653

Open
MehVahdJukaar opened this issue Aug 9, 2024 · 11 comments
Open

Smooth Lighting for emissive blocks #2653

MehVahdJukaar opened this issue Aug 9, 2024 · 11 comments
Labels
T-enhancement Type: Enhancement

Comments

@MehVahdJukaar
Copy link

Request Description

I noticed that the game only applies smooth lighting to blocks that dont emit light level. When placing say many lamps with light level 5 next to a torch emitting 15 one can clearly see each lamp block has a distinct "shading" to it, similar to how every block looks when smooth lighting is off.
I think having this would be a flat visual improvements for all those blocks.
Screenshot to explain my point. Note how each of those white blocks has a slightly different shade and the illumination isnt smooth on their surface

image

@MehVahdJukaar MehVahdJukaar added S-needs-triage Status: Needs triage T-enhancement Type: Enhancement labels Aug 9, 2024
@djmrFunnyMan
Copy link

djmrFunnyMan commented Aug 9, 2024

This is a vanilla issue https://bugs.mojang.com/browse/MC-225516
(though would be nice if sodium fixed it)

@PepperCode1
Copy link
Contributor

Changing this behavior for all blocks may break other mods that rely on it, but it is possible to force-enable AO on blocks that emit light using MaterialFinder#ambientOcclusion(TriState.TRUE) in FRAPI.

@MehVahdJukaar
Copy link
Author

MehVahdJukaar commented Aug 9, 2024

Well even with that on the effect isn't what one wants. It's ends up creating darker edges on the edge of the block as it blends it's light to neighboring lower light values blocks which looks bad for a block that is supposed to look all the same brightness throughout it's entire face. This is very likely why that was turned off

@PepperCode1
Copy link
Contributor

I don't understand what behavior you want then. The behavior of the FRAPI option is that it force-enables smooth lighting. You say you don't want light blending and say that the faces of these blocks should all have the same brightness but that is exactly what flat lighting does and what is seen in the original screenshot.

@MehVahdJukaar
Copy link
Author

MehVahdJukaar commented Aug 9, 2024

If a block emits light level 5 it should in theory have each quad have at least light level 5 thought its entirety. This is what vanilla does. Catch is when you place Brighter light sources next to it you will notice discontinuities. The probable reason why these don't have AO is because when blending Down they get darker edges, hence making my first statement not true. So lights like that to look best and proper should only blend up not down

@IMS212
Copy link
Member

IMS212 commented Aug 9, 2024

This seems like a request for a FRAPI enhancement to separate ambient occlusion from smooth lighting? Vanilla makes no distinction between the two.

@MehVahdJukaar
Copy link
Author

MehVahdJukaar commented Aug 9, 2024

From what I know sodium has its own ambient occlusion code which fixes vanilla bugs too hence why I posted it here. I'm not sure but it could be that as you say It would mean somehow conceptually separating those two but I don't know too much about their internals so I can't say

@IMS212
Copy link
Member

IMS212 commented Aug 9, 2024

Separating these two is definitely possible, even in Vanilla; it's just a question of whether that's in scope of FRAPI. If FRAPI adds it, Sodium will likely support it; so I'd recommend making an issue for that.

@djmrFunnyMan
Copy link

djmrFunnyMan commented Aug 9, 2024

Well as far as I understand this is a suggestion of fix a vanilla bug (smooth lighting broken on light sources)
That FRAPI has a somewhat related feature to force enable AO isn't really relevant

@MehVahdJukaar
Copy link
Author

I'll suggest on fabric API tho I still believe could still be a nice visual improvement that fixes vanilla bug, akin to other similar sodium improvements

@MehVahdJukaar
Copy link
Author

MehVahdJukaar commented Aug 12, 2024

I did some testing and provided the AO light values of each vertices are capped to be AT LEAST the light value OF THAT block (given we are dealing with emissive blocks), just turning on AO for these blocks fixes all issues that are associated with that

@jellysquid3 jellysquid3 removed the S-needs-triage Status: Needs triage label Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-enhancement Type: Enhancement
Projects
None yet
Development

No branches or pull requests

5 participants