Lightprobes and muzzle flash

hi guys,
i want to experiment with muzzles using the approach in shadowgun, using lightprobes, the thing is, i don’t know quite yet where to start, can anybody give me a pointer?
Sorry for such a vague request, but i’ve looking at the shadowgun sample and i can’t figure out how they did it ( i know it must be something with the shader?)
Any help is very appreciated.
All the best

Actually, you can simply search for the nearest light probe, and change it’s brightness, the shader on your surrounding mesh will behave accordingly. Here’s some documentation :slight_smile:

http://docs.unity3d.com/Documentation/ScriptReference/LightProbes-coefficients.html

Thank you for your answer!, very useful.
But this means you have to pack more probes in your scene (since each probe could be illuminating more than one character).
I wonder if it’s better just having a light flickering to achieve the same results.
All the best!

Well, the probes take up a tiny amount of memory overhead and their illumination is very cheap. I haven’t had a chance to benchmark it yet, but I would imagine adjusting the light probes would be better than a light you keep around purely to illuminate things, particularly on mobile platforms where the light will instantly double the draw calls of anything it touches.

cool, thanks for your advice!
Thinking about this -and for future reference i guess- it seems it’s not enough just to find the nearest light probe (you can query all light probes positions using the API), but also, the nearest in front of your character (you don’t want a flashing back), so i guess you can use the dot product to get the best candidate, and then change its values.
Well, time to start coding, thanks again for pointing me in the right direction :slight_smile: