How to learn shaders in jme? (I need it to wave a flag)

I want to learn using and writing shaders in jme to simulate a waving flag…
where is the step by step tutorial and docs?
if you did it (waving flag) please share your code.

I did a search, it literally only took 5 seconds, considerably less time than it took to write this, read the OP or even author the OP…

It’s from 2004 :stuck_out_tongue:
That said no reason it couldn’t be adapted - I am not the person to ask, would you want to make the necessary changes to get it working in jme3 or would you start over and do it as a shader?

I am learning shaders atm, it doesn’t seem overly difficult if you put some time into it. Do you actually want a flag that reacts to physics or is this just a looping animation with no dynamic interaction with physical objects?

I want to write a waving animated flag . yes a looping animation with no dynamic interaction with physical objects.
I watched a video clip on youtube that had done it via shaders in jme.

Animation is the keyword here.
Check out @Ali_RS Tutorial about how to bake such things from blender into a regular animation

1 Like

would you mind giving me a link?

I didn’t know that using Google is so difficult. @yn97, you should learn to use it, no joke!

1 Like

I’m pretty sure you’re looking for this series:

Especially Part 7.1 and 7.2

Hi Younes

I have not created video tutorial for flag waving.
This is just a demo video and do note i am not using shaders, it is just a animation i am playing by updating mesh.

You can do usual soft body animation in blender.You can search the web for “Animating flag using blender softbody” . There are lots of videos on youtube.
Then for importing it in jme, here is how i am doing it

If you run to any problem please ask.

Why are you trying to do these with shaders?

It would be much easier to just do it with an animated model.

If you need, I can even help you with that, as I too will be adding animated flags to my game in the next few days.

1 Like

I think the easiest way to do this in the shader would be to use a normal map to distort the texture and scroll the normal map. This does not modify the actual geometry, just gives the illusion of movement. Here’s an example: Deus Ex 3 – Folds | Simon schreibt.

1 Like

Hi Joehot, did it work to you to make a flag using animated model?
If you used blender cloth simulation, how did you get it exported into JME?