Board index FlightGear Development Scenery

earthview offset and mirrored  Topic is solved

Questions and discussion about enhancing and populating the FlightGear world.

Re: earthview offset and mirrored

Postby Thorsten » Sat Jun 18, 2016 5:48 pm

Some generic city pattern?


Pretty much, yeah. The photos of the nile delta show hints of roads - that'd be nice mixed with the noise, right now the noise is too structureless. It just needs a hint of structure in addition.

Is it possible to switch off the noise shading for the night lights at runtime? Actually, I just want to check how it looks without.


Currently not (should probably implement that...) - I'm kind of tied up with the Shuttle PFD at the moment, but I'll do my best to give it a try.
Thorsten
 
Posts: 11206
Joined: Mon Nov 02, 2009 8:33 am

Re: earthview offset and mirrored

Postby chris_blues » Sat Jun 18, 2016 6:18 pm

Actually, I'm not so certain, that we need some effect on it. Looking at the nightlight textures, I think they're pretty detailed and even have some structure. Of course that would vanish at lower resolutions, but I'd love to actually see it with my own eyes...
Additionally I'm a bit afraid to touch the shader code myself, as all I can see there is ASCII-art... :D
Don't hesitate to let me know if I'm incorrect or just annoying! As long as you do it gently! :)
Debian testing 64bit - Athlon II 2x2.6GHz - 8GB RAM - GeForce GTS 450
Citation II
User avatar
chris_blues
 
Posts: 1539
Joined: Mon May 03, 2010 1:30 pm
Location: claws of real life
Callsign: chris_blues
Version: GIT
OS: Debian 8 64

Re: earthview offset and mirrored

Postby chris_blues » Sun Jun 19, 2016 12:46 am

Just a heads up:

I tagged the first release on Github: https://github.com/chris-blues/Nasa2FGearthview

The script works quite fine. I'll go and update the textures on my server, so that everybody can enjoy them. Plus I'll reactivate the links on the wiki-page.

Cheers
Don't hesitate to let me know if I'm incorrect or just annoying! As long as you do it gently! :)
Debian testing 64bit - Athlon II 2x2.6GHz - 8GB RAM - GeForce GTS 450
Citation II
User avatar
chris_blues
 
Posts: 1539
Joined: Mon May 03, 2010 1:30 pm
Location: claws of real life
Callsign: chris_blues
Version: GIT
OS: Debian 8 64

Re: earthview offset and mirrored

Postby vnts » Sun Jun 19, 2016 6:33 am

chris_blues wrote in Sat Jun 18, 2016 6:18 pm:Of course that would vanish at lower resolutions, but I'd love to actually see it with my own eyes...

Additionally I'm a bit afraid to touch the shader code myself, as all I can see there is ASCII-art... :D

Don't be too worried, it's possible to back up data/shaders/planet.frag and replace it if anything goes wrong.
NB: For context, my fields are not in IT, let alone graphics programming. But this seems to work:

You can add 'noise = 1.0;' in-between the two lines as done here to turn off the structuring introduced by noise:

float night_light_factor = night_light * (1.0 - smoothstep(-0.3, 0.0, NdotLraw));
noise = 1.0;
float noise_factor = (0.4 + 0.6* smoothstep(0.7 - 0.4* night_light,0.9 - 0.4 * night_light,noise));

(Noise has a maximum value of 1 so this stops structure being introduced by noise, but leaves intact use of noise earlier and leaves night_light_factor alone as it doesn't seem to be in the interval 0-1).

This still leaves in desaturation making bright areas white which you can turn off if you find it distracting, by inserting '//' before this line as done here:

//light_color = mix(light_color, central_light_color, smoothstep(0.3, 0.6,noise*noise * night_light));

regards,
vnts
vnts
 
Posts: 101
Joined: Thu Apr 02, 2015 12:29 am

Re: earthview offset and mirrored

Postby chris_blues » Sun Jun 19, 2016 11:56 am

Thanks! I'll give it a try.
Don't hesitate to let me know if I'm incorrect or just annoying! As long as you do it gently! :)
Debian testing 64bit - Athlon II 2x2.6GHz - 8GB RAM - GeForce GTS 450
Citation II
User avatar
chris_blues
 
