Iris Shaders

Iris Shaders

38M Downloads

Can't differentiate between water and flowing_water

amlib opened this issue ยท 3 comments

commented

What happened?

I'm trying to mask flowing water from still water in an attempt to handle their rendering in different ways, but it seems like they both always get accounted as the same water block type. I'm not sure if this is a bug or a limitation of Iris/Optifine.

In block.properties I tried:

block.8 = minecraft:water
block.9 = minecraft:flowing_water

And then in gbuffers_water vertex shader I do the usual mc_Entity == x to filter the block ID I want, but no matter what I do they both count as ID 8.

I would like to do this because there seems to be no way (as far as I know) to tell how deep a body of water is other than using the (solid) depth from the scene. This approach works mostly fine for actual bodies of water like rivers, lakes and oceans. But, for example, waterfalls which might actually just be a single block of depth will register as being as deep as the scene is, which could potentially be a wall right behind it (fine again) or a wall hundreds of blocks away (bad case), making any volumetric effect look wrong for that kind of water.

By masking the flowing_water type I was hoping to work around this and cap the maximum depth or using a different volumetric effect. I'm open to other solutions if anyone has any idea how to properly solve this.

As you can see on the uploaded screenshot, the waterfall takes a very dark appearance when against the sky or even fairly near geometry that is just a few dozen blocks away. Even this is enough to make the water fog/volumetric effect darken it by allot.

Screenshots

image

Log output

No response

Minecraft Version

Minecraft 1.20.1

Iris Version

1.7.1

Operating System

Manjaro Linux

What is your GPU?

Radeon 6700XT

Additional context

No response

commented

This is likely due to a conflict with the "default ID map", most pack devs use ID's above 10000 in order to reduce this happening.

commented

I've looked around and indeed some packs use IDs above 10000 but the ones I've seen still keep together water and flowing_water on the same ID.

I then tried something like this:

block.10001 = minecraft:water
block.10002 = minecraft:flowing_water

But I still got the same behavior as previously, with flowing_water being counted as normal water.

EDIT: I've looked around and this commit seems relevant:
e87c743

But I'm still not sure if there is a proper workaround to this or if water and flowing_water are now hardcoded as water after this commit.

commented

minecraft 1.13+ should use blockstates