Hi Thorsten,

> De: "Renk Thorsten" <thorsten.i.r...@jyu.fi>
> À: "FlightGear developers discussions" 
> <flightgear-devel@lists.sourceforge.net>
> Envoyé: Samedi 10 Novembre 2012 13:34:30
> Objet: Re: [Flightgear-devel] Moonlight reloaded
> 
> > If you need any information about the moon's position and/or phase,
> > just
> > let me know. It should be trivial to extract these values from the
> > ephemeris code.
> 
> Thanks, that was what I was hoping for :-)
> 
> It depends a bit on if Fred wants to do anything with the moon - my
> scheme would be fine with the angle of the moon above the horizon
> and the moon phase (or, as Curt explained, equivalently the relative
> angle between sun and moon) as properties. I think I have a
> brightness curve of moonlight as a function of phase somewhere, so
> from there I'd be good.
> 
> However, if we want directional moonlight in Rembrandt, then I guess
> the info has to flow to the shader in a more direct way (like
> gl_LightSource[1].position) - in which case I'd use it from there.

Don't wait for me.
Anyway, sun direction and colors are given to shader via normal uniforms 
that are updated here (in Rembrandt mode only) :
http://gitorious.org/fg/flightgear/blobs/next/src/Viewer/renderer.cxx#line1570

Moon equivalent should go the same way. I just don't have an idea on own to 
balance sun light and moon light without knowing the time of day or having 
test on the light direction. I suspect the difference in light intensity 
(dynamic range) doesn't fit in an 8-bit 3-component color.

I was also thinking about replacing sun values by the one from the moon during
night in the C++ code, without telling to the shaders. I didn't ponder on the 
cons of that approach thought.

Regards,
-Fred

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to