PDA

View Full Version : RGB ambient occlusion compositing?


DJSmackMackey
11-04-2004, 09:17 PM
Does anyone know how those Ambient Occlusion passes that use RGB values are used in compositing? At first I thought you just used each channel as a black and white layer and you just multiply them over the diffuse render, but I don't think that's right. I've included an example picture of the AO render that I found online.
http://www.drone.org/tutorials/billboards/shadeMap1.jpg

Aruna
11-04-2004, 11:18 PM
So Sweet... Damn.. Can you tell me where you got this image from?

Edit: Never mind, I found the source.

An example of how you could use this is to speed up lighting a flat image object, instead of geometry.. Pretty damn nice..

DJSmackMackey
11-04-2004, 11:23 PM
If you right click on the picture you can open it's properties and see the webpage it's from. I certainly didn't make it. I'm just trying to figure out how to use a render like this in compositing for ambient occlusion. I see renders like this all the time in things like cinefex, but I don't know how they are used.

pasghetti
11-11-2004, 01:26 AM
You should head over to http://renderman.org/RMR/Books/index.html#Sig and download the SIGGRAPH 2002 pdf. It's all good, of course ;-) but I highly recommend Ch.5 - Hayden Landis' "Production-Ready Global Illumination." Great explanation of all-things-AO.

Cheers!

don

jussing
11-17-2004, 12:58 PM
At first I thought you just used each channel as a black and white layer and you just multiply them over the diffuse render, but I don't think that's right. It's my understanding that that's exactly what you do. :shrug:

But, when doing hefty color correction to passes with premultiplied alphas, you might get into trouble with matte edges...

Cheers,
- Jonas

Hugh
11-17-2004, 01:30 PM
You should always do colour correction on passes on unpremultiplied images... and multiply by the alpha later...

jussing
11-17-2004, 01:52 PM
Exactly... but Max isn't good at rendering non-antialiased plates for un-premultiplied alphas, and After Effects doesn't have an "unpremultiply" option.

I suppose this can be dealt with by setting up an expression that divides the color values with the alpha values, but I never learned how to do this. :)

- Jonas

bartrobinson
11-22-2004, 05:54 PM
I could be mistaken but, can't you render your premultiplied sequence/images in After Effects out with a Straight Alpha and get an un-multiplied sequence/image? Also, does the Compound Arithmetic effect have a Divide me, can't remember and I don't have AE on me at the moment.

jussing
11-22-2004, 07:06 PM
I could be mistaken but, can't you render your premultiplied sequence/images in After Effects out with a Straight Alpha and get an un-multiplied sequence/image? Hm, just tried it, but the image data is the same as in the original file - premultiplied edges.
Also, does the Compound Arithmetic effect have a Divide me, can't remember and I don't have AE on me at the moment. Darnit, thanks, this is the closest I've come yet, but no, there are 15 operaters and a kitchen sink, but no divide... ugh.

Thanks anyway! ;)

Cheers,
- Jonas

kag122
11-24-2004, 04:11 AM
These passes can be used in various ways, but the general method is to layering is

(colour * (diffuse *4)) + (specular * 4)

The rgb passes that you have as an example are then generally used as lighting masks to help grade the objects. You can check this by bringing it into your compositing software and looking at the seperate red green and blue channels

DJSmackMackey
11-24-2004, 02:10 PM
Thanks guys. You've been a lot of help on this. So, does anyone know of any tutorials out there that implement these types of renders for use with lighting adjustments in compositing? I've looked, but I haven't found any. Maybe there's a special term for it that I don't know about?

stew
11-24-2004, 10:53 PM
I don't think RGB AO passes are intended for compositing. They contain xyz directions which are usuallly being used as input for a second render pass for environement map lookups.

jussing
11-24-2004, 11:04 PM
Yes, those would be the "bent normals", as described in the article Pasghetti provided, right?

But how are those stored in the file?

And isn't it possible to have just the RGB information from the ambient occlusion, and ignore the bent normals, and still call it "ambient occlusion", and use that for compositing?

Cheers,
- Jonas

stew
11-24-2004, 11:14 PM
I would guess that in this case the bent normals are multiplied with the regular AO, the x, y and z components being stored as RGB. Could be that the original image was not multiplied but had the intensity in the alpha channel. I don't think there's a standard for saving bent normals.

If you get rid of the color information, you should be able to use it as a regular AO pass. Desaturation couldl be one way to try.

kag122
11-25-2004, 04:11 AM
The first image doesnt seem to be a bent normals image as they tend to look more like this correct me if i'm wrong, please

http://www.andrew-whitehurst.net/tutorials/bend_norm.jpg

Hugh
11-25-2004, 08:39 AM
The first image, to me, looks like an RGB lighting pass.... If it were at all normals-based (either bent or straight), then the leaves would be a lot more colourful. Also, about a quarter of the way up the trunk, one of the branches on the right casts a red shadow.... You wouldn't get this with anything that was using ambient light....

