tr7zw / EntityCulling

Using async path-tracing to hide Tiles/Entities that are not visible
Other
238 stars 35 forks source link

Enable Glow effect? #163

Closed ghost closed 1 month ago

ghost commented 1 month ago

Is there a way to let the glow effect work? I find any mods that use it can't properly use it because entities stop rendering even if they have the glow effect.

tr7zw commented 1 month ago

Glowing entities are excluded from EntityCulling.

ghost commented 1 month ago

Ah, well let me be more specific, I think it has to do with client-side glow effects, not the normal way glowing is given. Take this video of an Iron's Spellbooks spell not working with entity culling installed. Moreover, the same effect happens when you try to use the origins:entity_glow power from the Origins mod. I'd assume the same thing happens in other mods like Botania's 3rd eye.

https://github.com/user-attachments/assets/394f5791-7aa9-4cc4-9c7e-0566c07d06fe

tr7zw commented 1 month ago

That's not using the vanilla glow then, and there is not much I can do about that currently. Don't want to have EntityCulling to have compile-time dependencies and code for specific mods because they re-implement the glow logic. The mods can consider disabling culling for these "custom glowing" entities so entity culling ignores them(thats a vanilla variable, so no dependencies between mods), use the entity culling api to allow them to be rendered through walls, or you can use the debug toggle key to turn entity culling on/off on the fly when you need these custom glows to work(assuming its something you don't need all the time).

ghost commented 1 month ago

Alrighty, I didn't think of the debug toggle key so that could be helpful. I'll bring up the issue to Iron's Spellbooks in case they want to add compatability.

Thanks for your help!

iron431 commented 1 month ago

This is an issue with the implementation of your glowing detection. You check Entity#isCurrentlyGlowing, (here) not Minecraft#shouldEntityAppearGlowing, which is the highest level check that should be used for glowing.

    public boolean shouldEntityAppearGlowing(Entity pEntity) {
        return pEntity.isCurrentlyGlowing() || this.player != null && this.player.isSpectator() && this.options.keySpectatorOutlines.isDown() && pEntity.getType() == EntityType.PLAYER;
    }

This likely means this culling bug also applies to spectator glow outlines.

tr7zw commented 1 month ago

Huh interesting. Leave it to Mojang to have multiple conflicting method names where "isCurrentlyGlowing" can be false while the entity is glowing.