Jump to content
  • Advertisement
  • entries
  • comments
  • views

Tri-planar Texture Mapping in Blender Cycles

Sign in to follow this  



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:


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:


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...


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


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.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!