Posts Tagged tutorials
Reconstructing Position from Depth for Fullscreen Quads
Posted by Michael in Programming, Tips, directx, xna on June 29, 2010
Recently I found an issue with an older article of mine that covered this topic, so I pulled it down until I could find the time to understand and fix the issue. After a bit of work I have fixed it and present this refresh.
The key to deferred rendering and other techniques is the ability to use a depth map to store world position. As we know a depth map consists of floating point values (optimally) and so normally we would use those values with our Clip Space coordinates and the Inverse of the ViewProjection matrix to get the position in World Space.
However there is another way to do this, and the big benefit is that it does not require a matrix multiplication to do so.
Presented by Crytek during a presentation on Atmospheric Scattering, this method uses just a Multiply + Add to get the position in World Space from our depth value at that point. To do this we need to get the far view frustum corners, in View Space, and pass them to the shader.
Status June 2010
Posted by Michael in Programming, directx, xna on June 17, 2010
Hi all, not dead.
Apologies for the lack of updates, I am in the process of finishing an internship required for my university course, and it is a challenge to find good time to tackle some XNA issues and write posts.
I am currently working on Directional light shadows for my engine, I have cascaded shadow maps implemented, and now I am just tackling some issues I have encountered, which is taking a while – I also need to find a good filtering method.
If I get bored of trying to fix those annoying issues, I will probably jump into re-implementing point lights, and spotlights, and write something about those.
Some housekeeping notes:
I encountered a pretty big issue with the “Reconstructing position from depth” technique, and I have taken that article down from the blog for now. At the moment my own code uses the old “Multiply my the Inverse of the View Projection matrix”, and probably will continue to until I have time to solve that problem.
I have also updated this blog to WordPress 3.0, so let me know if you encounter any issues.
Back to work.
Light Pre-Pass Round 2
Posted by Michael in Games, Programming, directx, xna on March 11, 2010
Those who have been following this blog know that I wrote an article about implementing a Light Pre-Pass renderer last year. Since then I have made numerous improvements and fixes as I have tried the system over different PC configurations.
This time around I will be including those changes into the implementation, and also releasing sample code for educational use. If you feel you have learned enough from the previous article, then feel free to skip this. For those new to the topic, please use this article instead of the older one.
A Note on Sample Code
Posted by Michael in Uncategorized on December 1, 2009
Just a quick note about the sample code download for the current Light Pre Pass tutorial, and probably future tutorials. I am in the process of cleaning up and commenting the code, and hope to have it out really soon. I am to have a complete tutorial with all the information on the page, however in some cases I don’t explicitly provide every bit of code, to prevent the tutorial from becoming too long.
As this implementation and sample is a part of my own engine, I need to split the code from the main project and ensure it is readable and in a suitable educational state. This should not take too long, so if you are watching this blog, I will post when this code is available, and link to it in the original article as well.
Sorry for any inconvenience, I hope the article will satisfy your LPP needs in the meanwhile. As usual if you have any questions, post them in the comments of the respective article and I will answer them as soon as possible.
Light Pre Pass in XNA: Basic Implementation
Posted by Michael in Programming, Xbox 360, directx, xna on December 1, 2009
NOTE: This article is now obsolete. An up-to-date sample and article can be found at http://mquandt.com/blog/2010/03/light-pre-pass-round-2/
In this part I will cover how to implement the basic form of the Light Pre Pass renderer, with support for point lights, and the basic Blinn-Phong shader, including Albedo texture support.
As this article is fairly advanced in nature, I have to make certain assumptions about my audience, so that I do not spend half my time explaining basics. Firstly, you should have an understanding of basic concepts such as Cameras, Fullscreen Quads (including how to render one) and rendering a mesh with custom effects.
This pretty much means that as long as you have done some 3D work before, you should be fine. It would be best if you also knew XNA, as I will be using that to write this implementation, however as long as you can translate from C# and get the basic idea, that should be enough.
As you can see from these requirements, this article is not aimed at beginners, and if you are looking for tutorials on how to get started with XNA for 3D development, I would recommend you visit some great sites such as:
Those sites will help you get started with XNA, and once you are familiar and comfortable with the concepts behind 3D graphics, you can return here to learn an advanced renderer implementation.
My focus in this article will be on the implementation of the renderer, as a result, I will not be referring to the implementation of cameras or scene graphs.
Now that the housekeeping is out of the way, we can begin.
Light Pre Pass Implementation Ready
As you can see, it is rendering correctly, and now I can begin writing about the implementation.
Just have to clean some code, maybe improve one or two things. I hope to begin the article series (the previous entry was an intro) after my final exam on friday.