Maya for 3D Printing - Rapid Prototyping
In this course we're going to look at something a little different, creating technically accurate 3D printed parts.
# 1 02-09-2012 , 08:12 PM
Registered User
Join Date: Aug 2012
Posts: 5

Variable driven Shaders

Hello Everyone,

I haven't worked with Maya for quite a while, but I used a CAD-Application called CATIA for the last 6 years and my workflow got heavily influenced by its programmable object-handling and modelling.

For my new job I have to create a simple animation in Maya and I need your advice on how to achieve a certain effect:

I need to animate and accurately texture earth during a one year period. While the basic animation will be simply a sphere following a ellipse (motionpath), the texturing is a bit more tricky.

I have 12 textures (one for each month with different ice distribution) that I want to blend one after the other. For greater flexibility I dont want to "hardwire" the blending but rather use some kind of counter (integer-variable from 1-12) to tell my shader when to blend. The counter should be triggered automatically when earth passes one of 12 fixed points on its motion path.

And now the problem:

I dont have the slightest clue where to start. I know the basics (maybe even a bit more) of the shader network and how powerful it is, but I never use a variable driven approach to influence my shaders. Any ideas that hint me in the right direction would be really appreciated.

regards cl10b

# 2 02-09-2012 , 09:19 PM
EduSciVis-er
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
If you asked a hundred people, they would probably give you a hundred different answers. That's just to preface my suggestion since other people will probably say "that's not the best way".

I would start with a layered texture (not layered shader) plugged into a shader. Load all 12 of your textures into the layered texture, with the first one to be shown at the top, and the last one at the bottom. Then you could use set driven keys: rotation of the earth as the driver, and the alpha of each texture layer as the driven.

Halfway through your rotation animation, you will have the first 6 textures with an alpha as 0 and the next 6 with an alpha as 1.

Hope that makes sense.

Edit: Sorry, I mean the rotation of the earth around the sun, but since I see you're using motion path, hopefully you can set the driver as the distance along the path.


Last edited by stwert; 02-09-2012 at 09:22 PM.
# 3 02-09-2012 , 09:24 PM
daverave's Avatar
The thin red line
Join Date: Aug 2009
Location: England
Posts: 4,472
Im sure you can use the "use image sequence" in the texture file node. Google this and im sure you can key frame them.............dave




Avatar Challenge Winner 2010
# 4 02-09-2012 , 09:31 PM
EduSciVis-er
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
Just been playing around with the set driven key, and it doesn't look like you can choose which input alpha to drive (out of all your textures). You can probably do something fancy in the node editor, but maybe start with Dave's suggestion first user added image

# 5 02-09-2012 , 09:53 PM
daverave's Avatar
The thin red line
Join Date: Aug 2009
Location: England
Posts: 4,472
On a side note Stwert I saw this done on a egg face animation......LOL.........dave




Avatar Challenge Winner 2010

Last edited by daverave; 02-09-2012 at 09:57 PM.
# 6 02-09-2012 , 10:13 PM
EduSciVis-er
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
Nice user added image
Something to tuck away for future use.

# 7 03-09-2012 , 08:06 AM
Registered User
Join Date: Aug 2012
Posts: 5
You guys are great!

As you suggested, I played with setdriven keys last night and I think thats really the way to go. Thanks very much!

user added image

# 8 03-09-2012 , 10:33 AM
daverave's Avatar
The thin red line
Join Date: Aug 2009
Location: England
Posts: 4,472




Avatar Challenge Winner 2010
# 9 04-09-2012 , 11:42 PM
Registered User
Join Date: Aug 2012
Posts: 5
I wanted to say thanks!

Set Driven Key works very well. Btw you were right, its not possible to manipulate the alpha of each individual texture-layer directly.

But you can easily create another attribute per layer and link it to each alpha and use this new attribute as the driven instead.


The picture shows my first attempt of creating something in Maya for nearly six years. It's not perfect, but it's a start. I'll keep on tweaking the next days and hopefully the final result will be good.

My biggest concerns right now are the night-lights and the ramp-shader for the atmosphere. Both don't look very convincing...

Any criticism would be greatly appreciated!

regards

cl10b

Attached Thumbnails

Last edited by cl10b; 04-09-2012 at 11:45 PM.
# 10 05-09-2012 , 01:20 AM
EduSciVis-er
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
Great, you got it working. That looks very nice to my eye, although the "night" atmosphere is quite crisp, maybe that's what you were talking about.

# 11 05-09-2012 , 09:10 AM
daverave's Avatar
The thin red line
Join Date: Aug 2009
Location: England
Posts: 4,472




Avatar Challenge Winner 2010
# 12 05-09-2012 , 09:18 AM
Registered User
Join Date: Aug 2012
Posts: 5
Do you have any ideas how I could achieve a more fuzzy look on the outer rim of the atmosphere? I'd prefer a way that doesn't use postprocessing in an external application because I don't have the tools here to combine those passes later on for 1000 single frames.

I already tried to use a SphereFog but Mental Ray doesn't render it.

Here you can see the ramp-shader for my atmosphere, maybe you have any ideas on how to soften it up a bit

EDIT: Hey Dave, hadn't seen your post. I'll take a look at it first. Thx for your help!

EDIT2: Although your link is very interesting, the effect doesn't convince me too much. The point is, that the atmosphere has a height of lets say 100km, by directly mapping the ramp on top the color-texture (like its done in the vid) you completely loose that impression of height. I think I'd prefer mapping the ramp on a sphere with a slightly bigger diameter. That still leaves me with the problem of the sharp edge on the night site. It's probably just a minor tweak in the ramp-shader but I have no idea. I'll play with it some more and also try the shader the video explains, but any ideas are still appreciated.

Attached Images

Last edited by cl10b; 05-09-2012 at 09:41 AM.
# 13 05-09-2012 , 09:33 AM
daverave's Avatar
The thin red line
Join Date: Aug 2009
Location: England
Posts: 4,472
Just add some noise (or some thing like) to the transpancey ...........dave




Avatar Challenge Winner 2010
# 14 05-09-2012 , 09:43 AM
Registered User
Join Date: Aug 2012
Posts: 5
Your too fast for me user added image I'll try your last suggestion...

Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads