#Well, if you use the position .XY, .XZ
1 messages ยท Page 1 of 1 (latest)
made a thread as to not clutter the shader channel with this but here is how my uvs are currently mapped. they are correct with the texture repeating every 4 voxels. but on 2 sides the uvs are mirrored. if i could mirror those the texture should repeat perfectly between all the sides ( as seen on the second SS )
Is it the UVs of the mesh, or the result of the triplanar mapping in the shader ?
this is from the uvs i manually added
Well, just negate the X axis of the UV depending on the normal orientation ๐
for the effect i wanted someone suggested i needed to use the uvs on the mesh aswell as projection. so i started on giving the mesh uvs
uOffset = (adjPos.z % tilingFactor) * tileSize;
vOffset = (adjPos.y % tilingFactor) * tileSize;
uvs.Add(new Vector2(uOffset + tileSize, vOffset + tileSize)); //1,1 Top Right
uvs.Add(new Vector2(uOffset, vOffset + tileSize)); //0,1 Top Left
uvs.Add(new Vector2(uOffset, vOffset)); //0,0 Bottom Left
uvs.Add(new Vector2(uOffset + tileSize, vOffset)); //1,0 Bottom Right ``` this is how i make the currently wrongly mirrored side. how do you mean i can negate the x axis?
case Direction.West: //X- Fixed, reversed x+
uOffset = (adjPos.z % tilingFactor) * tileSize;
vOffset = (adjPos.y % tilingFactor) * tileSize;
uvs.Add(new Vector2(uOffset, vOffset + tileSize)); //0,1 Top Left
uvs.Add(new Vector2(uOffset + tileSize, vOffset + tileSize)); //1,1 Top Right
uvs.Add(new Vector2(uOffset + tileSize, vOffset)); //1,0 Bottom Right
uvs.Add(new Vector2(uOffset, vOffset)); //0,0 Bottom Left
Like this I guess
that is a solution i already attempted, but it results in chopping the texture vertically. bit hard to see in the ss
or horizontally i guess
Ok, then :
case Direction.West: //X- Fixed, reversed x+
uOffset = (adjPos.z % tilingFactor) * tileSize;
vOffset = (adjPos.y % tilingFactor) * tileSize;
uvs.Add(new Vector2(uOffset - tileSize, vOffset + tileSize)); //1,1 Top Right
uvs.Add(new Vector2(uOffset, vOffset + tileSize)); //0,1 Top Left
uvs.Add(new Vector2(uOffset, vOffset)); //0,0 Bottom Left
uvs.Add(new Vector2(uOffset - tileSize, vOffset)); //1,0 Bottom Right
Or
case Direction.West: //X- Fixed, reversed x+
uOffset = (adjPos.z % tilingFactor) * tileSize;
vOffset = (adjPos.y % tilingFactor) * tileSize;
uvs.Add(new Vector2(-uOffset - tileSize, vOffset + tileSize)); //1,1 Top Right
uvs.Add(new Vector2(-uOffset, vOffset + tileSize)); //0,1 Top Left
uvs.Add(new Vector2(-uOffset, vOffset)); //0,0 Bottom Left
uvs.Add(new Vector2(-uOffset - tileSize, vOffset)); //1,0 Bottom Right
still chopped up
i've tried brute forcing the issue yesterday by going through every possible order for those 4 offsets. and none of them even came close. only the mirrored solution
#1258761117396635771 message
This one should be working, it's literally the negative of the original, so a mirror
ill implement it again and post ss of both textures
and this is my original mirrored solution
So, this one is the last one I've recommanded ?
yeah that is the code you provided first, its the exact same solution travis came up with yesterday
"first" ? not that one ? #1258761117396635771 message
sorry for the confusion i implemented the first solution you mentioned for these screenshots #1258761117396635771 message
the second one was not correct either #1258761117396635771 message
And third ?
#1258761117396635771 message these are my original code that has the correct space and tiling but is mirrored #1258761117396635771 message
I'm so confused now ....
Could you share the full UV generation / loop ?
๐ Large Code Blocks
Use links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/, https://paste.myst.rs/, https://hastebin.com/
๐ Inline Code
Surround code with three backquotes. Not quotation marks.
To format as C#, add cs to the first line:
```cs
// Your code here
```
Add a comment with a line number if there is an error message.
I'm surprised it does "chop" the X- axis, but not Z- ๐ค
i could not make much sense of it either, i think there must be a different way of mirroring the uvs i havent tought about yet
Hum ๐ค
I have some hard time visualizing that mess just in my head, but since
uvs.Add(new Vector2(uOffset + tileSize, vOffset + tileSize)); //1,1 Top Right
uvs.Add(new Vector2(uOffset, vOffset + tileSize)); //0,1 Top Left
uvs.Add(new Vector2(uOffset, vOffset)); //0,0 Bottom Left
uvs.Add(new Vector2(uOffset + tileSize, vOffset)); //1,0 Bottom Right
does stiches, but is properly oriented, maybe
uvs.Add(new Vector2(-uOffset + tileSize, vOffset + tileSize)); //1,1 Top Right
uvs.Add(new Vector2(-uOffset, vOffset + tileSize)); //0,1 Top Left
uvs.Add(new Vector2(-uOffset, vOffset)); //0,0 Bottom Left
uvs.Add(new Vector2(-uOffset + tileSize, vOffset)); //1,0 Bottom Right
would fix the stitches
And
uvs.Add(new Vector2(-uOffset - tileSize, vOffset + tileSize)); //1,1 Top Right
uvs.Add(new Vector2(-uOffset, vOffset + tileSize)); //0,1 Top Left
uvs.Add(new Vector2(-uOffset, vOffset)); //0,0 Bottom Left
uvs.Add(new Vector2(-uOffset - tileSize, vOffset)); //1,0 Bottom Right
Really is also chopped ? :/
๐ฅณ ๐ฅณ ๐ฅณ ๐ฅณ
So you really didn't try what I posted here : #1258761117396635771 message
Note that you will have some seams inevitably, unless the texture tiles with the sube size
it should tile every 4 voxels, and im only rendering chunks of 16 so it should line up perfectly as it does here
im very gratefull and amazed that you got that working. but i dont quite understand why it works, you are shifting the u to the negative and y positive still?
It's just negating the U : sor it's an horizontal mirror