Forceshield – my very first shader

I just wrote my very first shader… uff. It’s force field which can display up to 8 hits.

demo:

http://www.youtube.com/watch?v=uu2nbaBM9Pk

13 Likes

nice work man, i like it :slight_smile:

Nice! This is something I could use. :smiley:



What is configurable in it? Does it use the model’s bounds? Could I use that? I imagine the color is also configurable and the textures?

Texture, color, minimal visibility, effect duration and size are configurable. It’s control set to sphere, which sets material on it.

Hits are registred as contact point position using this control and effect animation is based on distance from contact point and time. So if you set contact point on object it shows animation like above. If you put it in front of it it should display same effect with smaller radius.

Link to ugly and poorly documented code :slight_smile:

Ah, nice. :slight_smile:



The only wish I’d have is to be able to override the mesh so if I wanted to use, for example, an oval surrounding a ship, or a cube (anyone can thing of Borgs?) it could be done.



Except for that, great job.

Box or oval should be possible to use. Only problem is that it has to be higher-poly because distace is calculated from vertex.

I just made cube in blender (for some strange reason I could not export create highpoly cube, so it’s some kind of bended cube) and here’s result (texture mapping is wrong, it can be fixed):

http://www.youtube.com/watch?v=urzMiUeHsCc


I just changed model and it works

That’s real nice. I like!



Just a tiny bit of criticism here though. It would be much better if the mouse was “free” and you could move the camera around when you clicked on the “field”. As it is now, with the camera moving, it’s hard to properly see the effect. :slight_smile: Just saying. It’s not a big deal.



As for your other post about higher vertex count, that shouldn’t be a problem if you specify it in the Javadoc.

Very very nice :slight_smile:



the real forceshield! Just Rate your post! :smiley:

@ficik: How did you get to run that scene fast with the HoverCraft added? Because the HoverCraftTest is very slow with its HullCollisionShape.

@glaucomardano there is no glow and HoverCraft has no collisionShape :slight_smile:

1 Like

@ficik , would you like to share your shader?



I did a JME shader library: http://code.google.com/p/jme-glsl-shaders/



I can add your shader or add you as a member of the shader library project.

@mifth it would be honor to me :slight_smile:



But don’t add it now. I need to fix few things and improve comments. I’ll post new version soon.

COOOOLLL!!! Would you like to be a member of a project or just paste a code here?

If you want to be a member, so I need your email to give you an access.

I’m not going to work on more shaders or keep improving this one. I’ve got right now what I need for my game. So for now code-pasting would be enought. Maybe next time, but thanks.

newer version

  • limit to number of hits set in java
  • added bit more comments

Cool!!! Can you paste a simple example with its usage. I will put it in the shader library too.

Also I can paste your youtube link example if you don’t mind.

very nice :stuck_out_tongue:

@mifth I’m sorry i didn’t have much time last few days. You can of course use youtube link (it’s under CC-BY :slight_smile: ). I’ll write new example asap.