Rendering issue between NineZero's Gun Expansion and Embeddium
zaeonNineZero opened this issue ยท 3 comments
Bug Description
A few users have reported a rendering issue with my mod, NineZero's Gun Expansion. When Embeddium is installed, the red dot reticle of the Ballistic Scope attachment turns into a stretched red line. This occurs regardless of whether shaders are installed or not, and does not occur when Embeddium is not installed.
Here's how the scope should look:
And here is the scope when Embeddium is installed:
The dot is a square model element with a 1-pixel UV map - so a UV/texture bug would not result in this stretched effect. Instead, it appears that the model element itself is being stretched along the X-axis.
Here is a snapshot of the dot model element in Blockbench (the red color comes from a tint effect in-game):
And here's the element's parameters
The user who reported this issue did not specify the MC version or Forge version they were using; the mod is available for 1.16.5 through 1.19.4. I will provide an update once the user sends their version info.
Please let me know if more information is needed to resolve this issue.
zaeonNineZero/NineZero-Gun-Expansion#25
Reproduction Steps
- Install NineZero's Gun Expansion and its dependencies along with Embeddium.
- Attach a Ballistic Scope to any gun that supports sight attachments.
- Hold right-click to aim. The reticle should be visible along with the stretched dot.
Log File
n/a
It's most likely caused by https://github.com/embeddedt/embeddium/blob/340b226c5932d00f5a3b45850dec255a72b50b2e/src/main/java/me/jellysquid/mods/sodium/mixin/features/model/BlockElementMixin.java, which will increase the offsets of fractional components of certain positions in order to prevent z-fighting from occuring. This fixes issues like https://bugs.mojang.com/browse/MC-192420.
I'll have to add a heuristic that attempts to skip models that aren't actually being used for blocks in the world.
The change in 7b59de8 fixes this for me on 1.19.2; this will be included in the next release.