Skip to main content
gamedev.net
🔒 Locked

Implementing Hemispheric Lighting...

Started by DirectXFreak Dec 10, 2005 at 11:42 PM 3 replies 2.5k views
Original Post
DirectXFreak
DirectXFreak
Hello, I recently stumbled accross the hemispheric lighting tutorial in the DirectX SDK, and I find it an impressive and easy upgrade from the traditional ambient lighting model. Now, all the shader code made sense, but there's one thing they left out... Calculating the occlusion term. The one thing I'm beginning to notice about the SDK samples is that they cheat a lot. In this case, they used a .x file that had the occlusion values precomputed (scullocc.x I believe). I've searched the net, but I can't find any resources on implementing this offline process... Can you guys give me some pointers? Thanks
--m_nPostCount++
Yann L
Yann L
Google for "ambient occlusion", it's a very popular technique, and you'll find a lot of references and papers about it. GPU Gems has an entire chapter about the technique. I seem to recall that both ATI and nvidia have tools to generate offline ambient occlusion term maps. It's also possible to generate them in realtime, on the fly (good for animated models).

Wikipedia has a short introduction into the technique, that might get you started.
DirectXFreak
DirectXFreak
Thanks Yann,
I'll check that stuff out.
--m_nPostCount++
EvilDecl81
EvilDecl81
Quote:
Original post by DirectXFreak
Hello,

I recently stumbled accross the hemispheric lighting tutorial in the DirectX SDK, and I find it an impressive and easy upgrade from the traditional ambient lighting model. Now, all the shader code made sense, but there's one thing they left out... Calculating the occlusion term.

The one thing I'm beginning to notice about the SDK samples is that they cheat a lot. In this case, they used a .x file that had the occlusion values precomputed (scullocc.x I believe).

I've searched the net, but I can't find any resources on implementing this offline process... Can you guys give me some pointers?

Thanks


You can get the Ambient Occlusion term by using the PRT library in D3DX. PRT is a superset of Ambient Occlusion - it will spit a bunch of numbers for each vertex/texture called the basis. The FIRST term is exactly the ambient occlusion, you will often see it refered to as the DC term.

So you have to do a bit of code to run the PRT library and process the data, but it is all there.


EvilDecl81
DirectXFreak
DirectXFreak
Thanks EvilDecl81,

I've always wanted to learn about PRT, maybe I'll start now =)

--m_nPostCount++

Topic Locked

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

Sign in to reply to this topic.