Transparency/Translucent Issue with Mod Rendering
I'm currently developing a Fabric mod which uses FAPI's world rendering to create elytra contrails. I'm struggling with a rendering issue specifically when Iris Shaders is installed(no shaders enabled). I am unsure if my code is at fault.
When there is a semi-transparent block(e.g. water or colored glass) behind my semi-transparent contrails, the block doesn't get fully rendered. I had this issue without Iris installed, but was able to fix it by:
- Changing my
WorldRenderEvents
call from BEFORE_DEBUG_RENDER
to AFTER_TRANSLUCENT
or LAST
. This fix does not work with Iris installed though.
- Changing the shader program on my contrail render layer from the tripwire program to the translucent program.
- Adding the translucent target to my contrail render layer.
Doing these did not fix the issue with Iris installed, however.
Maybe helpful info:
- This is my contrail renderer class (https://github.com/Superkat32/Jet-Lag/blob/master/src/main/java/net/superkat/jetlag/rendering/ContrailRenderer.java). I'm wondering if the drawing of vertex consumers at line 208 and 215 is causing any issues? Code around line 76 may be helpful to know as well(RenderSystem stuff).
- My WorldRenderEvents event call is in the JetLagClient
class at line 62. Using AFTER_TRANSLUCENT
or LAST
fixes the issue without Iris, but with Iris installed not only reintroduces the transparency issue, but also makes the contrails move slightly when the camera is moving. Using BEFORE_DEBUG_RENDER
does not introduce the camera issue with Iris, but still has the transparency issue.
- I have tested with:
- Sodium 0.5.11 + Iris 1.7.3
- Sodium 0.6.0 beta 2 + Iris 1.8.3 beta 4
and the issue still persists.
I'd like to know if there is anything I can reasonably do, whether it be using a built-in Iris shader program or API I'm unaware of, or changing my rendering code.
Thanks!0 Replies