MetaBalls Demo
MetaBalls Demo
Metaballs at 60+ FPS, based on killthesand's original MetaballSceneNode (Big props go to him).
Optimizations include:
- Meshbuffers with dynamic vbos.
- Colour calculations are now done in vertex shader.
- Normal calculations are now done in vertex shader.
- Proximity checks for only calculating values near the metaballs.
- Other optimizations, preallocations, set_used, etc. (Thanks to hybrid for tips.)
- I even went to the lengths of implementing the algorithm using SSE intrinsics, but I ditched it because it ended up slower than just normal C++.
Shader features include:
- Background refraction based on the spheres normals.
- Reflection mapping.
- Fresnal to alternate between refraction and reflection based on view angle.
- Specular with shine-through.
Press Z/X to increase/decrease the quality at runtime (Lower sample width = higher quality).
Press Space to pause the metaballs animation and benefit from VBOs. You can still change the quality while they're paused.
Screenshots:
Download:
http://irrlichtirc.g0dsoft.com/BlindSide/Metaballs.zip
Cheers
Optimizations include:
- Meshbuffers with dynamic vbos.
- Colour calculations are now done in vertex shader.
- Normal calculations are now done in vertex shader.
- Proximity checks for only calculating values near the metaballs.
- Other optimizations, preallocations, set_used, etc. (Thanks to hybrid for tips.)
- I even went to the lengths of implementing the algorithm using SSE intrinsics, but I ditched it because it ended up slower than just normal C++.
Shader features include:
- Background refraction based on the spheres normals.
- Reflection mapping.
- Fresnal to alternate between refraction and reflection based on view angle.
- Specular with shine-through.
Press Z/X to increase/decrease the quality at runtime (Lower sample width = higher quality).
Press Space to pause the metaballs animation and benefit from VBOs. You can still change the quality while they're paused.
Screenshots:
Download:
http://irrlichtirc.g0dsoft.com/BlindSide/Metaballs.zip
Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
During the process of optimization, the code quickly became rather messy and unorthodox, so I'll PM it to you later to save me the public humiliation.hybrid wrote:Oh no, Windows-only binary and no source code I want to use it under Linux, please give me your code
Either that, or I can compile you a Linux binary, whats your arch? 386? AMD64?
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
It's mainly due to the passing of uniform variables to the vertex shader. I didn't want to go through the headache of (Unsupported on ATI) uniform arrays in GLSL, so I passed the Balls' location as singly named variables. This makes the code very unadaptable. Until I think of a better way of handling this I can't release it as a viable solution. Currently the only solution I can think of is to convert it to DirectX, trying to use CG in OpenGL might also somehow work. Oh, or I could use some string manipulation here and there and emulate the arrays somehow, but that would get messy quite fast.
The shaders are free for you to look at and modify, they are pretty much the same as the ones from my refraction demo with a few additions here and there.
Cheers
The shaders are free for you to look at and modify, they are pretty much the same as the ones from my refraction demo with a few additions here and there.
Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
This demo looks very good:)
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Well ...what a nice piece of coding and math ...good work BlindSide
Last edited by arras on Sat May 17, 2008 9:29 pm, edited 1 time in total.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
-
- Posts: 39
- Joined: Tue Apr 29, 2008 1:41 pm
- Contact:
Hey, could I also get a copy of the source for the metaballs as well? pleasssseeeeeeeee
Chris Goddard
http://www.chris-goddard.co.uk
http://www.chris-goddard.co.uk
I wanna work on it some more first, make it faster than this and easier to use then release it.Blue Hampster wrote:Hey, could I also get a copy of the source for the metaballs as well? pleasssseeeeeeeee
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net