Board index FlightGear Development Effects and shaders

Start with rocks

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

Re: Start with rocks

Postby gral » Sun Aug 22, 2010 10:09 pm

Experimental: I added a glacier/permanent snow 'effect' which gives some permanent snow above 3300 m and a new structure to glaciers.

Image

And I changed the snow to not cover steep terrain (rocks). This gives more dimension to the mountains at all - or at least it gives some terrain back if it has snowed in the GUI in the middle of the summer.

Image

And yes, it is all simulation of course. Best case is it hides not-so-accurate landcover, and helps more accurate data too - I hope.

Cheers, gral

btw. I am very glad to see that Switzerland is on top of landcover list of statto (and others?) at the moment. Many thanks to statto in advance for this initiative.
gral
 
Posts: 325
Joined: Mon Nov 16, 2009 1:03 pm
Location: Zurich (Switzerland)
Callsign: HB-GRAL
Version: GIT

Re: Start with rocks

Postby statto » Sun Aug 22, 2010 11:42 pm

I've got a long ways to go - I'm doing an unsupervised classification on 10-year-old LANDSAT data, which is a different technique from I've done before (and similar, but quite different than the tutorial on custom-scenery.org). Currently, I've only separated a few classes (lake, mixed, coniferous, crops, grass, urban, glacier, along with null areas of shadows and clouds) and am experimenting with the best technique, so it's going to be awhile until anything is done.

I'm also going to be working on northern New Jersey.
Custom Scenery available from http://www.stattosoftware.com/flightgear
statto
 
Posts: 2113
Joined: Fri Jan 25, 2008 9:57 pm

Re: Start with rocks

Postby Thorsten » Mon Aug 23, 2010 6:59 am

gral's work does look really good, though I wonder if it's more a "simulation" of land cover than actual land cover itself


That's true, but in my view not a useful way to think about it. Here's what I get for Innsbruck custom landcover:

Image

It's really good, but contrast the sharp boundaries with the much smoother ones gral gets. The detailed landcover seems to resolve terrain features at distance scales of O(100 m). Judging from the visual impression of grals pics, the gradient technique can pick out scales of O(10 m), i.e. an order of magnitude lower. Thus, it can be used to increase the perceived amount of detail even in detailed terrain, just like random object placement can be used for that purpose (or a detailed texture with interesting features). And it does so with a good physics/geology/botany motivation (steep gradients are different...) .

