View Full Version : Clay Dragon Exercise, Florian Wild (3D)
floze 11-29-2007, 10:44 PM http://features.cgsociety.org/gallerycrits/116679/116679_1196379888_medium.jpg (http://features.cgsociety.org/gallerycrits/116679/116679_1196379888_large.jpg)
Title: Clay Dragon Exercise
Name: Florian Wild
Country: Germany
Software: Maya, mental ray, Photoshop
Some shading exercise on clay.
The model can be downloaded from the Stanford 3D Scanning Repository and consists of around 7 million triangles. All HDR images I used are courtesy of Paul Debevec.
The main intention was to try to find a way to quickly and believably light and shade a model without having to mess around with textures, UVs and crap. This bothered me because I see such great and talented modellers, like e.g. Giovanni Nakpil, with works beyond belief, but often poorly (if at all!) lit and shaded. It would be rather easy to give the digital sculptures that little analog, clayish touch.
A mel script to set up your model scene with the shader and proper rendering settings is available in the thread, see below. All you need aside is a nice HDRI, like the Uffizi one or similar.
|
|
Baltasound
11-30-2007, 11:36 AM
Even better then the Buhdda! :thumbsup:
This is a great exercise.
I often find myself trying to do the same thing.
Just put a basic shader on a model without having to fully texture it at that moment.
I've had decent results using a standard GI dome at a low intensity an area light, basic color, occlusion, and a little SSS to give it a dull wax-like look with no specular.
Just to subtly bring out some detail without worrying about proper lighting.
floze
11-30-2007, 03:39 PM
Here's a little mel script that automates the clay setup I did above:
(Maya 2008 only)
//clay automat by floze
//(C)2007 Florian Wild
//written for Maya 2008 / mental ray
//
//be sure the mental ray plugin is loaded before you run it
global proc clayit() {
//is mental ray loaded?
if ( `objExists miDefaultOptions` == 0 ) {
RenderGlobalsWindow;
}
//set some render globals stuff for good quality
setAttr "defaultRenderGlobals.enableDefaultLight" 0;
setAttr "miDefaultOptions.scanline" 0;
setAttr "miDefaultOptions.minSamples" 0;
setAttr "miDefaultOptions.maxSamples" 2;
setAttr "miDefaultOptions.contrastR" 0.05;
setAttr "miDefaultOptions.contrastG" 0.05;
setAttr "miDefaultOptions.contrastB" 0.05;
setAttr "miDefaultOptions.contrastA" 0.05;
setAttr "miDefaultOptions.filter" 2;
setAttr "miDefaultOptions.filterWidth" 0.6666666667;
setAttr "miDefaultOptions.filterHeight" 0.6666666667;
setAttr "miDefaultOptions.maxReflectionRays" 2;
setAttr "miDefaultOptions.maxRefractionRays" 2;
setAttr "miDefaultOptions.maxRayDepth" 4;
setAttr "miDefaultOptions.maxShadowRayDepth" 4;
setAttr "miDefaultOptions.shadowMethod" 1;
setAttr "miDefaultOptions.finalGather" 1;
setAttr "miDefaultOptions.finalGatherRays" 64;
setAttr "miDefaultOptions.finalGatherPresampleDensity" 2.0;
setAttr "miDefaultOptions.finalGatherPoints" 25;
setAttr "miDefaultOptions.finalGatherTraceDiffuse" 2;
setAttr "miDefaultOptions.finalGatherTraceReflection" 2;
setAttr "miDefaultOptions.finalGatherTraceRefraction" 2;
setAttr "miDefaultOptions.finalGatherTraceDepth" 4;
setAttr "miDefaultOptions.finalGatherFalloffStart" 0;
setAttr "miDefaultOptions.finalGatherFalloffStop" 0;
setAttr "miDefaultOptions.finalGatherFilter" 0;
setAttr "miDefaultFramebuffer.gamma" 0.455;
//add the final gather contrast option, which helps reducing render time
setAttr -type "string" miDefaultOptions.stringOptions[2].name "finalgather contrast";
setAttr -type "string" miDefaultOptions.stringOptions[2].value "0.45 0.45 0.45 0.45";
setAttr -type "string" miDefaultOptions.stringOptions[2].type "color";
//create the flake bump shader
$clay_flakes = `mrCreateCustomNode -asTexture "" mi_bump_flakes`;
setAttr ( $clay_flakes + ".flake_density" ) 1.0;
setAttr ( $clay_flakes + ".flake_strength" ) 0.95;
//the smaller your model, the lower the scale value should be set:
setAttr ( $clay_flakes + ".flake_scale" ) 0.5;
//create the glaze shader
$clay_glaze = `shadingNode -asShader mia_material`;
setAttr ( $clay_glaze + ".diffuse" ) -type double3 0 0 0;
setAttr ( $clay_glaze + ".reflectivity" ) 0.175;
setAttr ( $clay_glaze + ".refl_gloss" ) 0.35;
setAttr ( $clay_glaze + ".refl_gloss_samples" ) 1;
setAttr ( $clay_glaze + ".brdf_0_degree_refl" ) 0.05;
//create the actual clay shader
$clay = `shadingNode -asShader mia_material`;
setAttr ( $clay + ".diffuse" ) -type double3 0.133 0.0606616 0.017689 ;
setAttr ( $clay + ".reflectivity" ) 0.1;
setAttr ( $clay + ".refl_gloss" ) 0.05;
setAttr ( $clay + ".refl_gloss_samples" ) 1;
setAttr ( $clay + ".brdf_0_degree_refl" ) 0.05;
connectAttr -f ( $clay_flakes + ".message" ) ( $clay + ".bump" );
connectAttr -f ( $clay_glaze + ".outValue" ) ( $clay + ".additional_color" );
//create a photographic lens; todo: adding an auto focus bokeh lens
$photo_lens = `mrCreateCustomNode -asUtility "" mia_exposure_photographic`;
setAttr ( $photo_lens + ".cm2_factor" ) 10000.0;
setAttr ( $photo_lens + ".f_number" ) 1.4;
setAttr ( $photo_lens + ".vignetting" ) 10.0;
setAttr ( $photo_lens + ".gamma" ) 1.0;
//Get a renderable cam..
string $cams[] = `ls-ca`;
string $renderableCams[];
for ( $cam in $cams ) {
if ( `getAttr ( $cam + ".renderable" )`) {
$renderableCams = `listRelatives -p $cam`;
}
}
//..and connect the photographic lens to them
for ( $c in $renderableCams ) {
connectAttr -f ( $photo_lens + ".message" ) ( $c + ".miLensShader" );
}
//remove any existant IBL
miDeleteIbl;
//assign the shader to every geometric object in the scene
$clay_sg = `sets -renderable true -noSurfaceShader true -empty -name ( $clay + "SG" )`;
connectAttr ( $clay + ".outValue" ) ( $clay_sg + ".miMaterialShader" );
connectAttr ( $clay + ".outValue" ) ( $clay_sg + ".miPhotonShader" );
sets -e -forceElement $clay_sg `ls-g`;
//create a new IBL, dont forget to select a proper HDRI; I like the Uffizi one by Paul Debevec
miCreateIbl;
setAttr -type "string" mentalrayIblShape1.texture "sourceimages/HDRI/uffizi_probe.hdr";
}
..or download the attached clayit.mel, put it into a script folder, restart Maya, and run 'clayit' (without quotes of course) in the script line or the script editor.
The script attaches a clay shader to all objects in the scene, tunes some render globals, creates an image based lighting node where you should put in a proper HDR texture, and connects a photographic lens to the renderable cameras. Its plain, its straight forward, and its only clay. Run the script and hit render.
You might need to tune the bump flakes' scale value, depending on how large your model is.
That's the happy Buddha with the default clay automat:
http://img406.imageshack.us/img406/1230/4trethm4.jpg
Enjoy.
ZippZopp
11-30-2007, 04:06 PM
very nice! thanks so much for sharing!
visionmaster2
11-30-2007, 04:31 PM
Thank you so much !! :thumbsup:
StephaneD
11-30-2007, 05:28 PM
very nice shader !
thanks for sharing
Baltasound
11-30-2007, 05:53 PM
Gonna try it right now thanks a lot :)
RicardoAriza
11-30-2007, 11:08 PM
Hey Florian,
Man your fast! Your work's looking great...you've made leaps and bounds with your stuff since we last spoke. I hope your doing good as well...are you coming back the US anytime soon? Thanks again for sharing the clay script. Im definitely going to be playing around with it to make some clay renders of my own.
Cheers,
Ricardo
zforge
11-30-2007, 11:29 PM
Hey Floze,
I am totaly with you on that. Texturing by hand is too time consuming,
specially when you have lots of stuff to texture. I often try to use 3d textures,
they don't even need uv's, just throw 'em on and be happy. And use them over and over again. And when needed you still can bake them to paintable 2D textures.
I look forward to seeing more work from you !
bizgraphix308
12-01-2007, 01:07 AM
Florian,
I know a sculptor how can render that in clay if you want.
Just thought I'd be of help,
- Sam
floze that's great thanks, only 1 thing. i've notcied mi flake scales it self basically based on the total size of the object it's attached to...meaning if you have more than 1 object on the model with different scales they wont match. is there a way to average or have the scale fixed on this node without combining all objects(since uv overlap and mr/maya issues with uv channels wont allow this)?
floze
12-01-2007, 03:44 PM
Hey Florian,
Man your fast! Your work's looking great...you've made leaps and bounds with your stuff since we last spoke. I hope your doing good as well...are you coming back the US anytime soon? Thanks again for sharing the clay script. Im definitely going to be playing around with it to make some clay renders of my own.
Cheers,
Ricardo
Yo Ricardo, dont know if I'll be back in the US anytime soon, perhaps if something interesting turns out anywhere, but I'm not planning on it right now, we'll see.. :)
I hope the script stuff is working; again, its for Maya 2008 only at this time. Should have checked the version as some guys and gals seem to have problems running this on Maya 8.5 and lower, for obvious reason though.
@Gal: Yeah I know, but with simplicity comes hassle, sometimes.. the mi_bump_flakes just work this way. You could however duplicate the shading network as seen here:
http://img505.imageshack.us/img505/9043/ffdsarj2.jpg
..and assign it to the according objects, to set the scale individually.
@bizgraphix308: How do you mean exactly? Feel free to use the shader wherever you like! :)
actually after careful inspection the scale doesnt vary..something else is happening, the reaction to light seems different..the intensity, oh i forgot to ask how would you combine the flake bump with other bump nodes such as the models generated bump map or another flake with a diff scale?
floze
12-01-2007, 09:51 PM
actually after careful inspection the scale doesnt vary..something else is happening, the reaction to light seems different..the intensity, oh i forgot to ask how would you combine the flake bump with other bump nodes such as the models generated bump map or another flake with a diff scale?
The size of the flakes is derived from the object's space, hence it is directly depending on the scale value (transform) of your objects.
To add any further bump you simply (yeah I know.. not quite;)) do the following:
http://img141.imageshack.us/img141/8641/dfewrwo4.jpg
The connections are as follows:
file.outAlpha -> bump2d.bumpValue
mi_bump_flakes.outValue -> bump2d.normalCamera
bump2d.outNormal -> misss_set_normal.normal
misss_set_normal.message -> mia_material.bump
You can stack up even more bump2d nodes on top of each other, by connecting their .outNormal into their .normalCamera correspondingly. The only thing is you need a misss_set_normal (found under mental ray materials) at the end of the chain to translate the bump information into mental ray world.
floze
12-01-2007, 10:18 PM
I was crazy enough to add some nutty particle tracing auto focus of a mia_lens_bokeh to the script. Try it if you dare.
(Its more of an idea rather than what you would really expect from a fully worked out utility)
//clay automat by floze
//(C)2007 Florian Wild
//written for Maya 2008 / mental ray
//
//be sure the mental ray plugin is loaded before you run it
global proc clayit() {
//catch wrong version
if ( `about -v` != "2008" ) {
error "Only works with Maya 2008! :(\n";
}
//make sure some mental ray stuff is loaded
RenderGlobalsWindow;
//set some render globals stuff for good quality
setAttr "defaultRenderGlobals.enableDefaultLight" 0;
setAttr "miDefaultOptions.scanline" 0;
setAttr "miDefaultOptions.minSamples" 0;
setAttr "miDefaultOptions.maxSamples" 2;
setAttr "miDefaultOptions.contrastR" 0.05;
setAttr "miDefaultOptions.contrastG" 0.05;
setAttr "miDefaultOptions.contrastB" 0.05;
setAttr "miDefaultOptions.contrastA" 0.05;
setAttr "miDefaultOptions.filter" 2;
setAttr "miDefaultOptions.filterWidth" 0.6666666667;
setAttr "miDefaultOptions.filterHeight" 0.6666666667;
setAttr "miDefaultOptions.maxReflectionRays" 2;
setAttr "miDefaultOptions.maxRefractionRays" 2;
setAttr "miDefaultOptions.maxRayDepth" 4;
setAttr "miDefaultOptions.maxShadowRayDepth" 4;
setAttr "miDefaultOptions.shadowMethod" 1;
setAttr "miDefaultOptions.finalGather" 1;
setAttr "miDefaultOptions.finalGatherRays" 64;
setAttr "miDefaultOptions.finalGatherPresampleDensity" 2.0;
setAttr "miDefaultOptions.finalGatherPoints" 25;
setAttr "miDefaultOptions.finalGatherTraceDiffuse" 2;
setAttr "miDefaultOptions.finalGatherTraceReflection" 2;
setAttr "miDefaultOptions.finalGatherTraceRefraction" 2;
setAttr "miDefaultOptions.finalGatherTraceDepth" 4;
setAttr "miDefaultOptions.finalGatherFalloffStart" 0;
setAttr "miDefaultOptions.finalGatherFalloffStop" 0;
setAttr "miDefaultOptions.finalGatherFilter" 0;
setAttr "miDefaultFramebuffer.gamma" 0.455;
//add the final gather contrast option, which helps reducing render time
setAttr -type "string" miDefaultOptions.stringOptions[2].name "finalgather contrast";
setAttr -type "string" miDefaultOptions.stringOptions[2].value "0.45 0.45 0.45 0.45";
setAttr -type "string" miDefaultOptions.stringOptions[2].type "color";
//create the flake bump shader
$clay_flakes = `mrCreateCustomNode -asTexture "" mi_bump_flakes`;
setAttr ( $clay_flakes + ".flake_density" ) 1.0;
setAttr ( $clay_flakes + ".flake_strength" ) 0.95;
//the smaller your model, the lower the scale value should be set:
setAttr ( $clay_flakes + ".flake_scale" ) 0.5;
//create the glaze shader
$clay_glaze = `shadingNode -asShader mia_material`;
setAttr ( $clay_glaze + ".diffuse" ) -type double3 0 0 0;
setAttr ( $clay_glaze + ".reflectivity" ) 0.175;
setAttr ( $clay_glaze + ".refl_gloss" ) 0.35;
setAttr ( $clay_glaze + ".refl_gloss_samples" ) 1;
setAttr ( $clay_glaze + ".brdf_0_degree_refl" ) 0.05;
//create the actual clay shader
$clay = `shadingNode -asShader mia_material`;
setAttr ( $clay + ".diffuse" ) -type double3 0.133 0.0606616 0.017689 ;
setAttr ( $clay + ".reflectivity" ) 0.1;
setAttr ( $clay + ".refl_gloss" ) 0.05;
setAttr ( $clay + ".refl_gloss_samples" ) 1;
setAttr ( $clay + ".brdf_0_degree_refl" ) 0.05;
connectAttr -f ( $clay_flakes + ".message" ) ( $clay + ".bump" );
connectAttr -f ( $clay_glaze + ".outValue" ) ( $clay + ".additional_color" );
//get renderable cams
string $cams[] = `ls-ca`;
string $renderableCams[];
int $camNumber = 0;
for ( $c in $cams ) {
if ( `getAttr ( $c + ".renderable" )`) {
$renderableCams[$camNumber] = $c;
$camNumber++;
}
}
//create and assign autofocussing bokeh lens
$bokeh_lens = `mrCreateCustomNode -asUtility "" mia_lens_bokeh`;
setAttr ( $bokeh_lens + ".plane" ) `traceDistance( $renderableCams[0] )`;
setAttr ( $bokeh_lens + ".radius" ) 0.5;
setAttr ( $bokeh_lens + ".samples" ) 1;
connectAttr -f ( $bokeh_lens + ".message" ) ( $renderableCams[0] + ".miLensShaderList[0]" );
//create a photographic lens; todo: adding an auto focus bokeh lens
$photo_lens = `mrCreateCustomNode -asUtility "" mia_exposure_photographic`;
setAttr ( $photo_lens + ".cm2_factor" ) 10000.0;
setAttr ( $photo_lens + ".f_number" ) 1.4;
setAttr ( $photo_lens + ".vignetting" ) 10.0;
setAttr ( $photo_lens + ".gamma" ) 1.0;
//assign it to the cameras
connectAttr -f ( $photo_lens + ".message" ) ( $renderableCams[0] + ".miLensShaderList[1]" );
//remove any existant IBL
miDeleteIbl;
//assign the shader to every geometric object in the scene
$clay_sg = `sets -renderable true -noSurfaceShader true -empty -name ( $clay + "SG" )`;
connectAttr ( $clay + ".outValue" ) ( $clay_sg + ".miMaterialShader" );
connectAttr ( $clay + ".outValue" ) ( $clay_sg + ".miPhotonShader" );
sets -e -forceElement $clay_sg `ls-g`;
//create a new IBL, dont forget to select a proper HDRI; I like the Uffizi one by Paul Debevec
miCreateIbl;
setAttr -type "string" mentalrayIblShape1.texture "sourceimages/HDRI/uffizi_probe.hdr";
}
global proc float traceDistance( string $cam ) {
$camTrans = `listRelatives -p $cam`;
float $camPos[] = `xform -q -t -a -ws $camTrans`;
float $camRot[] = `xform -q -ro -a -ws $camTrans`;
$partiAir = `air -pos $camPos[0] $camPos[1] $camPos[2] -m 10000 -att 0 -dx 0 -dy 0 -dz -1 -s 5 -iv 1 -iro 1 -vco 0 -es 0 -mxd -1 -vsh none -vex 0 -vof 0 0 0 -vsw 360 -tsr 0.5`;
rotate $camRot[0] $camRot[1] $camRot[2] $partiAir;
$parti = `particle -p $camPos[0] $camPos[1] $camPos[2] -c 1`;
event -die 0 -count 0 -proc stopTrace $parti;
connectDynamic -f $partiAir $parti;
$stuff = `listTransforms "-type mesh"`;
if ( size( $stuff ) ) {
collision -r 0 -f 1 -o 0.001 $stuff $parti;
} else {
delete $parti $partiAir;
error "No objects in scene?\n";
}
$pbMin = `playbackOptions -q -min`;
$pbMax = `playbackOptions -q -max`;
$current = `currentTime -q`;
currentTime -e 0;
playbackOptions -e -min 0;
playbackOptions -e -max 100;
play -w;
float $intersectPos[] = `getParticleAttr -at position ( $parti[0] + ".pt[0]" )`;
playbackOptions -e -min $pbMin;
playbackOptions -e -max $pbMax;
$distanceFromCam = `mag ( << ($intersectPos[0] - $camPos[0]), ($intersectPos[1] - $camPos[1]), ($intersectPos[2] - $camPos[2]) >> )`;
delete $parti $partiAir;
currentTime -e $current;
return $distanceFromCam;
}
global proc stopTrace( string $particleName, int $particleID, string $objectName ) {
play -st 0;
}
I would definitely have to grind some things down on this, and improve others, but I thought some of you guys would think its funny enough to share it. :p
Magnus3D
12-01-2007, 10:36 PM
Great results! real nice and realistic looking :)
This gives me inspiration enough to try to recreate this shader for both Maxwell and Fryrender.
/ Magnus
cool, thanks a bunch floze..ill play around with this. silly question how can you see .normalcamera of a bump2d node in the connection editor? can i only do it via the script editor?
being greedy and all you think you can share some info on your ceramic shader? dont have to upload it just briefly explain the network?
thanks
floze
12-02-2007, 12:40 PM
cool, thanks a bunch floze..ill play around with this. silly question how can you see .normalcamera of a bump2d node in the connection editor? can i only do it via the script editor?
being greedy and all you think you can share some info on your ceramic shader? dont have to upload it just briefly explain the network?
thanks
To answer the 1st question: switch on 'Show Hidden' in the input display. And the second question: well, its nothing esoteric. Its a mia_material with a very low Reflectivity (0.1) and Glossiness (0.05) value and a minor tweaked BRDF (the 0° reflection is lowered to 0.05) for the base, underlying surface. And on top of that I added a mia_material with the same BRDF but with higher Reflectivity (0.175) and Glossiness (0.35) values, to simulate a glaze layer. For reason of simplicity I plugged the glaze material into the Additional Color slot of the base material, which does nothing but a 'base + glaze' operation. Thats it, no rocket science.
ah, thanks again.
here's a modification of your shader (mostly the bump, adjusted based on normal direction and etc) and instead of an hdri i used 3 arealights. it's a model in progress, still working on his hair. 1 thing i couldnt figure out is how to get rid of the low reflection sampling of physical lights that you can spot on his forehead...i've increased sampling in both the mia gloss shaders, area light shape..aa.. nothing. beyond me..
http://galroiter.com/images/wip/high/clay_disp.jpg
floze
12-02-2007, 07:19 PM
ah, thanks again.
here's a modification of your shader (mostly the bump, adjusted based on normal direction and etc) and instead of an hdri i used 3 arealights. it's a model in progress, still working on his hair. 1 thing i couldnt figure out is how to get rid of the low reflection sampling of physical lights that you can spot on his forehead...i've increased sampling in both the mia gloss shaders, area light shape..aa.. nothing. beyond me..
http://galroiter.com/images/wip/high/clay_disp.jpg
Hey, this looks nice!
Hmm hard to tell whats going on with the artifacts there.. afaik the mi_bump_flakes do not use any filtering, so it might get crispy when the scale is very low, or when looked at at sharp angle... do you use any other bump maps in your setup?
thanks
nope it's just the flakes with an intensity network,flakes arent big either on the face atleast...i know it's the reflection on the physical light but weird that nothing can sample/filter it. not to mention it's really hard to control that specifc area light's reflection intensity. shape intensity under the area light doesnt affect it, it's the physical light value which does... but adjusting it also changes the amount of light coming in. MIA materials are...tricky... i know it was made so artists wont be able to "break" anything by mistake but it can be a pain sometimes to control.
floze
12-03-2007, 11:58 AM
thanks
nope it's just the flakes with an intensity network,flakes arent big either on the face atleast...i know it's the reflection on the physical light but weird that nothing can sample/filter it. not to mention it's really hard to control that specifc area light's reflection intensity. shape intensity under the area light doesnt affect it, it's the physical light value which does... but adjusting it also changes the amount of light coming in. MIA materials are...tricky... i know it was made so artists wont be able to "break" anything by mistake but it can be a pain sometimes to control.
There's no actual need to use the physical_light shader anymore. Try the new mia_portal_light instead. You can use them as light cards if you build a black, surrounding, environment blocking object around your scene.
thanks again! so you would use portal lights instead of the "trad" area light+physical light setup for anything the old area lights were used for? even direct illumination situations?
ha1984ha
12-03-2007, 06:59 PM
Wow excellent!
I really love it
JupiterSunset
12-04-2007, 06:57 PM
reschpekt!
sunnypure
12-31-2007, 08:34 AM
This dragon is so short...
CGTalk Moderation
12-31-2007, 08:34 AM
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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.