Unexpected DhApiRenderParam#dhProjectionMatrix content with Iris enabled

I'm grabbing the projection matrix from the DhApiAfterRenderEvent and use it to perform a depth test in one of my shaders. And this works fine as long as no Iris shaders are active. Usually the projection matrix contains "normal" values, e.g.:
4,702E-1 0,000E+0 0,000E+0 -0,000E+0
0,000E+0 8,541E-1 0,000E+0 -0,000E+0
-0,000E+0 -0,000E+0 -1,014E+0 -4,908E+1
-0,000E+0 -0,000E+0 -1,000E+0 -0,000E+0
4,702E-1 0,000E+0 0,000E+0 -0,000E+0
0,000E+0 8,541E-1 0,000E+0 -0,000E+0
-0,000E+0 -0,000E+0 -1,014E+0 -4,908E+1
-0,000E+0 -0,000E+0 -1,000E+0 -0,000E+0
But when an Iris shader is active (in this case BSL but I don't think it matters) the values seem wrong:
1,000E+0 0,000E+0 0,000E+0 0,000E+0
0,000E+0 1,000E+0 0,000E+0 0,000E+0
0,000E+0 0,000E+0 -1,014E+0 -4,908E+1
0,000E+0 0,000E+0 0,000E+0 1,000E+0
1,000E+0 0,000E+0 0,000E+0 0,000E+0
0,000E+0 1,000E+0 0,000E+0 0,000E+0
0,000E+0 0,000E+0 -1,014E+0 -4,908E+1
0,000E+0 0,000E+0 0,000E+0 1,000E+0
In earlier version of DH and Iris (1.x on 1.20.1 for example) this wasn't an issue. It seems to me that DH is not providing the correct projection matrix, which is causing the depth test in my shader to produce wrong results. I'm using: - DH 2.1.2-a - Iris 1.7.2 - Indium 1.0.33 - Sodium 0.5.9 and trying to update the DH compatibility of my mod "Better Clouds"
6 Replies
Miki_P98
Miki_P984d ago
I hope you will find a fix!
Wendelin
Wendelin3d ago
bump
Puhpine
Puhpine3d ago
as @James Seibel (GMT-6) was the only one who could help you here: https://discord.com/channels/881614130614767666/1211290858134052894 i assume he's also the only one who can here you with this new problem
Wendelin
Wendelin3d ago
Yes, probably. But I'm sure he has a lot to do.
BackSun
BackSun3d ago
Thanks for the info I didn't realize there was a problem. Hmmm... Iris must be modifying the matrix, which is causing it to change when passed along. I have an idea on how to fix it, I'll add this to my todo list.
Wendelin
Wendelin3d ago
Thanks! Do you think it would be better to wait for the fix or look for a workaround on my end?