Entity Culling Fabric/Forge

Entity Culling Fabric/Forge

80M Downloads

Optimize EntityRenderDispatcher::shouldRender

FazziCLAY opened this issue · 2 comments

commented

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

commented

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.

commented

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).