Pages

Showing posts with label light pre pass. Show all posts
Showing posts with label light pre pass. Show all posts

Thursday, 23 December 2010

Anti aliasing

I've wanted to implement  some form of anti aliasing for a while now so I took a break from playing through the recent Humble Indie Bundle and looked into it. There are several different options when it comes to AA in deferred rendering so I've started with what seemed to be the easiest. The method I've used here is the one outlined in GPU Gems: Deferred Shading in Tabula Rasa and I haven't really deviated from that article with regards to AA.

I also took the opportunity to look into applying a post process sharpen to the overall image. The method is known as unsharp masking and it's an effect a lot of digital artists use to spruce up their images. It goes back further actually and I was surprised to learn that the technique was pioneered in conventional photographic darkrooms.

You can see some examples of AA and unsharp masking below. Be sure to view them full screen without any scaling as the difference is hard to spot when the images are down sampled. In some areas the sharpen effect over sharpens fine details and increases the aliasing problem although for the most part the effect is an improvement.






















Fullscreen examples (click for larger versions)


With AA
No AA


With AA

No AA




With AA
No AA


Well that was fun, back to playing Cortex Command... sniping the engines off drop ships never get's boring ;)

Wednesday, 29 September 2010

Light volumes - animated character

Similar to my previous post but with an animated character this time round.

Animated Character
I went about texturing this model a little differently to usual so I thought I'd mention it. I'd normally lay out the UV's, pick a few nice base textures and start painting away in photoshop. I thought I'd try something different this time round, it's a technique I've seen used in lots of places and I was keen to try it. Instead of manually painting in all the rusted / chipped areas (which is actually a lot of fun) you use a bunch of masks and procedural noise to blend between different surface types. The image below shows a rust mask built from ambient occlusion, cavity, 3d noise and a scratchy bitmap. The ao and cavity maps provide rusted areas in the grooves and worn edges while the noise and scratch maps provide general wear and tear.


Below is the resulting texture map, rendered straight from the material editor. It could definitely use a pass in photoshop to add some more specific detail but it's fine for the time being. Rendering out spec and bump maps was also very easy.


With the textures done I animated a walk and idle cycle and exported the character into the engine. I've spent a lot of time on the mesh and animation exporter so thankfully the process isn't painful.

Video
Okay, onto the actual video which came together pretty quickly. I already had a very basic animation system in place but it doesn't support blending so the animations do pop a bit. I also had to manually control the camera so the camera work isn't as smooth as the other videos. Environment wise I'm still using the same volume textures but I have boosted their contribution to the light buffer.

That's all folks, don't forget to switch it over to HD, hope you enjoy and thanks for reading :)

Wednesday, 22 September 2010

Light Volumes – Sponza Attrium

In previous months I've posted several simple volume lighting tests. The screen shots were taken in my global illumination lightmap renderer so the results were fairly basic. I wanted to try using light volumes on a more complicated scene so I blew the dust off an old deferred render testbed and modified it to work with light volumes. I was about to build my own environment but remembered that Crytek had released their cracking version of the Sponza model so that's the model you see here. The model is largely unchanged although I've left out a few objects. The plants for one, mainly due to no alpha support in my render engine. I've also added some paper lanterns and a second UV channel for the ambient occlusion maps (see previous post).



Light volume generation

As before, a rough GI solution was first generated for the scene. This solution was then sampled to create the light volume textures. The rough solution, consisting of about 15 512x512 light maps and the light volumes took about 4 minutes to compute.

Screenshots taken from my GI light-map / light-volume renderer

Placing the light volumes was tricky, care needs to be taken that no sample point falls outside the scene or can “see” through to areas it shouldn't. The mid level floor and vaulted ceilings in particular took a few tries to get right. I used two volumes in this scene. It may have been possible to use just one but I wanted to attempt a scene with multiple volumes.

The smaller volume is 8x8x32 and the larger is 32x17x64

Scene rendering with light volumes




The deferred renderer I'm using renders in the following stages.

1. Render compressed view space normals, material roughness and depth to G-Buffer.

2. Render dynamic scene lights to light buffer.

3. Render volume lighting to light buffer.

4. Render final geometry using light buffer.

It wasn't hard to add an extra lighting stage to incorporate light volumes. The extra stage functions much like the existing light buffer stage. Geometry representing the light volume is drawn to the screen and the relevant area of the volume can then be sampled. Below is a breakdown of the lighting stages.

Static ambient occlusion (rendered offline in my lightmap renderer)

Dynamic direct light

Light volume ambient diffuse and specular

Final light buffer

As mentioned in the original paper (see references section) the light volume can also provide local environment specular. I initially underestimated this effect but it certainly makes a difference, especially in areas untouched by direct light. The images below show the effect well. A fresnel term also makes a big difference here, note the increased reflections on the wall in the second image.


In addition, a couple of images showing ambient specular and ambient diffuse in isolation.


Finally, two videos of the scene under seperate lighting conditions.



References / Links


Gamefest 2010, Lighting Volumes

HDR the Bungie way

Engel's Prepass Renderer (SIGGRAPH 2009)

Updated Crytek sponza model

Thursday, 20 May 2010

More realtime tests

The street scene running in the realtime renderer. The diffuse and specular textures have all been thrown on really quickly.











... and some more random dynamic lights ...







Wednesday, 19 May 2010

Realtime tests

Thought I'd blow the dust off an old render engine I was working on to test the lightmaps I've been generating. The scene's pretty basic but the lightmap (1024^2) is working well I think. I'll post some more complex scenes soon.













The old engine was a light pre pass type renderer so here's the scene rendered with 64 dynamic point lights. I also baked an ambient occlusion map to help modulate the lighting.