Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.






Tri-planar Texture Mapping in Blender Cycles

Posted by JTippetts, 10 August 2012 · 1,734 views

Blender 3D Cycles Triplanar mapping render
Posted Image

What is that monstrosity, you ask? Why, I'm delighted you asked. That is a first stab at a material node tree for doing triplanar mapping in Blender's Cycles renderer. Until Cycles came along, I couldn't find any way at all of doing tri-planar mapping. The result:

Posted Image

Woot! No stretching. One of the big drawbacks for me lately doing terrains and landscapes with Blender has been the fact that I rely so much on procedurally generating terrain texture maps, but texture mapping a heightmap terrain always results in stretching. Tri-planar is effective at reducing stretching, but until the enhanced shader-like functionality of Cycles came along, there really was no way to do it in Blender. The ugly bastard needs some tweaking and there are some things that I'm sure there has to be a better way to do, but by golly, it works. I can even extend it to a couple textures and use a map to blend between them:

Posted Image

Now, there are some issues. I need to iron out a different way of doing the blending. You can see some banding on the flat spots that shouldn't be there. And, of course, the textures themselves are kind of cruddy. But it's a whole lot more than I was ever able to do before Cycles.

I've got plenty more to say about Cycles in the next entry, as I tackle another landscape scene and learn more about this fabulous new renderer that is quickly becoming my default renderer. Stay tuned...

Edit:

I was tweaking around and did a render using the blending texture as a bump map:

Posted Image

In the process, I realized where the banding in the previous images was coming from. Cycles materials allow you to specify a node tree for Displacement of the rendered surface. (Currently, the Displacement is bump-map only, but I understand true displacement is in the works as an option.) The thing is, Displacement is calculated and applied before the fragment is shaded, and I was using the textures themselves as bump-maps in the previous renders, so that perturbation of the surface normal was being taken into account during the coloration phase, when the surface normal was dot-producted against the unit vectors (0,0,1), (0,1,0) and (1,0,0) to calculate the blending factors. This was causing there to be non-0 contribution from the two vertical planar textures on surfaces that should be considered flat horizontal. Thus the banding. Seems like something that can be solved by simply being careful with bump maps.




November 2014 »

S M T W T F S
      1
2345678
9101112131415
16171819202122
23 24 2526272829
30      
PARTNERS