PDA

View Full Version : passes for an ambient occlusion gi fake


Simon Wicker
03-16-2004, 05:25 AM
here is one recipe that you can use to make a fake gi render using any of the available ambient occlusion plug-ins (posted also to the postforum).

just for starters you have to remember that this technique only makes sense when you are compositing your image together (such as in ae) and with all the extra mucking about you have to do with extra passes and swapping materials and such-like you won't see much efficiency from the technique unless you are rendering sequences. there is little reason to use this for stills.

so create your scene and render out four passes:

1)key pass. this is just a plain render of your image using the original materials with just key lights lighting the scene. you can add extra fill lights if necessary, it all depends on the effect you are after however in general exteriors should just have a single key light that represents the sun.

2) material colour pass - one of the special passes found in the multi-pass tab. this is just the colour values of the textures ignoring any shading.

3)environment pass. take your scene and replace all of the original materials with a material that has an appropriate image in the environment channel. you should use an image that matches the ambient light you are attempting to match in your scene. this is one of the uses for a 'chrome ball' shot and is something that is usually shot on set so that the ambient light recreated matches the lighting that prevailed when the live action was shot. because we are recreating diffuse bounce light you can use a low res image and blur it quite heavily to smooth out the environment reflection.

4)ambient occlusion pass. throw one of the ambient occlusion shaders into the luminance channel of a new material and apply this to your scene. render that out - the result will be a greyscale image where the cracks and crevices of your scene are darkened.

so now that you have rendered the passes you need to blend them together. the base is the material colour. on top of that you place the environment pass and use the 'multiply' mode to blend the two together. next place the ambient occlusion pass on top and set the blend mode to multiply also. you should now have something that looks very much like a standard sky dome render of your scene. finally you place the key pass on top and set the blend mode to screen. this provides the 'direct' lighting.

the beauty is of course that with all the different passes you can easily change the look of your scene by tweaking the relative colour/opacity/levels of the layers.

cheers, simon w.

JoelOtron
03-16-2004, 06:14 AM
A double thanks :)

Continuumx
03-16-2004, 06:48 AM
I recommend this message be placed in the sticky messages for all time and future retrieval.

michaeli
03-16-2004, 07:02 AM
Thanks very much! :thumbsup:

Essania
03-16-2004, 09:22 AM
Great!!!
Thanks a lot Simon.

Some questions:

For the 3rd part, can we use a render of the actual scene?

For the AO shader, I have the Stefan Werner's one (I'm on Mac, so I can't try the other one). He say that this plugin should be use in the Environment channel.
Is there a difference if we use the Luminance channel?
Also, with this plugin, we can choose the color.
Do you use a pure white?

And last, why do you think that this is not suitable for stills?
Is there a better method for stills?

Thanks again Simon :thumbsup:

Essania
03-16-2004, 09:24 AM
Can I translate this text and put it in the French Cinema 4D forum, with your name for credits of course?

Thanks again.

stew
03-16-2004, 12:22 PM
Originally posted by Essania
For the AO shader, I have the Stefan Werner's one (I'm on Mac, so I can't try the other one). He say that this plugin should be use in the Environment channel.
Is there a difference if we use the Luminance channel?
No. Both are added in the shading equation, the only difference between these channels is how they do texture lookups.
Environment channel to
Also, with this plugin, we can choose the color.
Do you use a pure white?
Yes.

Essania
03-16-2004, 12:36 PM
Hi Stefan!

Thanks for the answers :thumbsup:
And thanks for your plugin!

I'll try this passes on a still I'm working now.
I'll show you something...

flingster
03-16-2004, 01:31 PM
as one of those badgering you for this on postforum...i appreciate you taking the time out to write this up for us bud...thanks alot
top job...cheers.:beer:

Simon Wicker
03-16-2004, 03:21 PM
Originally posted by Essania
Great!!!
Thanks a lot Simon.

Some questions:

For the 3rd part, can we use a render of the actual scene?

And last, why do you think that this is not suitable for stills?
Is there a better method for stills?

Thanks again Simon :thumbsup:

