Maya: Shader Networks


#1

Here is the sticky everyone has been asking for!

Lets see the shaders :slight_smile:


#2

Let me start off with a simple one :slight_smile:

P.s. THANK YOU FOR THE STICKYYYYYYY :beer: :beer: :beer:


#3

Here’s a pretty neat shader i came up with a couple of months ago, i was despeartly trying to make the whater shine when the sun hits it, like small lensflares. An example of that is in the warcraft 3 trailer when the army enters the caste in the beginning.

So anyway, sorry that I don’t have so many pictures but i thought that it’s better to post one mesage instead of 5 or so.

here’s some settings:

blinn2:
color = black (it’s up to you, but if you wanto do like the example)

ramp1:
U Ramp
Color = (ramp B on the attatched image)

ramp2:
U Ramp
Color = (ramp A on the attatched image)

shaderGlow1: (I havn’t tried what settings that are importait yet, so I write them all to be on the safe side.)
Quality = 5
Threshold = 0.200
Radial Frequency = 0
Star Points = 6.923 (You can edit this if you want more or less “lines” on the stars)
Rotation = 190 (Just edit this to edit the rotation of the stars)
Auto Exposure = unchecked
Glow Color = Grey
Glow Intensity = 0.94
Glow Spread = 0.035
Glow Eccentricity = 0.128
Glow Radial Noice = 0.615
Glow Star Level = 4
Glow Optacy = 0
Glow Ring intensity = 0
Glow Ring Frequency = 0
Glow Filter Width = 1

Connections:
samplerInfo1.facingRatio - ramp1.uCoord
samplerInfo1.facingRatio - ramp2.uCoord
ramp1.outColor - blinn2.incandescence
ramp2.outColor - blinn2.glowIntensity

If you want more stars you could add some white “Lines” , lines that are as small as posible near the bottom on ramp2.

Just add a light and viola! =)
MSG Me if you find any errors or have any questions.

Here is a better example, but you have to look close on the picture to see the stars: http://213.66.208.141/hemsida/Pics/Maya/back_blackbeauty.jpg


#4

Color editing network

Create

1 File Texture (file1)
4 Ramps (ramp1, ramp2, ramp3, ramp4)
1 RGB to HVS (rgbToHvs1)
1 HVS To RGB (hvsToRgb1)
1 Shader (lambert2)

The Ramps

Make ramp1 white in the Top and Black in bottom
Make ramp2 Red in the Top and Black in bottom
Make ramp3 Blue in the Top and Black in bottom
Make ramp4 Green in the Top and Black in bottom

Connections

file1.outColorG > ramp4.vCoord
file1.outColorR > ramp2.vCoord
file1.outColorB > ramp3.vCoord

ramp4.outColorG > rgbToHvs1.inRgbG
ramp2.outColorR > rgbToHvs1.inRgbR
ramp3.outColorB > rgbToHvs1.inRgbB

rgbToHvs1.outHvsH > hvsToRgb1.inHvsR
rgbToHvs1.outHvsS > hvsToRgb1.inHvsG
rgbToHvs1.outHvsV > ramp1.vCoord

hvsToRgb1.outRgb > lambert2.color

How to Use

With this setup you can edit contrast and Color of a image like in Photoshop.
Use Ramp1 to edit light and dark areas of the file like the “Curves” function in Photoshop…
The ramp2,3,4 is used to add or remove color from the Image file.


#5

Hi,

since I started learning how to render in Maya I´ve created some thousand samplerInfonodes and connected them into the vCoord of a ramp. (very timeconsuming)

But now this is history, cause I learned mel :slight_smile:

have fun

// siRamp.mel Script © Paul Dreisen 2002
// mailto: basspaul@web.de
// Version 0.2c
// this Script creates a basic bw-Ramp with a samplerInfoNode connected into the vCoord.

global proc siRamp()

{

// needed nodes

string $ctrlRamp = shadingNode -at ramp;
string $si = shadingNode -au samplerInfo;

// connections

connectAttr -f ($si + “.facingRatio”) ($ctrlRamp + “.vCoord”);
removeMultiInstance -break true ($ctrlRamp + “.colorEntryList[1]”);

// settings for nodes

setAttr ($ctrlRamp + “.colorEntryList[0].position”) 0;
setAttr ($ctrlRamp + “.colorEntryList[1].position”) 1;
setAttr ($ctrlRamp + “.colorEntryList[0].color”) 0 0 0;
setAttr ($ctrlRamp + “.colorEntryList[1].color”) 1 1 1;

select $ctrlRamp;
editSelected;

}


#6

this is all nice and all, but are there any ways that I can learn what I’m actually doing, when tryng to do a shader?
any links would be warmly welcomed :slight_smile:


#7

try reading the manual =)


#8

This thread shows how to use a ramp shader to give the effect of a rim light that always appears only on the top of the object, regardless of it’s position or rotation.


#9

Here’s a description of how that ramp shader Floyd posted about above works. It’s fairly simple!

The end result is basically a shader that has a rim around it’s edge (like with a toon outline or rim lighting effect) but you can choose how much (top half in this case) gets the rim effect.

All you need to use is:

1 shader (ie lambert)
2 ramp nodes (not the new ramp shader)
1 SamplerInfo node

The first ramp node is used to control how much of your object (vertically) recieves the rim effect. The second ramp when combined with the SamplerInfo node’s much loved ‘FacingRatio’ attribute, gives you the rim effect in the colour of your choice.

You could of course plug this network into any other shading attribute of a shader to create say, a rim of transparency or a rim of icandescence.

There’s an attached image to show the exact construction.


#10

i’ll try to compile a list of links that helped me to better understand how to write shaders

  • leigh’s tutorials on texturing

part 1 - introduction - http://www.cgtalk.com/showthread.php?s=&threadid=6648
part 4 - diffusion - http://www.cgtalk.com/showthread.php?s=&threadid=11053
part 5 - specularity/reflectivity - http://www.cgtalk.com/showthread.php?s=&threadid=17631

  • metals and reflections (by Neil Blevins) - (specularity, reflectivity, fresnel, …)

http://www.neilblevins.com/cg_education/metal_and_refs/metal_and_refs.htm

  • water links - a collection of links to information regarding rendering of water - quite extensive and not restricted to water

http://www-public.tu-bs.de:8080/~y0013390/pov/water/water_app1.html

  • bill’s realitiy clinic

diffusion -> http://visualmagic.awn.com/mag/june98/brc.html
photorealistic 3d / part 1 -> http://visualmagic.awn.com/html/regulars/feb98-brc.html
photorealistic 3d / part 2 -> http://visualmagic.awn.com/html/regulars/march98-brc.html
photorealistic 3d / part 3 -> http://visualmagic.awn.com/mag/april98/billsrealityclinic.html

  • Light Measurement Handbook - very thorough book about light and its interaction with surfaces - it describes many light phenomenons (e.g. how light is irradiated from human skin)

http://www.intl-light.com/handbookthanks.html

  • IOR tables

http://hokum.freehomepage.com/Content/Reference/Ref_Refract.html

http://www.glenbrook.k12.il.us/gbssci/phys/Class/refrn/u14l1d.html

  • DVGarage - a lot of tutorials on how to create maps and many other observations

http://www.dvgarage.com/garage/a2d/tut/tutpast/tutpast_1_25.php


#11

mental-ray related links

Antialiasing and Mental Ray 2.x - http://www.countywest.com/marek/tutorials/Antialiasing_and_Mental_Ray/Antialiasing_and_Mental_Ray.htm

Ed Hariss’s mental-ray (in XSI) link collection - http://www.edharriss.com/tutorials/tutorials_render_XSI.html

Volume Caustics and Subsurface Scattering Simulation - http://www.motiondesign.biz/


#12

here’s a fairly simple shader for a car surface

Shader


#13

B-Holm,

I made a really simple example of a fake fur shader, and am kind of toying with a tutorial for it, describing what the different nodes and stuff do.

Here’s one variation of it…
http://lq.amsterdamned.org/images/child/teddybear4.jpg

No really complex stuff… But if you’re not used to working with Hypershade you might find it interesting.


#14

Carina, thanks alot for taking the time to do one!
I know some simple stuff in the Hypershade.
But when I’m connection different I don’t always know what I am doing really :confused:
so please post something in thise thread when your done with the tut :slight_smile:


#15

Right I posted the tutorial, this is the thread for it…


#16

KEEP IT GOING PEOPLE :smiley:


#17

simple network to get procedural hair :


#18

Hi all,

Yep, this is a cool thread and i’ve been waiting a while for it. However, it’s not as cool as it could be. For me anyways:) . I have barely scratched the surface of Maya’s shading networks and what seems to be holding me back is a lack of basic knowledge. Actually, it seems a lack of advanced knowledge. Vectors products, dot products, ray direction, normal camera, plus/minus average???..?..?.! What on God’s green earth does all this mean. I went to school why don’t i understand this! Was i bunking off the day the teacher explained all this? Hmmm… maybe.

What i imagine a lot of us need is for some brave soul to write a kind of introductory knowledge type of tutorial, which includes:-what all the nodes do(in a non geek way and with pretty pictures), basic and advanced networks, tips/tricks etc etc. As a reward for doing this i will impart MY knowedge of how i bedded 2000+ women.

And yes, i’ve read the manual.


#19

" As a reward for doing this i will impart MY knowedge of how i bedded 2000+ women. "

i didn’t know pornstars read the CGtalk forum too…


#20

Ok here this thread kinda died but was a really cool idea so here is something to kick start it a real simple one most of you probably already know but if anyone missed out.

In 4.5 there is this new node called a height field its used to preview the ocean shader.

Create the node in hypershape and it will create a plane for you, what i then did was map the out alpha of the ramp to the discplament value of the height node, then i just made the ramp repeat its self a few times and screwed around with different settings you can get some cool results… you could map anything into the discplacement value. Under the attributes of the height field you can increase the resolutoin.

You can’t render this out its only for real time preview (its pretty dam fast) but if you want to render this just make a nurbs plane with the same amount of division and connect your ramp/texture into the discplacement value.