Ambient occlusion shaders.

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.
Post Reply
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Ambient occlusion shaders.

Post by 3DModelerMan »

I was wondering how you calculate the accesibility value that's passed into the shader to determine diffuse lighting with. How do you implement it in Irrlicht?
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

XEffects

Post by 3DModelerMan »

If you're wondering why I don't use XEffects, it's because I'll probably learn more this way, and AO is going to be my first project with shaders(it seems to be pretty simple).
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

hopefully someone will reply your post
omaremad
Competition winner
Posts: 1027
Joined: Fri Jul 15, 2005 11:30 pm
Location: Cairo,Egypt

Post by omaremad »

Why do it real time when you can bake it into textures or vertex colours(see blender)? Ambient occlusion is very simple, imagine the world is a sphere with your object contained inside it, light comes from the sphere and hits your object, its a standard dot product like a point light except there are point lights all around your object and there is no distance attenuation.


After you have your AO term, multiply it by your ambient term in the objects lighting shader, you can also multiply it with the diffuse and spec of dynamic lights for some fake self shadowing.
"Irrlicht is obese"

If you want modern rendering techniques learn how to make them or go to the engine next door =p
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Re: Ambient occlusion shaders.

Post by BlindSide »

3DModelerMan wrote:I was wondering how you calculate the accesibility value that's passed into the shader to determine diffuse lighting with. How do you implement it in Irrlicht?
This doesn't sound like SSAO anyway.

A quick google reveals you're trying to implement this technique: http://http.developer.nvidia.com/GPUGem ... ter14.html

"Accessibility" seems to refer to the inverse of the occlusion value. It's calculated in the shader and doesn't get passed anywhere (It's used in the final result though).
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Hmmm

Post by 3DModelerMan »

Is there a tutorial on using nVidia melody to generate AO accesibility factors?
What I found the technique for AO in was the openGL shading language second edition book. It showed the general idea of calculating but not much else, just the shader.
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
Post Reply