you should be able to use a render of the scene and it should work fine - as far as i can tell because of the 'fake' aspect of this process all you really need is a suggestion of the correct ambient environment to get this to work and look okay.

historically this seems to have grown out of a need to replicate the lighting that was used on set while filming. the vfx supervisor would take a chrome sphere image photo so that they could capture the environment and see where all the main lights were. you can then easy add in the correct position for your 3d key lights. then someone worked out that if you use the same image in the environment channel (highly blurred) you could also sample the diffuse lighting in the scene and supply your 'fill' effect as well.

the process is quite long winded in cinema if you need all of the separate passes to composite in after effects or photoshop as it involves physically swapping out materials and manually rendering a couple of the different passes. to my mind this makes it less useful for a still - i would probably just use full radiosity and let it render overnight.

i assume that you could cut out some of the passes if you use a blend of the environment image and the ao shader in the environment channel using fusion. however you once again run into the fact that you are best served having all the separate passes available during the comp process as you need to tweak all of the layers relative brightness and colour to get it to sit into the scene correctly.

you can of course translate this all and pass it on. thanks to everyone and if there are any further questions just ask away.

cheers, simon w.

Essania
03-16-2004, 03:25 PM
Thank you very much Simon :thumbsup:

chris_b
03-16-2004, 03:39 PM
Thanks Simon :)
I have a question... When reading about ambient occlusion techniques (especially in Maya/PRMan) I have often heard reference to a 'bent normal' pass.

"A further development of this technique is that of the "average light direction vector" usually referred to as a bent normal vector. This is an additional pre-beauty render pass in which the R, G, and B values of the image do not represent physical colour but instead are used together to make a vector which the beauty pass surface shader uses to "bend" the currently shaded point's normal so that it "looks at" the position on the environment map from where the majority of light came from as calculated by the ambient occlusion render pass. "

Does anybody more versed in the inner-workings of Cinema's shading procedures know whether this would be possible with the current toolset? Or whether it would make much of a difference?

http://www.andrew-whitehurst.net/amb_occlude.html

handige_harrie
03-16-2004, 03:39 PM
Thank you very much, works very well. Despite the different approach about the same result as my two-pass method :).

AdamT
03-16-2004, 08:13 PM
Originally posted by chris_b
Thanks Simon :)
I have a question... When reading about ambient occlusion techniques (especially in Maya/PRMan) I have often heard reference to a 'bent normal' pass.
Sounds like they're talking about normal mapping, which Cinema doesn't support.

chris_b
03-16-2004, 08:28 PM
true true...except via plugin (i.e. DiTools).... or Per's NormalMap shader. Also there is Nlin for generating the maps...

So it seems that all the necessary parts are in place and somebody just needs to push the button :)

flingster
03-16-2004, 08:29 PM
Originally posted by chris_b
true true...except via plugin (i.e. DiTools).... or Per's NormalMap shader. Also there is Nlin for generating the maps...

So it seems that all the necessary parts are in place and somebody just needs to push the button :)

btw...does that nlin shader still work with 8.5?

chris_b
03-16-2004, 08:34 PM
yes.
There is also a tutorial somewhere that shows you what values to enter into a network of falloff shaders to get the same result... so you can set up your own NormalMap generator without the need for any plugins. What we need is some way to make use of the maps.

3dg
03-16-2004, 08:35 PM
Great tip!

Thanks Simon! :thumbsup:

JamesMK
03-16-2004, 10:15 PM
Great schtuff, Simon (and stew, how are things going with that 'thing' btw?)

Must find time to do some C4D-ing soon! I'm stuck with PHP-code up to my neck instead of 3D! WTF!? :D

stew
03-16-2004, 10:18 PM
Originally posted by AdamT
Sounds like they're talking about normal mapping, which Cinema doesn't support.
No, bent normals is something different than that. It is mostly being used with the environment pass, when you use an image map for lighting.

Normal mapping seems to be a popular word here since a couple of weeks, but I don't see how that would be useful outside games. To my knowledge, normal maps are nothing but the derivative of bump maps, being used to save a few CPU cycles in real-time applications.

