2
$\begingroup$

I'm trying to use blender to create a low poly mountain range. To make the illusion of a long mountain range without using huge textures, I'm using two different uv layouts to layer a semi-transparent snow cap texture on top of my base rock texture.

enter image description here

For the base rock texture, I can just unwrap and let it seamlessly tile.

enter image description here

For the snow cap, I need to edit the uvs so that the top ridge is within the white region and then squish all the other uvs into the transparent region.

enter image description here

The problem is more obvious for mountains where the snow cap texture only comes down part way. I suppose that I can squish all the uvs below that into the transparent region, but it would be nice if I could simply tell the graphics card to ignore everything outside of the texture region on the Y axis.

enter image description here

I've used other software programs that let the user control how the texture is sampled when you go out of bounds (usually repeat/mirror/clamp. Clamp just means that when you go outside the texture area, reuse the pixel on the closest edge of the image). If I could clamp my snow texture in the Y axis, everying above the cap would be white and everything below would be transparent, making editing my uvs more flexible.

I could get around this by just moving my uvs around. However, I wanted to know if Blender let you set the texture wrapping type too.

$\endgroup$
  • $\begingroup$ Could you edit your question and add an example screenshot of what you want to achieve? $\endgroup$ – Duarte Farrajota Ramos Mar 22 '17 at 0:14
  • $\begingroup$ In Mapping under the textrure tab, do you see any difference with Clip or Clip Cube instead of Repeat? $\endgroup$ – Craig D Jones Mar 22 '17 at 2:47
2
$\begingroup$

1. General solution (doesn't work in your case)

For many purposes, you can just change the texture repeat settings on the image texture node.

enter image description here

2. More complex solution (works perfectly in this case)

For more complex cases like yours, however, you this can be done quite easily with a mapping node:

enter image description here

Set the min value of, e.g., the y-axis to be whatever works best for your image. The setting 0.4 seems to work well for my simple testing setup shown below.

enter image description here

$\endgroup$
  • $\begingroup$ Interesting idea, and that might work in Cycles. However, I'm trying to create assets I can export for a game engine. I've been sticking to the basic properties you can set in the material and texture tabs because they're set up more like a typical game engine shader. IDK - can you export shader networks to game engines? $\endgroup$ – kitfox Mar 22 '17 at 3:56
  • $\begingroup$ @kitfox You can't export any of that in a game engine actually. If you are in Cycles, you should be using nodes, then baking to maps that you'll use in your game. If you want this technique to work in your game engine w/o a baked map, then you'll have to use some sort of shader in your game engine that does it for you. $\endgroup$ – JakeD Mar 22 '17 at 10:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.