Support for optional occlusion
Teqed opened this issue ยท 3 comments
Optional occlusion:
-
Currently, CC:T's computer blocks are solid blocks that occlude blocks behind them.
-
It may be desirable for resource packs to add a different shape of computer block, which is non-solid, and should not occlude.
- Used by ComputerCraft Create. See sashakoshka/ccc#1
- Used by CC Overhaul. See screenshots on
README.md
.
- See also the Restitched fork of CC Overhaul with additional notes specific to Restitched.
- Used by ComputerCraft Create. See sashakoshka/ccc#1
-
Currently, computers block all light from passing through them. If occlusion is disabled for the block, even without using a resource pack, the block will allow light to pass through it. This would change the expected behavior of the block for some users, both cosmetically and potentially functionally in the context of mob farms.
- While not directly related, AE2 has a similar unresolved issue with their cable facades, AppliedEnergistics/Applied-Energistics-2#6690
- If the occlusion of these blocks was configurable, it could be toggled when using resource packs.
- Could a data pack toggle this configuration? It could be bundled with resource packs.
I've committed a quick implementation for 1.19.2 at mc-1.19.2...Teqed:CC-Tweaked:mc-1.19.2 that disables occlusion for use with resource packs, without any configurability.
It may be desirable for resource packs to add a different shape of computer block
I definitely don't want to limit the creativity of artists making resource packs, but I really would caution against this. This causes the collision/hit bounding box to be different to the model, which ends up being incredibly janky.
I don't think setting noOcclusion
is the right option here. As you say, this changes the behaviour of lighting, in a way which I don't think makes sense.
It might be possible to solve the culling by putting computers on one of the other render layers (probably cutout) - I'd need to check the code to make sure. This is already possible with Forge, but we could add support to Fabric. I fear the quad below the computer will be unlit though, would need to test.
Yeah, I'm afraid I don't see a good way to solve this. Block.shouldRenderFace
(which controls the culling) uses the same shape information as the lighting engine. There's no good way to stop culling without changing how light propagates.
Really, this is a limitation with Minecraft itself. One would see the same issues if trying to change the block model for any solid block. I think such a solution would have to come from Minecraft itself.
I definitely don't want to limit the creativity of artists making resource packs, but I really would caution against this.
One would see the same issues if trying to change the block model for any solid block.
Agreed -- changing a model in such a way (from solid to non-solid) seems out of scope for just a resource pack, since it has functional impact that goes beyond aesthetic preference that you would want to be consistent between different clients.
Instead, perhaps an addon mod could create a new block that extends from existing computers but is a "Slim Computer" with a different model suitable for skinning in this way.
Thanks for having looked at this, I appreciate your time.