domenica 26 luglio 2015

Day 40: Fixed a problem

Today i managed to fix that annoying bug who made a lot of pixel black at a certain camera angle.

I had this bug already and the other time was due to a power of 0 to 0, so i knew that a similar mathematical error would probably be the cause...and indeed i had a square root that, is some cases, was trying to calculate the root of a negative number. I surrounded the argument with an absolute value, and the bug was fixed.

In the picture i rendered on screen the content of the 5 main buffers i use (excluding depth and stencil, because they get overridden a lot and also require a lot of extra work to be rendered like i did with the other ones, fur reasons i'm yet to understand).

The top central one is the color, the top right one the normals, and the bottom left one the depth (used to retrieve position). These three are used in deferred rendering.

Then in bottom-center there is the shadow map for the dirctional light (the only one supported for now). And finally, in the bottom-left corner, the final image.


Nessun commento:

Posta un commento