Jump to content
  • Advertisement
Sign in to follow this  
gunning

What is 'box' mapping?

This topic is 4314 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to texture a NURBS-based terrain. In this thread Yann L says...
Quote:
You can simple use parametric texcoords, derived from the HOS splines. This works more or less OK, but can show weird stretching on certain parts. A better approach is to use a 6-planar mapping with seam blending. Similar to the 'box' UVW mapper in 3DSMax, but with blending to remove any visible seams.
What does Yann mean when he says 6-planar mapping with seam blending? Are there any papers on this topic, or can someone share some insight into how it works?

Share this post


Link to post
Share on other sites
Advertisement
I understand cube maps already, and I'm sure the techniques are similar, but I don't think that's what Yann's referring to. Cube mapping is generally a technique to map 6 different textures arranged in a cube onto an object. 6-planar 'box' mapping AFAIK is a method to generate texture coordinates for 2D texture on a 3D object.

It's similar in concept to the cylindrical or spherical mapping also found in most 3D packages. Anyway, some searching lended me the term "surface parametrization", but I don't know if that's related because I'm not finding my box mapping technique anywhere.

Share this post


Link to post
Share on other sites
I suppose worst case scenario I could take a look at the Blender source code to understand their box mapping but I'm really looking for description not code.

Share this post


Link to post
Share on other sites
Take the normal of the triangle, find its largest component. You get 6 possibilities: +X, -X, +Y, -Y, +Z, -Z. Perform a planar 2D projection depending on the case.. this is box mapping.

Y.

Share this post


Link to post
Share on other sites
Awesome! Much appreciated...

Now for seam blending, I think the reason you need this is because the texture coordinates on a cube can never match up perfectly, particularly on the top and bottom.

So what do you think of this algorithm. Each triangle is mapped onto a plane and given texture coordinates for each of its vertices. This is done for every triangle so sometimes there are multiple copies of vertices with probably different texture coordinates. To fix the seams, like vertices would be melded together and their tex coords averaged.

I haven't tried it yet ... but hopefully that would fix the problem.

Share this post


Link to post
Share on other sites
Quote:
Original post by Ysaneya
Take the normal of the triangle, find its largest component. You get 6 possibilities: +X, -X, +Y, -Y, +Z, -Z. Perform a planar 2D projection depending on the case.. this is box mapping.

Y.


Box mapping must be synonymous with cube mapping as well, because that exact kind of transform is used to get cubemap texture lookups.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!