XNA 4.0 Light Pre-Pass
Jorge Coluna posted an article on his site about implementing the Light Pre-Pass technique for rendering in XNA 4.0
Read all about it here.
XNA 4.0 Light Pre-Pass
Jorge Coluna shares the code and an article of his Light Pre-Pass technique for XNA 4.0. Says the Jorge:
The discussion between pros and cons of different techniques for real-time lighting has been running for years. Forward rendering, deferred shading and light pre-pass are some of the most famous techniques nowadays. Their definitions and variations can be found with a simple search on internet, with all the most complex mathematics, notations and formulas possible. Therefore I will not focus on this.
XnaFlixel for XNA 4.0
Someone be the handle of graydsl announced the immediate availability of XnaFlixel on GitHub. Sez the laddie:
XnaFlixel is a XNA 4.0 port of flixel (http://flixel.org). It's highly experimental now and I'm planning to break the whole API to make it more C#-ish. It's not tested on Xbox yet, so if you plan to use it, don't expect to much.
Code From The Forums
Some code (well, more like library) announcements from the Creators Club OnlineAppHub forums.
First, there is GPF – WPF for XNA by genralhi (the blog links are in Russian), which looks interesting even though the full WPF might be a bit overkill for game UIs. Second, MicroMan6502 announces his EasyThreading library to “provide something to the community”.
About the XNA Game Studio 4.0 Release Date
The XNA team blog finally came out of the closest and confirmed that the upcoming release of the Windows Phone Developer Tools will include the final version of XNA Game Studio 4.0 (not that surprising, actually) on September 16, 2010. However, 360 fanbois get some heads up: a beta of the XNA Game Studio Connect tool (I love branding…) will be available!
XPF: A Layout Framework for XNA
Right after Mr. Styrchak shared his work on a Sinner clone now comes the word that the brave people at Red Badger just released a first build of BronzeglowXPF – I even named it XPF at first, too
Article: Texture Modification using Render Targets, with some Stencil Buffer Action
by Dave Carlile

Sometimes you need to modify a texture while your game is running, and there are a number of ways to do this. One of the first things newer game programmers often try to do is use Texture2D.GetData to copy the texture data from the GPU to an array on the CPU, modify the bytes, and then send it back to the GPU with Texture2D.SetData.
This is a bad idea on many, levels. Beyond issues with pipeline stalls, GetData and SetData can be slow, especially when working with a large texture. Any time you’re tempted grab data from the GPU for use on the CPU you should very carefully consider all of your options. There are often other solutions that let you keep the data entirely on the GPU and accomplish the same thing.
This tutorial will use an example that could be solved with GetData and SetData, and show you another alternative using render targets and the stencil buffer that will let you perform the same function entirely on the GPU.
Article: Derived Effect Classes in XNA 4
by Dave Carlile

One of the nice API changes in XNA 4.0 is the simplified syntax used when drawing with an Effect. In previous versions you would draw things like this:
effect.Begin();
foreach (EffectPass pass in effect.CurrentTechnique.Passes)
{
pass.Begin();
// draw your stuff
pass.End();
}
effect.End();
Now you can draw things like this, with EffectPass.Apply handling all the magic:
foreach (EffectPass pass in effect.CurrentTechnique.Passes)
{
pass.Apply();
// draw your stuff
}
Related to this is the new Effect.OnApply virtual method which gets called by EffectPass.Apply. By overriding this method in a derived class you can do things like perform pre-shader calculations and set shader parameters from properties. This is how BasicEffect and the other new standard shaders work, and it would be nice to be able to duplicate that functionality in our own derived effects.
Ideally we would like to be able to do something like this:
MyEffect effect = Content.Load<MyEffect>(“myeffect”);
effect.World = Matrix.Identity;
effect.Color = Color.Blue;
...
effect.Apply();
...
The first line is where we begin running into issues. In order to load a derived class using the content pipeline you have to write your own content processor, reader, and writer, for every single class. You might think that you could load an Effect instance using the content manager, then create an instance of your derived Effect class and pass in the code. Unfortunately, there is no way to get at the code in the Effect instance (okay, that is not entirely true, but this solution requires the full Game Studio install).
If you want to store the class properties (e.g. MyEffect.World, MyEffect.Color) as content then extending the content pipeline for each class is your best option. But what if you don't need to store the properties? What if you just want a cleaner interface to your shaders? Extending the pipeline each time for these cases seems like a lot of unnecessary work.
A Solution
This remainder of this tutorial will show you how to load any derived Effect class from the content pipeline without having to extend the pipeline for each class. To accomplish this we're going to create a content pipeline extension library that will compile the effect into an intermediate object that will let us get at the compiled code. We will also create a game library that will define the intermediate class so we can get to it at run time. And finally we’ll add an extension method that will do the work of loading our derived Effect class.
The new phone book’s here! The new phone book’s here!
In case, like me, you've been living under a rock, there has been an update to the Windows Phone 7 CTP that now supports Visual Studio 2010 RTM.
The main blog post from the WP7 dev team is Windows Phone Developer Tools CTP Refresh! and gives a great basic overview. If you want to get straight to the bits, that link is Windows Phone Developer Tools CTP - April Refresh. You will want to pay attention to the Release Notes this release as there are breaking changes if you have any projects created in the first CTP. There is also an overview of what has changed on MSDN, What's New in Windows Phone 7 CTP Refresh.
If you followed my post about Ultimate support (Windows Phone 7 Installation User Errors With Visual Studio 2010 Ultimate RC), there are a couple of caveats to uninstalling the RC bits. You may run into more problems when trying to install the CTP Refresh so hopefully this will help eliminate some headache ahead of time.
- Do not uninstall individual pieces like XNA or heaven forbid Visual Studio 2010 Express. The installer keeps track of everything it puts on your system and will proceed to add it back if it is missing. In the case of no VS2010, as The_Zman found out the hard way and had to reinstall the Express RC separate.
- The CTP leaves two things that the refresh needs to be removed before it will install: Silverlight 4 SDK and Microsoft Visual Studio 2010 Express Prerequisites x86 or x64 depending on your system.
- I had a link to the Silverlight 4 Tools that have now been refreshed to RTM. That link is actually no longer needed as VS2010 RTM installs them for you.
Hope this reiteration will save some of you the grief The_Zman or ElementCy ran into. Happy hax0rin!
Windows Phone 7 Installation User Errors with Visual Studio 2010 Ultimate RC
Before you begin:
So, you want to develop applications for Windows Phone 7. You have access to the public Visual Studio 2010 Ultimate Release Candidate and would rather use that because Express feels to wimpy. You should know that before you travel down this rabbit hole, you will have copies of both Ultimate and Express on your computer by the time you are done installing.
