[SOLVED]bullets emmiting light

Hi, I’m working in a Shoot em Up test in jmonkey, and the ship shoot spheres, I want that spheres emmite light, I try making and scene with a sphere and add a light but dont work, how I can do this? I want the bullets look like the picture.



http://imagenes.es.sftcdn.net/es/scrn/48000/48982/chromium-bsu-11.jpg



Somebody can helpme to give this effect?



Thanks.

I have a suggestion for how you may consider doing this. May work for you.



You could potentially add this effect after the fact. Render your scene the way you are, but also render your projectiles separately. Use the rendered projectiles texture as a map for producing the glow effect in a frag shader that composites this and the rendered scene. You can also give the effect of the ground being “lit” by the passing projectiles (minus shadow casting of course).



If you do not want to have to render the projectiles separately, you could use an unshaded texture and pick a color (like neon green). Sample the texture and knockout everything but the green. The problem is, if you do not break up this part and the glow effect into separate passes, you will be a bit limited as to what you can do. You really need the projectile map and rendered scene as two separate textures to work with in the shader to produce the effect you are looking for.



Anyways… this is how I would do it.

1 Like

Ok, I have tried this with a simple image black with a with circle in the middle and add this code



[java]



FilterPostProcessor fpp=new FilterPostProcessor(assetManager);

BloomFilter bloom=new BloomFilter();

//BloomFilter bloom=new BloomFilter(BloomFilter.GlowMode.Objects);

fpp.addFilter(bloom);

viewPort.addProcessor(fpp);



[/java]



and I get the result that I looking for, but the post processing is apply to all the viewport, How I can do the render separately like you say?



Thanks.

un-comment the line you commented and set a GlowColor (or GlowMap) on your bullets’ material.

see this doc

https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:bloom_and_glow

You could put a transparent alphaadditive circle of the correct colour (less transparent near bullet, fading out to alpha 0 at the edge) around your bullet orientated towards the screen. That would give the appearance of a glow.



Also take a look at the deferred rendering stuff being worked on at the moment. When that comes in it will in theory allow you to have hundreds of real light sources in a scene…

Thanks for all, the BloomFilter bloom=new BloomFilter(BloomFilter.GlowMode.Objects); work fine.



Bye.