Posts: 1539
Joined: Mon May 03, 2010 1:30 pm
Location: claws of real life
Callsign: chris_blues
Version: GIT
OS: Debian 8 64

Re: earthview offset and mirrored

Postby chris_blues » Sun Jun 19, 2016 12:01 pm

Because I found some small errors, both in the script and in my logic, I uploaded the new textures:
The script still resides here: https://github.com/chris-blues/Nasa2FGearthview

World: (.png and .dds format textures. Try .dds first! If it doesn't work for your graphics-card try the .png files instead!)
1024x1024: https://musicchris.de/download/FG/EarthView/world_1k.7z (7.5MiB)
2048x2048: https://musicchris.de/download/FG/EarthView/world_2k.7z (27.3MiB)
4096x4096: https://musicchris.de/download/FG/EarthView/world_4k.7z (99.5MiB)
8192x8192: https://musicchris.de/download/FG/EarthView/world_8k.7z (382.4MiB)

Clouds: (.png only)
1024x1024: https://musicchris.de/download/FG/EarthView/clouds_1k.7z (5.2MiB)
2048x2048: https://musicchris.de/download/FG/EarthView/clouds_2k.7z (18.9MiB)
4096x4096: https://musicchris.de/download/FG/EarthView/clouds_4k.7z (64.4MiB)
8192x8192: https://musicchris.de/download/FG/EarthView/clouds_8k.7z (212.8MiB)

See the wiki for information on how to add these to your $FGDATA: http://wiki.flightgear.org/Earthview#Customization
Last edited by chris_blues on Mon Jun 20, 2016 1:01 pm, edited 1 time in total.
Don't hesitate to let me know if I'm incorrect or just annoying! As long as you do it gently! :)
Debian testing 64bit - Athlon II 2x2.6GHz - 8GB RAM - GeForce GTS 450
Citation II
User avatar
chris_blues
 
Posts: 1539
Joined: Mon May 03, 2010 1:30 pm
Location: claws of real life
Callsign: chris_blues
Version: GIT
OS: Debian 8 64

Re: earthview offset and mirrored

Postby chris_blues » Sun Jun 19, 2016 6:00 pm

I just found this for comparison:

Not so bad all-in-all! 8)

Photo shot from ISS (credit: NASA)
Image

Screenshot I made:
Image

Edit:
Without noise overlay:
Image

I like it a lot! Some small tweaks to the colors, and I think I will try some different filtering on the nightlight textures, so that the big blops become a little darker, or might this be better done in the shader?

It occured to me, that I could have it the easy way, without messing with the code:
Code: Select all
$ git log
[...]
commit 4000ced617abb4089dc4b98b0e8d8166a523e1a4
Author: Thorsten Renk <thorsten@science-and-fiction.org>
Date:   Tue Jun 14 10:15:44 2016 +0300

    Noise overlay for Earthview night light appearance
[...]
git revert 4000ced617abb4089dc4b98b0e8d8166a523e1a4

After that a "git reset --hard origin/HEAD" got everything back to normal. Kids: don't try this at home. Chances are good, that you destroy any change you made yourself! I had nothing to loose. I usually never ever get my hands into FGDATA...
Last edited by chris_blues on Sun Jun 19, 2016 10:02 pm, edited 4 times in total.
Don't hesitate to let me know if I'm incorrect or just annoying! As long as you do it gently! :)
Debian testing 64bit - Athlon II 2x2.6GHz - 8GB RAM - GeForce GTS 450
Citation II
User avatar
chris_blues
 
Posts: 1539
Joined: Mon May 03, 2010 1:30 pm
Location: claws of real life
Callsign: chris_blues
Version: GIT
OS: Debian 8 64

