Using Projection Mapping in Maya
Application Used: Autodesk Maya
Author: Bogdan Amidzic
Using Projection Mapping in Maya
Projection mapping is a feature that allows you to project 2D texture with an object called placement node, so you don't actually need to worry about UVs on the objects.
It saves you from hours of tweaking UVs. In this part, I'm going to explain how to use a simple tri-planar (box) projection and planar projection to shade two walls, one with decal, all done in only one material.
So for starters, create two poly boxes. Scale one of them, so it's higher.
When you apply a texture to it, you see that the bricks are not the same size.
That's because objects use same UVs. The only way to fix this is to scale UVs down on one object. So maybe you'll get 100 objects and need to tweak all of them. What a NIGHTMARE!
Material is pretty simple right now. But not for longâ€?
To make a projection, you need to check as projection in the 2D textures tab. Create file texture.
Wow! What's that? Fear not. File1 and place2dtexture are used to control the texture itself, and the way it behaves in 2D . place3dtexture is controlling where the projection in 3D space will be (it's that green object in the scene). Projection1 controls the projection itself (type and some options).
Load brick texture into file1, and also connect projection1 to material
In the viewport, you can see that the texture looks blurry. Set texture resolution to maximum.
Place texture according to the larger object. Notice that the texture on objects still looks odd. Hardware shading doesn't really show projection mapping or 3D textures very well.
So when rendered it looks good. Now all bricks are exactly same size. 100 objects? Piece of cake.
But from the side view, the texture looks stretched.
That's because we were using planar projection (default one). Change it to TriPlanar (box)
Now it looks better.
Now, I'm going to show you how to create decal on one of the walls. First create layeredTexture.
Grab projection1 using MMB to color the attribute of the layeredTexture. Also you can set blend mode to none. It doesn't matter since this layer is the bottom layer.
Create another file texture, as projection. Find some grayscale decal texture.
Move placement to the second wall.
Then in layeredTexture node, click left to the blue rectangle. This will create another layer. Remember right is down here. Set blend mode to multiply (like in Photoshop) and MMB drag projection2 to the color of that layer. Now the wall texture is multiplied by decal texture. This is a simple example. If you want, you could use texture with alpha mask to define how the layer looks. Then just grab mask to swatch right to alpha attribute. Then you would use over (it like normal in Photoshop).
Also I reversed the decal texture because I want only that small part to be black on the wall, not the opposite.
Then I just connected layered texture node to color of the material.
When rendered it looks like this. What? Didn't I want the texture to be only where I placed it? Yes butâ€?
That's why there are 2D and 3D placement nodes. First go to file2 node and set default color to black. Black because the boundary of the image is black, so when I turn off wrapping, Maya will know which color to use instead of the image.
In 2D placement node, turn off Wrap U and Wrap V. No Wrapping. Difference between wrap and repeat is that wrapping occurs when UVs get over 1 or below 0. That means that UV space is repeating itself. Repeat U and V means how much you want the image to repeat inside 0 to 1 UV space.
So now it looks good..
Now just MMB drag from layered texture to material, and set bump.
What's this? A bug?
No, its the users' fault. It occurs because we are using two placement nodes (which are 3D ), into layered texture. Maya assumes that the layered texture is working with 2D. To fix that, create a bump3D node.
Connect layeredTexture to bump and bump to material.