Board index FlightGear Development Effects and shaders

Sunrises (version 1.3 available)

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

Re: Sunrises (version 1.0 available)

Postby someguy » Tue Feb 14, 2012 4:42 pm

Thorsten, those screenies are breathtaking. Kudos!
User avatar
someguy
 
Posts: 1650
Joined: Tue Nov 25, 2008 6:54 am
Location: USA
Version: 2019.1.1
OS: Mac OS X 10.11.6

Re: Sunrises (version 1.0 available)

Postby planetacancun » Tue Feb 14, 2012 5:19 pm

:O
Callsign:Fallen-
Videos: http://youtube.com/planetacancun2
planetacancun
 
Posts: 322
Joined: Thu Jul 30, 2009 5:52 pm
Callsign: Fallen-
IRC name: Fallen-
Version: GIT
OS: Ubuntu

Re: Sunrises (version 1.0 available)

Postby Ernest1984 » Tue Feb 14, 2012 10:47 pm

Yes, this really is breathtaking! I'm waiting for the time when all these great features (sunrise, weather, rembrandt) will be available "in standard" FG release version...
EPWA-hub: ERJ-195 clsgn: ERNIE
-----------------------------------
Around The World with B1900D!
callsign: AROUNDw - currently suspended till the FG will have a proper look on different locations
User avatar
Ernest1984
 
Posts: 438
Joined: Wed Dec 01, 2010 4:47 pm
Location: Poland / Canada
Callsign: ERNIE
Version: 2.10
OS: Mac OS X 10.8.2

Re: Sunrises (version 1.0 available)

Postby Bjoern » Thu Feb 16, 2012 4:23 am

Woooooooooah! :shock:
Bjoern
 
Posts: 484
Joined: Fri Jan 06, 2012 11:00 pm
Location: TXL (RIP)
Version: Next
OS: ArchLinux

Re: Sunrises (version 1.1 available)

Postby Thorsten » Mon Feb 20, 2012 10:21 am

I've placed the latest version online (see first post). This is after some time of optimization probably as fast as I can make it.

The approach is now to use only what is needed. The individual elements are:

* pre-dawn light rotation to blue
* Mie scattering
* schematic fog shading by terrain
* 3+1 dim lightfield (space and time)
* earth self-shading (terminator movement)
* time-dependent light
* constant light
* terrain haze

At pre-dawn, the code is slowest as all elements are active, as they are no longer needed they're gradually switched off and the code speeds up - at noon only constant light and terrain haze enter the rendering, so it is for me about 60% faster than at pre-dawn.

Currently, there's a Nasal hack involved which sets the eye altitude in meters into the property tree - this is needed to deal with some problems linking MSL elevation and shader z-coordinate in custom scenery areas and solves rendering artefacts there.

There are three bugs I am aware of:

* despite interpolating vectors and moving distance computations to the fragment shader, there are still fog seams over ocean under some conditions, although most of the time they are gone

* the sky turns black just at the top of the ground haze layer - since this condition must be fulfilled exactly (with the precision of few cm or so), usually it's just a single frame which is affected. It looks like something going to NaN for a moment, but despite looking for any suspicious expression for two days, I haven't found anything.

