Sky occlusion

by

One of the things that I’m currently busy with on my global illumination system is the calculation of sky visibility. The sky itself is an important source of the indirect illumination in an outdoor scene, and thus I’ll have to simulate it somehow. Since the sky is a pretty uniform light source I figured that I might as well just pre-compute it and store it in a 8 bits per pixel light map, using the same resolution as all my other light maps (i.e. very low). This way, I still have the freedom to change the sky color and similar. A couple of days ago I began my work on doing these pre-computations using my existing DirectCompute ray tracing kernel, and it works by simply tracing 128 rays across the hemisphere from each light map texel and then counting how many of them are occluded. If I run the computations in every frame instead of once, I still get pretty decent frame rates (37 FPS with doing the computations, compared to 350+ FPS without), this is also in debug mode as my graphics card drivers crash if I turn on shader optimization. The following screenshot demonstrates how the sky occlusion map looks:
Sky occlusion

As can be seen in the screenshot above, there are some artifacts at the edges of objects. This is because of my terrible light map unwrap, combined with the fact that D3D doesn’t use conservative rasterization; some texels are partly used by the mesh, but the mesh doesn’t cover the center of that texel. Maybe I can reduce it doing some clever trick with MSAA samples or some simple blur, I haven’t investigated it very closely yet. Also, it seems like it might have too much weight for occluders straight up, I was pretty sure that this was due to pole clustering due to a poor distribution scheme but changing it haven’t seemed to reduce the problem. Hopefully the problem is that my distribution scheme still sucks :].

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.