Blended Cube Projection By Neil Blevins Created On: Feb 12th 2013 Updated On: Nov 19th 2016 First off, I recommend reading my Blended Box
Mapping tutorial first, it contains useful background info that
will help you with this tutorial.
What is a Blended Cube
Projection?
Say you have a complex object, like a robot head, 291 objects to
be exact, and you want to paint some specific dirt on it, like dirt
near the places where the screws intersect with the face shields, drips
traveling down the face, darkening near panel lines, etc. Some
possibilities...
You could uv
the objects and then use a 3d paint program, but damn, uv mapping 291
objects is a real pain.
You could auto map it, but the result will be
useless if you want to edit the textures in photoshop.
You could use Ptex, but then you'll have to keep track of 291
Ptex files associated with this model.
You could use
procedurals, but it might be a
lot of work getting it to look natural when it would be pretty easy to
paint.
The Blended
Box
Mapping technique works great for applying "General" dirt to a
surface, but you want control over placing the dirt in very specific
spots.
If you want to apply "Specific" dirt to a surface, you
need to take the next step, a Blended Cube Projection. This is very
similar to a Blended Box Map, except instead of using a single map, you
create 6 different maps, one for each direction, and then apply them to
your surface.
The basic procedure is as follows, start with your model...
Assign a Blended Cube Projection.
Render Templates of your objects from all 6 sides.
Now open Photoshop, and load the front image. Create a new layer, and
start painting a dark brown color everywhere you want dirt.
Save this as a psd file, so you can always go back to your working file.
Once done, click "Lock Transparent Pixels" in your layers palette on
your dirt layer, and then fill your layer with white. Now everywhere
you painted brown will be white. Then place a black layer below the
dirt layer. And flatten the image. Now you have a black and white mask,
where white will put dirt, and black will be transparent. Save this
mask as a tif.
Open up max again, go to your Blended Cube Projection map, drop the
dirt bitmap you just created in the front slot.
Now place your Blended Cube Projection map in the mask slot of a Blend
material, with
Material 1 being your metal material, and Material 2 being a dirt
material.
Hit render, and voila, your dirt details are now projected on the front
surfaces of your objects.
Repeat for the other 5 sides, and now you've placed specific texture
details on all of your objects quickly and efficiently without the need
to unwrap everything.
There are three different ways to make a Blended Cube Projection...
The best and most modern Blended Cube Projection
technique is using the
BlendedBoxMap inside Max 2017 Ext 1. If you turn it from using 1 or 3
projections to 6, you are now using it as a Blended Cube Projection
instead of a Blended Box Map.
Here's a video showing the process...
This technique is full of advantages, the only real disadvantage to
this technique is it requires max 2017 Ext 1
or higher to work. So if you're using an older copy of max, you may
want to try out the other two techniques below...
CameraMapGemini Technique
This technique uses the free plugin CameraMapGemini to project
your textures onto the surface (make sure you have the free plugin
CameraMapGemini v0.16 or
higher by Markus Boos http://www.projectgemini.net/CameraMapGemini/).
Take the robot head model with the simple metal
material applied to it. Select all of the objects.
Now make sure all 6 maps are empty (since we haven't painted the maps
yet), choose CameraMapGemini Method in the Create Mapping Modifiers
dropdown,
and hit Do. Now we have 6 cameras pointing at our object from all 6
cardinal directions, Up, Down, Left, Right, Front, Back.
And a CameraMapGemini modifier is assigned to the objects...
We also have a mix map in the medit that uses all our cameras...
Next, we use another soulburn script, this one is called
cameraMapTemplateRenderer. Here's the interface...
First, change the Mode to CameraMapGemini. Next, it's recommended you
turn on camera lights, so you get
even illumination from all camera angles. Or for even better results,
turn off all lights except a dome light (for example, use vray's "GI
Environment" light set to a multiplier of 1 and a color of white in the
render dialog if you're using vray as your renderer). Finally, in the
script's interface, choose an output directory and hit Do.
You'll now have 6 templates saved to you directory.
Now open Photoshop, and load the front image, and create the dirt layer
are discussed in the section "What is a Blended Cube Projection".
Open up max again, go to the map tree that the
BlendedCubeProjectionMaker script created, and load
your new front bitmap in the appropriate map.
Now place your map tree in the mask slot of a Blend material, with
Material 1 being your metal material, and Material 2 being a dirt
material (this doesn't have to be complex, a standard material with no
specular and a dark brown color for instance).
Now hit render. And voila, you have painted dirt on your model. Do the
same for the other 5 directions.
Here's a video showing me apply a blended cube projection using the
CameraMapGemini Technique to a robot
head...
UVWMapping
Technique
This technique is almost identical to the CameraMapGemini technique,
except it uses Planar UV modifiers instead of camera projections.
Here's the differences in the setup:
When using the blendedCubeProjectionMaker, set it to UVWMapping Method
in the Create Mapping Modifiers
dropdown. 6 Cameras will again be created, but instead of a
CameraMapGemini modifier assigned to our objects, we'll have 6 Planar
UV modifiers aligned with the cameras.
Change the Mode in cameraMapTemplateRenderer to Selected Cameras, and
select your 6 cameras. It will render the 6 templates exactly like
before.
Paint your maps exactly like before, and place them in the same slots.
The visual result will be identical.
Here's a video showing me apply a blended cube projection using the
UVWMapping Technique to a robot head...
Comparing The CameraMapGemini
and UVWMapping Methods
The main advantages of using the UVWMapping Technique over the
CameraMapGemini technique are...
CameraMapGemini doesn't work in mentalray.
CameraMapGemini doesn't work in VrayRT.
CameraMapGemini doesn't support bump mapping (if you're using
vray, you can run the result through a color2bump map to get bump map
results).
CameraMapGemini takes a little longer to render than the
UVWMapping method. I've seen a 2x slowdown rendering objects.
You're dependent on a 3rd party plugin, rather than the UVW
Mapping technique that uses tools that already exist in max.
The main disadvantages of using the UVWMapping Technique over the
CameraMapGemini technique are...
The mapping
modifiers are attached to each individual object. So if you move one of
your objects, the mapping modifiers will become misaligned. Remember,
the image is not being projected by the camera, its being projected by
the UVW Mapping Gizmo. The cameras are just there for reference.
Your objects need to have their transforms reset in order to get
the falloff maps to align properly with the world (this is done using
the Reset XForm utility in max). This is especially
bad if you want to keep your original transforms on the objects.
Adding a new object to your mapping requires copying and
pasting six separate mapping modifiers, and in the process of pasting
them, again, they may become misaligned.
Conclusion
So the big advantages of using a Blended Cube Projection instead of
unwrapping / ptex / procedurals are...
You were able to apply dirt to a whole
bunch of objects without the need to worry about unwrapping the UVs on
every object.
If you need to move or add to or modify the faces on any of your
objects, you can do so without
messing up your paint or uvs.
You have 6 images to
manage, as opposed to possibly hundreds of images necessary for an
unwrapped object.
Frequently I'll start by making a material that uses a Blended Box
Map, just to get the basic patterns on the object, then I'll use a
Blended Cube Projection to add more specific details on top. For those
of you who do Matte Painting, you'll recognize this
technique, it's just it's being used to do regular shading as opposed
to being used to do more traditional Matte Painting from the hero
camera.
Anyways, hope you see the advantages of the Blended Cube Projection
technique and give it a
shot. You may never unwrap the UVs on another object again!