Blended Box Mapping
By Neil Blevins
Created On: May 15th 2006
Updated On: Dec 9th 2024
Software: Blender or 3dsmax (vray) or 3dsmax

Go here to read this tutorial in Russian.

Say I want to apply some dirt to a bunch of objects in my scene. While I could use procedural noise, I'd prefer to use bitmaps since that will make the dirt will look a little more organic. But I don't want to spend a long time setting up good UVs for all of the objects, because that will take awhile. This is a tutorial that discusses a quick and easy way to apply a noisy bitmap to a bunch of objects without the need to unwrap their uvs. The technique is called a Blended Box Map, or also sometimes referred to as a Triplanar.
What is a Blended Box Map?

So lets start with a reasonably random and noisy bitmap like the following...

Patern1

And you have a somewhat irregular object like this...

Object1

And you'd like to quickly apply this pattern to your object.

As already mentioned, one way is to unwrap your object's uvs. But this can take awhile to set up, especially if you have lots of objects in your scene.

A quicker way would be to use box mapping on the object. Box mapping is a mapping type that projects your texture from the six sides of a box at your object.

Seam

Well, that sort of worked, except there's a bunch of bad seams. Why is that? So if you use box mapping on an object that has rounded corners, faces of your mesh that point towards one of the 6 sides of the box map work fine. But if a face is near a 45 degree angle to the sides of the box, you get a seam where different sides of the box apply mapping to each face. For example, say a face is 44.5 degrees away from the front of the box map, it will receive mapping from the front of the box. Now say the next face is 45.5 degrees away from the front of the box map, it will receive mapping from the side of the box. So between those two faces you get a seam.

Lets look at the same problem on a sphere with a custom uv map applied using regular box mapping. Notice the seams right at the edges where faces are near a 45 degree angle to any given side of the box map.

Sphere1

If only there was some way to blend the seams on a box map?

That's where a Blended Box Map comes in. It's just like a regular box map, projecting the material from 6 different directions, but blends the seams so you don't notice them.

Seam

Blurry Seam

Here's a practical example, a robot character, which is made up of 291 separate objects...



and I want to apply some noisy dirt to all the pieces.



That's gonna be a pain to uvmap all those pieces of geometry, so lets use a Blended Box Map instead.

Assign the noisy bitmap above to a Blended Box Map instead of a regular box map, place it into the diffuse slot of a material assigned to the robot so you can see the result...



Looks the right size, and no visible seams. Now lets use out Blended Box Map as a mask to mix between a metal material and a dirt material. White parts of your map will show the dirt material, black areas will show the metal material...



So there, I've added some dirt to 291 objects in just a few button clicks, no tweaking procedural parameters, no uv unwrapping.

Now lets look at several different pieces of software that does Blended Box Maps or Triplanars and explain how to use them.

Blender Triplanar Example

Here's a video tutorial in Blender showing you how to make a Triplanar, which is another name for the Blended Box Map.





3dsmax BlendedBoxMap Example

Ever since 3dsmax 2017 Ext 1, 3dsmax has a native BlendedBoxMap that can be assigned as a map to any part of your material.



Here's a video showing the process for using 3dsmax's built in BlendedBoxMap.



3dsmax (vray) Triplanar Example:


Ever since vray version 3.3 we've had a vray triplanar map. Here's the interface...



It's simpler than the one built into 3dsmax, but sometimes simple is all you need.

Here's a few notes on what the parameters do...


A huge thanks to Vlado for writing this map.

3dsmax SoulburnScripts Blended Box Mapping Example

The SoulburnScripts technique is a manual way to construct a blended box map using the 3dsmax base package and works in all renderers and versions of max prior to 2017. The trick is to apply 3 planar UVW Mapping modifiers using 3 different map channels to your objects, and then blend their edges using falloff maps.

Take a peak at the map tree...

Maps

And a look at the 3 uvw mapping modifiers...

Mapping

Also note, in the output section of the 2 falloff maps are curve controls, and modifying these curve controls achieve a sharper or blurrier transition on the edges.

And here's the results...

Sphere 2

Notice the blending between the edges. Now this isn't ideal for something with a regular pattern like this uv map, but lets go back to our original example of the noisy looking map. The seam is basically gone.

Blurry Seam

So rather than manually creating the map tree and applying the uvw modifiers, I've automated the process and wrote a maxscript that will make the map-tree and UVWMapping gizmos for you. Please visit my Soulburn Scripts for 3dsMax page and get the latest pack. Install the scripts, and run the script called blendedBoxMapMaker. Here's an interface snapshot...



To run the script, select the objects you want to apply the 3 UVW Mapping Modifiers to, in the script interface window choose Create Map: "Falloff Method" and Create Mapping Modifiers: "UVW Mapping Method", choose the bitmap you want to use for your blended box map, and hit "do".

It'll apply the modifiers to the objects...



And place the map tree into your chosen slot...



Here's a video showing the process above for applying a Blended Box Map to the robot head using the SoulburnScripts Blended Box Mapping Using UVWMapping Technique...



InstantUV

As a footnote, back in the earlier days of max (Max 4) there was a plugin called InstantUV that did this sort of thing. But the developer decided to stop selling it, and it never got recompiled for more modern versions of max.

Here's a screencap from Robert Seidel:



Conclusion

Anyways, hopefully you see the advantages of using this technique over unwrapping thousands of objects, and you can incorporate it into your workflow, choosing the best Blended Box Map for you.


This site is ©2024 by Neil Blevins, All rights are reserved.
NeilBlevins.com TwitterMastodonBlueskyInstagramCaraBloggerFacebookLinkedInArtStationKickstarterGumroadYouTubeIMDB