Monday 3 September 2012

YouTube Demos!

After a few more busy days of work, I've finished enough of the editing interface at last that I've got something to show for it. Not much in terms of animation yet, but the stage is set in a basic sort of sense.

First up is a general usage video that shows off the pretty graphicses, followed by a more in-depth peek under the hood, which shows off what's making it tick, to some extent, for those of you into that. Bear with me though - not only are the assets quite rough just in terms of the whole scene being much closer to a draft than a finished project in terms of assets, but also the lightmaps were rendered at some very unforgivingly low-quality settings.

Enough to get a feel for the engine, but not representative of any kind of final-ish quality, is what I'm saying here.



The editor interface here is mostly showing off some simple tools for creating dynamic, realistic-looking lighting within the given constraints (low barrier for entry, no custom shaders etc. in order to be compliant with the XNA 'Reach' profile). This is the first time I've worked extensively with WinForms and creating an interface of this sort has been interesting.



Pretty much all the changes also create an XML class on the fly, which can be saved to the disc, and gets loaded next time the level is run.

The main trick here is lightmap management. This example is using four lightmap textures, that are then blended together to give the effect of dynamic lighting:



Like I said, the rendering was pretty rushed, so they're not especially good-looking on their end yet. The front and back of the scene have a separate lightmap each (I guess this is something I could simplify in future scenes), and then for every 'ambient' lightmap you can define lightmaps that are tied to particular lightsources, such as the green exit light in that scene.



One of the other main hurdles that I've had to cope with, is the lack of an easily-usable alpha testing function in XNA 4.0, where the renderstate-based alpha testing toggle has been switched out in favour of doing it shader-side. Of course, seeing as I only get five shaders to work with, actually enabling it in the shader isn't an option. At any rate, this prompted splitting things up into a few more vertical slices, which is why you can see all the Library01a, Library01b etc. objects. The archways in the background screwed up depth when used by default, since they are mostly just quite large, alpha-mapped planes. By splitting these elements up, I can change the order in which they're rendered without having to do anything too clever.



That said, someone on the XNA forums suggested that if I really need alpha testing, I could render
an object twice, once with the Alpha Test shader to create a stencil, then rendering into it again using the DualTexture shader, which I use for lightmapping. Haven't had need of it, but I'm keeping the AlphaTest checkbox open for future use there.


No comments:

Post a Comment