Skip to main content
GameDev.net gamedev.net
🔒 Locked

Ambient occlusion artifacts

Started by dtom Jan 12, 2007 at 6:19 PM 2 replies 1.2k views
Original Post
dtom
dtom
Hi all, I've been working on implementing ambient occlusion into my lightmap toolset, and for the most part I've been very pleased with the results. There's one problem that I've consistently encountered, though, and from what I can tell it's also found in most commercial renderers. Whenever the environment i'm lightmapping has geometry that intersects, I get black seams along the line of intersection. This happens because the rays that are being cast for a texel are hidden behind the intersecting geometry, rendering the both the visible and hidden portions of that pixel black. One way to reduce the artifacts is to crank up the lightmap resolution, thereby making the texels smaller and artifacts less noticeable. I was wondering how other people have dealt with the problem of seams in their ambient occlusion lightmaps (and other lightmapping procedures, including shadow casting). Thanks for any help you can offer!
Schrompf
Schrompf
Maybe simply cull back sides while casting the rays? That way, each of the intersecting objects would not notice the other objects, only the distant geometry they're supposed to notice.
----------
Gonna try that "Indie" stuff I keep hearing about. Let's start with Splatter.
daktaris
daktaris
are you generating the occlusion data per-vertex or per-face(and averaging the face obscurance for the verts)?

btw...how are you storing the information into a lightmap? I have been trying to solve that problem
isolation man
isolation man
I had the same problem when implementing ambient occlusion in the context of a Reyes renderer.

What I do is to store the normals of all the objects that the occlusion rays hit, and then test them against the normal of the point being occluded. If all the occlusion rays hit back facing geometry, I set a flag for that texel in the light map and move on. After the light maps have been generated, I go over them again and for every texel that has the flag set, I set its value to be the same as the nearest texel that has had a successful occlusion test.

Of course, this requires your ray tracer always return the closest intersection and still has problems with certain geometry. The only air tight solution is to avoid intersection geometry altogether.

Quote:
Original post by Schrompf
Maybe simply cull back sides while casting the rays?


This also has problems. Consider a box on a plane. Outside the box, you'd get proper occlusion results, but inside the box, the rays wouldn't see anything at all, which would result in spurious 0% occlusion results rather than %100 occlusion.

[Edited by - isolation man on January 17, 2007 1:05:47 AM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.