On June 20, 2005 12:53 pm, Harald JOHNSEN wrote:
> 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 ;)
> Harald.

Nice!  We will finally be able to see at night in FlightGear. =)

On June 20, 2005 04:15 pm, Josh Babcock wrote:
> I think the shadows are cool, but I think that being able to have
> spotlights is just awesome. Perhaps we should start thinking about how
> this will be implemented from the modeler's perspective.
> ...
> A really cool bit of eye candy would be to make a visible cone of light
> that would change intensity based on how much moisture is in the air.
> That can even produce blinding reflection in a heavy fog, which IMO
> would be very cool to see. It would be great to see two beams stabbing
> out in front of a landing jetliner!
To increase flexibility, I think it would be a good idea to allow the modeller 
to specify the light volume.  This way, the spot light can take the shape of 
a star if the modeller desires.  So, to light the interior of a hangar, all 
there would need is a box that is as big as the hangar itself.  For normal 
spot light, the modeller can specify a cone as the light volume.  For a 
linear light source, the modeller can use a triangular prism to outline the 
space being lit.

The modeller-specified object can also be served to control the parameters of 
the spot light.  Obviously, the width of the beam would be proportional the 
the thickness of the object.  In addition to using XML to control the 
brightness of the light source, the size of the object itself can be used to 
calculate the brightness factor.  The color of the object would be a 
contributing factor to the color of the light source.

The modeller-specified object should not be hidden by default, however.  The 
modeller would have to make the object hidden manually by setting the 
object's opacity to zero.  An object that is not totally transparent will be 
self illuminating.  This way, places such as hangar interiors can be served 
as prop and acted as the light volume simultaneously.

> I guess it would still be up to the modeler to provide Melchior style
> billboards so that the actual light would be visible. I'm not sure how
> one would deal with the directionality of the light though. One can
> also add lights for the nav lights. Imagine being able to look out the
> cockpit window and see your anti-collision lights reflecting off the ramp!
Yes.  The same idea occured to me while I was coming home on the bus. =)


Flightgear-devel mailing list

Reply via email to