Texture positioning - Projection mapping
For an overview of texturing methods visit Texture positioning - Overview.
Projection mapping is an effective methode for texturing basic shapes or multiple objects at the same time. This is beceause projection mapping is independant of the object, it only depends on the material. When you do a projection mapping an extra projection node is created in the 3d viewport of maya. This node is important as it determines the way the projection is mapped.
When using Projection Mapping, the projection is connected to the texture itself, instead of to the object (as with UV mapping and UV Texturing). This means that the UV projection information is embedded in the material, making it possible to assign the embedded UV projections to multiple objects at once. An additional advantage is that the projection options are more extensive compared to the Create UVs menu for UV mapping.
Projection mapping works as follows: When texturing with projection mapping, the texture is projected from the projection node that you can find at the origin of your 3D viewport. this node can be interpreted as a projector. You can scale, move or rotate this node to your own liking to change the direction it projects in or the size of the projected texture. The nice thing about this projector is that you can project in different shapes. In the image below a triPlanar projection is used, which means the texture is projected from the front, the side and the top direction on all selected objects. In the image the left cube is textured with normal mapping, the right cube with projection mapping. To distinguish the difference between the two mapping methodes the Normal projection has a lower repeat of the checker per face.
- In the first image you can see the two cubes and the projection node.
- The projection mapped cube is slightly rotated. This shows that the placement of the texture on the object is independent of the objects orientation(clearly visible on the top face of the cube).
- The projection node is slightly rotated. This shows that the placement of the texture on the object is dependent of the orientation of the projection node(clearly visible on the side face of the cube).
- Large amounts of objects that have the same orientation can be textured at once. The objects that have a different orientation should be textured with a second material of which projection node you re-orientate to their orientation.
- The last image shows the effect of scaling the projection node. It decreases the size of the texture and thus increases the repetitions of the checker per face.
When you assign any texture, you choose the placement method to use by RMB-clicking (Right Mouse Button) the type of texture you want:
- Create texture
- use the Normal mapping method (per object placement; default)
- Create as projection
- use the Projection method (per shader placement). This creates an additional Projection and Place3DTexture node.
- create as stencil
- use the method
You normally undertake the following steps when using Projection mapping to texture an object.
- You create a new mia_material_x shader in the Hypershade.
- You assign a texture to one of the attributes of the material. Lets take the Color attribute from the Diffuse section for this example. You click the checkerbox behind the Color attribute.
- The Create Render Node window will open.
- RMB on either a procedural 2D texture or a file texture node from the Create Render Node window. Choose Create as projection from the pop-up. In this example the procedural Checker texture is chosen.
- In the Property Editor under the Projection Attributes section choose the desired projection type (Proj Type). By default it is set on Planar.
- Change the specific attributes of the texture node if necessary. In this case for example you can change the colours of the checker.
- Select the object(s) you want to assign the texture to.
- RMB-hold on your shader in the Hypershade (do not deselect the objects) and move the mouse over to the Assign Material To Selection marking menu and release the mouse button. The material is now assigned to the object(s).
- Orient the projection node in the 3D viewport to your liking.
- If you texture multiple objects at once (i.e. houses) of which some have the same orientation and others have a slightly different orientation, then repeat the steps 1-9 for the objects with a different orientation.
Workflow: Different Nodes
There are several projection shapes. The most important ones are:
These are displayed in the image below. The projection method determines how the texture is placed. In the image you can see that the first cube, which is projected planar, has an orthogonal placement on the front side but on the top the texture is stretched. This is because the texture is only projected from the front as can be seen from the green projection node in front of the cube. If you look closely you can see the direction the node is projecting in. This direction is indicated by a green line emanating from the centre of the square projection node. It is pointing towards the front of the cube.
The mapping next to that is the spherical mapping and next to that is the cylindrical mapping. You can see that due to the round nature of these placement methods, the brick texture will not be placed correctly on a cube. you can see how the texture gets deformed on the surfaces of the cube.
The fourth one is cubic mapping.
A really effective projection method for cubes is tri-planar. This is the last one in the image. It projects the texture from three orthogonal directions. It is very useful in texturing a fast amount of cube shaped houses or something similar.
The thing with projection mappings like the planar and triplanar is that the back side of the objects will be textured in the same manner as its front side, because the projection continues projecting its texture through the object.
Note 1: One of the things that can be annoying when using projection mapping is that the texture will not display correctly on your object in the 3D viewport. This can be overcome by going to the attribute editor of the shader. Scroll down to the Hardware Texturing tab and crank up the texture resolution. You can put it on Highest (256x256), but this could be too intensive on some computers or in scenes with a lot of geometry. But normally putting it on High (128x128)will suffice.
Note 2: When using hardware texturing sometimes when you move or rotate the geometry on which the texture is projected, the texture doesn't update correctly. Go back to the Hardware texture tab, select a different texture resolution and reselect the old texture resolution again. The texture should now be updated.
Modifying the projection settings
When the As Projection option is used two additional nodes are created. One projection node (the checker with the arrow) will contain the information of how the texture is projected (planar, cylindrical, etc.). The other one (the Cube) contains the information of scale orientation and position If you use this projection option you always have to change the settings of these two nodes.
To change the method of projection:
- Select the projection node in the Hypershade.
- Open the Attribute Editor and select the desired projection type.
To change the position and/or scale of the projection:
- Select the palce3dTexture node.
- Change the values in the Transform Attributes section in the Attribute Editor.
- Select the projection node in the Hypershade.
- Click on the Interactive Placement button.
- In the viewport a modifier tool will become visible to manually change the position and scale of the projection. Keep in mind that the projection is always placed in the origin of the scene)
- Select the projection in the scene and choose the Show Manipulator Tool in the toolbox or .