Download

World position/tri-planar mapping with half of the texture

I am using tri-planar mapping using World UVs as explained in this video(from 3:22 on). Now, I want to sample only half of the texture, because I gathered two rectangle textures into a square one. I am not sure how to do that, I guess I should need to be able to limit the scope of the Texture Sample node with a length and an offset, but this is not configurable. Or I could use Texture Coordinates, but since I start with an Absolute World Position I am not sure how to fit that in. Any idea?

Don’t pack two textures to single one. Simple as that. You would need to bias then use fraction and then offset texture coords. This would need to be done three times per pixel. This would also might cause seam. With mipmapping two different textures will also bleed to each other. All these problems to gain nothing. Just split the textures to two.

@Kalle_H - I think I will do this, however my texture is really horizontal so I didn’t want to waste texture space. Also, even though rectangular textures are fine on PCs as long as their size is power of 2, this is not the case on mobile where they will be translated to square this way wasting memory.

Only PVRTC has this square limitation if I remember right.