Jump to content

Recommended Posts

Posted (edited)

Mod Version: 1.21.5

Summary: Having issues getting textures to align in engine even they're they're aligning within VSMC. 

Description: While working on an optimization update on my Upgradable Storage mod I'm in the process of consolidating my storage vessels textures (3 32x32 textures for top, sides, and inside) into a singular 64x64 texture. I believe I've properly set the new UV's and set the texture size to 32x32 instead of the vanilla games 16x16 to accommodate for the 2px/voxel but when I launch the game to test the texture appears shifted leaving empty blank space. I'm completely vexed by this and have been stuck on the issue for several days now. Resolving this is the last thing I need to do to release my update. Has anyone ever run into this issue with VSMC before or know a work around/fix for it? I've attached screen grabs inside of VSMC and engine to better show the issue I'm encountering as well as the texture I'm using and my block data In the case that one one is inclined to take a look and see where I might be going wrong.

Already Tried: 

  • Enabling Auto UV for all faces
  • Setting the texture to 16x16 and 64x64 in textureHeight and textureWidth in block JSON
  • Disabled Auto UV and hand placed all faces UVs 
  • Consolidating all pointers to a single "texture" pointer from "top", "sides", "inside"

Any assistance is appreciated, thanks in advance!

black.png

VSMC Texture Size.png

In Engine Block.png

normal-copper.json

Edited by TheCrimsonKing96
Posted
9 hours ago, TheCrimsonKing96 said:

Having issues getting textures to align in engine even they're they're aligning within VSMC.

I am looking at the most current version of your mod that's available on the ModDB. I assume that you are touching at least partially the files with code, considering that your shape definitions differ from the usual way. Is it possible that something is manipulating textures in code as well?

I assume that the texture definitions within the blocktypes have changed as well. Otherwise the overlays could potentially be messing with the in-game appearance.

I only downloaded the assets you shared here and everything appears to look like it is supposed to look.

3204_Dxs5Ox2afGOFfSFxJ2RC.thumb.png.21c642695b4dfdf74d90d2539e5f9772.png

Posted (edited)

Good question @Brady_The! I hadn't considered noting that to begin with but no, there's nothing in the code that manipulates the textures, the code is very rudimentary and only meant to allow for labeled blocks such as trunks and storage vessels to also be able to be reinforced like their non-labeled counter parts. The reason I am so incredibly vexed by this issue is due to the texture which I've attached below which is also a 64x64 size working albeit the shape data for this one are different and this was a very shoddy first attempt at creating an atlas since I'm not really much of an artist. 

In order to get this shape file to work inside of VSCM you have to change the texture size of the file from 32x32 to 16x16. My thought process with the original texture was that I could simply do the exact same process and just move the UVs but in doing so it creates that shifted texture with large chunks of missing texture data. 

I had started working on an overlay atlas as well to reduce the amount of files further so I've supplied those below as well as the blocktype in case that context paints a better picture.

black.png

normal-copper.json

vessel-overlay.png

 

storagevessel.json

Edited by TheCrimsonKing96
  • Solution
Posted (edited)

I am starting to understand. (Maybe.) (I am a bit slow...)

What I do not understand are the UV mappings in normal-copper.json. I assume you mapped the cubes according to the texture resolution? Or how did you work within the VSMC to get the correct view you presented?

Just one example. The element lid in the shape file you provided contains the following uv mapping for the cardinal directions. Those are for the default size of 16x16:

"north": { "texture": "#texture", "uv": [ 0.0, 0.0, 5.0, 1.0 ], "autoUv": false },
"east": { "texture": "#texture", "uv": [ 0.0, 0.0, 5.0, 1.0 ], "autoUv": false },
"south": { "texture": "#texture", "uv": [ 0.0, 0.0, 5.0, 1.0 ], "autoUv": false },
"west": { "texture": "#texture", "uv": [ 0.0, 0.0, 5.0, 1.0 ], "autoUv": false },

Now, if you want to to use a texture with the resolution of 32x32 (double the size) those mappings double too:

"north": { "texture": "#texture", "uv": [ 0.0, 0.0, 10.0, 2.0 ], "autoUv": false },
"east": { "texture": "#texture", "uv": [ 0.0, 0.0, 10.0, 2.0 ], "autoUv": false },
"south": { "texture": "#texture", "uv": [ 0.0, 0.0, 10.0, 2.0 ], "autoUv": false },
"west": { "texture": "#texture", "uv": [ 0.0, 0.0, 10.0, 2.0 ], "autoUv": false },
Spoiler

image.png.6aafffae7ac6767e8e730bf1d0bf941c.png

Your normal-copper file with 32x32 texture resolution: https://cdn.imgchest.com/files/602e49c5a090.png

The same would apply for 64x64 textures:

"north": { "texture": "#texture", "uv": [ 0.0, 0.0, 20.0, 4.0 ], "autoUv": false },
"east": { "texture": "#texture", "uv": [ 0.0, 0.0, 20.0, 4.0 ], "autoUv": false },
"south": { "texture": "#texture", "uv": [ 0.0, 0.0, 20.0, 4.0 ], "autoUv": false },
"west": { "texture": "#texture", "uv": [ 0.0, 0.0, 20.0, 4.0 ], "autoUv": false },
Spoiler

image.thumb.png.6329616ee9028a790e4d20807e73458b.png

Your normal-copper file with 64x64 texture resolution: https://cdn.imgchest.com/files/4ee5d0ec1f72.png

I am not much of a theoretician. I prefer a more hands-on approach, so I'll attach the files I had a go with. These files still probably need some cleaning.

As you can see in the hotbar there are some texture issues, which could be related to the texture resolution.

I hope I am not completely on the wrong path here. I am not a huge VSMC expert. Nor am I apparently able to understand your problem correctly. 😆

normal-copper_32.json normal-copper_64.json

Edited by Brady_The
Posted (edited)

I was hand UVing these inside of VSCM and can hardly even call myself a beginner, I'll give this a look myself and give it a try! I appreciate you providing files for reference thank you!

I spent two hours this morning trying to get 16x16, 32x32, and 64x64 texture height/width to work within the JSON and all gave me the same misaligned texture issues I started the post with. I don't fully grasp how VS works when it comes to textures.

I'm not sure if ALL block data should have:

    "textureWidth": 16,
    "textureHeight": 16,

no matter the size of the texture or if these should be accurate to the actual texture size. I initially worked under the assumption that due to vanilla files being 32x32 that the Width and Height within the block JSON should be 1/2 of what the texture size is but that seemed to make little difference. 

Edit: Your file does work, I am still incredibly confused as to why it does (and may likely never fully understand the why or how). I pulled your file into the VSCM tool, changed the texture size to 64x64 and the UVs data is not aligned in the tool. Yet in engine it works just fine now. Frustrating but also a relief, thank you for your assistance here I'd have never been able to get this resolved without it!

Screenshot 2026-01-16 201036.png

2026-01-16_20-11-03.png

Edited by TheCrimsonKing96
  • Like 1
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.