Archive for December, 2009
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!
Rewrite of LPP Article Planned
Posted by Michael in Programming, Xbox 360, directx, xna on December 12, 2009
I recently went about making the current Light Pre Pass system run on the XBOX 360, and had to fix some issues that appeared there. As a result, the next article to go up will be a rewrite with all of these fixes included. I should also be able to provide the sample code at the same time.
This time around I will cover Point, Ambient and Directional lights in the same post, as well as including information about an alternate light buffer format that allows for improved specular + per-material specular.
Expect this either during the weekend of 20-21st Dec, or shortly after that.
Unfortunately I could not test the code on the XBOX the first time around due to subscription issues, however everything is fine now, and I can and will test on both XBOX and my desktop PC beforehand. (Perhaps also other PC configs depending on who I can find online at the time, and what other machines I have on hand
)
Get Great Benefits from the MSP Program
Just a quick break from the regular programming (haha) to let every reader of this blog know that the Microsoft Student Partner program is open for signups.
If you are a student in tertiary education (University etc) then you can apply for the role by going to http://student-partners.com and following the instructions there.
Benefits vary per country, however the common one seems to be that you get a free MSDN Universal subscription, which gives you access to every piece of MS software you could want. (As long as it relates to development)
I have been a student partner for 2 years now, and I am really enjoying the experience. you meet like minded students from your country and get into some really awesome and at times exclusive events. Here in Australia we get free access to TechEd AU, and even get into exclusive XBOX parties. One big event of note this year was the local Windows 7 launch, which many MSPs from Sydney attended.
Tons of benefits, and plenty of reasons to join, so why don’t you?
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.
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.