Board index FlightGear Development Effects and shaders

Colour Temperature

An exciting "new" option in FlightGear, that includes reflections, lightmaps, the particle system etc.. A lot is yet to be discovered/implemented!

Re: Colour Temperature

Postby curt » Sun Sep 18, 2016 6:25 pm

I believe rembrandt uses a multipass rendering scheme that could (and does) allow for various post processing filters. However, ALS uses a single pass rendering scheme (I believe) so as a result does not facilitate a post processing filter scheme without adding an extra rendering pass (which would be a very noticeable frame rate hit for most people ... I believe.)
Aerospace Engineering and Mechanics
University of Minnesota
curt
Administrator
 
Posts: 1092
Joined: Thu Jan 01, 1970 12:00 am
Location: Minneapolis, MN

Re: Colour Temperature

Postby abassign » Sun Sep 18, 2016 10:12 pm

bugman wrote in Sun Sep 18, 2016 5:34 pm:@Abassign: For the post processor step, how would that be done in the OpenSceneGraph system used by FlightGear?
Edward


Good question, I often wonder what use OpenSceneGraph, if in the end someone has to put OpenGL code without a minimum of technical documentation. Honestly I do not know the way that the code (written by someone in OpenGL) do. My impression is that we are at the mercy of programmers who like to pretend to be the "best in class" when in truth those who develop code in any industrial environment, open-source or for fun, he must do it with the consciousness that one day it could not be him to maintain that code that has previously written.
In these cases, direct experience of work, is much more efficient throw it all away in a toilet, and start take advantage of starting with programs and/or libraries that others have developed and better documented!
This trivial request to insert filters, like other flight simulators already do for years, which can not be satisfied due to lack of documentation, it seems to me exemplary to make the greatest risk of all FGFS project can end the day that there is not will be the person who wrote tons of mysterious code.
Increase the load of GPU work does not think it is a problem for many users, though allows to have the visualization of reality for them more correct.
Intuitively (but of course I may be wrong totally) I think OpenSceneGraph make the first part of the work, what one sees if ALS or Rembrandt are not active. Then when ALS or Rembrandt are active these make up the rest of the work. Then I do not know what happens to the frame buffer that contains the image if it is given back to OpenSceneGraph or follows another way, I'd like to know how is the architecture without having to study thousands of lines of code written with very few comments.
abassign
 
Posts: 691
Joined: Mon Feb 27, 2012 5:09 pm
Location: Bergamo - Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2016.3
OS: Linux Mint 17. x

Re: Colour Temperature

Postby Thorsten » Mon Sep 19, 2016 4:51 am

In these cases, direct experience of work, is much more efficient throw it all away in a toilet, and start take advantage of starting with programs and/or libraries that others have developed and better documented!


I'm sure the proposal to break every existing rendering effect and the request that all aircraft developers do all from scratch with code none of us has any working experience with because you don't want to adjust your monitor's color temperature will make the rest of the FG community very happy :-)

Could we keep it realistic please? You need to be able to read code to modify it - if you don't understand how a rendering pipeline works and how it's set up, you can't read the corresponding code and you can't expect to be able to modify it, on the other hand knowing how it all works, I was quite able to modify Stuart's tree code when I needed.

So we're not talking about a lack of documentation, we're talking about absence of important background knowledge here.
Thorsten
 
Posts: 9370
Joined: Mon Nov 02, 2009 8:33 am

Re: Colour Temperature

Postby abassign » Mon Sep 19, 2016 12:51 pm

Thorsten wrote in Mon Sep 19, 2016 4:51 am:I'm sure the proposal to break every existing rendering effect and the request that all aircraft developers do all from scratch with code none of us has any working experience with because you don't want to adjust your monitor's color temperature will make the rest of the FG community very happy :-).


If I understand correctly this is your solution to the problem ...

Image

I honestly do not know if it's a great solution, since I have the distinct impression that no one except you, knows what which inserted into "ALS". At this point it seems clear that to use another rendering engine could only expand the knowledge base and not reduce it to a single person who, one day, if he wins a lottery, he might decide to do other more interesting activities ...
abassign
 