Re: earthview offset and mirrored

Postby D-ECHO » Sun Jun 19, 2016 6:42 pm

That looks awesome chris, thank you! :D
User avatar
D-ECHO
 
Posts: 1556
Joined: Sat May 09, 2015 12:31 pm

Re: earthview offset and mirrored

Postby vnts » Mon Jun 20, 2016 7:16 am

chris_blues wrote in Sun Jun 19, 2016 6:00 pm:Some small tweaks to the colors

In the shader, Light colour is (light_color = vec3(1.0, 0.7, 0.3);) and the desaturated colour for intense light is (central_light_color = ..). The 3 numbers are RGB values where 1.0 =255, 0.0=0.. e.g. (1.0,1.0,1.0) = white. The alpha channel value is just the greyscale intensity which blends from light_color to central_light_color according to a configurable formula.
It's safe to try out different values, and you can always use that reset command to restore FGData. If the shader won't compile all that will happen seems to be the Earth won't render, and FG can be restarted once the error is fixed.

That photo will be heavily filtered, so it may not represent what the eye would see.. Thorsten's values for light_colour might have been derived to be physically correct.

chris_blues wrote in Sun Jun 19, 2016 6:00 pm:I think I will try some different filtering on the nightlight textures, so that the big blops become a little darker, or might this be better done in the shader?

Is what you want the bright areas to be less broken up by noise when viewed from a distance? (This is the responsibility of the shader because noise is introduced there).

Or dense areas to become more white (desaturated) with increasing intensity? This is also done in the shader by the line with the mix function.

Any filtering done on the texture can result in a loss of information..
vnts
 
Posts: 101
Joined: Thu Apr 02, 2015 12:29 am

Re: earthview offset and mirrored

Postby Thorsten » Mon Jun 20, 2016 10:11 am

I like it a lot! Some small tweaks to the colors, and I think I will try some different filtering on the nightlight textures, so that the big blops become a little darker, or might this be better done in the shader?


Keep a straight and simple path from raw NASA texture to alpha channel, tweak the shader - that's future proof.

In the shader, Light colour is(..)


What he says.

You can simply edit your file without special precautions,

Code: Select all
git checkout next -- Shaders/planet.frag


will simply bring it back if you don't commit anything over it.
Thorsten
 
Posts: 11206
Joined: Mon Nov 02, 2009 8:33 am

Re: earthview offset and mirrored

Postby vnts » Mon Jun 20, 2016 11:55 am

From trying to characterise light patterns:

Light colours can either be orange from common sodium vapour street lights, or greenish-blue from older mercury vapour lamps. Cities can have a mixture, depending on age of the area.

This nasa video covers the view from a lot of cities.

Points mentioned: Europe patterns show major roads that radiate away from centers. Us cities have a grid pattern. Middle east: multi-coloured. Rural india: small isolated rural village lights (probably similar for rural areas in similar countries).Japan has a blue green cast. Brazil cities are an example of older areas being blue-green, while newer areas are orange.

There's 21 images here. Interestingly it appears that lights used by fishing boats to attract fish at night are very visible (Asia-pacific region, not sure about elsewhere).

Detail visible really depends on altitude, and importance depends on how long people are likely to spend at different altitudes currently I guess. It's hard to match the center of a radiating pattern with a blob in the texture.. Maybe(?) a low res map indicating ratio of sodium to mercury light sources might work (another channel could ID regions with different patterns).

regards,
vnts
Last edited by vnts on Mon Jun 20, 2016 12:31 pm, edited 1 time in total.
vnts
 
Posts: 101
Joined: Thu Apr 02, 2015 12:29 am

Re: earthview offset and mirrored

Postby chris_blues » Mon Jun 20, 2016 12:10 pm

Thanks for the photos! I wish NASA would send up a professional photographer to make better pictures. The comparison of LA and LA+San Diego shows very different colors. :roll:
All in all, I'd say the color is ok. Thorsten, what do you think? Put a "regional color" into it? I don't know if that's even possible.

And with blops I meant the big cities. Like Cairo on the Nile pic. It's a very bright spot between many small lights (villages, streets etc). If we could tune it down just a little...


Ok, I'll not touch the textures further. :) (Though I have done some filtering already)
BTW, you could add the new 2k textures to FGDATA if you have the time. I can't think of anything that still needs to be done in that department. Or I'll try my hands on creating a merge request. Time to try that anyway...


Thorsten wrote in Mon Jun 20, 2016 10:11 am:You can simply edit your file without special precautions,
Code: Select all
    git checkout next -- Shaders/planet.frag
will simply bring it back if you don't commit anything over it.

Thanks!
Don't hesitate to let me know if I'm incorrect or just annoying! As long as you do it gently! :)
Debian testing 64bit - Athlon II 2x2.6GHz - 8GB RAM - GeForce GTS 450
Citation II
User avatar
chris_blues
 
Posts: 1539
Joined: Mon May 03, 2010 1:30 pm
Location: claws of real life
Callsign: chris_blues
Version: GIT
OS: Debian 8 64

Re: earthview offset and mirrored

Postby chris_blues » Mon Jun 20, 2016 3:12 pm

I just created a merge request for the new textures: https://sourceforge.net/p/flightgear/fg ... quests/68/

I also took the liberty to make a few minor changes to the directory and file hierachry:

commit f7aabb85c18010c5a9b6fab3316450fb7179c317
Author: chris_blues <******@*********.**>
Date: Mon Jun 20 14:58:21 2016 +0200

EarthView:
* new textures for EarthView ( viewtopic.php?f=5&t=29780&p=289106#p289106 )
* change location of earthview textures to Models/Astro/Textures/*
* change pale_blue_aug_??.png world tiles to Textures/world_??.png
* change clouds_??.png to Textures/clouds_??.png
* change corresponding xml accordingly

I hope this saves you some time...


Also, still I feel very uncomfortable, fiddling with the shaders. Maybe I can find the courage to dig into it, let's see...
Don't hesitate to let me know if I'm incorrect or just annoying! As long as you do it gently! :)
Debian testing 64bit - Athlon II 2x2.6GHz - 8GB RAM - GeForce GTS 450
Citation II
User avatar
chris_blues
 
Posts: 1539
Joined: Mon May 03, 2010 1:30 pm
Location: claws of real life
Callsign: chris_blues
Version: GIT
OS: Debian 8 64

Re: earthview offset and mirrored

Postby Thorsten » Mon Jun 20, 2016 6:16 pm

Please give it a try - I've used SF's automatic merge button for the first time rather than doing it all manually, so it ought to be taken care of.
Thorsten
 
Posts: 11206
Joined: Mon Nov 02, 2009 8:33 am

Re: earthview offset and mirrored

Postby chris_blues » Tue Jun 21, 2016 3:08 am

I'd say all went fine! I couldn't detect any problems. Thanks a lot!
Now we got it nailed so far. Only thing left is an agreement on the shading... :) But I guess that's a solveable problem! No hurry!

First, this is how it looks with FGDATA default 2k textures:
Image
This is the same with 8k textures:
Image

Then I went goofing around, looking for the north-pole. I always wondered, how that rectangle map stitches together at the poles:
Image

And then I completely lost it at about 2M ft (ca 600km) Altitude: (click to enlarge - 1920x1080px)
Image

Image

Image

This is so beautiful, it almost hurts! Amazing!
Don't hesitate to let me know if I'm incorrect or just annoying! As long as you do it gently! :)
Debian testing 64bit - Athlon II 2x2.6GHz - 8GB RAM - GeForce GTS 450
Citation II
User avatar
chris_blues
 
Posts: 1539
Joined: Mon May 03, 2010 1:30 pm
Location: claws of real life
Callsign: chris_blues
Version: GIT
OS: Debian 8 64

PreviousNext

Return to Scenery

Who is online

Users browsing this forum: No registered users and 2 guests