Ampere K. Hardraade wrote:
Finally, is there a potential for this technique of generating shadow to be
used on generating the effects of spot lights (eg. landing light, taxi light,
logo light, etc.)?
You are a genius, forget my previous reply.
We can't lighten pixels from the framebuffer because of the low
precision (8 bits) but we can of course darken them.
Algo (works better at full night) :
1) render the scene and all non emissive geometry with a 'day' ambient term
2) render all lights (or emissive geometry) and update the stencil
buffer ( stencil := 1)
3) render a quad on screen to darken everything where stencil == 0
with 1 & 3 the scenery goes dark/black as usual
with 2 the scenery in light stay illuminated
Its quasi free, simple, support a million (fake) spot light ;)
Flightgear-devel mailing list