Posts: 691
Joined: Mon Feb 27, 2012 5:09 pm
Location: Bergamo - Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2016.3
OS: Linux Mint 17. x

Re: Colour Temperature

Postby Thorsten » Mon Sep 19, 2016 1:04 pm

Look, I don't know what precisely you expect - since I've said as far as I'm concerned there is no problem but we're solving correct physics, I'm not trying to solve a problem here.

As for your request, it's really up to you.

* I'm guessing your monitor has the technology to change color temperature ready - so that works pretty quickly.

* You can spend a few weeks of your life learning GLSL and the FG effect framework and add your own post-processing filters.

* You can also spend a few months of your life learning OpenSceneGraph coding and add your own optional post-processing stage.

* You can also spend a few years of your life hooking up FG with a different rendering backend (judging by the OSG migration, that seems to be about the timescale...)

The thing I don't really get is why you expect that I (or anyone else) should spend a month of my life doing something you think best when I really don't. If you believe using a rendering library is about copying a few files and changing a path in the compiler, I think you're in for a very very bad surprise. If you think we're better off with code none of us has developed and any experience with than with code that has been grown and maintained by FG over the years, you're in for a very very bad surprise.

Just try something yourself - anything - work a few weeks on it, struggle with bugs, figure out ten ways how it doesn't work - maybe that gives you the appreciation for what kind of work it is you want to throw 'into the toilet' and how 'trivial' your request is. Because as far as I can tell, there's no 'we' in any of this - you're expecting someone else to do the work according to your specs.
Thorsten
 
Posts: 9370
Joined: Mon Nov 02, 2009 8:33 am

Re: Colour Temperature

Postby ludomotico » Mon Sep 19, 2016 1:21 pm

abassign wrote in Mon Sep 19, 2016 12:51 pm:I honestly do not know if it's a great solution, since I have the distinct impression that no one except you, knows what which inserted into "ALS".


To be fair, ALS is one of the best documented projects I've ever seen:

- Introduction: http://wiki.flightgear.org/Atmospheric_light_scattering and also http://www.science-and-fiction.org/rendering/als.html
- Introduction to GLSL, as used by ALS: http://www.science-and-fiction.org/rendering/glsl.html
- Noise production, as used in many ALS techniques: http://www.science-and-fiction.org/rendering/noise.html
- Adding effects to models: http://wiki.flightgear.org/ALS_technical_notes
- Shaders are well documented with lots of comments. For example, check: https://sourceforge.net/p/flightgear/fg ... d-ALS.vert

But ALS is a complex project. You need a strong background on physics, a good understanding of how GLSL pipelines work, and you must run dozens of algorithms and efficiency tests to understand why the final implementation was chosen over the alternatives. You have to invest many long hours to fully understand ALS.

In addition, effects in FlightGear, regardless if they are generic, ALS or Rembrandt, are all together in two directories: FGDATA/Shaders and FGDATA/Effects. Probably, this is a constrain of FlightGear: we have three different renderers (four, if you count the "unofficial" osgearth), and all of them save effect files in the same directories. Some of the effects are shared between all renderers, such as the model-combined effect. This is the only "complain" I can make of the ALS documentation: it is not evident which file implements a specific ALS feature.
Last edited by ludomotico on Mon Sep 19, 2016 1:28 pm, edited 1 time in total.
User avatar
ludomotico
 
Posts: 990
Joined: Tue Apr 24, 2012 1:01 pm
Version: git
OS: Debian GNU/Linux

Re: Colour Temperature

Postby Thorsten » Mon Sep 19, 2016 1:27 pm

it is not evident which file implements a specific ALS feature.


Effects are responsible for all three frameworks, so by nature they have to be shared (the contain the logic which rendering framework is used) - the ALS-relevant sections are usually denoted by a comment and marked by the test in the predicate section.