* at altitudes > 100 km ('outside the atmosphere' in Lauri's original skydome shader) the zenith is handled incorrectly. I assume I have coded an assumption which doesn't agree with the 'outside' situation somewhere, but I'm not good enough in visualizing the skydome geometry to find it easily.

Anyway, the thing that needs to be integrated with other shaders - terrain-haze.* is quite well-tested and understood and should now be stable.

The whole pack is designed for 2.7, but apart from the cloud shader will probably run with 2.6. A cloud shader for 2.6 is available though.

Image
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Sunrises (version 1.1 available)

Postby sgofferj » Mon Feb 20, 2012 12:35 pm

With FG 2.6 and Sunrises 1.1 I get these results (location: EFTP, timeofday=noon, weather=global)

With Sunrises 1.1 and separate 3dcloud.vert as per instructions:
Image

With Sunrises 1.1 and without separately copying the vert file:
Image

Both look kinda different than with 1.0... (location EFTU, rest, the same)
Image
FG 3.1 GIT / Opensuse 12.3 / Phenom II X4 / GForce GTX560
Stefan's little Flightgear corner | The Finnish Weather Center | Wolves in Finland

Working on: EFTP
COM: IAX2:home.gofferje.net/stefan (MO-FR 0700-2000 UTC, SA+SU 0900-2000 UTC)
sgofferj
 
Posts: 789
Joined: Mon Dec 05, 2011 5:13 pm
Location: EFTP
Callsign: OH-SW
Version: 3.1 GIT
OS: Opensuse

Re: Sunrises (version 1.1 available)

Postby Thorsten » Mon Feb 20, 2012 1:06 pm

* skydome scattering shader -> on
* all other special shaders (water, urban, terrain, landmass, transition) -> off
* random vegetation -> off
* Advanced Weather -> on

Otherwise rendering artefacts... if you have a working cloud shader, use that. It may be that I messed something else up, I don't have a working 2.6 copy on my box, so I can't test.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Sunrises (version 1.1 available)

Postby sgofferj » Mon Feb 20, 2012 1:57 pm

SInce I installed 1.1, the skydome scattering shader doesn't have any effect any more. I'm just restoring the factory settings and then I'll go back to 1.0 :).
FG 3.1 GIT / Opensuse 12.3 / Phenom II X4 / GForce GTX560
Stefan's little Flightgear corner | The Finnish Weather Center | Wolves in Finland

Working on: EFTP
COM: IAX2:home.gofferje.net/stefan (MO-FR 0700-2000 UTC, SA+SU 0900-2000 UTC)
sgofferj
 
Posts: 789
Joined: Mon Dec 05, 2011 5:13 pm
Location: EFTP
Callsign: OH-SW
Version: 3.1 GIT
OS: Opensuse

Re: Sunrises (version 1.1 available)

Postby Thorsten » Mon Feb 20, 2012 5:20 pm

After analyzing the problem:

* unfortunately the whole cloud framework changed from 2.6 to 2.7, so the new version can't be used at all
* skydome.eff wasn't up to date, which probably rendered it ineffective

I've updated the package and changed the instructions. If you want to try to upgrade, you can try using just the skydome code

Effects/skydome.eff Shaders/skydome.vert Shaders/skydome.frag

and the terrain code

Effects/terrain-default.eff Effects/model-default.eff Shaders/terrain-haze.vert Shaders/terrain-haze.frag

and the newest weather code

Nasal/local-weather/*.nas

which should let you stay clear of the changes in the cloud code.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Sunrises (version 1.1 available)

Postby sgofferj » Tue Feb 21, 2012 7:28 am

Performance is noticeably better. However, also in the updated version, the skydome shader doesn't work.
Edit: Precisely spoken: There is no visual difference, if I activate the skydome scattering in the rendering options or not.

Code: Select all
Failed to find parking position A10 at airport EFTP
Starting automatic scenery download/synchronization. Using built-in SVN support. Directory: '/home/sgofferj/flightgear/TerraSync'.
Multiplayer mode active!
Could not find at least one of the following objects for animation: 'Circle'
Could not find at least one of the following objects for animation: 'RAlt.Bug'
Could not find at least one of the following objects for animation: 'Circle'
no image file, maybe the reader did not set the filename attribute, using white for type '2d' on '', in /technique[9]/pass[0]/texture-unit[0]
creating 3D noise texture... DONE
no image file, maybe the reader did not set the filename attribute, using white for type '2d' on '', in /technique[9]/pass[0]/texture-unit[0]
Use of <global> in material animation is no longer supported
Use of <global> in material animation is no longer supported
Bombable (ver. 4.4) loaded - bombable, weapons, damage, fire, and explosion effects
Bombable: Bombable successfully set up and enabled for multiplayer dogfighting (you can disable Multiplayer Bombable in the Bombable menu)
loading scenario 'daedalus4-napa'
loading scenario 'nimitz_demo'
AL lib: pulseaudio.c:612: Context did not connect: Access denied
AL lib: pulseaudio.c:612: Context did not connect: Access denied
PNG lib warning : Malformed iTXt chunk
weather util initialized ...
Loading hi-poly Daedalus-ai-static version 4.0  release date 2010.Mar.19  at /ai/models/carrier
FG 3.1 GIT / Opensuse 12.3 / Phenom II X4 / GForce GTX560
Stefan's little Flightgear corner | The Finnish Weather Center | Wolves in Finland

Working on: EFTP
COM: IAX2:home.gofferje.net/stefan (MO-FR 0700-2000 UTC, SA+SU 0900-2000 UTC)
sgofferj
 
Posts: 789
Joined: Mon Dec 05, 2011 5:13 pm
Location: EFTP
Callsign: OH-SW
Version: 3.1 GIT
OS: Opensuse

Re: Sunrises (version 1.1 available)

Postby Thorsten » Tue Feb 21, 2012 8:55 am

There's no error in the log indicating that the shaders are not compiled.

The structure of skydome.eff requires that both /sim/rendering/shader-effects and /sim/rendering/scattering-shader are true - can you verify that this is the case?

Also, this does work with 1.0, right, just not with 1.1?
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Sunrises (version 1.1 available)

Postby sgofferj » Tue Feb 21, 2012 10:17 am

Correct, with 1.0, everything works fine.

/sim/rendering/scattering-shader was indeed not set, although skydome scattering was selected in rendering options. After manually setting it, the shader came on but with a strange discoloration and the same color and brightness careless of time of day. Even at night, it was sill that orange.
Screenshots take with timeofday=noon.

Image
Image
FG 3.1 GIT / Opensuse 12.3 / Phenom II X4 / GForce GTX560
Stefan's little Flightgear corner | The Finnish Weather Center | Wolves in Finland

Working on: EFTP
COM: IAX2:home.gofferje.net/stefan (MO-FR 0700-2000 UTC, SA+SU 0900-2000 UTC)
sgofferj
 
Posts: 789
Joined: Mon Dec 05, 2011 5:13 pm
Location: EFTP
Callsign: OH-SW
Version: 3.1 GIT
OS: Opensuse

Re: Sunrises (version 1.1 available)

Postby Thorsten » Tue Feb 21, 2012 10:21 am

Ah, what is /environment/terminator-relative-position-m doing? If you have a constant value there, it explains what you're seeing (you can also manually set it to a large value, say 3 million, then you should get to noon).

It used to be updated by a Nasal hack, but Torsten coded a property rule for me to do it, if that property rule is missing then it wouldn't be updated properly. Do you have $FGroot/Environment/local-weather-rules.xml in your directory?

And I'm not sure from your screenshots: The whole framework really requires Advanced Weather to be up and running. It relies on terrain presampling, shader parameters being set as a function of altitude and other stuff - if you just run global weather, lots of properties are passed incorrectly (or worse, not at all).
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Sunrises (version 1.1 available)

Postby sgofferj » Tue Feb 21, 2012 10:29 am

local-weather-rules.xml
Code: Select all
<?xml version="1.0" ?>
<!--
 This file is part of FlightGear, the free flight simulator
 http://www.flightgear.org/

 Copyright (C) 2012 Torsten Dreyer, Torsten (at) t3r _dot_ de

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License as
 published by the Free Software Foundation; either version 2 of the
 License, or (at your option) any later version.

 This program is distributed in the hope that it will be useful, but
 WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 General Public License for more details.
-->
<!--
  Compute local weather related properties
-->
<PropertyList>

  <!-- (pi/2 - /sim/time/sun-angle-rad) / 0.017451 * 110000.0 -->
  <filter>
    <name>LocalWeather:terminator-relative-position</name>
    <input>
      <expression>
        <difference>
          <value>1.57079632675</value>
          <property>/sim/time/sun-angle-rad</property>
        </difference>
      </expression>
    </input>
    <output>/environment/terminator-relative-position-m</output>
    <type>gain</type>
    <gain>6303363.70409</gain>
  </filter>

</PropertyList>


/environment/terminator-relative-position-m is constant at 60000.
Again, on start of fgfs, /sim/rendering/scattering-shader was present but empty. is this property maybe set by the 2.7 rendering dialog?

Edit: I don't wanna keep you from important things. I can go with 1.0. But I am happy to debug 1.1 with 2.6 for you if you are interested.
FG 3.1 GIT / Opensuse 12.3 / Phenom II X4 / GForce GTX560
Stefan's little Flightgear corner | The Finnish Weather Center | Wolves in Finland

Working on: EFTP
COM: IAX2:home.gofferje.net/stefan (MO-FR 0700-2000 UTC, SA+SU 0900-2000 UTC)
sgofferj
 
Posts: 789
Joined: Mon Dec 05, 2011 5:13 pm
Location: EFTP
Callsign: OH-SW
Version: 3.1 GIT
OS: Opensuse

Re: Sunrises (version 1.1 available)

Postby Thorsten » Tue Feb 21, 2012 10:38 am

Edit: I don't wanna keep you from important things. I can go with 1.0. But I am happy to debug 1.1 with 2.6 for you if you are interested.


Actually, I would like to be able to offer a decent 2.6 package, so going through this is useful.

/environment/terminator-relative-position-m is constant at 60000.


This is vexing... So the property rule is there, but it isn't actually ? Does the skydome behaviour change if you manually change /environment/terminator-relative-position-m to other values?

Perhaps it's simply not called correctly. Can you check if the block

Code: Select all
<property-rule>
            <name>Local Weather Rules </name>
            <path>Environment/local-weather-rules.xml</path>
         </property-rule>


appears in preferences.xml?

If it doesn't, it should go below the block

Code: Select all
<property-rule>
            <name>Environment METAR Interpolation Rule</name>
            <path>Environment/metarinterpolator.xml</path>
         </property-rule>


Again, on start of fgfs, /sim/rendering/scattering-shader was present but empty. is this property maybe set by the 2.7 rendering dialog?


No idea, on my box it's in autosave.xml and always on. As far as I know, the rendering dialog hasn't changed from 2.6 to 2.7.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

PreviousNext

Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 9 guests