Take a look at the Matterhorn picture and observe how the forest at times dissolves into patches. Exactly that visual impression could be the result of a gradient changing forest to herbtundra for too steep gradients in nominally forest-covered terrain (in the Matterhorn case, the reason doesn't always seem to be a gradient - but the visual impression would be similar).

It doesn't mean that detailed landcover and landcover simulation compete - they don't. They are techniques working together nicely to get more visual details out of Flightgear.

In mountains, gradients seem to supply the natural level of detail. In flat terrain, other (imposed) structures could do a similar job.
Thorsten
 
Posts: 11379
Joined: Mon Nov 02, 2009 8:33 am

Re: Start with rocks

Postby gral » Mon Aug 23, 2010 10:47 am

statto wrote:Actually, I flew by the Matterhorn and it's there and it's distinct. I was expecting a lot less from the scenery, to be honest. I can do where the LANDSAT image covers, but a lot of that is covered by CORINE data...

But replicating the actual Matterhorn... that would be spectacular.

Image



Good old Matterhorn without new effects:
Image

Good old Matterhorn with new effects/shader (without any change in landclasses):
Image

(Sorry Thorsten, I really tried to add the same cloud, I know it’s possible, but I had no time left :wink: )

Cheers, gral
gral
 
Posts: 325
Joined: Mon Nov 16, 2009 1:03 pm
Location: Zurich (Switzerland)
Callsign: HB-GRAL
Version: GIT

Re: Start with rocks

Postby Armchair Ace » Mon Aug 23, 2010 10:51 am

You could sell the second picture as a postcard! :lol:

Fantastic work!
Member of the FlightGear Flying Club

Current Projects :
Miscellaneous texture and sound work
User avatar
Armchair Ace
 
Posts: 1385
Joined: Sun Sep 27, 2009 7:48 pm
Location: EGP?
Callsign: G-ATPF
IRC name: ArmchairAce
OS: Mac OSX

Re: Start with rocks

Postby statto » Mon Aug 23, 2010 12:57 pm

It is obvious gral's work on the default landcover looks better than the custom Innsbruck landcover. I just want to make sure my point is clear: there is a pattern going on with how the trees around say Zermatt grow, and that pattern may be different than how the trees in the hills around Sion grow. Slope, aspect, temperature, and sunlight have a lot to do with the way vegetation grows in any given mountain valley - while this is hard to pull out of a satellite image and turn into land cover, if we have good land cover, it's more 'accurate' than what the shader can do, even if the shader looks great.

For instance, if I can finish this Switzerland project, there will be a >80% chance the land cover is correct within 30 meters of the point you are flying over. With the default land cover, I think you push that to about a kilometer. With the shader, the magnitude of order is artificial - ie, what works for the Matterhorn will probably work for the Himalayas, and it will look damn good, but it's really just making an educated guess as to what the land cover is at that geographic point in real-time. For 99% of the world at the moment, this is a great feature, especially considering we won't get better, fully worldwide scenery in my lifetime! But since even 30m land cover is over 30 times more accurate than the default scenery, there should be a way for the shader to say, okay, this is a forest patch, and it should blend into the rock here, which should blend into the grass here, which should blend into the town here. The hard edge for water should probably be preserved, though.
Custom Scenery available from http://www.stattosoftware.com/flightgear
statto
 
Posts: 2113
Joined: Fri Jan 25, 2008 9:57 pm

Re: Start with rocks

Postby erik » Mon Aug 23, 2010 1:26 pm

I think you misinterpret the reason for this shader. It's additional to custom landcover and gives a plausible result for situations that are almost impossible to create by hand. For example the rockface shader gives a plausible rock cover for steep mountainous areas that are hard to spot on a map or aerial photographs. It's probably best seen as a detail map generator.

I do agree that it still needs fine tuning since the forest texture (for example) is almost unrecognizable with this shader.

Erik
erik
 
Posts: 1543
Joined: Thu Nov 01, 2007 1:41 pm

Re: Start with rocks

Postby Thorsten » Mon Aug 23, 2010 2:05 pm

I just want to make sure my point is clear: there is a pattern going on with how the trees around say Zermatt grow, and that pattern may be different than how the trees in the hills around Sion grow. Slope, aspect, temperature, and sunlight have a lot to do with the way vegetation grows in any given mountain valley - while this is hard to pull out of a satellite image and turn into land cover, if we have good land cover, it's more 'accurate' than what the shader can do, even if the shader looks great.


I'm not completely sure what you want to argue. Here you're (as far as I can see arbitrarily) pulling one detail into the foreground - the spatial distribution of tree growth. But the size of trees and nature of the undergrowth may also be very different between Zermatt and Sion - and yet, as long as the forests are classified as the same landcover, they will get the same texture. In fact, Zermatt and Sion have very different distribution of buildings, and yet they will get the same city textures. Thus, you can't get it as 'accurate' as aerial imagery no matter what you do, and even that isn't real time - wet terrain looks different from dry and dusty one, spring and summer are different,...

So the very design of the system with landcover classes means that it can't be completely accurate beyond a point, no matter what you do - you have to 'fake' some amount of detail.

But beyond that point, the fakes, if cleverly done, can visually be better than aerial imagery if you take the landcover as something which needs to be interpreted by suitable textures, shader effects and random objects - based on a 'best guess' scheme given input like steepness, geographical location and such like. So, I very much agree with erik that it is a detail map generator.

I don't think anyone here is arging that detailed landcover is obsolete and that landcover can be better handled with the shader effect. Quite the contrary, at least as far as I am concerned.
Thorsten
 
Posts: 11379
Joined: Mon Nov 02, 2009 8:33 am

Re: Start with rocks

Postby gral » Mon Aug 23, 2010 3:53 pm

erik wrote:I do agree that it still needs fine tuning since the forest texture (for example) is almost unrecognizable with this shader.
Erik


Erik, the forest is already tuned to bring more color and structure back, it is recently going to GIT I think. And the relief comes back too, yes, it is time for rude tuning and this will take some time :wink:
-gral

I have to write it here once and please read this:
My shaders do not change our recent system with landcovering. It is a change in how the textures are adapted to the covering. I need accurate landcover data. Thank you very much for all your thoughts and writings here. Statto, Thorsten, Erik and all others. Just to give some credits once, my work is based on shader work coming from Till Busch/Tim Moore, prepared for FlightGear last year. I did some changes and added some ideas and new textures. And for my work I always got a lot of help here and elsewhere. And very important to say, it would never be possible without great help from Frederic Bouvier!
Last edited by gral on Mon Aug 23, 2010 4:13 pm, edited 1 time in total.
gral
 
Posts: 325
Joined: Mon Nov 16, 2009 1:03 pm
Location: Zurich (Switzerland)
Callsign: HB-GRAL
Version: GIT

Re: Start with rocks

Postby fredb » Mon Aug 23, 2010 4:10 pm

To have nice transitions between landcover classes, we would need adjacency informations and that would require either scenery preprocessing (possibly requiring a change in file format) or computing it at load-time on the CPU with a cost in term of memory consumption and processing power allocated to the task.
User avatar
fredb
 
Posts: 756
Joined: Fri Dec 01, 2006 10:41 am
Location: Paris, France

Re: Start with rocks

Postby SkyWlf77 » Mon Aug 23, 2010 8:48 pm

Gral, I must say that your shader effects shown here bring a massive increase in the visual appeal of the areas it is applied to. I am blown away by the difference and it will make it much more enjoyable to fly around :)

