Board index FlightGear Development Effects and shaders

Smooth transitions for a) clouds b) cities  Topic is solved

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

Smooth transitions for a) clouds b) cities

Postby ManDay » Sat Sep 10, 2011 7:22 am

I wanted to ask whether it would be possible to make

  1. Clouds appear gradually. Currently, clouds in the far "pop up" (unless obscured by gradually disappearing fog) and changes in the overall cloud coverage (weather system) also make new clouds layers pop up instead of being blended in. I think making all sorts of clouds fade in would make look things a lot more realistic and enjoyable.
  2. Cities blend in better with the sourrounding terrain. Cities, esp. with the urban shader, look already nice, but it would be even nicer if the edges of the city would not be so sharp and more realistic. I think if you can take the distinction that the urban shader makes, between houses and streets underneath and have the streets fade to green near the edge of the city that would make cities look really amazing!
ManDay
 
Posts: 6
Joined: Sat Feb 19, 2011 3:56 pm

Re: Smooth transitions for a) clouds b) cities

Postby Thorsten » Sat Sep 10, 2011 1:07 pm

a) For clouds which appear far away, what you see depends on the selected view range. There is a hard-coded fade-in distance in the cloud shader (40 to 45 km) over which clouds gradually fade in, when the selected view range is maxed out (and in the case of usign Local Weather) tile generation distance is set accordingly, you never see clouds appear - they are created beyond visible distance and then fade in as you approach them.

As for changes in weather, the Local Weather package uses a setup in which new layers appear as you move on (or as weather drifts by), rather than replacing the existing layer.

So, in principle much of what you ask is there, you just need to use the menu.

With dynamical generation of convective clouds within Local Weather, it is true that clouds appear suddenly rather than fade in. We have discussed passing a transparency as parameter to the cloud shader, which would allow to fade new clouds in wherever they are created, but the amount of parameters passed to the shader is high already, and there are concerns that older graphic cards will not cope with a yet increased amount, so there are currently no plans to implement that.

b) Blending textures with adjacent textures has been discussed a few times - my last information is that this is not easily possible within the current setup of storing terrain info and would essentially require to restructure the whole way we define terrain. As far as I know, there are no plans to do that in the near future.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Smooth transitions for a) clouds b) cities

Postby ManDay » Thu Sep 15, 2011 9:32 pm

Thorsten wrote in Sat Sep 10, 2011 1:07 pm:a) For clouds which appear far away, what you see depends on the selected view range. There is a hard-coded fade-in distance in the cloud shader (40 to 45 km) over which clouds gradually fade in, when the selected view range is maxed out (and in the case of usign Local Weather) tile generation distance is set accordingly, you never see clouds appear - they are created beyond visible distance and then fade in as you approach them.

As for changes in weather, the Local Weather package uses a setup in which new layers appear as you move on (or as weather drifts by), rather than replacing the existing layer.


I do not fully parse your answer, or rather don't see the actual answer in it. Why, do you suggest, do I not see the clouds gradually fade in and what will I have to do, in order to have them so?

So, in principle much of what you ask is there, you just need to use the menu.


Okay, but I could not really extract from your answer what exactly.

With dynamical generation of convective clouds within Local Weather, it is true that clouds appear suddenly rather than fade in. We have discussed passing a transparency as parameter to the cloud shader, which would allow to fade new clouds in wherever they are created, but the amount of parameters passed to the shader is high already, and there are concerns that older graphic cards will not cope with a yet increased amount, so there are currently no plans to implement that.


Again, I don't understand you. Why do you say that passing transparency to the shader of convective clouds is unbearable while you alegedly do so for all the other clouds (as you, so I think to have deciphered, implied in the first paragraph of your answer)?

b) Blending textures with adjacent textures has been discussed a few times - my last information is that this is not easily possible within the current setup of storing terrain info and would essentially require to restructure the whole way we define terrain. As far as I know, there are no plans to do that in the near future.


Thanks Thorsten.
ManDay
 
Posts: 6
Joined: Sat Feb 19, 2011 3:56 pm

Re: Smooth transitions for a) clouds b) cities  

Postby Thorsten » Fri Sep 16, 2011 7:56 am

I do not fully parse your answer, or rather don't see the actual answer in it. Why, do you suggest, do I not see the clouds gradually fade in and what will I have to do, in order to have them so?


As I saw yesterday, my answer is obsolete - the shader now gets the cloud visibility distance as parameter in recent GIT, so clouds fade smoothly whenever they reach the edge of the visibility limit.


Again, I don't understand you. Why do you say that passing transparency to the shader of convective clouds is unbearable while you alegedly do so for all the other clouds (as you, so I think to have deciphered, implied in the first paragraph of your answer)?


Do you have a rough idea how the two weather systems in Flightgear work? I assumed you have that knowledge, but if not then you may want to read this up in the documentation (README.local_weather.html, README.3DClouds) first.

The shader doesn't get a transparency value passed, it knows the vertex position of the cloud relative to the eye position, from that it computes a distance, and from that distance it computes an alpha value. For a cloud suddenly forming at a closer distance (which you'd like to fade in over time), a distance criterion does not work - this needs the time dependence of the alpha channel explicitly passed to the shader from an external source.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am


Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 4 guests