#Well, if you use the position .XY, .XZ

1 messages ยท Page 1 of 1 (latest)

surreal bloom
#

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 )

cosmic shore
#

Is it the UVs of the mesh, or the result of the triplanar mapping in the shader ?

surreal bloom
#

this is from the uvs i manually added

cosmic shore
#

Well, just negate the X axis of the UV depending on the normal orientation ๐Ÿ™‚

surreal bloom
#

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

surreal bloom
# cosmic shore Well, just negate the X axis of the UV depending on the normal orientation ๐Ÿ™‚
                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?
cosmic shore
#
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

surreal bloom
#

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

cosmic shore
#

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  
surreal bloom
#

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

cosmic shore
surreal bloom
#

ill implement it again and post ss of both textures

#

and this is my original mirrored solution

cosmic shore
surreal bloom
#

yeah that is the code you provided first, its the exact same solution travis came up with yesterday

cosmic shore
surreal bloom
cosmic shore
#

And third ?

surreal bloom
cosmic shore
#

I'm so confused now ....
Could you share the full UV generation / loop ?

surreal bloom
#

ugh both haste bin and hatebin are not working

#

!code

echo hatchBOT
surreal bloom
#

it is the direction X- / west i've been testing with

cosmic shore
#

I'm surprised it does "chop" the X- axis, but not Z- ๐Ÿค”

surreal bloom
#

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

cosmic shore
#

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

surreal bloom
#

still chopped

cosmic shore
#

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 ? :/

surreal bloom
#

๐Ÿฅณ ๐Ÿฅณ ๐Ÿฅณ ๐Ÿฅณ

cosmic shore
#

Note that you will have some seams inevitably, unless the texture tiles with the sube size

surreal bloom
#

oh damn, i was sure i tried that

#

must have copied the wrong thing, im so sorry

surreal bloom
#

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?

cosmic shore
#

It's just negating the U : sor it's an horizontal mirror