Iris Shaders

Iris Shaders

36M Downloads

`IrisTextVertexSink` uses wrong vertex offsets when shaders are disabled

SquidDev opened this issue ยท 3 comments

commented

What happened?

  • Install Sodium, Iris, and ComputerCraft in a fresh instance.
  • Configure Iris with the default settings (i.e. no shaders)
  • Place down a computer and a monitor next to it.
  • Write something to the monitor (e.g. monitor left paint a).
  • Observe the monitor is very dark.

A similar issue was reported back in April (#1959), and marked fixed. It's not clear if this is another regression, or if the bug was only fixed in the case of shaders.

Screenshots

With shaders

A screenshot of a ComputerCraft monitor displaying the paint program.

Without shaders

A screenshot of a ComputerCraft monitor displaying the paint program. The monitor is dark, almost appearing blank.

Log output

https://mclo.gs/Mfr0e2k

Minecraft Version

Minecraft 1.19.4

Iris Version

iris-mc1.19.4-1.6.4

Operating System

Linux, but I've had reports on Windows too.

What is your GPU?

AMD Ryzen 7 Pro 4750U, confirmed on other GPUs

Additional context

See also cc-tweaked/CC-Tweaked#1502 and cc-tweaked/cc-restitched#148 for related issues.

commented

Finally sat down with RenderDoc and looked at this.

Inspecting the input of the vertex shader, we can see that UV2 set is set to (0, 10), when we'd expect it to be fullbright. This causes the output colour to be incredibly dark.

A screenshot of a table with columns titled "Idx", "Colour", "UV0", "UV2". All rows in UV2 are equal to (0, 10)

Looking at the VBO itself, we can see that UV2 has an offset of 24, while IrisTextVertexSinkImpl hard-codes an offset of 28.

A screenshot of the various attributes in our VBO. The last one, UV2, has an offset of 24.

private static final int OFFSET_LIGHT = 28;

I'm assuming what's going on here is that the Iris hard codes the offsets for IrisVertexFormats.ENTITY. However, because shaders aren't active, this code is skipped and so we're actually rendering with the default POSITION_COLOR_TEX_LIGHTMAP vertex format.

commented

Recently I came across this problem on ATM9, and discovered that the problem was on Oculus/Iris, I just removed it, if you are not going to use Shaders I highly recommend removing it from your mod pack, the monitors return to normal almost than immediately.

commented

IMS pushed a commit that fixed this issue as you can see in the history here