Im the last weeks, I've been working on integrating Lauri's skydome
scattering shader in a seamless way with the rest of the environment. I
have now a working version of the shaders available which could be
committed.

This is:

* the original skydome shader, with an added simulation of a low altitude
constant density haze layer and meaningful response to the parameters
/rendering/scene/overcast, /rendering/scene/scattering and
/rendering/scene/saturation.

* a matching terrain shader which connects to the skydome in a (mostly)
seamless way

* this can render everything from rather heavy fog on the ground to a near
space view at high altitude with (mostly) seamless transitions

* some additional code getting the sunrise/sunset plausible by darkening
the haze where needed. See

http://www.flightgear.org/forums/viewtopic.php?f=47&t=11274&start=135#p140031

for some recent pictures

* a small change in 3dclouds.frag to let clouds fade into a matching
horizon haze color.

All this is conceptually independent of Local Weather - while it is
supported and the relevant parameters are automatically set by Local
Weather, they can be set from anywhere else.

Now, I need some help.

First, the combined effect of lots of 3d clouds and haze shading isn't
fast. It isn't really slow either, with multiple layers of 6/8 clouds
drawn to 45 km distance I still get ~20 fps out (36 without the haze and
skydome shader for the same clouds), but I have the feeling it could go
faster, there's too much redundant things happening.

For instance, I get my altitude in model space by

vec4 ep = gl_ModelViewMatrixInverse * vec4(0.0,0.0,0.0,1.0);
alt = ep.z;

in the vertex shader - but this could probably easily be passed as a
uniform if I just would know how (lat, lon, alt) maps into model space.
And so on. So if anyone with more experience in shader writing can look
over it and smooth it a bit, that'd be very good. There is a writeup of
the underlying ideas available, and I have tried to comment a lot, and I
can also explain the underlying math.

The second thing is - I can't get it into a distributable form myself. I
don't understand the structure of effect files. In my current
implementation, I have just overwritten the Flightgear defaults, used some
really ugly hack at one point and distributing that in this form means
either using my skydome/terrain or CPU rendering. I don't want to commit
it in such a form, this should be optionally linked to the scattering
shader on/off. Also, I run into other problems - I've tried to use the
haze shader instead of object default, but they're not blended to the same
final color when fully fogged, they come out too dark, and I don't know
why. I suspect that something happens to objects later that doesn't happen
to terrain... So, I'd need the help of someone who understands the effect
file structure to create a structure which can be committed without
wrecking everything else.

If anyone is willing to help with either problem, please let me know and
then we can take the bulk of the technical discussion off list (where I
can use attachments). I have a pretty good idea what the issues are and in
what direction one should probably go to address them - I'm just a bit out
of my depth doing it myself.

Thanks in advance,

* Thorsten


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to