Thursday, November 29, 2007

Light volumes and more

I've not been able to work much on the engine the last week since I've been busy with school projects.

Some things have been done though. I've updated the deferred rendering system to work with light volumes instead of full-screen quads. This alone provides a huge speedup as long as the lights are reasonably small. This also made me think about light attenuation. Funny enough, this thread at gamdev popped up today. As discussed in the thread, I also wanted to find a way to set a maximum radius for a light, without affecting its atenuation too much. After some playing around with Maple, I found that max(0, 1-1/maxRadius*x)/(1+k*x^2) does the job quite good (this function is suggested in the thread) . I implemented it in my lighting shaders and the result is fine. I also took the opportunity to shave of a few instructions.

Here are some screens:



In the second shot there is 100+ lights. As you can see, the point lights does not cast shadows yet. I will also need to implement a 64 bit HDR pipeline as I get oversaturation and banding artifacts.

I've also ordered a AMD HD3870. While slightly slower than the Nvidia 8800GT, it's slightly cheaper and most importantly: it's available ;)

Tuesday, November 20, 2007

Eliminating noise

The last couple of days I have tried to reduse the noise in the SSAO output. It proved to be a hard problem. My initial attempt was to simply apply a separable gaussian blur. It produced a nice, smooth image. But as I expected it resulted in ugly halos around object edges when combined with the albedo term. Next I tried to combine the gaussian with some edge detection trickery. Looked kind of cool, but unfortunally it just reduced the halos and did not eliminate them.

Then I turned to bilateral upsampling (see Jeremy Shopf's blog). Eliminated halos, but the SSAO input was way to noisy for simple bilinear filtering. My last atempt was a combination of a box blur and a variant of bilateral filtering. The result is acceptable. I'm not satisfied, but it will do for now.

Next up is some speed optimizations and then I'm on to indirect lighting.

SSAO + "bilateral filtering"-hack

Tuesday, November 13, 2007

I've been playing around with screen-space ambient occlusion (SSAO) today, one of the AO-techniques used in Crysis. It's not trivial to get it to look good. I use the randomized normal trick described in the Crytek paper but I only sample on a hemisphere around the pixel normal to avoid self occlusion. I need to optimize the shader quite a bit, but so far this is just an evaluation of the technique and I'm quite pleased with the initial results.

Mandatory screenshots:
SSAO Only:

SSAO + direct lighting

Friday, November 09, 2007

Wheee! Shadows!

Wednesday, October 24, 2007

First screenshots of NebulaX

I have been working on my new engine for some months now and I thought it was time to start blogging again.

Here are some random facts about the new engine:

* Complete rewrite of my old engine.
* Despite its name and contrary to my previous posts: it's 100% API-independent.
* Only XNA 1.1 renderer at the moment
* Pluggable rendering pipeline, but only deferred shading pipeline atm.
* DXEffect-like effect system based on XML
* Shader language independent, only HLSL impl. atm.
* "Super-shader"-style effects for generating shader permutations
* Post-processing framework
* Pluggable scene management system
* Pluggable mesh import pipeline, only COLLADA support atm.
* Optimized math library
* Everything is witten in C# execpt the math lib witch is written in C++/CLI.
* Zero GC collections during runtime!

Sounds like marketing bull, and it is:) There's quite a few places in the code that needs to get cleaned up but this is work in progress.

Below is some screenies showing some deferred shading tests.
One point light and 5 colored spot lights.



Thursday, March 01, 2007

Update at last

I realize I'm one lazy blogger. I'm not even sure I'm allowed to call this a blog with these infrequent updates:)

Anyway, in my last post I mentioned that I might release some code for my GUI system. Sorry, won't happen anytime soon. The reason?
The usual. School eating up my time.

I'm taking a course in AI. And it has turned out to be one of the best courses I've taken so far.
The first assignment was to implement a Checkers program, and to be approved we had to enter a tournament. I teamed up with Jesper Ek (again) and Jacob Persson and we set out with a reasonable goal: to win the competition.

And that we did.

Our program, Black Doctor, won six games in a row but unfortunately lost the last one. That was enough to win the tournament, however.

Some info about the program:
* Written in C++, multi-platform
* Bitboard representation of game board.
* Alpha-Beta (iterative + recursive) and MTD(f) searching
* Transposition table
* Quiescense
* Dynamic time management
* Simple opening book and endgame database (3-pieces)
* ~1M nodes/sec on a 1.7MHz Pentium M

No screenie this time. Console UI's just aren't that sexy...