Re: [Flightgear-devel] RFC: A new sun
Hi there! After some time of coding and restructuring I finally managed to clean up the repaint-code using the property-tree as interface for the data between fg and sg. Now everything is calculated where it's supposed to be: Environmental data in fg's environment, positional data in the reposition code and color in repaint. Nice and clean ;-) I'm using the following property-tree nodes for interaction between the sun-code and the environment: /environment/relative-humidity // data for repaint /environment/atmosphere/density-tropo-avg// data for repaint /environment/atmosphere/altitude-half-to-sun // data for calculating avg density /environment/atmosphere/altitude-troposphere-top // data for calculating avg density Is the location of the nodes ok, or should I move them somewhere else? I'm really happy about the solution with the property tree. Since everything is working fine, I can address the other points in the coming days. Mark Melchior FRANZ wrote: > * Melchior FRANZ -- Monday 10 July 2006 20:24: > >> If you let fgfs tell sg which node to get the density from, and >> make this a node with tied getter function, [...] >> > > Or, illustrated with some code: > > > fgfs: > > static double calc_density() { > // stuff > return density; > } > > void Whatever::bind() { >fgTie("/calculate/density", calc_density); > } > > void Whatever::unbind() { >fgUntie("/calculate/density); > } > > > now you tell sg that it can have the density from /calculate/density, > and whenever sg or anyone else reads that property, the density is > calculated freshly (and only then). > > m. > > > - > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > ___ > Flightgear-devel mailing list > Flightgear-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/flightgear-devel > - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] RFC: A new sun
Hi Durk, The previous sun implementation was very fine. Actually I only changed maybe 20%. Finetuning, if you like. So you did a great job on that. I also made the same observation with the halo turning to be more of an ellipse at the horizon. Actually the sun gets squeezed too and this is related to the horizon effect we are already using. Since we are using textures now for everything, it shouldn't be too hard to emulate this in the horizon-effect code. Hm, yes, the outer halo. Well, I made this texture really quickly and it probably could be improved so that it blends better. But I still think the problem is mainly that the colors of the skydome and fogcolor don't fit the halo's color. CU Mark Durk Talsma wrote: > On Sunday 09 July 2006 19:03, Mark wrote: > >> Hello everybody, >> >> I've been experimenting with a redone implementation of the sun in simgear. >> My goal is to create a more acurate looking sun that also has more >> variability in its appearance. >> I'm pretty much done and like to ask for comments and advice. >> >> For those of you who'd like to take a look at my current results: >> >> http://www.akermann.org/fgfs/sun_light_yellow.jpg >> http://www.akermann.org/fgfs/sun_yellow.jpg >> http://www.akermann.org/fgfs/sun_orange.jpg >> http://www.akermann.org/fgfs/sun_white.jpg >> >> > > This looks great. The original "sun changes color near the horizon" scheme > was > done by me, and if I recall recorrectly has been fine tuned by various people > over the years. The original scheme has always been a bit of a hack waiting > for a proper implimentation, and I would consider your atmosphere based code > to be exactly that. Thanks for your contribution. > > I agree with other people commenting that the edge of the halo looks a bit > too > explicit, but I believe that's something that can be fine tuned. > > Another thing to consider is that while the halo is oftentimes more or less > circular when the sun is high in the sky, I get the impression it compresses > as the sun sinks toward the horizon, and blends in with the rest of the > (reddish) sky. I never really came up with a good solution to do this, so > I've always left the halo as a perfectly round disk. > > Cheers, > Durk > > > - > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > ___ > Flightgear-devel mailing list > Flightgear-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/flightgear-devel > - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] RFC: A new sun
Great! I wasn't aware that the property tree could also trigger functions after they are bound. So now I'll have to see how I can integrate my code with fg's environment. I hope i'll have some time for this on the weekend. Thanks alot, Mark Melchior FRANZ wrote: > * Melchior FRANZ -- Monday 10 July 2006 20:24: > >> If you let fgfs tell sg which node to get the density from, and >> make this a node with tied getter function, [...] >> > > Or, illustrated with some code: > > > fgfs: > > static double calc_density() { > // stuff > return density; > } > > void Whatever::bind() { >fgTie("/calculate/density", calc_density); > } > > void Whatever::unbind() { >fgUntie("/calculate/density); > } > > > now you tell sg that it can have the density from /calculate/density, > and whenever sg or anyone else reads that property, the density is > calculated freshly (and only then). > > m. > > > - > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > ___ > Flightgear-devel mailing list > Flightgear-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/flightgear-devel > - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] RFC: A new sun
On Sunday 09 July 2006 19:03, Mark wrote: > Hello everybody, > > I've been experimenting with a redone implementation of the sun in simgear. > My goal is to create a more acurate looking sun that also has more > variability in its appearance. > I'm pretty much done and like to ask for comments and advice. > > For those of you who'd like to take a look at my current results: > > http://www.akermann.org/fgfs/sun_light_yellow.jpg > http://www.akermann.org/fgfs/sun_yellow.jpg > http://www.akermann.org/fgfs/sun_orange.jpg > http://www.akermann.org/fgfs/sun_white.jpg > This looks great. The original "sun changes color near the horizon" scheme was done by me, and if I recall recorrectly has been fine tuned by various people over the years. The original scheme has always been a bit of a hack waiting for a proper implimentation, and I would consider your atmosphere based code to be exactly that. Thanks for your contribution. I agree with other people commenting that the edge of the halo looks a bit too explicit, but I believe that's something that can be fine tuned. Another thing to consider is that while the halo is oftentimes more or less circular when the sun is high in the sky, I get the impression it compresses as the sun sinks toward the horizon, and blends in with the rest of the (reddish) sky. I never really came up with a good solution to do this, so I've always left the halo as a perfectly round disk. Cheers, Durk - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] RFC: A new sun
* Melchior FRANZ -- Monday 10 July 2006 20:24: > If you let fgfs tell sg which node to get the density from, and > make this a node with tied getter function, [...] Or, illustrated with some code: fgfs: static double calc_density() { // stuff return density; } void Whatever::bind() { fgTie("/calculate/density", calc_density); } void Whatever::unbind() { fgUntie("/calculate/density); } now you tell sg that it can have the density from /calculate/density, and whenever sg or anyone else reads that property, the density is calculated freshly (and only then). m. - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] RFC: A new sun
* Mark -- Monday 10 July 2006 20:14: > However, as it appears you can only read and set the information in the > property tree. But what I would need is a function I could call that > calculates some values. So even when I would use the set-methods to put > my data in the property tree, this wouldn't be adequate. Huh? If you let fgfs tell sg which node to get the density from, and make this a node with tied getter function, then you have what you need, no? m. - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] RFC: A new sun
Hi, I looked at the rain code and it seems a more elegant solution than what I've done so far. I just passed the needed info as elements of a struct which I filled with the same get-methods in renderer.cxx. However, as it appears you can only read and set the information in the property tree. But what I would need is a function I could call that calculates some values. So even when I would use the set-methods to put my data in the property tree, this wouldn't be adequate. The reason for this is that I'm considering the average density along the light-path. This is necessary because it can differ vastly depending on the planes position and results without this aren't realistic. For example, take two positions, in which the distance of the light-path is equal but the altitude of the observer is different. The sun will be much more yellowish for the observer at a lower altitude because the average density is higher and there's more scattering taking place. Also the light-path can go through areas of higher and lower density if the observer is at a higher altitude and the sun is setting. In this case the light first travels through low density arriving from the sun, then higher density at earth-level and then again traverses low density air at the observer. So only taking the observers density and the density at the top of the atmosphere in account is not going to act as a accurate substitute. To figure out the average altitude I determine the density at the observers position, the density at about 8-16 km (depending on the lat due to different thickness of the stratosphere at the poles and the equator) and the density at the half of the distance the light travels through the stratosphere. This gives a rough idea of the average density that is good enough for our purposes. So ideally I would have to pass an altitude to the function and it should return the density at that height. But then the environment code is in Flightgear. I could, however, put the code somewhere else in Simgear, but what's the sense to scatter basically the same type of functions around different parts of fg/sg? I don't know. Any Ideas? Mark Melchior FRANZ wrote: > * Mark -- Sunday 09 July 2006 19:03: > > Looks beautiful, indeed. (Only the outer halo border is a bit too > obvious. :-) > > > > >> Right now i'm doing alot of calculations in the repaint-method that >> deals with enviromental values, such as humidity, visibility and density. >> This is necessary, since this kind of information currently is dealt >> with in FlightGear's Enviroment branch. Since the sun is calculated in >> Simgear, I can't access the information there. >> > > Look how the rain code does it. It uses default parameters, but has > a config function in simgear/environment/visual_enviro.cxx that is > called with a property node as argument. This is then called from > fgfs and tells simgear where to get the 'real' parameters from. > > SGEnviro::config(const SGPropertyNode* n) > > m. > > > - > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > ___ > Flightgear-devel mailing list > Flightgear-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/flightgear-devel > - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] RFC: A new sun
Thank you! Yes, I agree the border looks somewhat displaced but this is actually because the fogcolor and the skydome don't match the sun (yet ;-). It's noticeable especially in the picture with the Citation or if the sun gets orange-red while the sky's blue and the fog is pinkish. If the sky/fogcolors would be close to the outer halo you won't notice. Besides the halo get's smaller the higher the sun is, so the big halo is actually only visible at angles near the horizon. I'll take a look at the visual_environment code these days (if it's not to hot to sit in front of this heater called computer...). I hope this'll bring a solution, however i'm not quite sure if i can get everything out of the repaint method. We'll see and I'll keep you informed. @Vassilii: *g* What a compliment ;-) Mark Melchior FRANZ wrote: > * Mark -- Sunday 09 July 2006 19:03: > > Looks beautiful, indeed. (Only the outer halo border is a bit too > obvious. :-) > > > > >> Right now i'm doing alot of calculations in the repaint-method that >> deals with enviromental values, such as humidity, visibility and density. >> This is necessary, since this kind of information currently is dealt >> with in FlightGear's Enviroment branch. Since the sun is calculated in >> Simgear, I can't access the information there. >> > > Look how the rain code does it. It uses default parameters, but has > a config function in simgear/environment/visual_enviro.cxx that is > called with a property node as argument. This is then called from > fgfs and tells simgear where to get the 'real' parameters from. > > SGEnviro::config(const SGPropertyNode* n) > > m. > > > - > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > ___ > Flightgear-devel mailing list > Flightgear-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/flightgear-devel > - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] RFC: A new sun
Beautiful. Thank you very much for doing this. The screens eluded gasps from my 2 elder sons watching over the shoulder; one even asked if it's a real photo or a FGFS capture - and said he was asking because the sun is usually much more dull in FG :-) (I was silent all the way and didn't introduce the capture as anything dealing with the sun). Vassilii - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] RFC: A new sun
* Mark -- Sunday 09 July 2006 19:03: Looks beautiful, indeed. (Only the outer halo border is a bit too obvious. :-) > Right now i'm doing alot of calculations in the repaint-method that > deals with enviromental values, such as humidity, visibility and density. > This is necessary, since this kind of information currently is dealt > with in FlightGear's Enviroment branch. Since the sun is calculated in > Simgear, I can't access the information there. Look how the rain code does it. It uses default parameters, but has a config function in simgear/environment/visual_enviro.cxx that is called with a property node as argument. This is then called from fgfs and tells simgear where to get the 'real' parameters from. SGEnviro::config(const SGPropertyNode* n) m. - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] RFC: A new sun
> Hello everybody, > > I've been experimenting with a redone implementation of the sun > in simgear. > My goal is to create a more acurate looking sun that also has more > variability in its appearance. > I'm pretty much done and like to ask for comments and advice. > > For those of you who'd like to take a look at my current results: > > http://www.akermann.org/fgfs/sun_light_yellow.jpg > http://www.akermann.org/fgfs/sun_yellow.jpg > http://www.akermann.org/fgfs/sun_orange.jpg > http://www.akermann.org/fgfs/sun_white.jpg Very nice. Jon - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
[Flightgear-devel] RFC: A new sun
Hello everybody, I've been experimenting with a redone implementation of the sun in simgear. My goal is to create a more acurate looking sun that also has more variability in its appearance. I'm pretty much done and like to ask for comments and advice. For those of you who'd like to take a look at my current results: http://www.akermann.org/fgfs/sun_light_yellow.jpg http://www.akermann.org/fgfs/sun_yellow.jpg http://www.akermann.org/fgfs/sun_orange.jpg http://www.akermann.org/fgfs/sun_white.jpg As you can see the sun's color differs depending on weather conditions and time of day. The implementation is based on the physics that actually affect the suncoloring. So by figuring out the amount of Raleigh Scattering, it calculates the colors. What the implementation calculates is basically the distance the light travels through the atmosphere (depending on sunangle and atmosphere thickness), the density and humidity which all influence the amount of scattering and uses this to determine the color. The sun consists of three textures for the suncore, a halo directly surrounding the sun and an outer halo. Each of them has a different color. The size of the halos also vary depending on sunangle and visibility. Although there is more calculation done in comparision to the existing implementation, the effect on framerates is insignificant. At least I didn't notice a difference. Now, the current glitch i'd like to ask you for advice is this: Right now i'm doing alot of calculations in the repaint-method that deals with enviromental values, such as humidity, visibility and density. This is necessary, since this kind of information currently is dealt with in FlightGear's Enviroment branch. Since the sun is calculated in Simgear, I can't access the information there. So adding the missing calculations there wouldn't make sence and I have to take care of that in Simgear/the sun-code. Any ideas how this could be done more elegantly? What should be changed before it is commitable to cvs? Oh, if you wan't to experiment with the implementation here's what you'll need: - Textures for the halos in $FGROOT/Textures/Sky: http://www.akermann.org/fgfs/halos.tgz - Patches for files in FG: http://www.akermann.org/fgfs/fgfs-diff - Patches for files in SG: http://www.akermann.org/fgfs/simgear-diff Mark - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel