Better Foliage

Better Foliage

35M Downloads

Shader wind integration for double plants has no config option

Builderb0y opened this issue ยท 5 comments

commented

Every shader-related config option is disabled, yet mc_Entity.x still returns 31.0 for double plants instead of 175.0
Correct values: (with better foliage uninstalled)
Vanilla + optifine
After better foliage is installed:
Better foliage installed
In both screenshots, gl_FragColor = vec4(mc_Entity.x / 255.0, mc_Entity.z / 16.0, 0.0, 1.0);

Additionally, you can see some trees in the background of the second screenshot which seem to have incorrect metadatas for their leaves (always seems to return 8.0). I honestly don't know why this feature would be useful, as most shader packs don't check for metadatas of leaves. Nevertheless, it should probably be configurable too, as this makes it impossible for shader packs to check metadatas if they are needed.

Using version MC1.10-2.1.1.

commented

I haven't seen any shaders supporting seamless wind sway for double plants when I was implementing this way back when, but that's probably a thing now.

I wouldn't be reporting it if my own support for them in my shader pack wasn't broken by this :)

I think the best way to implement this feature in a way that doesn't break things might be to have the config file simply have a list of which modded blocks map to which vanilla IDs. (which has already been suggested for optifine to support natively)

commented

Fair enough. I'll figure something out.

Just out of curiosity, do you know what to do with arbitrary-sized reed columns?

commented

Oh, I love saying this:
It's not a bug, it's a feature! :)

These features are useful exactly because they give back incorrect data. Block IDs and metadata in shader programs are - as it currently stands - completely useless for modded blocks, because they are not stable. They are automatically assigned and stored with the world, and every modpack will have different mappings.

By forcing these values to known Vanilla numbers for certain types of blocks, shader features for these blocks (like wind sway) will automagically "just work" for modded blocks in a uniform way. Since this is the only purpose IDs and metadata is used for in shaders (AFAIK), I never even considered making this configurable. There's no utility to it.

That being said, I see your point regarding double plants. I haven't seen any shaders supporting seamless wind sway for double plants when I was implementing this way back when, but that's probably a thing now. I'll find a way to support this use case.

commented

Personally, I just blacklist them from wind effects, as neither vertex positions nor metadata can be used to determine their height.

If I really wanted to implement wind effects for them though, I could technically whitelist them only if they're within 3-5 blocks of sea level, as that would work for most naturally-spawned ones. However, it could look a bit odd if the player happened to place them above sea level, but still within the 3-5 block range.

commented

Since there are no shaders that properly implement double plant wind sway (I think), there's no good reason to overthink this. I just added reeds and double plants to the blacklist in 2.1.4, so they'll not be modified any longer.