All ALS shaders have the string *-ALS* somewhere in the filename (and usually the filename is descriptive as far as object and quality level are concerned - so terrain-ALS-base.frag handles terrain on base quality level, water-ALS-high.frag handles water at high quality level,...

So it's not really obvious to me how much more descriptive this could be made.
Thorsten
 
Posts: 9370
Joined: Mon Nov 02, 2009 8:33 am

Re: Colour Temperature

Postby abassign » Mon Sep 19, 2016 3:01 pm

@Thorsten

Thank you to start giving some information, it would be nice to put it in the Wiki, try entering a technical page for "ALS", I would not know in what capacity I think it would be useful for those who want to experiment with "ALS", maybe I'll write me too so that others can correct errors that certainly will put. I think it's important for those who want to experiment to learn how to have the attachment points with which to start to learn the techniques. It's a typical working method in programming like when you learn the C language and invariably the first program is "Hello World!".

Meanwhile, to make you understand the significance of the analysis I am doing you look at this image generated by "Lockheed Martin Prepar3D", as you can see is color-balanced, you see very well nearby images have little blue which then increases with distance, like I would expect to see in reality.
But the most important thing is that the dominant color in the highlights is not blue, but ... Green! The tonal range covers all 256 levels for each color channel, including the gray, this means that the image is well-balanced and in fact, if you fly at that altitude, I see just that! Obviously my monitor this see it ... I have a well-balanced monitor even if someone does not believe it!

Image
abassign
 
Posts: 691
Joined: Mon Feb 27, 2012 5:09 pm
Location: Bergamo - Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2016.3
OS: Linux Mint 17. x

Re: Colour Temperature

Postby Thorsten » Mon Sep 19, 2016 3:26 pm

Have you considered the possibility that Prepar3D has an artist doing the Rayleigh effect rather than a physicist and might have gotten it wrong as a result?

I believe ALS is actually quite a bit more sophisticated than what other flightsims run...
Thorsten
 
Posts: 9370
Joined: Mon Nov 02, 2009 8:33 am

Re: Colour Temperature

Postby abassign » Mon Sep 19, 2016 4:28 pm

Thorsten wrote in Mon Sep 19, 2016 3:26 pm:Have you considered the possibility that Prepar3D has an artist doing the Rayleigh effect rather than a physicist and might have gotten it wrong as a result?
I believe ALS is actually quite a bit more sophisticated than what other flightsims run...


Yours is a fair question to which I would like to give a comprehensible answer. In my physics laboratory (work on catalyst materials in hydrogen) I have many sensors, each with its own characteristics. Then I must combine all this data and insert them into a data-logging system to be able to read and evaluate with other programs (all of course is under GNU license ...;)) When my instrument measures a temperature produced by a thermocouple I must use a algorithm that reduces the temperature of the A/D converter junction point, my reading is absolute, but one that I can utilize is the absolute less the ambient temperature in which the A/D conversion is done.
If I used only the absolute reading (in Kelvin) you will never know the true temperature of the thermocouple as the temperature is given by a voltage differential.

When I was studying the ocular perception, I have always noticed that the eye does exactly the same thing, working in differential mode with a medium environmental value. In this way maximizes the contrast of the scene, that it can see better!
If you do the scattering of heaven obviously see a lot of blue radiation, this fact is due to a reissue (Rayleigh scattering), which arises from the fact that the blue radiation has higher frequency and a higher energy therefore prevail over the other. Why blue is more prevalent than the red of a factor: (700/400) ^ 4 ~ 10
So when we see things out the window illuminated indirectly are more blue than red! The interesting thing is that gradually that we get to share the atmosphere is reduced and then you tend to have a more balanced situation, until you get into the space where you no longer scattering. This is the reason why when you go to high mountains or high altitude flight colors are more saturated and photographers are very happy!
This confirms that, if you are at high altitude, it is correct that the Rayleigh scattering is more evident at low altitude and then the mountains in the background of a scene are blue, then the sky is darker because the atmosphere is less dense and therefore it is less than the Rayleigh scattering.
But what really see the eye?
As I told you the eye must maximization of the contrast and therefore "put things right", that reads the whole scene, it yields a mean value (the famous gray diagram) and adapts everything to that value (a kind of natural HDR!).
With your approach so there would be no problem if, for example, I used a pair of glasses type Oculus Glass (now buy them ;) ... )
Because the eye sees the whole scene and that alone and then automagically adjusts everything and sees in a balanced way! (If you are using a pair of green colored sun glasses after a few minutes you'll see all the colors and not you'll see that in fact there is so much green).
But I see a monitor, and then my eye sees on the monitor and the rest of the environmental scene, you forget about it, but the eye does this automatically with the micro-movements, like a fast scanner (the eye can not see permanently, sees only the variations versus time, a trick that automatically allows the elimination of background noise, the central blind spot (the eye has a blind spot in its center called "blind spot") and much even more!
At this point, with actual ALS setting, I see more blue, as if a blue filter has been added! Why the scene around me, usually ;) it is not blue!
For this you need to adjust the color temperature of the scene (and maybe even put a HDR filter, so you can enjoy all the color information produced with such effort by "ALS").
Sorry if I was particularly long risking making the figure of the teacher, but I think the important topic that can give FGFS a real touch of magic :)
abassign
 
