Wednesday, 13 October 2010

Bluestone GPU lightmapper update

2.1 million sample points rendered in 6 seconds (Bluestone screenshot)

The GPU lightmap renderer I've been developing (Bluestone) is written in XNA. It's always been a concern that the remit of XNA most definitely isn't GPU lightmap renderers but until recently that hasn't been an issue.  Unfortunately, the changes made to the framework in XNA 4.0 (link) mean that using XNA for this type of application is probably no longer practical. The biggest issue for me is the loss of control over render targets and depth buffers. In XNA 4.0 render targets are automatically assigned depth buffers. Meaning it's no longer possible to reuse a single depth buffer among multiple render targets, which is what Bluestone requires.

In order to move the project forward I needed to look elsewhere. There were a few different options but I've gone with SlimDX, for several reasons. I can stick with C# for one but it also has the advantage of opening up a lot of very nice DirectX 10 features not available in XNA. So far the porting has gone well and both the direct and indirect lighting systems are in place.

In related news, an unexpected win was a decrease in global illumination render times. I made some alterations to the GI shader which have worked wonders. I need to test it more widely but the improvement seems to be about 30% in most cases.


Marco said...

Hi Stefan, I'm working on a project similar to bluestone, I watched other posts and we share same aproach to lightmaps computation ecc...

Problems starts with XNA 4 (like you wrote), I ve translated my lightmap renderer (Radiosity normal mapping) from version 3 to 4 and I've got problems with Matrix.CreateLookAt() (in version 3 all work perfectly), the matrix resulting from this method have Forward vector (the view vector) that some time is different from te vector specified as input parameter...

You've found some bugs, I move to matrix XForms done by hands? Thankyou in advance, and keep working!

P.S.: Reply me on my blog. Bye.

Stefan Kamoda said...

Can't be of much help there I'm afraid. Blue stone uses SlimDX these days and my XNA4 experience is limited. Stick at it though, those sort of problems usually turn out to be something simple.

Post a Comment