CaffeineMC / sodium

A Minecraft mod designed to improve frame rates and reduce micro-stutter
Other
4.8k stars 812 forks source link

Quad ordering is incorrect after material downgrading, causing problems with certain block models #2868

Open joe-vettek opened 1 week ago

joe-vettek commented 1 week ago

Bug Description

In vanilla MC, Mojang allowed modders to overlay textures by means of isotropic blocks, without being affected by z-depth. An example is the grass block model, which makes layered tinting possible and more flexible. However, in Sodium, although side coverage is still supported, There is a weird sorting problem here. image image

Reproduction Steps

  1. open minecraft and use version 1.21.1
  2. use Sodium
  3. use the test resourcepack TESTPack.zip
  4. place oak leaves or blue stained glass

Log File

None log, because it not crash. debug.log

Crash Report

crash-2024-11-06_12.14.25-client.txt

jellysquid3 commented 1 week ago

Does this issue happen without Iris?

douira commented 1 week ago

I can reproduce without Iris on dev

douira commented 1 week ago

For reference, the result vanilla produces is oak leaves that look like a snow block.

Screenshot 2024-11-06 at 05 27 31 The model is the following:

{
  "parent": "block/block",
  "textures": {
    "particle": "block/oak_leaves",
    "all": "block/oak_leaves",
    "1": "block/snow"
  },
  "elements": [
{
    "from": [0, 0, 0],
    "to": [16, 16, 16],
    "faces": {
      "north": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "north", "tintindex": 0},
      "east": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "east", "tintindex": 0},
      "south": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "south", "tintindex": 0},
      "west": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "west", "tintindex": 0},
      "up": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "up", "tintindex": 0},
      "down": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "down", "tintindex": 0}
    }
  },{
      "from": [0, 0, 0],
      "to": [16, 16, 16],
      "faces": {
        "north": {"uv": [0, 0, 16, 16], "texture": "#1", "cullface": "north"},
        "east": {"uv": [0, 0, 16, 16], "texture": "#1", "cullface": "east"},
        "south": {"uv": [0, 0, 16, 16], "texture": "#1", "cullface": "south"},
        "west": {"uv": [0, 0, 16, 16], "texture": "#1", "cullface": "west"},
        "up": {"uv": [0, 0, 16, 16], "texture": "#1", "cullface": "up"}
      }
    }]
}
douira commented 1 week ago

Possibly related to https://github.com/CaffeineMC/sodium/issues/2810?

joe-vettek commented 1 week ago

Possibly related to #2810?

i think yes, but not need Continuity

joe-vettek commented 1 week ago

@jellysquid3 yes, iris is not need in fact