Closed leagris closed 8 months ago
Please attach the log file, it contains important information (like the size of the texture atlas, which is relevant here). Also, what MC version does this occur on?
The issue is probably caused by Sodium using 16-bit texture coordinates. I can increase the precision of the texture coordinates in Embeddium's non-compact vertex format but I want to be sure it will fix the issue first.
On Mon., Dec. 18, 2023, 5:05 p.m. Léa Gris, @.***> wrote:
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: image.png (view on web) https://github.com/embeddedt/embeddium/assets/1111474/bcac76ef-0bbe-46ba-87e8-9569120f6f11
With Embeddium, UV mapping stretches the texture, and now textures is not aligned across blocks: image.png (view on web) https://github.com/embeddedt/embeddium/assets/1111474/704ded03-6ecc-458e-b565-b8543a186718 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
— Reply to this email directly, view it on GitHub https://github.com/embeddedt/embeddium/issues/147, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKHTVADWALIYENVZDCHPJCTYKC43XAVCNFSM6AAAAABA2GKTSWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGA2DONJTHE4TCMI . You are receiving this because you are subscribed to this thread.Message ID: @.***>
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.
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.
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?
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,
}
}
Perfect!
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.
Issue is fixed for both vertex formats as of 0.2.14, so it will work correctly with Oculus installed once Oculus makes another release (I provided the necessary patch to them).
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:![image](https://github.com/embeddedt/embeddium/assets/1111474/bcac76ef-0bbe-46ba-87e8-9569120f6f11)
With Embeddium, UV mapping stretches the texture, and now textures is not aligned across blocks:![image](https://github.com/embeddedt/embeddium/assets/1111474/704ded03-6ecc-458e-b565-b8543a186718)
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