Well, this blog has been dead for a while. I was working hard on getting AHR ready for the GDC, as I was rejected at SIGGRAPH (but not by far actually).
So, here's a new video:
Again, I can't provide a lot of details. Just hope that I get into the GDC, will explain everything there ;)
Global Illumination is the thing of the moment. Rendering it at real time is a really complex problem, so a lot of techniques have surfaced lately, mainly influenced by the amount of raw power and programability of current gen GPUs, and the new generation of consoles.
Therefore, I took my take at that problem.
I got inspired in my technique after looking at the Sparse Voxel Octree Global Illumination a couple years back. I can't comment a lot right now because I applied to present it at the Real Time Live! conference, that is a part of the SIGGRAPH.

Below is a video of a baseline implementation of the algorithm. The demo actually runs more fluent, but Camtasia seems to make a significant impact on the framerate.


With Visual Studio 2012 Microsoft dumped the DirectX SDK, and the effects library with it( along other things), which I needed for my engine.
To compensate for that, I wrote some code to load an xml file that describes the outputs and inputs of the shaders, just like the .fx files used to do.
Having that working, I realized xml is a bit too cumbersome for that use, and coming up with some small language will speed up development time, plus, I've always wanted to write a parser/compiler/vm.
Before starting with it, I decided to try to do something smaller first, something to parse/execute a kind of assembly code meant to run embedded in an application.
So after a lot of coding, and messing with regular expressions, I finally managed to get it working. 
The parser can load code like this:
and produce a memory representation that the vm can execute. The example above adds in parallel two arrays of floats, and stores the result in another array. 
The vm code runs from 10 % to 20 % slower, which isn't that bad for a simple implementation. Ok, so now some code! I won't put the VM, as it is a lot of code, but I'll put the parser.

Parser:

So I finally got to work again in the particles simulation, and I made some advances. Mainly, fixing the displacement of the particles and adding a "pseudo z culling" step. Actually, what I'm doing is compare the distance of the sample to the camera with the distance of the scene to the camera, and only add the sample to the final color if the distance is smaller.
Oh, I forgot. I also optimized part of the voxel update code, so I'm now using 80.000 particles at 90 - 110 fps. Quite nice!
There are things to do though. First of all, add some shading, maybe even shadows. I have other thing in mind, that I mentioned earlier, regarding compression of the voxels ( particles are sparse after all right? ) but it still needs some more work.
For now, here are some screens:





Working on a parser the other day, I decided to use the new <regex> library in C++ 11.
It's awesome, once you get to know the regex sintax. To make development faster, I coded a couple functions. They are nothing fancy, but they speed up my workflow.

Well, after a lot of fighting, I managed to get the volumetric render working. I'm using a 128*128*128 3D texture, and then I raymarch it in a compute shader.
The results are quite good actually. I'm getting around 140 - 170 FPS with 40.000 particles (!).
There are things to fix though. Mainly, the voxel appears to be displaced from the real center, and the rendering against the scene ( can't do Z-Buffering just like that ) leaves a lot of room for improvement.
Next things to do, fix that, add proper lighting, and then I'll pass to one idea of mine, which involves hash-maps and voxel compression...

Some screens:




So, the other day I decided I wanted to try to add particles to my engine. I already have PhysX ( 3.3 beta ) working, so I grabbed the documentation and started from there. The documentation includes a guide that it's really complete, so it just took me a couple hours to get it working.
For rendering I'm using the most naive implementation possible : draw a cube for each particle, with one batch per particle. Really slow, but still, I manage to get 80 fps with a GTX 480 and a i3 @ 3.65 GHz in a simple scene (5000 triangles + 36*4000 of the particles)  with 4000 particles, simulated in the GPU, courtesy of nVIDIA.




Next stop, volumetric rendering using voxels.

Pages

Powered by Blogger.