UV independent material.

Sometimes you need to use a texture as a scaling guide when building a structure, this little node set allows you to use the “box” uv mode in world space. Another issue of “box” mode, is that if you like sharp pixels on your guide textures, you’ll notice that using “Closest” prevents your textures from repeating properly.

So here is a little node graph (which i just keep inside a group) that will correct the UVs that are fed into your texture.

Now all you have to do is plug that node into your texture UV node. And it’s done!

Explanation on what’s exactly going on with this:

When setting a texture to use “box” uvs & and “closest” for the filtering, it causes a weird behavior where the texture will only accept uv values that are within the standard UV space (0.0-1.0).

The solution:

  1. Separate the position components X Y Z
  2. Add 1000 (or any other round value) to each of the position components (this prevents them from being negative… at least up to -1000 meters)
  3. Modulo the result by 1 (constraints the result to a repeating 0.0-1.0 value space).
  4. Recombine X Y Z into a vector.

 

About Me
I started SecondLife in 2004 and created my own bdsm fetish virtual products under the name KDC. I fancy myself as a programmer, 3D artist and terrible game designer.
Archives
  • [—]2019
  • [+]2018
  • [+]2017
  • [+]2016
  • [+]2015
  • [+]2014
  • [+]2013
  • [+]2012
  • [+]2011
  • [+]2010
  • [+]2009
  • [+]2008
  • [+]2007
  • [+]2006