-Jason
SkyWlf77
 
Posts: 624
Joined: Sun Jan 10, 2010 12:19 am
Location: Central Illinois
Callsign: SkyWlf77
Version: 2
OS: Windows 7 64-bit

Re: Start with rocks

Postby statto » Mon Aug 23, 2010 9:52 pm

I'm not pulling tree growth in arbitrarily - different species of trees grow on different aspects, for instance. For instance, if we have a saguaro cactus texture, I could crunch some LANDSAT numbers to find out where the saguaros grow if I figure out the pattern to where they grow; getting it into FlightGear would be a different story, but this is all theoretical anyways. I had a picture looking the other direction from the Matterhorn, and it shows tree growth on a very steep hill, 'randomly' accented by rock slides, with intermittent grass and rock above the alpine line.

We can have a good educated guess based on land cover about what is grass and what is rock and what are trees (ie where they are growing with regard to aspect and slope in any individual valley) and what are chalet-style apartment buildings :) within the valley in Zermatt with good land cover. Apologies for repeating myself.

I'm just curious to know how the shaders react when good land cover data is available - does rock show up if we know trees exist there?

fredb - would it be impossible to write a shader which, say, averages pixel colors along boundaries at the present hour?

World Scenery 2.0 is still a work in process and no date has been set yet - if you want any of the new areas, you must compile them or download them (where available) yourself, with the exception of Hawai'i, which is available through TerraSync.

Switzerland is coming along faster than expected, but is still a very slow process, especially because I am hand-creating polygonal river data.
Custom Scenery available from http://www.stattosoftware.com/flightgear
statto
 
Posts: 2113
Joined: Fri Jan 25, 2008 9:57 pm

Re: Start with rocks

Postby fredb » Tue Aug 24, 2010 6:29 am

statto wrote: would it be impossible to write a shader which, say, averages pixel colors along boundaries at the present hour?