jussing
11-25-2004, 09:21 AM
You wouldn't get this with anything that was using ambient light.... Why not, if it was colored ambient light? For instance, the ambient occlusion combined with the environment map lookup?

Cheers,
- Jonas

Hugh
11-25-2004, 09:33 AM
In that case, I wouldn't call it ambient.... That would be (probably) HDRI lighting....

Anyway, this one still definately looks like three coloured lights coming from different directions...

jussing
11-25-2004, 11:08 AM
All right, here are some quotes from chapter 5 by Hayden Landis from the Siggraph article posted earlier (not to say you're right and you're wrong, but to cast some more light over the last few questions).

Ambient occlusion is a crucial element in creating realistic ambient environment. It provides the soft shadowing that we have come to expect from global illumination...
Then there are two pictures from Pearl Harbor and Jurrasic Park III, respectively, as examples of ambient occlusion. These pictures are greyscale ambient shadows, and contain no colored light or any vector information.

Ambient occlusion is achieved through the following process: For every surface point, rays are cast in a hemisphere around the surface nirmal. The final occlusion amount is dependent on the number of rays that hit other surfaces or objects in the scene.

Bent normals - Another important component of Ambient Occlusion is the addition of an "average light direction vector" (later defined as "bent normal".)
...
This vector is stored in the G, B and A channels of the Ambient Occlusion map

So, it seems there are different ways to go about using ambient occlusion.

Even if you just use the greyscale ambient pass for compositing, or a baked ambient shadow texture, it would seem to me that it would qualify as "basic ambient occlusion".

The bent normals seems to be an add-on, and ILM apparently uses this by storing the greyscale shadow information in the RED channel of a baked ambient occlusion shadow texture, while storing the x,y,z of the bent normal vector in the blue, green and alpha channels.

But using the vectors would mean calculating the final color calues at render time, and not in compositing.

Anyone agree? Disagree? :)

Keep it going, this is good debate.

Cheers,
- Jonas

jussing
11-25-2004, 11:11 AM
...to cast some more light over the last few questions No pun intended, I swear! :D

jussing
11-25-2004, 11:16 AM
...and ILM apparently uses this by storing the greyscale shadow information in the RED channel of a baked ambient occlusion shadow texture...Well, I correct myself - being that the article is in fact a RenderMan paper, it has more to do with how RenderMan works, than how ILM "does it".

So the way the vector is described implemented and used, is not necessarily "standard practice", but a specific RenderMan feature.

stew
11-25-2004, 12:37 PM
three coloured lights coming from different directions...
Which equals normals in world space, saved in RGB channels.

stew
11-25-2004, 12:46 PM
But using the vectors would mean calculating the final color calues at render time, and not in compositing.
What I was trying to say :)

But overall, what are we actually arguing about? If you need an AO pass for compositing, you render it in black and white, if you need bent normals for environment lookups, just let the same TD write both shaders.

Hugh
11-25-2004, 01:12 PM
Which equals normals in world space, saved in RGB channels.
I would say that this would be an incredibly dodgy way of generating a normal pass....

RGB lighting passes are usually used for various lighting positions - not necessarily directional light along the axes...

In fact, thinking about it, this wouldn't work.... As the normal pass needs negative values for when the normal is pointing the opposite direction to the axis... I'd definately recommend sticking with properly-generated normal passes!

stew
11-25-2004, 01:26 PM
Well, the discussion as a whole is quite pointless as it start with
an example picture of the AO render that I found online.
We don't know what the creator of that image intended to do with the RGB information, all we can do is speculate.

jussing
11-25-2004, 02:05 PM
What I was trying to say :)Yup, and you were right.

But overall, what are we actually arguing about?We're not arguing! We're throwing as much information about AO - and the practical use of it - as possible on the table. I think it's been extremely fruitful so far. :)

Cheers,
- Jonas

playmesumch00ns
11-25-2004, 02:34 PM
The image posted is 3 directional occlusion renders in one. It's intended for relighting cards with self-shadowing.

i.e. you figure out which way your light's coming from, and then the occlusion from that direction is a combination of the occlusion in each direction stored in the rgb occlusion image i.e. the light from above is occuded by the red channel, the light from the side is occluded by the green channel, the light from in front is occluded by the blue channel.

It's sort of like spherical harmonics relighting but without the spherical harmonics :)

jussing
11-25-2004, 03:07 PM
Aha, that makes sense... but then, since that original picture is about lighting 2D objects, as seen in the original article here (http://www.drone.org/tutorials/lighting_flat_objects.html), that picture is actually a bit off-topic, although it IS ambient occlusion, and not 3 seperate light sources.

- Jonas

stew
11-25-2004, 03:38 PM
Ah, OK. With the context it becomes much clearer what it is :)

Aneks
11-26-2004, 01:33 AM
I do not beleive that the image is a bent normal pass ! it is a normal pass for generating a normal map for a 3d app or realtime engine !

Where's that frame from kyle ?!?

CGTalk Moderation
01-19-2006, 07:00 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.