Better 3D Projection

(will make into a script eventually)
There are several texture projection types available in Maya(planar, spherical, cubic, etc) but all create artifacts at angles perpendicular to the projection. Spherical or cylindrical create stretching at the poles & along the surface, cubic & triplanar create hard edges at the border between projected directions. To avoid these hard edges in this shader I use the surface normals to mask off areas on the surface parallel to the planar projection, using a planar projected texture in X, Y, & Z layered on top one another I get a texture to smoothly transition on all sides. Great for texturing static hi-poly models for pre-render or baking.


Also useful for baking is a simple camera space normals shader:
1. create a sampleInfo & setRange node, and any shader type(suggest surfaceShader) to assign to the mesh
2. connect the normal camera output from the sampleInfo node to the setRange value input
3. set the setRange values as fallows: Min 0,0,0; Max 1,1,1; OldMin -1,-1,-1,; OldMax 1,1,1
4. connect the outValue of the setRange to the color value of your shader, done