Brute force Rendering Culling

Brute force Rendering Culling

31.7k Downloads

[Question/Suggestion] Does the entity culling cull the whole entity or each face of an entity?

StormDragon-64 opened this issue ยท 1 comments

commented

If this mod culls each face of entities you can't see, it would help reduce the performance cost of entities that are visible, not just ones that are hidden. However, it currently appears that the mod just culls the whole entity, but that means this mod only improves performance (ignoring chunk culling) of entities that are completely hidden.

If the mod does work by culling each hidden face of an entity then let me know, but otherwise I think you should at least look into changing your mod to use the first approach.

commented

This is quite an interesting topic. In fact, the vanilla game already performs back-face culling for entities, or rather, the rendering API itself has this functionality. In Minecraft, rendering any opaque object involves determining the orientation of fragments before rasterization, and all back faces of objects are culled. In the modding community, mods like More Culling target the occluded faces of blocks that aren't considered during chunk compilation. This means that when two block faces are directly adjacent and the internal face is not visible from the outside, it can be culled.

For entities, it's different. The blocks that make up an entity vary in size, making it difficult to have occlusion, and the blocks within an entity are in motion, so their adjacency is not constantly occluded. Therefore, there's no need to cull the adjacent faces of blocks that make up entities.

Since version 1.15.x, vanilla Minecraft has implemented some batching optimizations for entities, though the effects are not very pronounced. Theoretically, more aggressive optimizations could be done to reduce draw calls and enhance rendering performance. However, if such optimizations are handled by mods, it might disrupt the entity rendering process. Sodium seems to have attempted further batching optimizations for entity rendering.

Returning to the functionality of this project, what I have done is use depth buffering to determine occlusion, which is an occlusion determination method that has existed for a long time. However, I haven't seen anyone implement such occlusion determination specifically for Minecraft, so I decided to give it a try, limited to Hierarchical Z-Buffer occlusion culling. Currently, Sodium sets the benchmark for rendering optimization mods. If other optimization mods do too much, ensuring compatibility becomes difficult, and subsequent development and migration become increasingly challenging. My goal here is simply to do my part well.