- Home /
Issue with UV mapping on voxel faces
Hi
The issue I'm having is with mapping UVs to a voxel face.
Setting alpha as transparency reduces the thickness of the lines, but does not remove the problem completely.
The UV code is a follows, 'dimPerTex' being 0.1 as the tilesheet is 320 x 320 pixels with 32 x 32 tiles and ~~Pos being the position as an int
newUV.Add(new Vector2(dimPerTex * texturePos.x + dimPerTex, dimPerTex * texturePos.y));
newUV.Add(new Vector2(dimPerTex * texturePos.x + dimPerTex, dimPerTex * texturePos.y + dimPerTex));
newUV.Add(new Vector2(dimPerTex * texturePos.x, dimPerTex * texturePos.y + dimPerTex));
newUV.Add(new Vector2(dimPerTex * texturePos.x, dimPerTex * texturePos.y));
The problem fixes itself almost entirely when the camera is changed from Vertex Lit to Deferred Lighting
I've no idea what's causing this, so any help would be much appreciated
EDIT:
It seems i found the solution with the problem originating with the tilesheet. Spacing the tiles out so each tile was isolated from each other, then made the tile slightly bigger (e.g. 34 x 34) fixed the problem.
[1]: http://i.imgur.com/im687I6.png?1
[2]: http://i.imgur.com/SFAOkWl.png?1
Your answer
![](https://koobas.hobune.stream/wayback/20220613143800im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Graphics.DrawMeshInstanced sometimes inside out? 0 Answers
Job-simulator-like liquids 0 Answers
Help pls, when I build the game it gets img 2 no img 1? 0 Answers