cc-tweaked / CC-Tweaked

Just another ComputerCraft fork
https://tweaked.cc
923 stars 212 forks source link

Support for optional occlusion #1644

Closed Teqed closed 10 months ago

Teqed commented 10 months ago

image

Optional occlusion:

I've committed a quick implementation for 1.19.2 at https://github.com/cc-tweaked/CC-Tweaked/compare/mc-1.19.2...Teqed:CC-Tweaked:mc-1.19.2 that disables occlusion for use with resource packs, without any configurability.

SquidDev commented 10 months ago

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.

SquidDev commented 10 months ago

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.

Teqed commented 10 months ago

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.