V

Avatar



Mass cube rendering

I have recently done some experimental work in order to render mass amounts of cubes. I was moved by this video from Smash, i wanted to know how far i would be able to go on my NVidia GT240M (rendering side). My first choice was Geometry Shaders.
I quickly wrote an app that sent a list of points in space to the GPU and a geometry shader would generate a cube mesh for each one of  the points. Tested it on 100.000 cubes and the framerate was bad(10fps or so). The time was now for optimization.

Next step was to optimize the cube generation by lowering from a 24 vertex cube to 14 vertex triangle strip. Things got better, but nothing close to my expectations. I was not satisfied, i mean, i had alot of cubes on screen (100K which was not that much) and that was it, nothing else. We’re talking about 20fps or so, for 100.000 cubes (around 1.2 million triangles per frame). Later on i added vertex normals to the geometry shader and started to work on some lighting/shadowing, but i ended up going back on the rendering side of the job. Meanwhile, i was speaking with a friend of mine about this idea and we were discussing ways to compute lighting but i couldn’t stop thinking about my real problem. So it came to me.

Previously, i have done some experiments with opengl hardware instancing, but never got  to do much about it .  What better time than now, so i grabbed the project and took it for a spin. After a few hours i had the same amount of cubes on screen with a much much better framerate. Quickly implemented some eye-candy (coloring, texturing, vertex lighting), some tweaking here and there and as i was listening to Mr. Peter Broderick (hi, i love you man) added some audio analysis to the feature list.
Last but not least, a kind of “Brownian Motion” was used to generate points in space, increased the cube count to 512*512 and watched it flow ( at 20fps ).

In conclusion, Hardware instancing was much easier to implement  and performance seems much better at first sight. Above is a video of 262.144 audio-reactive cubes with GPU animation and basic lighting at around 20fps. For my video card i think that is very good. On a sidenote, i have not given up on the geometry shaders. I am not sure what will be my next step regarding the subject (back to geometry shaders?) but for now this is it. Hardware Instancing kicked Geometry Shaders in the ass.





Taxesss from Nothing

So here it is, new demo is out! It’s called Taxesss from Nothing and it was released at Mainparty this year. This demo started as an idea from my good friend and work colleague, ps, who usually watches my experiments in first hand. After watching some of the stuff you can see in my vimeo account, he came out with this piece for a grindcore jazz track from The Lost Gorbachevs. After handing him all the sources, he started building the demo while i was working on my own idea. Well, it turns out Taxesss is out and has been quite well accepted by the alternative parties, and my own project is still waiting to come out.. Hope you enjoy this piece.

You can download the demos from scene.org.

Mac OSX | Windows





hmm.Motion Blur as a Post Processing Effect

One more ‘hmm’ series experiment.

Motion Blur as a Post Processing Effect.

This is based on an article from GPU Gems 3, which basically takes the motion for each pixel and computes a velocity from the difference with the previous position to sample the rendered scene texture and compute the final color. It works only for camera movement, meaning, if the camera does not move but you have a moving/rotating object in front of you the effect won’t apply.

This two videos shows camera lookat point motion, meaning it randomly looks at different points every second, and the second video shows a camera spinning around a sphere objectwith increasing velocity to reach a maximum blur state. Both are using camera motion as i stated it’s important, anyway, it should give an idea of the effect.

Source code available here





hmm.Grassfield

Here is a new experiment. This time Terrain rendering and Countless blades of waving grass.

The terrain is an heightmap loaded from an image and it is textured on gpu based on simple rules like height, slope and steep.

The grass is based on the article “Rendering Countless Blades of Waving Grass” from GPU gems. The animation is per-object, a sin/cos wave makes it flow with the wind.





hmm.Sshhhh (MD5 file format loader)

After getting MD5 files (Doom 3) to load correctly i wanted to make something simple and nice to show the world, so i came up with this. I think i have dreamt of this before.

based on md5 reader