Posts: 691
Joined: Mon Feb 27, 2012 5:09 pm
Location: Bergamo - Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2016.3
OS: Linux Mint 17. x

Re: Colour Temperature

Postby Thorsten » Mon Sep 19, 2016 4:55 pm

Because the eye sees the whole scene and that alone and then automagically adjusts everything and sees in a balanced way!


If that would be true, I would see a sunset as essentially white (or grey) - but I manifestly do not - I see the whole scene in red light (and in central Finland, the sun goes down in a very shallow angle, so we have very long sunsets - with O(30 min) time to adapt to the scene).

By the same token, looking out of an airplane window at 36.000 ft, I see an essentially bluish scene during the day. Nor do I know of anyone who claims to see sunsets as grey/white.

I've been scuba-diving, and I would definitely describe my experiences underwater as 'blue' - when I think back, I do not remember seeing colors, I remember seeing hues of blue (as I would expect). Photographs underwater taken with a flashlight show the near zone in colors, and so does night diving with a powerful lamp - as expected. So it's physics that determines what colors I see underwater, not perception.

I've never experienced adaption of the eye to a 'mean light color', nor have I ever read about it. The eye does adjust to a 'mean light level' and the eye sees very low intensity light as blue hue (moonlight appears bluish while in reality it is white) and very high intensity light as white (sunlight is green while we see it as white) - which ALS knows and takes into account - and that's about it as far as color shifts in perception are concerned.

So no, I don't believe such an effect is real, it would eliminate red sunset lights just as well as blue shadows under a clear sky.
Thorsten
 
Posts: 9370
Joined: Mon Nov 02, 2009 8:33 am

Re: Colour Temperature

Postby abassign » Mon Sep 19, 2016 5:52 pm

This confirms that it is a purely subjective, I can see a sunset with less red than you see yourself. The Impressionist painters almost all suffered from various visual defects (mainly were color blindness) which altered their color vision, and that made them paint with different color! It's normal for a very high percentage of the population! For this it is just what you did with "ALS", following a physical means, but it is necessary to insert a filter (which can be inserted or not as you did with the brightness filter) so that it fits to visual characteristics of the observer, the environment etc.

Basically if you noticed I never criticized the quality of the color produced by "ALS", but the fact that it can not be properly represented for each of us. This is the reason why I started with the Latin motto:

De gustibus non est disputandum

Because I was sure that you, like others, they would take my analysis as a criticism and not as an opportunity to improve the product. Any SW product must be able to obtain the most large percentage of the population satisfied (is one of the GNU assumptions!) And the population is made up of many different types are persons with different characteristics of view, of videos, of physical environments in which the running program. Obviously you can not get everything, but the inclusion of a filter that changes the color temperature is already a very good result as "ALS" by so much, and the correct image information that realizes.

And be careful, the filter should be placed in the bottom of the chain, in the frame-buffer, before it is sent to the display! The filter should not affect what he does ALS, Rembrandt etc ... But only on what the user sees!
abassign
 
