FakeParticleBlow Shader

Hi guys.



My shader contribution.

Effect for fire or engine of a ship. Such an effect is used in eve online for ship engines.



http://www.youtube.com/watch?v=hdQop4yZ-lA&feature=channel_video_title



Shader repository:
http://code.google.com/p/jme-glsl-shaders/
4 Likes

That’s nice!

Hello!



Ahah! Awesome! Wonder if I could get some torches with that… Like 40 of them! :stuck_out_tongue: MOAR FIYA! :stuck_out_tongue:



You know though, is there going to be any j3o’s included with jME for effects like this? Because I study the way a lot of games do their effects and it usually is some variation or combination of some very simple geometries + awesome shaders/textures like this. Seems like there would be a lot of applications for the one @mifth has presented here.



Or maybe he already submitted it in the build. RIDUNNO! :stuck_out_tongue:

~FlaH

You can download my j3o with the code and the shader from http://code.google.com/p/jme-glsl-shaders/ .

FakeParticleBlow update:



Features:

1 gpu animation (now you don’t need simpleUpdate(float tpf)).

2 X/Y animation direction.

3 Animation direction changer.



http://code.google.com/p/jme-glsl-shaders/

g_time has some bugs.



Please, download new version: http://code.google.com/p/jme-glsl-shaders/

@mifth: i really like this shader but i have a few questions. Is there anything special in the mesh you use? I am asking because anytime i don’t use your default mesh the shader draws nothing at all. I only get a blank mesh. If i change the code back to your model everything is fine again.

nothing special. just planes. I exported them to obj. you can try ogre/blender/obj models. Your material should be transparent and additive.

A very cool shader and definitely a GPU saving one. :slight_smile: - Looking at the shader, do you move the particles.png as a filter over a static mask.png in high speed? Perhaps its possible to modify the images a bit and move it more slowly and you can also use it for simple torch fires. That would be cool.



I see the mesh is a simple billboard fan which could also be very useful for anglebased billboards.



I wish I had more knowledge but conceptually I know it would be possible to have a shader that took a texture mesh and spread it out a similar fan and faded each quad in and out depending on the angle to the camera. This way it would be possible to have e.g. a tree billboard that shows different pre-rendered versions. I think they have something like that in Wolfire.

Texture coordinates are moved for particles.png.

You can change speed in material.

@johncl , @tehflah, @zzuegg I had a bug in the vertex shader. Now it’s fixed in the mercurial repository.



http://code.google.com/p/jme-glsl-shaders/source/browse/assets/Shaders/FakeParticleBlow/FakeParticleBlow.vert?spec=svnc82ecb46f47a110c4dcfa7d8c3d1854bfc0407ca&r=c82ecb46f47a110c4dcfa7d8c3d1854bfc0407ca

Hi @mifth,



FakeParticleBlow seems to have a problem with the fog. The mask texture is not apply when you set fogColor. Set fogColor to red and the move the camera away from the particle object and you will see the problem, all the plane is colored. The issue is happen on my pc at least. Can you check please?

I will try to research more about this tomorrow.



Also, can you check if skybox fog is working on your pc? Do you have a testcase for skyfog on FakeParticleBlow?



P.S: I will try to test blow effect on FakeParticleBlow shader tomorrow too.

@H said:
Hi @mifth,

FakeParticleBlow seems to have a problem with the fog. The mask texture is not apply when you set fogColor. Set fogColor to red and the move the camera away from the particle object and you will see the problem, all the plane is colored. The issue is happen on my pc at least. Can you check please?
I will try to research more about this tomorrow.

Also, can you check if skybox fog is working on your pc? Do you have a testcase for skyfog on FakeParticleBlow?

P.S: I will try to test blow effect on FakeParticleBlow shader tomorrow too.



Ok, i fixed fog in the java code.

You will need to set fog to black. As there is additive material. :)

