1
$\begingroup$

I created a picture frame by extruding the profile along a rectangular path. Is it possible to kind of split the texture at the corners and move it around, so it isn't continuous from one edge to the other? (Right now it's obvious the wood fibers just bend around the corner and it's not another piece of wood)

Ideally, I'd like to do that with nodes, so it's easy to switch the texture without having to make other changes manually.

[update] After thinking about it more and trying different suggestions, I guess what I'm looking for is a way to change (in nodes) the coordinates of the texture at, or rather between, some points on the path along which a shape is extruded (i.e. the vertices of the frame). I still have no idea if it's even possible, though, and even less how to do it.

enter image description here

enter image description here

I would like to get a result similar to this, where it really looks like two different pieces of wood. enter image description here

$\endgroup$
14
  • $\begingroup$ Check out this answer.. it uses bricks, bit would apply to any 2D texture. $\endgroup$
    – Robin Betts
    Apr 25, 2021 at 19:04
  • $\begingroup$ Thanks @RobinBetts! It looks quite complex for my limited knowledge, but I'll try to replicate it. FYI, I just updated my post (and picture) to make sure I'm explaining myself correctly. $\endgroup$ Apr 25, 2021 at 19:39
  • 1
    $\begingroup$ @RobinBetts I think they're actually looking for the opposite of what is provided in the answer if I understood correctly, having a visible seam at the edge $\endgroup$
    – Gorgious
    Apr 25, 2021 at 20:50
  • $\begingroup$ Are you using Cycles or Eevee for rendering ? $\endgroup$
    – Gorgious
    Apr 25, 2021 at 20:50
  • 1
    $\begingroup$ Thanks @RichSedman. I'll probably end up doing it the classic way, indeed, but when I have some time to spend, maybe I'll look into it again, using normals. Anyway, I've learned quite a bit from the comments from you and others, which is nice. Thank you for your time, much appreciated ;) $\endgroup$ Apr 27, 2021 at 8:48

2 Answers 2

2
$\begingroup$

My suggestion would be to switch to Object's texture mapping with a box projection on the texture:

demo picture

Since your model is basically a box, it will project the texture from an invisible box around your object, with discontinuity between each side (though you can use the "Blend" option below the box projection setting if you ever want a seamless effect).

You can then control the stretch and position of each X Y Z axes, either via the mapping node or by targeting an object in the Texture coordinates node and transforming that object around as you wish.

demo gif

If this isn't enough, the next easy solution is to set back the texture projection to flat, remove the mapping and texture coordinates nodes, and edit the object's UVs so that they match.

In the top bar, click the UV Editing tab. Your faces'UV are most likely attached to each other's neighbor, which is normal, but in your case you will most likely need to create some seams. You can select some edges and hit Ctrl E → Create seam, or in the 3D viewprt select one face on your whose texture is in the wrong way, then press U → unwrap. Then rotate the faces as you need in the UV editor.

$\endgroup$
6
  • $\begingroup$ Thanks for the suggestion @L0Lock Definitely worth remembering that technique, but unfortunately it doesn't help in my case, because on the front of the frame the wood fibers are now all in the same direction, instead of horizontal/vertical. Is there some way to make it so? Michael $\endgroup$ Apr 26, 2021 at 10:02
  • $\begingroup$ Sure, just use the Mapping node's rotation controls. $\endgroup$
    – L0Lock
    Apr 26, 2021 at 13:15
  • $\begingroup$ It rotates the texture, but all wood fibers are in the same direction, instead of bending at the frame corners as in my screenshot. The top and bottom of the frame should have horizontal wood fibers, while the left and right should have vertical ones $\endgroup$ Apr 26, 2021 at 13:36
  • $\begingroup$ Then if this setup doesn't do the trick, the next simple solution is to edit your set back the texture projection to flat, remove the mapping and texture coordinates nodes, and edit you object's UVs so that they match. I'll edit my answer. $\endgroup$
    – L0Lock
    Apr 26, 2021 at 13:46
  • $\begingroup$ Thank you, @L0Lock. Yes, I'll just do it the classic way with a mesh and unwrapping. It's not what I was looking for, but it's seems unlikely I'll be able to do it with nodes only. Thank you for your time. Happy to have learned that trick with the object texture, which will probably come in handy in the future. $\endgroup$ Apr 27, 2021 at 8:53
1
$\begingroup$

One option is to use the Normal of the surface to determine the 'split' between material and offset and rotate the texture based on this - for example, one piece has its surface normal pointing along the X-axis and the other switches to the Y-axis. We can use this to offset the texture so as to get a different section per piece as well as to rotate the coordinates to re-orient the grain.

result and nodes

Here I'm using the True Normal - in case of smoothing on the surface. The pair of Cross Products, being passed the vector 0,0,1 produce a vector that is independent of the Z axis - since the Cross Product returns a result that is perpendicular to both of the input vectors (so the first one will produce a vector along the surface of the mesh while the second one flips that back to a vector that is perpendicular with 0,0,1 as well as being perpendicular with the surface. The Normalise makes it a vector with a length of 1 and the Scale is used to allow the offset to be adjusted as desired.

For the rotation, the Separate XYZ us used to get the component in the Y direction and the Absolute and Less Than isolates those surfaces that are oriented along the 'X' direction (since the 'Y' component will be very small). This is multiplied by 0.5xPi (which equates to 90 degrees rotation) and used as the Z component of rotation - effectively rotating anything facing along the X axis by 90 degrees.

Note that this is now using Object coordinates and so is independent of any UV unwrapping.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .