Creating a carpet and rug shader using Maya’s Procedural textures

Creating a carpet and rug shader using Maya’s Procedural textures

For this tutorial, I will be using VRay shader and Maya’s procedural textures, but please note that this tutorial will work not matter what type of render system you are about to use. It works great in both Mental Ray and Maya software renderer. I’ll talk a bit about modeling, cause no matter how good your shader is, if the 3d model isn’t done right, the look you are going for will not be easily achieved. I wanted a rounded rug, so I started with a simple cylinder primitive and deleted its bottom face.

 

maya cylinder primitive

 

Then I selected the top edge that goes all around and added a small bevel using the Bevel tool found under Edit Mesh. Make sure that bevel is not very tight cause then you will end up with a very sharp unrealistic edge to the rug and the rug will look like it’s made of plastic. Also you can notice that I added an extra edge using the Insert Edge Loop Tool found under Edit Mesh just so I can hold that edge.

 

edge bevel 3d rug carpet

 

Once I finished the modeling, I will need to UVmap; this so I can get the effect that I’m looking for. I know we are using procedural textures and when using procedural texture you don’t need to do any UVmapping, please bare with me. I won’t do any fancy UV mapping you just need to create a Planar mapping by going to  Create UVs > Planar mapping 

The result will be something like this:

 

3d carpet modeling and shading

 

Now we just have to rotate the polyPlanarProj in the Channel Box 90 in X axis, and set the projection Width and Height to 25, the number might be different for you, just make sure the polyPlanarProj is square and will cover the entire 3d model. Your planar mapping and Channel Box should look like this:

 

3d carpet texturing maya

 

Now we start working on the Rug/Carpet Shader. Again for this tutorial I’m using a VRay shader; feel free to use a Lambert, Blinn or any type of shader you want . Ctrl+ double click (windows) cmd + double click (mac) to rename the shader.

 

vray shader carpet maya

 

Next we will create a Maya 2d texture, a Ramp; middle click and drag the ramp that you just created over the Vray Shader, and drop it into the Default drop down.

 

3d carpet procedural shading maya

 

Let’s tweak the ramp so we can get the style that we are looking for! Double click on the 2D Ramp shader so it opens up in the Attribute Editor, change the Ramp type to Circular Ramp, the Interpolation to none so we can get solid color edges in the ramp and just start adding colors and moving them around to achieve the look that you want. Feel free to add as many colors as you like.

 

carpet and rug ramp shader maya

 

Now let’s add the bump shader to the carpet/rug shader. We start by creating a Cloth material, which can be found under the 2D Textures in the Hypershade.

 

bump shader carpet rug

 

Middle click and drag the cloth that you just created over the Vray shader, and drop it into the Bump Map drop down.

 

carpet rug texture tutorial

 

Double click on the Cloth shader so we can start tweaking it. To get the look that we are looking for, please feel free to experiment with the setting, cause you might come up with something that works best for the project that you are working on.

 

how to create a carpet shader in maya

 

Once we have the Cloth shader tweaked and ready, back into the hyper shader, double click on the place2dTexture that is linked to the cloth shader. Now in the Attribute Editor change the Repeat UV to 100 and 100, this will make the cloth shader repeat 100 times along the U and V. Again, feel free to experiment with this value cause you might need more or less to achieve the style that you are going for.

 

3d rug texture tutorial maya

 

 

Please Note: When adding the bump map on a Maya Shader like Lambert, Blinn, Phong and Phong E you will get an extra utility node called bump2d, double click on the Bump2d node and in the attribute editor tweak the Bump depth to change the strength of that bump, going all the way to 0 you will have no bump, going in the negative you will get an inward bump rather than going out.

 

shading a rug using maya

 

Now we just apply the shader to the cylinder that we created. You can apply the shader to the cylinder either by middle click drag and drop the shader from the Hypershade window unto the cylinder, or select the cyclinder then in the Hypershade while the cylinder is still selected middle click on the Rug_carpet shader and select Assign Material to Selection.

 

texturing a 3d carpet using procedural maya

 

Now if we do a render to the rug we might get something like this. Please note that the scene that I’m rendering has multiple light setup in it; you can check out the scene and the lighting setup by visiting the Waiting for Santa scene. As you can see the result came out nice, but the cylinder is very chopy cause it has a low number of faces.

 

carpet texturing

 

Here is the interesting part which happened by mistake while working on this project: I added a smooth modifier to the cylinder – you can do that by going to Mesh > Smooth  – just so I can make the rug smoother. Select the cylinder and go into the Channel Box. You will see under INPUTS something called polySmoothFace; click on that to expand it and under Divisions add 2.

 

3d carpet texturing maya

 

This will add more subdivisions to our cylinder so it doesn’t look so faceted, but because we did UVmaping to this cylinder and because it was low in polycount while adding the smooth modifier it caused the Rug shader to stretch giving me that lovely waves on the carpet circles which made the carpet look more interesting. This is what I would call a happy creative accident which gets you some awesome results.

 

3d rug shader procedural

 

I really hope you find this tutorial helpful, and below you can see some example of the styles that you can achieve with this simple shader. And I have also uploaded the shader tree in the Hypershade for each one, All shaders on the carpets and rugs are 100% Procedural textures.

 

3d rug shader vray for maya

 

3d rug tutorial maya procedural shaders tutorialvray for maya shaders


About the Author

oasim

I'm Oasim Karmieh, people on DeviantArt know me as Pixelbudah. I have been working in CG and web design for 8 years now gathered lots of experience from Web, Graphic Design, 3d modeling, Animation and Lighting (and still tying new stuff). I Love trying new tools and techniques, from modeling to animation to Illustration to matte painting and Photography.

Comments:

  1. Excellent tutorial! Congrats!
    Cant seem to get the creases with the smooth modifier though, i must be doing somethig wrong haha

  2. [...] Carpet or Rug http://www.pixelophy.com/?p=1110 [...]

  3. thanks for the tutorial! very helpful!

    • Pleasure is all mine, really glad you found it helpful!

  4. [...] used this tutorial to help develop my wood materials, and this one to help with the material for the chairs. All other materials were created by [...]

  5. This is So Awesome ! thanks .

    • Pleasure is all mine!

Leave a Reply




  • Twitter feed loading...