Creating a random shaded look for repeating items - techniques?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 01 January 2013   #1
Question Creating a random shaded look for repeating items - techniques?

I am learning UV texturing/shading. I modeled a quick elevator in about 2 days and I want to shade it using Maya 2013. Right now, it has flat shaders and a few procedural shaders that look really bad.

http://i.imgur.com/kaW2J.jpg

I'd like to get some grunge and metal photos and create a more realistic scene. I'm learning the whole UV shading process, and I like it. But I don't want every repeating piece of geometry to look identical to the last. I'd like them to be more random.

Are there good practices for accomplishing this? Perhaps combining different mappings for color, specular, and reflective properties to create variety?

Thanks
 
Old 01 January 2013   #2
If they're static, 1 way is to utilize the 3d procedural texture nodes. It can be used as a mask to blend in a second texture (such as rust) on top of your base material. Or simply lay on top to create color or value variety.
 
Old 01 January 2013   #3
you can also add an attribute to each object, assign a random value between 0 and 1 then pipe this through a switch that calls the v value from a ramp, which can then in turn drive diffuse, reflect, procedural textures and pretty much anything else. With a pretty simple script you can use this to randomize across many objects with only one shader.

cheers

Craig
 
Old 01 January 2013   #4
Craig (skunk),

Are there examples of this anywhere? I have, literally, never scripted in Maya.
 
Old 01 January 2013   #5
you only really need to script the randomizing of values on your custom attributes.

the MEL code below will add an attribute if it does'nt exit otherwise it will just random the values between the min and max threshold.

copy and paste the code into your script editor.
ctrl + a .. to select text.
ctrl + enter ..to execute text.
EDIT.. select the objects you want to add attributes to before you execute ...END EDIT

you only need to edit the 3 variables at the top of the code.
change "myattr" to "anything you like" (this will be your attribute name). Also you can change the $min and $max values ( your random number will be generated between this range).

cheers,
Craig.




{
string  $attribute = "myattr"; // your attribute name here
float $min = 0.8; // your min vslur
float $max = 1; //your max value    
    
string $sel[] = `ls -sl`;

for($i=0;$i<size($sel);$i++)
    {
    if(! `attributeExists $attribute $sel[$i]`) // check if the attribute already exists
        {
        addAttr -ln $attribute -at double  $sel[$i];  //add attribute
        setAttr -e-keyable true ($sel[$i] + "." + $attribute); 
        float $rand = rand($min,$max);     //randomize
        setAttr ($sel[$i] + "." + $attribute) $rand; //set attribute value
        }
     else 
        {
        float $rand = rand($min,$max);     //randomize
        setAttr ($sel[$i] + "." + $attribute) $rand; //set attribute value
        }  
     }
}    

Last edited by skunk184 : 01 January 2013 at 07:21 AM.
 
Old 01 January 2013   #6
This is fascinating. Thanks for posting. I'll be studying this script to see how and why it does its magic.



----------S
 
Old 01 January 2013   #7
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 07:02 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.