Hello,
it’s time to update this thread and make it more interessting. I thought when I open the theard the shader was not very useful and there were no pictures or something like that but know I have worked again on this shader and I think it will be more useful now!
One example what you can do with it:
“Some time ago I have tried to make particlesystem with GLSL in a Geometryshader via bgl wrapper (thanks to HG1) which calculate particles with a timevariable because the bge have no option to save data on the GPU. This way to make particle has some disadvantages but has also some advantages compared to other ways to make particle in the bge.”
Advantage:
+better Logic performance because the python scripte must only run once then the bge run this shader itself
+you can copy particlesources, so objects with the same material are also particlesources an they don’t must run a python scripte
Disadvantage:
-requires geometryshader functionality
-amount of particles is also limited on the geometryshader (at the moment only 42 particles per source but for much things that is enough and if you need more particles you can duplicate the source and transfer it a little bit too).
-it’s mostly useful for static sources which don’t change there position because the particle only caculate their own movement on the current source position but maybe for some things this behavior is not bad or it can be ignored…
- the randomness is caculated by a combination of sin and cos funktion so with some settings it’s look not much random
-setup the settings isn’t so easy sometimes so you need to try it out and test it a liitle bit
Examples for useful things with this shader
- it’s very useful for static particlesources which are often in a level:
for example: fires (campfires, fireplaces…), smoke (picture above), gas (destroyed gas lines…) …
At the moment it will be setup with variables in the shader (in the geometryshader and in the Fragmentshader):
Maybe I will make a addon with a userfriendly gui with some presets like easy emit if this shader will be useful enought and I have the motivation/time for that.
Here is the Blendfile. In the current layer is a simple particlesetup in the next Layer is the example with the houses which I use for the picture above:
[ATTACH]409669[/ATTACH]
The shader is not finished yet, so if you give feedback it would be nice if you could mention things like errors, performance, ideas for features and so on…
And ignore my bad english here and in the code comments:cool: