3
$\begingroup$

How to use a shader from texture 3 to make texture 4 (see attached image)?

enter image description here

$\endgroup$

3 Answers 3

3
$\begingroup$

if you have a "nice" uv unwrapping like this:

enter image description here

with "nice" i mean, that with exact the same uv mapping values, you get an image which is placed right in the middle.

you will get this:

enter image description here

enter image description here

$\endgroup$
2
  • $\begingroup$ One question for clarification, since you mention the "image which is placed right in the middle": is it just my impression or do the resulting 4 images have the character closer to the center of the area as if the character of the original image had been moved to the right? $\endgroup$ Commented Apr 25 at 13:29
  • 1
    $\begingroup$ yes, mine wasn't exactly in the middle, but it should be - i was lazy :( $\endgroup$
    – Chris
    Commented Apr 25 at 14:12
3
$\begingroup$

You can also do some math with the texture coordinates. You can split them in to X,Y and Z (that is irrelevant for UV) and use modulo and multiply to repeat the range then find out what is every other repeated range by another modulo twice as "big" as a mask and flip them multiplying by -1. This also let's you choose how many times to repeat this easily:

enter image description here

Actually, you could also do "ping-pong" operation from the math node as well:

enter image description here

...or do the modulo thing with vector math node without splitting the vector.

$\endgroup$
2
  • 1
    $\begingroup$ You can get rid of the Sep/PingPong/Combine and just change "Repeat" on the Image node to "Mirror". $\endgroup$
    – scurest
    Commented Apr 26 at 6:13
  • $\begingroup$ Now what's the fun in that?.. :D OK, I did not know about that... :D :D :D $\endgroup$ Commented Apr 26 at 8:18
2
$\begingroup$

First of all, I expect your texture 3 to be fully covering the UV map of the plane, i.e. the image stretches all the way from bottom left to top right of the plane and so does the plane's UV. Then here is a step-by-step guide how you can do it and what each node does:

  1. Starting with the UV output of the Texture Coordinate node plugged into the Vector input of the Image Texture node.

    start basic uv

  2. Next you take a Vector Math node and Subtract 0.5 on each axis (actually like in my example only X and Y are needed, because the UVs are 2-dimensional). This way the bottom left (the origin) of the UV map is in the center of the plane.

    centering the uv origin

  3. Now you add a Vector Math node set to Scale by 2, this way the texture gets mapped to all four quadrants of the plane.

    scaling the uvs

  4. The step before made the texture just repeat from four times, but the coordinates left of the left and below the center are negative. If you now take another Vector Math node set to Absolute, the textures get mapped from the center to the border, meaning the ones to the left and bottom are now mirrored.

    mirroring uvs by absolute coordinates

  5. Finally, since your example texture 4 shows the correctly oriented text in the bottom left quadrant not the top right, mirror everything again by using another Scale node, this time by -1.

    final result

$\endgroup$
2
  • $\begingroup$ but to be nit picky ;) ...yours won't work if the image isn't places perfectly, because then you would see pieces of more images, my setup "ignores" sloppy work ;) $\endgroup$
    – Chris
    Commented Apr 26 at 5:04
  • $\begingroup$ @Chris Yeah sure, that's why my first paragraph tells it has to match the UV map, might have been not clear enough from what I've written. It looks like in the question it is simply the basic plane with an unaltered UV map stretching across the whole UV area, and that's the case which I made this answer for and said it at the beginning... doesn't really matter though since my answer wasn't accepted anyway. But: as long as the UVs are not outside the UV map's bounds, you will not "see pieces of more images". $\endgroup$ Commented Apr 26 at 5:56

You must log in to answer this question.