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

Backface culling on items/item entities #2982

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

Taiyou06
Copy link

Adds backface culling on the items and item entities, as recently with the addition of display entity stuff, servers started to using those to make custom content. This PR should be 10-20% (in general) faster compared to 0.6.6

This is my first time PRing to sodium, so if i missed something or need anything or did something wrong, I will do my best to help.

One thing to note is that i have no idea on how to make isFacingAway any faster, so suggestions for that would be appreciated!

@douira douira added the T-enhancement Type: Enhancement label Jan 14, 2025
@jellysquid3
Copy link
Member

As discussed in the Discord server, there are some concerns this would have for mod compatibility. The biggest issue as I see it would be that we can't detect whether the render state is actually configured for back-face culling, since mods can decide to only set that state after writing vertex data.

Without moving the early back-face culling to right before draw call submission, it is unlikely that could be solved. And it would negate any performance improvement, while also making it impossible to write vertex data directly into GPU-visible memory (i.e. as might be used for zero-copy uploads.)

@Taiyou06
Copy link
Author

Are there any example mods that could be causing the said issues for replication? I would love to investigate solutions for this.
Maybe some API solution through sodium to explicitly disable the behaviour etc.

@Taiyou06 Taiyou06 marked this pull request as draft January 15, 2025 11:52
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

Successfully merging this pull request may close these issues.

3 participants