Create flashlight?

Whats the best way to create a flashlight?

With that I mean a light that spreads from one point in one direction. Can I use DirectionalLight?



How can I place an object (in my case a light) in a constant distance to the camera direction?



Thx

Well at least half life 2 does not use a real light for that, instead they project a white(ish) texture out of the flashlight.

Same goes for Killingfloor I would say.





Well, that’s one possibility. Just how can I do that? xD

The second question i also an important one! :slight_smile:

-Well in jme2 you could use a projected texture, it had an example you may be able to find out how they did it and implement it in jme3

-You could experiment with a semitransparent decal (doa ray add a mesh there with the form of the flashlight

-Use a own shader for the Material, and implement a way to simulate a flashligh (probably the most complex, but also fastest method)

-You could also try it with a small pointlight at the end of the flashlighttrace, this might have the same effect (probably best work/result ratio at least this is where i would start)