Posts: 691
Joined: Mon Feb 27, 2012 5:09 pm
Location: Bergamo - Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2016.3
OS: Linux Mint 17. x

Re: Colour Temperature

Postby Thorsten » Tue Sep 20, 2016 5:38 am

This confirms that it is a purely subjective, I can see a sunset with less red than you see yourself.


You postulate a subjective effect - so by definition it is impossible to disprove you objectively since it's subjective. Surely you realize the logical situation.

I don't think if you'd take a vote here, you'll find other people who agree that the light during a sunset does not appear red. So there's that.

Basically if you noticed I never criticized the quality of the color produced by "ALS", but the fact that it can not be properly represented for each of us.


You're, I think, missing the point.

Idealized, it goes like this: If I have an (calibrated, unprocessed, insert a few more disclaimers about differences between photography and reality) photograph of reality, the aim is to make FG render the same. Whatever your visual systems and subjective impressions are, whatever your monitor settings are, whatever the lighting conditions in your room are - you would then agree that FG 'represents' the reality shown by the photograph.

Thus, once you manage to make your computer display photographs properly, FG will appear properly.

Which is to say, only settings specific to the simulated situation in FG should be adjusted by FG, settings specific to you and your viewing environment should be adjusted elsewhere. All else is a muddle.

To give a simple example - if you carry your laptop outside on a sunny day, it would seem reasonable to adjust laptop brightness (because all applications will be affected) rather than change brightness separately in each application.

Any SW product must be able to obtain the most large percentage of the population satisfied


No, actually not. I don't have to market anything - I'm not getting any revenue, the only enjoyment I get out of this is the satisfaction of having solved a complicated physics problem properly (which is also why a lottery winning would not change anything) - so to me it's the same if 10 users or 10.000 users are happy with it (in fact, 10.000 probably means a lot more bug reports to deal with...). So I will create it such that it solves a complicated physics problem properly (and that's the goal outlined in the mission statement) - there's two alternative renderers and the possibility to code yet more for people who have different ideas how things should be.
Thorsten
 
Posts: 9370
Joined: Mon Nov 02, 2009 8:33 am

Re: Colour Temperature

Postby agough » Tue Sep 20, 2016 8:54 am

Apologies for interrupting the discussion on whether color temperature should be a FG option, but ReShade works fine with FlightGear:

Image
[DoF example]

It includes loads of shaders for color options, never really explored it, but the performance hit doesn't seem too bad.
agough
 
Posts: 118
Joined: Thu Oct 23, 2014 9:54 am
Callsign: G-OUGH
Version: 3.7
OS: Windows

Re: Colour Temperature

Postby abassign » Tue Sep 20, 2016 12:02 pm

agough wrote in Tue Sep 20, 2016 8:54 am:Apologies for interrupting the discussion on whether color temperature should be a FG option, but ReShade works fine with FlightGear ...
It includes loads of shaders for color options, never really explored it, but the performance hit doesn't seem too bad.


WoW :)


There are more things in heaven and earth, Horatio,
Than are dreamt of in your philosophy.
- Hamlet (1.5.167-8), Hamlet to Horatio


How did you do, there can you explain it ?

But :( from http://reshade.me/

ReShade supports all of Direct3D8, Direct3D9 + Ex, Direct3D10.0 - 10.1, Direct3D11.0 - 11.3 and OpenGL. A computer with Windows Vista or higher (Windows 7, 8, 8.1 and 10) and the DirectX end-user runtime installed is required.


But: :(

But after the initial amazement, I must say that I do not think that programs of this kind serve to much, not being able to try (I do not have Windows), I can not say much more.

However, maybe I'm wrong, so I'd like to know this:

* Meanwhile, there are various problems, did not appear that there is a version for Linux and Mac
* The license does not know if it is compatible with the GNU
* Is there any alternative for Linux compatible with GNU license?
abassign
 
Posts: 691
Joined: Mon Feb 27, 2012 5:09 pm
Location: Bergamo - Italy (living 5 Km from airport LIME)
Callsign: I-BASSY
Version: 2016.3
OS: Linux Mint 17. x

PreviousNext

Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 3 guests