Previously a production blog for my final year project ( you can still find the old posts of WIP images) YOu have stumbled across a collection of knick knacks and tutorials for 3D CG...

Friday, September 11, 2009

Multiple UV tiles for a single shader...

Did some R&D on how to have multiple texture maps allocated to a single shader.
Why do we want to do this? This allows us to have different resolution textures allocated to our mesh.
Example: A 4k  Texture map for the character's face, a 2K texture map for the body and legs, 4k map for the hands----> all this plugged into a single shader.

With this we can work within the Maya optimised Texture map size of 4k.

Step 1: UV unwrap and place your tiles in a positive UV space of (1,1), (1,2), (1,3), (1,4) etc. Under the Image tab click image range and Set the maximum and minimum U and V values, if tiling 4 squares to the right , set maximum V to 5.

Step 2: Create file nodes for each texture map you wish to assign

Step 3: In the place2dTexture node, uncheck Wrap U and Wrap V (you dont want it to tile), Translate frame to your UV coordinates ( 0,0 being the default square, 1,0 to the adjacent square on the right)

Step 4:  in the File Node go to Color balance and set default color to black.

Step 5: Create a layered texture. drop your file nodes into the layered Texture Attributes. Set blend mode to Add.

Step 6: Connect layered texture to the color, bump, specular etc. of the shader you want to use for your mesh.

Notes: Remember to set the default color of the file nodes to black. Reason being we are "adding" layers in the layered texture, hence black being (0,0,0) will not affect your color map values because as everyone knows 0 + X = X.

8 comments:

  1. This is an awesome tutorial. Thank you.

    ReplyDelete
  2. this is great thank you sir

    ReplyDelete
  3. I am using three different textures/uv tiles for one object. The UVs are arranged from 0-1, -1,0, and -1,1. I created file nodes and assigned the textures, offset the UVs correctly, and connected to a layered texture. I then assigned my object to the layered shader. Everything looks perfect in the Maya workspace, but I can only render one of the three textures on my object with mental ray. The other textures render completely black. Is this a bug?

    NOTES
    I am using 3 Targa texture files (Each is 4k).
    I have set the default color balance to black for the layered texture
    In the place2dTexture nodes, I have unchecked Wrap U and Wrap V
    I have set the layered blend mode to Add and for the others I have selected “over”.

    ReplyDelete
    Replies
    1. hey les,

      did you find a solution for your problem? i am facing the same problem. can u help?

      Delete
  4. Hellow Iam Kottish, and i have very huge problem in Multi Tile Texture what it is that all the "Texture's, Normal Map And displacement" map are exported from "Zbrush" using "Multi Map Exporter" And i i've pluged The "Texture Map & Displacement Map" in to the Maya Blin shader and its totally fine no problem at all. when it comes to "Normal Map" if i plug the normal map without the "layered texture" its working fine. But when i plug it in to the "Layered Texture" it give me a very bad looking output. so is there any other way to plug the Multi tile normal map in to shader please help Me with this iam very confused. so here are the images that is "Normal Map without Layered Texture & With the Layered Texture

    ReplyDelete
    Replies
    1. this is a question no one seems to know that the answer too my friend, I have the exact same damned problem and im fed up

      Delete
  5. This comment has been removed by the author.

    ReplyDelete
  6. This is a good tutorial thank you. It amazes me that maya is so widely used, I have worked with both Maya and Max and find Max much more intuitive.
    For example we are unable to view these layered textures in the hardware render, the only way to view them is if we render them. WTF!!!

    ReplyDelete