After some big refactoring made in Gine, I started to play with shaders.
It's not my first time of course, but I'm trying to standarize fx file loading and usage. Another time - make it user friendly.
My first goal was to make a very simple greyscale post-processing effect. Now it looks like that:
Supersimple pixel shader goes like:
Notice the usage of a gTransition float. Yeah! I made smoot transitions as well and I must say it looks exactly as it should ;)
The next step was to blur the background at a pause stage:
The thing was tricky - Gaussian blur needs two passes to work in an optimal way. So after adding a backbuffer render target view, I had to add another and swap them in meantime. Geez, it's so unnecessarily complicated at that level.
I'm happy that main rendering loop looks like that:
And when you want to enable or disable the effect:
Showing posts with label fx. Show all posts
Showing posts with label fx. Show all posts
Sunday, September 22, 2013
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 :)
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 :)
Labels:
asteroids,
explosions,
fx,
geometry shader,
particles,
stars
Subscribe to:
Posts (Atom)