A shader is only able to shade a single pixel/fragment, with no knowledge of its neighbors. Areas are coherent because the calculation is the same with only slight changes in parameters inside the same landclass. But at boundaries, when the shader and the base texture change, there is a discontinuity. One solution could be to use the same shader for all landclass but there is not enough texture units in a graphic card to give him all possible textures the way we use them. It would require to group all possible images inside a very big texture, but care will be needed to avoid artifacts at the edges.
User avatar
fredb
 
Posts: 756
Joined: Fri Dec 01, 2006 10:41 am
Location: Paris, France

Re: Start with rocks

Postby Thorsten » Tue Aug 24, 2010 6:58 am

I'm just curious to know how the shaders react when good land cover data is available - does rock show up if we know trees exist there?


As far as I understand, the shader effect blends two textures inside a landclass based on slope, so you would have e.g. herbtundra blended with rock where the gradient is large, or you could imagine forest blended with rock (or herbtundra).

Your question can then refer to two different situations: Terrain which exists as low resolution landcover and classified as forest will have (in the above example) rocky patches on steep elevations. If you compare that with high resolution landcover data which knows of the actual rocky patches, there is no guarantee that the shader will have guessed the correct distribution - an educated guess is just that - a guess - better than a random guess, but not accurate.

If you run the shader on high-resolution landcover data, at least for a suitable set of shader parameters the problem will be less severe. What is classified rock in high resolution will remain visually rock, so the only problem is that forest could be misclassified as rock - so in addition to the genuine rock patches, there may be additional ones where the shader paints what is classified as forest as rock.

That will only happen on very steep slopes - which is maybe not a problem as a) forest on steep slopes is rare, and the steepness criterion of the shader can be conservative here and b) steep slopes seem to be difficult to classify correctly in aerial imagery anyway.

So my expectation is that high resolution data will not be 'spoiled' by the shader, but that the shader will do a lot for low resolution data (if the parameters are suitably chosen).

A shader is only able to shade a single pixel/fragment, with no knowledge of its neighbors.


I know from shading cloud models that it is possible to make the model appear 'larger' than it actually is by coordinate rescaling. If I had two adjacent rectangles, I could make their front surfaces visually 10% larger so they'd overlap, and then adjust texture transparency such that they blend.

I'm gussing the terrain likewise is decomposed into individual triangular (?) patches - maybe a similar trick with coordinate scaling can be used to make the individual textured patches appear larger than they actually are? Inside a coherent patch of terrain, blending the same texture wouldn't do much - so it would only affect boundaries.
Thorsten
 
Posts: 11379
Joined: Mon Nov 02, 2009 8:33 am

Re: Start with rocks

Postby fredb » Tue Aug 24, 2010 7:11 am

Thorsten wrote:
A shader is only able to shade a single pixel/fragment, with no knowledge of its neighbors.


I know from shading cloud models that it is possible to make the model appear 'larger' than it actually is by coordinate rescaling. If I had two adjacent rectangles, I could make their front surfaces visually 10% larger so they'd overlap, and then adjust texture transparency such that they blend.

I'm gussing the terrain likewise is decomposed into individual triangular (?) patches - maybe a similar trick with coordinate scaling can be used to make the individual textured patches appear larger than they actually are? Inside a coherent patch of terrain, blending the same texture wouldn't do much - so it would only affect boundaries.


It's what I said earlier : you need either preprocessing, or make computation at load-time. They are more powerful ways to do that without risks of overlapping artifacts (like z-fighting or transparency order). You can use new geometry shader adjacency ( that requires twice the amount of vertex memory ), or use a vertex attribute to tell where is the border and what material is at the other side. But you'll also need to provide the texture of the adjacent tile and you may need more texture units than what is available.
User avatar
fredb
 
Posts: 756
Joined: Fri Dec 01, 2006 10:41 am
Location: Paris, France

PreviousNext

Return to Effects and shaders

Who is online

Users browsing this forum: No registered users and 3 guests