Spellcaster Studios

Make it happen…

So ashamed…

Finally figured out what was the problem with my reconstruction of the position from the FOV and depth…

NOTHING! ABSOLUTELY NOTHING!

The problem was way before that… For some reason (and I never noticed it for years on end), I was using the field of view parameter as the VERTICAL field of view, scaled by half (for some another really unknown reason), but everything I made with shaders that required the field of view assumed I was using the fov property as the HORIZONTAL FOV… The scaling factor I had only screwed up everything…

So I was looking at at a scene with a FOV property set to 80º… But since I was diving that scale by 2 (yielding 40º), and then computing the horizontal FOV from it by dividing by the aspect ratio (yielding 71º), the visual result was close enough for me never to suspect a thing…

Except when I’m actually using the fov in another calculation on a shader and nothing seems right…

What helped this revelation was the fact that I decided to change the way I was seeing the error on screen… Instead of using colors, I decided to compute the world position and compare that with the depth I had on the depth buffer…

The two images below show the “normal” result (the one rendered correctly), and the one that the SSAO would compute half-way through the process:

screen396

screen397

When I saw this, I figured the problem would have to have something to do with the FOV, the images were too close to be a normal math or reasoning error…

After a lot more debugging, finally figured it out!

Now, tomorrow I’ll be able to see the SSAO in action properly!

Now listening to “Ghost Opera” by “Kamelot”

Link of the Day: I know this is a hype video, and we’re really far from this, no matter what Microsoft marketers says… But it looks soooooo cool! I can imagine my “Skylander’s-like” game here… Smile

Comment