Showing posts with label deferred shading. Show all posts
Showing posts with label deferred shading. Show all posts

Monday, 27 February 2012

Lights!


Decided it was time to fling some deferred rendering at the project, because who doesn't like taking huge chunks of VRAM to do simple things? Thanks to Jotaf's comments last week, I have a much easier method for making and rendering walls, so it only took a few minutes of Blender-torture to generate new ones.

The question of style is one I haven't resolved yet, alas. Making tech is far, far easier than trying to hang a scene together as a coherent whole. I know the cultural roots the game world will draw from, but not whether to go for a cell-shaded or painterly or somewhat realistic approach. The latter is probably most tedious in terms of rendering tech and modelling, but is almost certainly the easier to at least rough out textures based on photographic sources.

Saturday, 20 November 2010

Water! Again!

I've been off discovering the joys of Bitbucket, but after some friendly discussion of various crazy rendering schemes I decided to do a litle shader work with respect to water rendering. The spare channels of the blur mask render target now store distortion and detail values, which are applied during the blur pass to add a bit more detail back into the freshly-blurred areas.

Looking a bit better than it was, I think, especially when the water is moving.



Yeah, the distortion values have a definite tendency to smear downwards, which is very visible in the image taken from a low camera angle. I'll work on that. Still, it's nice to have lit water that doesn't look too smeary.

Friday, 27 August 2010

Side Projects: Xibalba

This is actually the project around which this blog formed, a turn based roguelike-like game of procedural dungeons, faint mesoamerican stylings, dice rolls, and general geekery.

So far it's seen more use as a rendering playpen than an actual game, although messing around with various representations of immutable game state has been fun.

Oh, and for the curious, I did indeed mis-spell the name for a goodly portion of the project. This is what happens when you start naming things at dark o'clock one night and don't check them for ages.

On the graphics side:
  • Deferred shading forms the core of the pipeline. I wanted lots of light sources, and wanted an excuse to mess around with deferred rendering. It's been fun.
  • A single main light uses a conventional forward-rendering technique with exponential shadow maps. This forms the focal point, being centred on the player character, and also serves to illustrate line of sight.
  • Transparent objects are forward-rendered after the deferred pass, although I don't like this approach at all. Planning on doing some stuff with screen-door transparency for water at least, essentially stealing the work done by Media Molecule for LBP.
  • Zeroth order particle systems! I've a minor obsession with these, entirely deterministic effects with all particle motion calculated in the vertex shader for a given time.
  • Star-shaped bloom. This is just a very boring post-process, but it's summed over many increasingly downsampled versions of the final image so has quite a large effect considering the main blur kernel is rather small.
  • SSAO. Actually, this is no longer a 'proper' SSAO implementation. After messing around with a few different approaches, I eventually settled on a very crude approximation of the depth Laplacian using difference of gaussians, plus some falloff over large distance deltas. This gives a rather stylized effect that I really like. It only works well for quite compressed scenes due to fixed kernel size - perfect for a top-down view though!

First working implementation of the deferred render targets:


Prototyping water, note that only the main (forward rendered, shadowed) light affects the water surface:


The 'notSSAO' post process, dialled up to 11. This also shows a chunk of the map lit almost entirely by deferred lights cenred on the glowing mushrooms:


And last repeat screenshot for this post, the basic particles with a simple lit and shadowed alpha-tested rendering mode:


I'll try to get this running on my partner's PC and get some new screenshots of this for a later post. Have to admit, it was nice going over the early screenshots and see it evolve.

Monday, 8 September 2008

Even more deferred tentacles

Just a quicky today.

These are lighting-only shots showing the same scene with and without screen-space ambient occlusion, the latest hacktastic post process to take the rendering world by storm. Unfortunately I have to concede that even my less than stellar implementation does add a lot to the rendering, for a moderate cost, so I guess I'll be jumping on the bandwagon. It's an especially useful technique when combined with deferred lighting, as attempting any real shadowing with a bucketload of small point lights is very bonkers, so the illusion that the faked ambient occlusion provides is doubly useful.

As an aside, I do like my dungeon fairy lights. They add such a nice ambience...

Before (no SSAO):



After (mit SSAO):

Friday, 5 September 2008

Deferred Tentacles

Further work on the deferred rendering side. I finally found an example online using FBOs with a stencil buffer, and thereby discovered that despite using a combined depth-stencil renderbuffer it needs to be attached to the frame buffer object twice, once as a depth attachment and once as a stencil attachment. Sigh.

That done, efficient rendering of small lights via z-and-stencil-tested spheres works nicely!

Behold the scene, containing no less than fifty ickle lights, plus the large shadow-casting light from the player's avatar.


The majority of the screen is taken up by the final composite image. On the right, small sections show a sample of the buffers involved (yes, I don't even turn off my debugging chuffle before posting, I'm that lazy). Top is the SSAO term (very low intensity in the final image, as it looks pants). Below that are the lighting accumulation buffer, world-space normal, and finally unlit diffuse buffers.

Lastly, the image displays some filthy aliasing as the source render targets are only 512x512, violently scaled up to match the screen resolution. I should fix that.

Edit: here's a version using 1024x768 buffers throughout. Ouch, bye-bye framerate. Need to fix my absurd pixel shader usage methinks.