AdamT
03-16-2004, 11:00 PM
Originally posted by stew
Normal mapping seems to be a popular word here since a couple of weeks, but I don't see how that would be useful outside games. To my knowledge, normal maps are nothing but the derivative of bump maps, being used to save a few CPU cycles in real-time applications.
Basically it's just a better bump map, but better is ... better.

stew
03-16-2004, 11:11 PM
Better in what regard? Unless I'm mistaken, you can convert from bump map to normal map and back via integration/derivation, so both contain the same information anyway.

LucentDreams
03-17-2004, 03:35 AM
yes you can use a bump to create a more detailed normal map but thety are very different, and they are being used extensivly in film now, look at the pressrelease regarding wetas use of zbrush on the return of the king.

While it is just a more advanced type of bump map its results are still considerably different. While the main use most peple tend to be looking at is getting the normal map from a highres to a low res, its also good for insanely highres to a mdeium res model as well. Now they are able to use the highest resoluitions possible on scanners when they scan maquettes, while someone else models a medium res version of the same creatre, and generrate a normal map and a displacement map. A normal map can be used in every part of the industry, Heck Architectural renders could take huge advantage of them too, using a real tree model kills renders times, apply a flat spriteplace done follow lighting very well, but with a single polygon plain and a well generated normal map the tree will appear to respond to lighting as if it was a real 3d tree, unlike a bump map which would simply look embossed.

The difference lies in how they treat the normals, a bump map only returns a scalar value of the original normal, meaning the actual shading of the object will remain.


a normal map can either add to or even replace the original normal shading since it returns a vector which is generated by the RGB values of the image.

Since a single polygon only has one surface normal, a bump map will simply appear to emboss on the object, a normal map however can totally replace that single normal with the appearance of millions of surface normal of something like a tree or a face.

Simon Wicker
03-17-2004, 04:12 AM
Originally posted by chris_b
Thanks Simon :)
I have a question... When reading about ambient occlusion techniques (especially in Maya/PRMan) I have often heard reference to a 'bent normal' pass.

bent normals is a way of telling the renderer where the brightest light sources in the scene are and then biasing the normal towards that point during renderering - this should be perfectly possible in cinema.

thinking more about the way this all works it seems that there are two ways of doing ambient occlusion and it depends on your rendering strategy. so far i have worked at studios that either render millions of passes and then composite that all together and fix problems as the come up in post by tweaking a pass, or they render a single beauty pass and then re-render that when they need to make changes.

looking at it this way you can either render all these passes as i have outlined or you could actually get exactly the same result by creating a shader tree that brings all of these layers together in a single shader - taking the output of one pass and passing that result to the input of another in much the same way that xpresso works currently.

the only drawback to this is of course that cinema doesn't currently support this kind of process and this is precisely the thing people use shader networks within XSI and maya for.

cheers, simon w.

bobtronic
03-17-2004, 12:46 PM
Hi,

I have played a bit with Simons method. Nothing special
but here it goes:

material color pass:
http://home.snafu.de/bobtronic/misc/ao/matcolor_pass.jpg

enviroment pass:
http://home.snafu.de/bobtronic/misc/ao/env_pass.jpg

AO pass:
http://home.snafu.de/bobtronic/misc/ao/ao_pass_ambiente.jpg

Raytraced pass:
http://home.snafu.de/bobtronic/misc/ao/ray_pass.jpg

Final composition:
http://home.snafu.de/bobtronic/misc/ao/final_ambiente.jpg


Rendertime for AO pass (Ambiente shader) was 2:05 min.


Bob

stew
03-17-2004, 11:02 PM
[i]Originally posted by JamesMK stew, how are things going with that 'thing' btw?[/B]
Results of my thesis are pending, AO2 plugin still not cleaned up (I'm so lazy), employment in progress and right now a little too much of red wine :D

ThirdEye
07-17-2005, 02:06 PM
[moved in the tips forum]

Juanje
07-18-2005, 02:46 PM
Very interesting thread, guys. Thanks a lot, Simon!!

Bob, I can't access to your pics, can you attach them?

one
11-15-2005, 11:12 PM
nice thread peopel!!! thx Simon! hope u will post such thread again soon! :applause:

CGTalk Moderation
11-15-2005, 11:12 PM
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.