Archive for category Uncategorized
Happy New Year
Posted by Michael in Uncategorized on December 31, 2009
Happy New Year everyone, hope you all have a great 2010.
I for one know that my new years resolution will be to get more content up. Once I am better of course, I caught a cold + ear infection at #ozgamecamp and haven’t been in the mood to do much development or writing over the past two weeks. Expect content as that clears up (It is slowly going away) and things get started again for 2010.
Enjoy!
Important Additions & Fixes to LPP Implementation
Posted by Michael in Uncategorized on December 4, 2009
I have finally tracked down an issue that I was having with the Light Pre Pass implementation, and as a result have had to make some changes to the implementation.
Firstly, I would recommend ensuring RenderState.AlphaTestEnable is false before rendering materials, it appears this is set (at least in my sample) somewhere and it corrupts the light buffer.
Secondly, move the postProjToScreen and halfPixel calls from the vertex shader in blinnphong.fx, to the pixel shader. Some GPUs (like my laptop’s) do not correctly interpolate the adjusted screen coordinates, and this ensures it is correctly interpolated per pixel.
gfx.SetRenderTarget(0, light); gfx.SetRenderTarget(1, null); depthImage = depth.GetTexture(); normImage = normals.GetTexture(); gfx.RenderState.AlphaTestEnable = false;
Finally, when writing the Normal in the vertex shader for def_depthnorm.fx, swap the parameters of mul(input.Normal, World) to mul(World, input.Normal).
That should be all, if you notice any other issues, feel free to post them in the comments, it would be greatly appreciated.
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.