http://code.google.com/p/jmonkeyplatform-contributions/source/detail?r=508

Or you can try like that if you want to get green/yellow/blue fog (not transparency):



[java]



mat.getAdditionalRenderState().setBlendMode(BlendMode.AlphaAdditive);

final ColorRGBA fogColor = ColorRGBA.Blue.clone();

[/java]



But you will need to set more planes geometries. As there will be AlphaAdditive material.

1 Like
@mifth said:
Ok, i fixed fog in the java code.

You will need to set fog to black. As there is additive material. :)

http://code.google.com/p/jmonkeyplatform-contributions/source/detail?r=508


Thanks

There is an error on FakeParticleBlow.vert:
ERROR: 0:52: error(#143) Undeclared identifier pos
ERROR: 0:52: error(#224) Illegal length of matrix field selection xyz
WARNING: 0:52: warning(#402) Implicit truncation of vector from size 1 to size 3.

Take a look when you have time please

Update: This error happens when I use SkyFog
@H said:
Thanks

There is an error on FakeParticleBlow.vert:
ERROR: 0:52: error(#143) Undeclared identifier pos
ERROR: 0:52: error(#224) Illegal length of matrix field selection xyz
WARNING: 0:52: warning(#402) Implicit truncation of vector from size 1 to size 3.

Take a look when you have time please

Update: This error happens when I use SkyFog


Can you send entire log?

There should be lines with the vert shader (143 line).
@H said:
Thanks

There is an error on FakeParticleBlow.vert:
ERROR: 0:52: error(#143) Undeclared identifier pos
ERROR: 0:52: error(#224) Illegal length of matrix field selection xyz
WARNING: 0:52: warning(#402) Implicit truncation of vector from size 1 to size 3.

Take a look when you have time please

Update: This error happens when I use SkyFog



Fixed here:
http://code.google.com/p/jmonkeyplatform-contributions/source/detail?r=510

THANKS MAN!

Hi everyone

I’m creating a boardgame and I’m trying to create an effect of card selection using FakeParticleBlow Shader.

You can see the result in: http://hub.jmonkeyengine.org/forum/topic/selection-effect/#post-272895

I would like to change the animation. I want to create a clockwise animation around the card. And add glow and bright to it. I don’t have a background about shaders, can you help me to understand .frag and .vert, and what else I need to study to change these modifications.

Thanks for all help :slight_smile:

Tati

@tatiana.evers said: Hi everyone

I’m creating a boardgame and I’m trying to create an effect of card selection using FakeParticleBlow Shader.

You can see the result in: http://hub.jmonkeyengine.org/forum/topic/selection-effect/#post-272895

I would like to change the animation. I want to create a clockwise animation around the card. And add glow and bright to it. I don’t have a background about shaders, can you help me to understand .frag and .vert, and what else I need to study to change these modifications.

Thanks for all help :slight_smile:

Tati

Sorry, you certainly need to dig into shaders. I guess it should be changed in a vertex shader.

@mifth said: Sorry, you certainly need to dig into shaders. I guess it should be changed in a vertex shader.

You can do this using the emitter system I wrote. You can also do this with the 2D emitter that is part of tonegodGUI.

For the regular emitter would require a specific mesh for the emitter shape. To make the needed… you would:

  1. Extrude the shape of the card and remove the top and bottom faces (only keeping the sides).
  2. Sub-divide the faces until it has as many sections as you would like to emit particles from.
  3. Set this as the mesh to use as an emitter shape.
  4. Set the setUseSequentialEmissionFace(true)

For the 2D emitter:

  1. Create a black and white image that is an outline of the card
  2. Set this image as the emitter shape
  3. Set the emitter to use centered velocity.

To make it trace the shape, use the direction influencer, set it to fixed direction and update the rotation during the update loop.

Here is how it works with the 3D emitter (right around 0:35 seconds)
[video]http://youtu.be/LDxpBcMrDJ4[/video]