Altered UV breaks texture alignment
leagris opened this issue · 9 comments
Bug Description
On some blocks, UV mapping is modified/stretched and it breaks alignment like here:
Normal rendering without Embeddium, UV mapping is not modified and texture correctly align across blocks:
With Embeddium, UV mapping stretches the texture, and now textures is not aligned across blocks:
Reproduction Steps
Place multiple connected Pipez pipes and see the west side of it has UV distortion that prevent correct matching of the texture across pipe blocks.
Log File
irrelevant
Does https://nightly.link/embeddedt/embeddium/workflows/build-snapshot/20.1%2Fforge/Embeddium.zip fix this if you disable "Compact Vertex Format" in video settings?
I think it may be a side-effect of shrinking the UV slightly shorter than the icon to prevent blurring-in transparent pixels at edge of quads when quad coordinates are shorter than the rendering cuboid boundaries.
This definitely sounds like it won't work correctly with reduced texture precision. I'll try to reproduce it locally and see what I can do.
I think altering the UV mapping of block models would be better default to off and turned-on on a per modid basis in some config file.
It cannot be done on a per-mod basis, as it's a side effect of using a compressed vertex format that takes up less memory (and therefore does not have the precision to store the UV shrinkage). There are many advantages to using that format, so I don't plan to disable it by default. However I can certainly make sure that these types of textures are drawn correctly when users explicitly disable it in video settings.
Please attach the log file, it contains important information (like the
Here it is:
https://mclo.gs/WuqmjT7
I think it may be a side-effect of shrinking the UV slightly shorter than the icon to prevent blurring-in transparent pixels at edge of quads when quad coordinates are shorter than the rendering cuboid boundaries. This indeed get ride of transparent thin artifacts at edges, but it has the side-effect of stretching the texture.
I think altering the UV mapping of block models would be better default to off and turned-on on a per modid basis in some config file.
Some AE2 blocks also have this very same issue (Crafting CPU, Crafting Storage at least have this same problem with distorted UV-mapping when embeddium/rubydium is installed.
Does https://nightly.link/embeddedt/embeddium/workflows/build-snapshot/20.1%2Fforge/Embeddium.zip fix this if you disable "Compact Vertex Format" in video settings?
Yes it does fix the issue, perfect !
embeddium-options.json
{
"performance": {
"use_compact_vertex_format": false,
}
}
As soon as re-adding oculus-mc1.20.1-1.6.13
it breaks again; Possibly oculus would need support for this.
Iris & Oculus are hardcoded to only support the compact vertex format. I can't do anything about that from my end, unfortunately.
An issue was discovered in how Sodium encodes textures for the compact vertex format, and that is what causes this bug when it's enabled. I've backported the fix for the next release, but it requires an Oculus update to not break when shaders are enabled.