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

Optimize EntityRenderDispatcher::shouldRender #107

Closed
WilliamPhysics opened this issue Apr 18, 2023 · 2 comments
Closed

Optimize EntityRenderDispatcher::shouldRender #107

WilliamPhysics opened this issue Apr 18, 2023 · 2 comments

Comments

@WilliamPhysics
Copy link

Hello ✋
Maybe it's worth moving the code canceling rendering from renderEntity to shouldRender?
And indeed there is a lot of unnecessary stuff in vanilla shouldRender using your mod.

Red - current
Green - my request

image

@tr7zw
Copy link
Owner

tr7zw commented Apr 18, 2023

If I remember correctly, skipping on shouldRender caused some unintended side effects, since that check assumes that the entity is outside of the frustum. Looking at it, it mainly just does the outline(glowing) preparations right after, which is the only "lot of unnecessary stuff". But then glowing entities can't be seen through walls. So I'd also need to check for glowing in my code... at which point this just gets done twice. So moving it into shouldRender wouldn't be any benefit.

@tr7zw
Copy link
Owner

tr7zw commented Apr 18, 2023

Ah, also I need some stuff like the pose stack to for example render the nametag of culled entities. Cancelling at shouldRender would also remove the nametag, and I'd be missing the posestack to render it myself(since shouldRender only has the entity and frustum).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants