Digital humans the art of the digital double
Ever wanted to know how digital doubles are created in the movie industry? This course will give you an insight into how it's done.
# 1 11-09-2012 , 02:19 AM
Registered User
Join Date: Aug 2012
Posts: 22

Individual faces change color based on position/orientation from camera?

I guess this is the right category to post this question:

How would one take a polygon with all quads (I'm using a whirlpool-shaped funnel), and make each individual face render with a procedural solid color, to be assigned based on each face's relative distance or orientation to the camera?

I hope that's clear enough. I don't have much knowledge with expressions, MEL, or anything involving syntax, but I have a feeling it can be done somehow.

The result of this would presumably be, with a hi-res mesh, a smooth gradation of colors that change when seen through a moving camera, kind of the same coloration that you would see from a normal map - but dynamic.

Anyone have an idea how to do this?

# 2 11-09-2012 , 04:24 AM
EduSciVis-er
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
Does it have to be on a face by face basis? You can do stuff like this with the facing angle node... can't remember if it's its own hypershade node or if it's something like a surface info node. Give those a google.

# 3 11-09-2012 , 06:52 AM
Registered User
Join Date: Aug 2012
Posts: 22
@stwert:

I took your advice and found a pretty good suggestion here: https://www.3dbuzz.com/vbforum/showth...based-on-angle

(quote from the site)
"I'll describe the flow of nodes to the final Material: SamplerInfo Node (FacingRatio attr) > Ramp (Vcoord) Ramp (outColour) > Blinn (Colour) or surface shader (outcolour) if you don't want light to be a part of the result."

It's actually pretty simple to set up a quickie material that does this, but I'll need to spend some time seeing how much control it'll give me. Thanks for the suggestion, stwert!

# 4 11-09-2012 , 12:10 PM
EduSciVis-er
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
SamplerInfo node... that's the one. Getting precise control is all about adding nodes to nodes to nodes. Experiment with connecting stuff in different ways after you've got a basic color change based on camera angle.

# 5 11-09-2012 , 04:05 PM
ctbram's Avatar
Moderator
Join Date: Jan 2004
Location: Michigan, USA
Posts: 2,998
ramp shader and setting color input to facing angle works pretty well


"If I have seen further it is by standing on the shoulders of giants." Sir Isaac Newton, 1675
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