Showing posts with label geometry shader. Show all posts
Showing posts with label geometry shader. Show all posts

Tuesday, February 26, 2013

Glow me baby

You know what sucks when participating in OGAM? Having room redecoration in the same time. But now it's over and I finally have some time to finish my game. Unfortunately I'll had to close the project in beta stage just to fit in February.

I had some hard time with post-processing, after hours of wondering if I'm that stupid or something I found a solution for my problem and it was in adding that line:
SetGeometryShader(NULL);
DirectX is a state machine, one rendering technique turns geo shader on and it's on until you disable it. Jesus, I know that but it's really hard to debug that kind of stuff on my knowledge level...

Anyway, finally I've added some music-dependent glow:


Of course it looks better in game (it's a music-like game at last). FMOD is really fantastic sound engine, you write something like
float* spectrum = new float[64];
channel->getSpectrum(spectrum, 64, 0, FMOD_DSP_FFT_WINDOW_RECT);
and in spectrum array you have 64 0.0f to 1.0f values describing sound intensity by pitch. Right now I only take bass spectrum to describe wireframe width and glow size but it's really easy to make some fancy effects with it.

Now I have only 3 days left and the next big thing to do is instancing and frustum culling (yes, I still haven't done it).

Sunday, February 10, 2013

Particle Sunday

Today's work: asteroid destruction particle effect and dynamic stars.


At collsion with laser, asteroids explode to little triangles. Screen above has auto-explosions enabled. With the time, triangles decelerating and getting more transparent.


At lower speeds we can see star points around. When we're getting faster and faster, points transforming into lines. The faster we get, the longer the lines.

These two effects were generated by the same particle system. Most of the work is done by stream-out of geometry shader, the C++ class is the same, only fx files differ. So right now I have wireframedExplosion.fx and stars.fx in use. Geez, I need to say that - Geometry shader kicks ass! You can do magic with it. Just gathered some EXP in my noob-to-pro path :)