#43 Color mismatch when combining color base nodes with stairs/slabs

Затворено
отворено пре 2 година од whats_his_face · 3 коментара
whats_his_face коментирира пре 2 година

When combining nodes that are changeable with the paintbrush tool with their corresponding stair and slab nodes, there is a slight mismatch in color tone noticeable if you use base RGB values >= 32.

Here is a sample using the "aqua" nodes with a base color of 32:

Depending on the base value, the mismatch gets more or less noticeable. On the "In our midst" server, you can find more examples in the Ambianum level. For instance, this is the upper part of the grey building next to the spawn: Mismatch on grey nodes Notice the difference in color in the upper right corner of the grey brick wall.

If I'm not mistaken, this is due to the color palette being used, covering more than 8 different colors. I was able to fix the problem by using the alternative PNGs in the textures subdir of the color mod for both the base nodes as well as the stair and slab nodes:

The above fix merely changed two lines in the init.lua, lines 115 and 122 (i.e., I inserted "_1"):

111    minetest.register_node('color:'..name..'_bricks', {
112       description = desc..' Bricks',
113       tiles = {{name='color_bricks.png', align_style='world', scale=4}},
114       paramtype2 = 'color',
115       palette = 'color_'..name..'_1.png',
116       color = hex,
117       groups = {breakable=1, stainable=1},
118    })
119 
120    color.register_stair_and_slab(name..'_bricks',
121       {{name='color_bricks.png', align_style='world', scale=4}},
122       'color_'..name..'_1.png',
123       hex,
124       true)

Although this seems to work, I'm not convinced that it's a good solution, since the MT docs for the color paramtype2 clearly state that the palette should have 256 pixels, yet the "aqua_color_1.png" only seems to have 8: https://minetest.gitlab.io/minetest/nodes/#node-paramtypes

When combining nodes that are changeable with the paintbrush tool with their corresponding stair and slab nodes, there is a slight mismatch in color tone noticeable if you use base RGB values >= 32. Here is a sample using the "aqua" nodes with a base color of 32: ![Color mismatch, aqua sample, base RGB=32](https://notabug.org/attachments/ee841d18-e668-46f6-b355-744228f965cf) Depending on the base value, the mismatch gets more or less noticeable. On the "In our midst" server, you can find more examples in the Ambianum level. For instance, this is the upper part of the grey building next to the spawn: ![Mismatch on grey nodes](https://notabug.org/attachments/6f2ac890-de20-4bea-80b7-97b1d7a984fa) Notice the difference in color in the upper right corner of the grey brick wall. If I'm not mistaken, this is due to the color palette being used, covering more than 8 different colors. I was able to fix the problem by using the alternative PNGs in the `textures` subdir of the `color` mod for both the base nodes as well as the stair and slab nodes: ![Quick fix using "aqua_color_1.png" instead of "aqua_color.png"](https://notabug.org/attachments/2afd88f5-b0a3-4c58-b855-a52ec3c20c70) The above fix merely changed two lines in the `init.lua`, lines 115 and 122 (i.e., I inserted "_1"): 111 minetest.register_node('color:'..name..'_bricks', { 112 description = desc..' Bricks', 113 tiles = {{name='color_bricks.png', align_style='world', scale=4}}, 114 paramtype2 = 'color', 115 palette = 'color_'..name..'_1.png', 116 color = hex, 117 groups = {breakable=1, stainable=1}, 118 }) 119 120 color.register_stair_and_slab(name..'_bricks', 121 {{name='color_bricks.png', align_style='world', scale=4}}, 122 'color_'..name..'_1.png', 123 hex, 124 true) Although this seems to work, I'm not convinced that it's a _good_ solution, since the MT docs for the `color` paramtype2 clearly state that the palette should have 256 pixels, yet the "aqua_color_1.png" only seems to have 8: https://minetest.gitlab.io/minetest/nodes/#node-paramtypes
whats_his_face коментирира пре 2 година
Аутор

I forgot to mention that this might break existing levels, especially if map builders have fiddled with the param2 values on color base nodes. Therefore, it might be a good idea to include a note in the changelog.

Also, I'm perfectly fine with and accept all changes introduced by a fix for this issue in all my maps on the "In our midst" server.

I forgot to mention that this might break existing levels, especially if map builders have fiddled with the param2 values on color base nodes. Therefore, it might be a good idea to include a note in the changelog. Also, I'm perfectly fine with and accept all changes introduced by a fix for this issue in all my maps on the "In our midst" server.
NathanS21 коментирира пре 2 година
Власник

This may be an engine bug. Nodes with colorfacedir are only suppose to have eight colors, they're getting more than three colors here though. I think I can probably make a fix by manually recreating the eight pixel pallets with every 32nd pixel. The full range of colors is needed for the full nodes to get the extra shades of color, as when the engine scales the color palette up it doesn't do any blending. I'll report this in the engine, and also work on a fix for the server.

This may be an engine bug. Nodes with colorfacedir are only suppose to have eight colors, they're getting more than three colors here though. I think I can probably make a fix by manually recreating the eight pixel pallets with every 32nd pixel. The full range of colors is needed for the full nodes to get the extra shades of color, as when the engine scales the color palette up it doesn't do any blending. I'll report this in the engine, and also work on a fix for the server.
NathanS21 коментирира пре 2 година
Власник

Well so maybe it's actually not a bug, IDK.

paramtype2 = "colorfacedir"for nodes which use the first three bits ofparam2for palette indexing. The remaining five bits are describing rotation, as infacedir` paramtype2. Division by 32 yields the palette index (without stretching the palette). These nodes can have 8 different colors, and the palette should contain 8 pixels. Examples:

* `param2 = 17` is 0 * 32 + 17, so the rotation is 17 and the
  first (= 0 + 1) pixel will be picked from the palette.
* `param2 = 35` is 1 * 32 + 3, so the rotation is 3 and the
  second (= 1 + 1) pixel will be picked from the palette.
Well so maybe it's actually not a bug, IDK. paramtype2 = "colorfacedir"` for nodes which use the first three bits of `param2` for palette indexing. The remaining five bits are describing rotation, as in `facedir` paramtype2. Division by 32 yields the palette index (without stretching the palette). These nodes can have 8 different colors, and the palette should contain 8 pixels. Examples: * `param2 = 17` is 0 * 32 + 17, so the rotation is 17 and the first (= 0 + 1) pixel will be picked from the palette. * `param2 = 35` is 1 * 32 + 3, so the rotation is 3 and the second (= 1 + 1) pixel will be picked from the palette.
NathanS21 поменуо овај задатак у комит пре 2 година
NathanS21 затворено пре 2 година
Пријавите се да се прикључе у овом разговору.
Нема фазе
Нема одговорних
2 учесника
Учитавање...
Откажи
Сачувај
Још нема садржаја.