Ambient Occlusion and alpha mapping

Hey all. So, I’ve noticed that Ambient Occlusion seems to ignore alpha maps on objects. I have a PNG with transparent areas UV-mapped to a series of connected planes bent at 90 degree angles. The image causes the planes to look like ironwork enclosing a veranda, with numerous holes of various sizes in the ironwork. The thing is, my sun lamp’s rays don’t reach the veranda because of the overhang above, so this area relies on Ambient Occlusion for lighting. When the ironwork planes (which appear to have many holes, thanks to the transparent areas of the PNG, but actually are quite solid) are in place, the verandas go completely black because the AO is ignoring the alpha.

So, my question is–is there a workaround? I know I could simply put dim lamps–most likely area lights–inside the ironwork, and I’m also trying cutting rough holes in the mesh itself for the AO to come through. But it’d be very nice if there were a simple setting I could adjust somewhere. If there’s not…well, consider this a feature request. :wink:

Thanks in advance for your help! :smiley:

Sorry, AO is solely based on geometry . . . so alpha maps have no effect. Same goes for raytraced transparent objects. A plane of ‘glass’ would be treated as an opaque wall. Modeling the detail would solve the problem . . . but add work, of course.

Thanks for the reply. I figured as much. Well, I think this would definitely be a nice addition to the program at some point. In the mean time, I suppose I’ll use a combo of dim area lights within the verandas and roughly-shaped holes in the mesh.

Sigh…

What you might be able to do is use nodes to multiply an AO pass with the alpha on the model. You may have to separate the model from the rest of the scene though and then composite it later I’m not sure.

I think AO must recognise transparency to some extent because if you turn AO on and set an object’s alpha value to zero, it disappears.

The object disappears, but not it’s occlusion ‘shadow’ on other objects.

What you might be able to do is use nodes to multiply an AO pass with the alpha on the model. You may have to separate the model from the rest of the scene though and then composite it later I’m not sure.
Interesting idea. At first, I was jumping for joy because I thought it’d work for sure, but then I thought it through and realized this would only work if the object in question is darker than the shadowed area behind it, which is not the case.

Oh well, I’m getting pretty good results with dim area lights within the ironwork. Note that this is definitely a work in progress, but I’m relatively happy with the lighting inside the second-floor verandas. Similar ironwork will be added to the ground floor, too.

Datameister,

there was a similar discussion recently in the Yafray forums regarding the new Yaf(a)Ray and it’s problem with alpha maps and occlusion. According to Lynx, the developer, it was a bug that he was able to fix.

Maybe it’s also a similar thing with Blender? If so, searching the bug trackerfor this and file a bug (if not already there) would be best, I think. You can also talk to the developers via IRC in channel #blendercoders on freenode.

Very nice model, btw. :slight_smile:

Here’s a build where AO takes object alphas into account . . . it seems to work with alpha-mapped materials, too.

This build also includes other cool features, like being able to set how much AO an object recieves (even to the point of ignoring it altogether), and object color bleeding with AO.

like being able to set how much AO an object recieves (even to the point of ignoring it altogether)

I thought that’s what the Amb vaariable did? Or does it only affect the AO it gives, not receives…???

Only RayTrans will affect how much AO is given by an object. How much one receives will be affected by both the Amb value and the Ignore setting. But the results are different, and Amb will also affect how much simple Ambient light an object receives.

Some examples:

[http://img86.imageshack.us/img86/7738/aoexampleses5.th.jpg](http://img86.imageshack.us/my.php?image=aoexampleses5.jpg)

Same problem here. It would be good if AO could take into account transparency (even if just on pixel level on/off). Problem is visible when you try to render wire fence or some polygon with alpha texture… AO is calculeted as if the whole polygon was visible.

Yep, that’s the one. =( Luckily, that other build Cire linked to does work rather nicely, though it doesn’t have the new features of the latest version of Blender, I believe…

Sorry to resurrect this thread but does anyone have a build like what was mentioned before but complied for OSX?

Thanks