PDA

View Full Version : why are some cg elements multiplied, whereas the rest is added?


mister3d
01-30-2010, 10:38 PM
Why are some cg elements multiplied, whereas the rest is added? For example we add specularity and reflection, but we need to multiply diffuse by GI? What's the logic behind it?

scrimski
01-30-2010, 11:56 PM
Simple math.

Basically everything that's darkening the picture is substracted/multiplied.

mister3d
01-31-2010, 06:59 AM
Simple math.

Basically everything that's darkening the picture is substracted/multiplied.
I understand how addition and multiplication works. But why not to make all elements with addition? For example GI and diffuse?

Aneks
02-01-2010, 12:23 PM
in a linear workflow everything is added except occlusion and shadows. Check how your renderer compiles theses passes internally.

mister3d
02-01-2010, 06:39 PM
in a linear workflow everything is added except occlusion and shadows. Check how your renderer compiles theses passes internally.
http://img46.imageshack.us/img46/9789/diagram01.jpg (http://img46.imageshack.us/i/diagram01.jpg/)
This is how vray compiles them, and you do the same thing with GI and rawlighting in mental ray.

Aneks
02-02-2010, 11:35 AM
never really used vray. But with PRman and renderman style renderers when multiplying in comp you need to be careful of how the renderer deals with anti-laising and sampling. Ideally you would not actually do any AO or reflection occlusion multiplication in your compositing app.

I know this is an issue with mental ray. Master Zap did a blog entry about this showing how post multiplication in mental ray is not accurate. His advice was that only additive processes can be postponed.

sundialsvc4
02-03-2010, 12:57 AM
Every modern-day package does it this way.

There are really two very-simple factors to consider here:

(1) "When the dust finally settles," the computer is dealing with a series of (extremely large) files which contain information about every pixel on a (also extremely large) rectangular (or three-dimensional...) screen. It's dealing with a so-called "n-tuple" of information about every single point.

(1a) What it does with "all those numbers" is entirely up to you. :surprised

(2) Sometimes it "pays" to do some of the computations ahead of time. (A classical example is the "anti-aliasing" which helps to eliminate "jaggies.") But, "once you have added the chocolate and sugar to the milk, you can never take it out again."

So... what you are actually dealing with here, from the computer's point of view, is "a data processing pipeline" involving a rather outrageous amount of math. (Which, fortunately, a digital computer is great at doing.) Pour all your inputs into the start of the pipeline, and (if you're good at this...) the desired output pops out the other end. You just have to plan accordingly.

CGTalk Moderation
02-03-2010, 12:57 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.