kvverti / colormatic

An independent implementation of the custom colors mod for Minecraft 1.15-1.18
GNU Lesser General Public License v3.0
108 stars 49 forks source link

Incorrect emulation of colormaps (might be "grid" format specific?) #105

Open coornio opened 2 years ago

coornio commented 2 years ago

Either incorrect, or perhaps non-existent? Either way, hello! I am back once more and although I noticed late, the water fog is (and potentially others) are not having their colormap applied. This is all tested in 1.18.2 (since OF hasn't released for 1.19 yet)

This is how it looks in OptiFine, underwater in a Deep Cold Ocean specifically: image

This is in vanilla, no mods: image

And this is in fabric with Colormatic installed. Practically no difference: image

The files controlling this are specifically under /assets/minecraft/optifine/colormap, once again tested through the John Smith Legacy pack. Here's the underwater.png texture as an example: underwater

How the folder's contents look. The blocks subfolder has colormaps for leaves. I don't know if those are also improper, I'd need to mess the textures up by painting all over them and go check for differences. image

The relevant code from the properties file:

format=grid

# (Optional) Blocks (with optional metadata) to apply the colormap to-----------

# (format=fixed or vanilla only) Color map image--------------------------------
source=underwater.png

# (Optional) Fixed RGB color----------------------------------------------------
#color=ffffff

# (format=grid only) y variance value-------------------------------------------
yVariance=5

# (format=grid only) y offset value---------------------------------------------
yOffset=-64

Lastly, the documentation for colormaps for optifine, in case it helps to have a shortcut to it: https://github.com/sp614x/optifine/blob/master/OptiFineDoc/doc/colormap.properties

According to the doc the map is meant to be 256x256 maximum, with Y being the build height. That probably changed back in the day when that became -64 to 320, but the use of an offset more or less corrects it. I can only assume that either the grid format isn't emulated, or perhaps Colormatic is failing to apply colors properly?

I hope this information is helpful in debugging this and getting one step closer to feature parity <3

kvverti commented 2 years ago

This is because John Smith Legacy is including a source property that doesn't point to an image. The value should be source=./underwater.png. I'm not sure why Optifine is accepting this (do they not accept standard resource locations?). In any case, they don't need to specify this property anyway, as by default both mods use the name of the properties file as an image source.

coornio commented 2 years ago

Your comment confuses me due to the fact that the source did point to a picture actually, but given that you crossed it out and re-opened the issue, I'm guessing you found something wrong to fix in the coming release? :D