Started updating

I thought it was about time to put up some updates. I have quite a few projects going on, but I haven't really gotten around to take a few screenshots.
So here are some screenshots from my terrain engine test project. The terrain is generated from a heightmap. So far I've implemented terrain patching with LOD, quadtree, multitexture splatting and terrain self shadowing. See screenshots here

Ronzan - 21 februar 2010 23:45 0 Comments
Tags: XNA

Multiple Lighs and Shadows

I just posted a "question" at the xna forums, and thought I'd might as well post here too just in case someone drops by and wants to share their thoughts ;)

The post on the forum is here

After getting my pointlight cubemap shadow mapping to work I am facing a new challenge.
I have read papers, studied samples and made prototypes. But I just can't decide/figure out what the "best"(tm) approach to this ordeal is.

Possible methods of dealing with multiple lights and their shadows I have found so far:

1. Multiple shadow maps - One depth pass per light, resolved to a unique texture.
a) Light contribution in a single pass (looping over lights).
b) Light contribution in multiple passes (additive blending).

There are several flaws to this approach:
Needs many textures, possibly exceeding the shader maximum.
Limited number of lights in a single pass, too many additive passes and gets too slow.

2. Single shadow map reused - Multiple passes (if possible at all?)
a) One depth pass and one light contribution pass per light (additive blending).

Flaws here could be poor performance of many additive passes.
I never succeeded in implementing this, I had problems rendering the shadow maps in between the light
passes, which I guess makes sense (as there is already stuff in the GPU buffers etc).

3. "Standard" deferred rendering.
a) Pre-Z pass, G-buffer pass, one shadow/light pass per light.

This looks like an optimal render method for dealing with multiple lights and shadows
not to mention other benefits like post-processing.

The main thing that bugs me (and everyone else it seems) about this approach is
of course the alpha/transparency issues. Especially in scenes with lots of foliage and particle effects.


I think my main issue with all of this is shadow mapping.
For lights alone I could live with a "multi-pass multi-lights" approach. But when adding shadows to the equation
it is just slow / complicated / smelly and what not.

Then I ran across this article here: http://mynameismjp.wordpress.com/samples-tutorials-tools/deferred-shadow-maps-sample/
It's Matt's (MJP) article about Deferred Shadow Mapping, I still need to re-read it a few times to fully understand it I think,
but it looks like an excellent approach.
Anyone have experience with this method? Is it a suitable approach?
Can I render multiple shadow passes into the same shadow texture(?).
I'm about to test it out but any insight is appreciated.


Now, do I actually have a question hidden in this wall of text?
I'm not sure, however I find it helpful to write things down when puzzled.
I'm pretty sure that not everything I've written above is 100% accurate, so feel free to enlighten me (no pun intended).


I have already searched the forum and googled a fair bit, but there are so many terms involved and I have probably missed something.
A few of the more interesting posts, papers and articles I've read so far:
Xna.com forum posts - this, and this, and this
Other resources - Deferred Shading presentation by Shawn Hargreaves, Deferred Shading tutorial


I would appreciate any thoughts on the subject, how do you handle this, do you just use a single shadow caster, do you live
with the shortcomings of deferred rendering, do you avoid pointlight shadows etc.

Ronzan - 27 januar 2010 21:56 1 Comments
Tags: XNA, Game

XNA 3.0 Version

I have recompiled the model viewer for XNA 3.0.
This build should also support 64bit OS's, though I haven't been able to test it.

I have made no changes to the viewer other than migrating it to XNA 3.0.

When I get some more time for this project I will update it based on the feedback I have received (thanks all).


The old version for XNA 2.0 does not support 64bit OS's, it is a very small change to fix that, but I'll leave it as is for now. Feel free to contact me if you need the XNA 2.0 version with 64bit support.


As always, feedback and bug reports are most welcome - You can use the feedback form in the viewer, post here or in the thread at Creators Club (http://forums.xna.com/forums/t/14018.aspx).

Ronzan - 04 marts 2009 12:10 0 Comments
Tags: XNA, Tools