Re: [Flightgear-devel] Clouds artefacts

2004-03-28 Thread Frederic Bouvier
Frederic Bouvier wrote:
 
 I manage to implement this algorithm tonight. The results are here :
 
 1. /sim/rendering/multi-pass-clouds=false :
  http://perso.wanadoo.fr/frbouvi/flightsim/fg-multip-off-1.jpg (204kb)
 
 2. /sim/rendering/multi-pass-clouds=true :
  http://perso.wanadoo.fr/frbouvi/flightsim/fg-multip-on-1.jpg (198kb)
 
 3 /sim/rendering/multi-pass-clouds=true ( billboard tree detail ) :
  http://perso.wanadoo.fr/frbouvi/flightsim/fg-multip-on-2.jpg (106kb)

The previous try was not addressing hole made by prop disc or exhaust 
plume in layers beneath. Only artefact created by upper layers.

This time, with more passes, the result is quite correct in all cases :

Without multi passes, depth buffer blocks cloud rendering through the prop 
disk/quad :
 http://perso.wanadoo.fr/frbouvi/flightsim/fg-multip-off-2.jpg (131kb)

with multi pass, over a broken layer :
 http://perso.wanadoo.fr/frbouvi/flightsim/fg-multip-on-3.jpg

over an overcast layer :
 http://perso.wanadoo.fr/frbouvi/flightsim/fg-multip-on-4.jpg

It seems there is a significant framerate penalty ( 14 - 11 fps ) :
cloud layers are drawn two or three times instead of one.

-Fred



___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel


Re: [Flightgear-devel] Clouds artefacts

2004-03-28 Thread Jim Wilson
Frederic Bouvier said:

 The previous try was not addressing hole made by prop disc or exhaust 
 plume in layers beneath. Only artefact created by upper layers.
 
 This time, with more passes, the result is quite correct in all cases :
 
 Without multi passes, depth buffer blocks cloud rendering through the prop 
 disk/quad :
  http://perso.wanadoo.fr/frbouvi/flightsim/fg-multip-off-2.jpg (131kb)
 
 with multi pass, over a broken layer :
  http://perso.wanadoo.fr/frbouvi/flightsim/fg-multip-on-3.jpg
 
 over an overcast layer :
  http://perso.wanadoo.fr/frbouvi/flightsim/fg-multip-on-4.jpg
 
 It seems there is a significant framerate penalty ( 14 - 11 fps ) :
 cloud layers are drawn two or three times instead of one.
 

FWIW I don't think prop disks and plumes (as they are being done now) are
worth the extra cost.  Is there any problem with ignoring this particular
issue for now,  or can the triple pass be a separate command line option?

Best,

Jim


___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel


Re: [Flightgear-devel] Clouds artefacts

2004-03-28 Thread Frederic Bouvier
Frederic Bouvier wrote:

 Melchior FRANZ wrote:
 
  * Jim Wilson -- Sunday 28 March 2004 18:07:
   FWIW I don't think prop disks and plumes (as they are being done now)
 are
   worth the extra cost.  Is there any problem with ignoring this
 particular
   issue for now,  or can the triple pass be a separate command line
 option?
 
  FWIW I think that this bug has to be fixed, but also that it should be
  a render option.
 
http://perso.wanadoo.fr/frbouvi/flightsim/fg-multip-off-2.jpg
 
 I am leaning to a 4 level quality choice :
 
  0 - actual state : clouds are making holes in mountains when seen from
  below, translucent surfaces are making hole in clouds underneath.

http://perso.wanadoo.fr/frbouvi/flightsim/fg-multip-lvl0.jpg

  1 - clouds are blended with mountains

http://perso.wanadoo.fr/frbouvi/flightsim/fg-multip-lvl1.jpg
 
  2 - translucent aircraft surfaces are blended with clouds but with
  problem with underlying 3d static objects ( clouds between the
  propeller disc and 3d objects are not seen )
 
  3 - total correctness

http://perso.wanadoo.fr/frbouvi/flightsim/fg-multip-lvl2-1.jpg
the propeller disc doesn't appear well on overcast so the same over 
broken to show that it is still there :
http://perso.wanadoo.fr/frbouvi/flightsim/fg-multip-lvl2-2.jpg

 Perhaps 2 and 3 can be collapsed with no extra cost. 

Yes, they can, it is just a matter of drawing the aircraft after the other 
models

In this area of the world, there is no impact on framerate with my
hardware setup. At KSFO though, the difference is real.

-Fred



___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel


RE: [Flightgear-devel] Clouds artefacts

2004-03-24 Thread Vivian Meazza


 Frederic Bouvier wrote

 Curtis L. Olson wrote:
 
  David Megginson wrote:
 
   Whether it goes in the release or not is up to Curt, but it looks 
   great, and I notice from the screenshots that your 
 framerate stayed 
   the same.
 
 
  On IRC Fred mentioned that they didn't look correct from 
 above.  Let's 
  see if he can track down the problem before the official 
 release ... 
  I'm trying to roll out the next pre release tonight.
 
 I discovered since then that I started FG with 
 --disable-clouds (!) With --enable-clouds, it is ok. This 
 property ( /environment/clouds/status ) seems to be only 
 tested on clouds drawn below the viewer.
 
 So to make it short, it seems to work ok. What this change 
 does not address yet is the fact that we can see the ground 
 over overcast layer through the exhaust beam of the hunter. I 
 can try to look at this tonight and cure the --disable-clouds 
 to really disable clouds.
 
 Cheers,
 -Fred
 

The exhaust plume of the Hunter is a crude simulation - using a nearly
transparent material. Perhaps there's a better way of simulating the
exhaust?

Regards

Vivian Meazza



___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel


Re: [Flightgear-devel] Clouds artefacts

2004-03-24 Thread Frederic BOUVIER
Vivian Meazza wrote:

  So to make it short, it seems to work ok. What this change 
  does not address yet is the fact that we can see the ground 
  over overcast layer through the exhaust beam of the hunter. I 
  can try to look at this tonight and cure the --disable-clouds 
  to really disable clouds.
 
 The exhaust plume of the Hunter is a crude simulation - using a nearly
 transparent material. Perhaps there's a better way of simulating the
 exhaust?

No, I don't think of a better way to draw something transparent with 
transparent material ;-) The only problem here is that it seems that 
the aircraft seems to be drawn before the lower clouds ( although 
the source contradict this, but I must be misled - perhaps the exterior
model is in the terrain scene graph ). For better result, transparent 
objects must be drawn back to front.

-Fred


___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel


RE: [Flightgear-devel] Clouds artefacts

2004-03-24 Thread Vivian Meazza

 Frederic BOUVIER wrote

 Vivian Meazza wrote:
 
   So to make it short, it seems to work ok. What this change does 
   not address yet is the fact that we can see the ground over 
   overcast layer through the exhaust beam of the hunter. I can try 
   to look at this tonight and cure the --disable-clouds to really 
   disable clouds.
  
  The exhaust plume of the Hunter is a crude simulation -
 using a nearly
  transparent material. Perhaps there's a better way of
 simulating the
  exhaust?
 
 No, I don't think of a better way to draw something transparent with
 transparent material ;-) The only problem here is that it seems that 
 the aircraft seems to be drawn before the lower clouds ( although 
 the source contradict this, but I must be misled - perhaps 
 the exterior model is in the terrain scene graph ). For 
 better result, transparent 
 objects must be drawn back to front.
 
 -Fred
 
 
The canopy doesn't do this - it has a semi-transparent texture as well. I'll
experiment some more.

Regards

Vivian



___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel


Re: [Flightgear-devel] Clouds artefacts

2004-03-24 Thread Frederic BOUVIER
Vivian Meazza wrote:

 Frederic BOUVIER wrote
 
  Vivian Meazza wrote:
  
So to make it short, it seems to work ok. What this change does 
not address yet is the fact that we can see the ground over 
overcast layer through the exhaust beam of the hunter. I can try 
to look at this tonight and cure the --disable-clouds to really 
disable clouds.
   
   The exhaust plume of the Hunter is a crude simulation -
  using a nearly
   transparent material. Perhaps there's a better way of
  simulating the
   exhaust?
  
  No, I don't think of a better way to draw something transparent with
  transparent material ;-) The only problem here is that it seems that 
  the aircraft seems to be drawn before the lower clouds ( although 
  the source contradict this, but I must be misled - perhaps 
  the exterior model is in the terrain scene graph ). For 
  better result, transparent 
  objects must be drawn back to front.
  
  -Fred
  
 
 The canopy doesn't do this - it has a semi-transparent texture as well. I'll
 experiment some more.

Beware: the interior is not drawn at the same place that the exterior. To convince 
yourself, you can see that exterior model is affected by fog ( in cloud layer for 
instance ) and the interior not.

-Fred


___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel


RE: [Flightgear-devel] Clouds artefacts

2004-03-24 Thread Norman Vine
Frederic BOUVIER writes:
 
 Vivian Meazza wrote:
 
  Frederic BOUVIER wrote
  
   Vivian Meazza wrote:
   
 So to make it short, it seems to work ok. What this change does 
 not address yet is the fact that we can see the ground over 
 overcast layer through the exhaust beam of the hunter. I can try 
 to look at this tonight and cure the --disable-clouds to really 
 disable clouds.

The exhaust plume of the Hunter is a crude simulation -
   using a nearly
transparent material. Perhaps there's a better way of
   simulating the exhaust?
   
   No, I don't think of a better way to draw something transparent with
   transparent material ;-) The only problem here is that it seems that 
   the aircraft seems to be drawn before the lower clouds ( although 
   the source contradict this, but I must be misled - perhaps 
   the exterior model is in the terrain scene graph ). For 
   better result, transparent objects must be drawn back to front.
   
  
  The canopy doesn't do this - it has a semi-transparent texture as well. I'll
  experiment some more.
 
 Beware: the interior is not drawn at the same place that the exterior. To convince 
 yourself, you can see that exterior model is affected by fog ( in cloud layer for 
 instance ) and the interior not.

Exactly,  as was mentioned earlier in this thread

To render transparent Objects with OpenGL 'correctly',
 they need to be rendered in sorted order from back to front.  

The only way I know of doing this in a 'generic' way requires
detecting those objects with tranparency somehow and adding
them to their own scenegraph which is then only drawn after all
non-transparent objects.  

The easiest way I can see to do this in FGFS would be to require
all models with transparent features to have two models
 1) the opaque parts
 2) the transparent parts
and then render the transparent parts after the clouds are drawn,
this assumes that all the clouds are further away then any of
(2) above, which might not be the case with eshaust trails esp.
with 3D clouds.

This is 'tricky' stuff :-)

Cheers

Norman




___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel


RE: [Flightgear-devel] Clouds artefacts

2004-03-24 Thread Vivian Meazza


Frederic BOUVIER wrote
 
 Vivian Meazza wrote:
 
  Frederic BOUVIER wrote
  
   Vivian Meazza wrote:
   
 So to make it short, it seems to work ok. What this 
 change does
 not address yet is the fact that we can see the ground over 
 overcast layer through the exhaust beam of the 
 hunter. I can try 
 to look at this tonight and cure the --disable-clouds 
 to really 
 disable clouds.

The exhaust plume of the Hunter is a crude simulation -
   using a nearly
transparent material. Perhaps there's a better way of
   simulating the
exhaust?
   
   No, I don't think of a better way to draw something 
 transparent with 
   transparent material ;-) The only problem here is that it 
 seems that 
   the aircraft seems to be drawn before the lower clouds ( although 
   the source contradict this, but I must be misled - perhaps the 
   exterior model is in the terrain scene graph ). For 
 better result, 
   transparent objects must be drawn back to front.
   
   -Fred
   
  
  The canopy doesn't do this - it has a semi-transparent texture as 
  well. I'll experiment some more.
 
 Beware: the interior is not drawn at the same place that the 
 exterior. To convince 
 yourself, you can see that exterior model is affected by fog 
 ( in cloud layer for 
 instance ) and the interior not.
 
 -Fred
 

It's hard to spot, but indeed the cockpit canopy does render clouds
transparent when viewed from outside not sure about fog - can't see through
it :-)). Transparent textures seem to make no difference. I was going to say
if it was just an exhaust plume problem, I could delete them until I could
make them better, but since the problem is wider we should seek a solution. 

Vivian



___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel


Re: [Flightgear-devel] Clouds artefacts

2004-03-23 Thread Frederic Bouvier
Frederic BOUVIER wrote:

 I wrote:

  We can also begin to think about a multi pass method that would :
  1. draw the clouds above the viewer without depth update,
  2. draw the scene,
  3 .redraw the clouds above with depth test

 Thinking more about it, for the record if someone wants to toy with this :
 0. clear the stencil buffer
 1. draw the clouds above the viewer without depth update,
 2. draw the scene with stencil buffer write enabled ( terrain and objects
overwrite all clouds, even those that are between the viewer and the
terrain )
 3 .redraw the clouds above with depth test and stencil test to only
update terrain that can be obscured by clouds - this should clear the
transparency
   'drawn twice' problem

  With an impact on framerate due to double writing and problem like
  the one Melchior is experiencing with overlapping semi transparent
  objects. Haven't thought about it much of that.

 Obviously, this should be optional to accomodate less capable hardware

I manage to implement this algorithm tonight. The results are here :

1. /sim/rendering/multi-pass-clouds=false :
 http://perso.wanadoo.fr/frbouvi/flightsim/fg-multip-off-1.jpg (204kb)

2. /sim/rendering/multi-pass-clouds=true :
 http://perso.wanadoo.fr/frbouvi/flightsim/fg-multip-on-1.jpg (198kb)

3 /sim/rendering/multi-pass-clouds=true ( billboard tree detail ) :
 http://perso.wanadoo.fr/frbouvi/flightsim/fg-multip-on-2.jpg (106kb)

If you think it's worth being in the release ( being optional
thanks to property ), just speak and I will prepare a patch
tomorrow evening ( sky.[ch]xx was touched in SimGear, main.cxx
in flightgear, preferences.xml in fgfsbase )

Otherwise, I'll hold off until the release is out.

Cheers,
-Fred



___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel


Re: [Flightgear-devel] Clouds artefacts

2004-03-23 Thread Jim Wilson
Frederic Bouvier said:

 Frederic BOUVIER wrote:
 
  I wrote:
 
   We can also begin to think about a multi pass method that would :
   1. draw the clouds above the viewer without depth update,
   2. draw the scene,
   3 .redraw the clouds above with depth test
 
  Thinking more about it, for the record if someone wants to toy with this :
  0. clear the stencil buffer
  1. draw the clouds above the viewer without depth update,
  2. draw the scene with stencil buffer write enabled ( terrain and objects
 overwrite all clouds, even those that are between the viewer and the
 terrain )
  3 .redraw the clouds above with depth test and stencil test to only
 update terrain that can be obscured by clouds - this should clear the
 transparency
'drawn twice' problem
 
   With an impact on framerate due to double writing and problem like
   the one Melchior is experiencing with overlapping semi transparent
   objects. Haven't thought about it much of that.
 
  Obviously, this should be optional to accomodate less capable hardware
 
 I manage to implement this algorithm tonight. The results are here :
 
 1. /sim/rendering/multi-pass-clouds=false :
  http://perso.wanadoo.fr/frbouvi/flightsim/fg-multip-off-1.jpg (204kb)
 
 2. /sim/rendering/multi-pass-clouds=true :
  http://perso.wanadoo.fr/frbouvi/flightsim/fg-multip-on-1.jpg (198kb)
 
 3 /sim/rendering/multi-pass-clouds=true ( billboard tree detail ) :
  http://perso.wanadoo.fr/frbouvi/flightsim/fg-multip-on-2.jpg (106kb)
 
 If you think it's worth being in the release ( being optional
 thanks to property ), just speak and I will prepare a patch
 tomorrow evening ( sky.[ch]xx was touched in SimGear, main.cxx
 in flightgear, preferences.xml in fgfsbase )
 
 Otherwise, I'll hold off until the release is out.
 
 Cheers,
 -Fred

That looks really nice.  I hope we can include it.

Best,

Jim


___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel


Re: [Flightgear-devel] Clouds artefacts

2004-03-23 Thread David Megginson
Frederic Bouvier wrote:

If you think it's worth being in the release ( being optional
thanks to property ), just speak and I will prepare a patch
tomorrow evening ( sky.[ch]xx was touched in SimGear, main.cxx
in flightgear, preferences.xml in fgfsbase )
Otherwise, I'll hold off until the release is out.
Whether it goes in the release or not is up to Curt, but it looks great, and 
I notice from the screenshots that your framerate stayed the same.

All the best,

David

___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel


Re: [Flightgear-devel] Clouds artefacts

2004-03-23 Thread Curtis L. Olson
David Megginson wrote:

Whether it goes in the release or not is up to Curt, but it looks 
great, and I notice from the screenshots that your framerate stayed 
the same.


On IRC Fred mentioned that they didn't look correct from above.  Let's 
see if he can track down the problem before the official release ... I'm 
trying to roll out the next pre release tonight.

Curt.

--
Curtis Olson   Intelligent Vehicles Lab FlightGear Project
Twin Cities[EMAIL PROTECTED]  [EMAIL PROTECTED]
Minnesota  http://www.menet.umn.edu/~curt   http://www.flightgear.org


___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel


Re: [Flightgear-devel] Clouds artefacts

2004-03-23 Thread Frederic Bouvier
David Megginson wrote :

 Frederic Bouvier wrote:

  If you think it's worth being in the release ( being optional
  thanks to property ), just speak and I will prepare a patch
  tomorrow evening ( sky.[ch]xx was touched in SimGear, main.cxx
  in flightgear, preferences.xml in fgfsbase )
 
  Otherwise, I'll hold off until the release is out.

 Whether it goes in the release or not is up to Curt, but it looks great,
and
 I notice from the screenshots that your framerate stayed the same.

I have a GeForce FX5900. I think it is where the newer cards can
give us the additional benefit we are not seeing in triangle crunching.

-Fred



___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel


Re: [Flightgear-devel] Clouds artefacts

2004-03-23 Thread Frederic Bouvier
Curtis L. Olson wrote:

 David Megginson wrote:

  Whether it goes in the release or not is up to Curt, but it looks
  great, and I notice from the screenshots that your framerate stayed
  the same.


 On IRC Fred mentioned that they didn't look correct from above.  Let's
 see if he can track down the problem before the official release ... I'm
 trying to roll out the next pre release tonight.

I discovered since then that I started FG with --disable-clouds (!)
With --enable-clouds, it is ok. This property ( /environment/clouds/status )
seems to be only tested on clouds drawn below the viewer.

So to make it short, it seems to work ok. What this change does not address
yet is the fact that we can see the ground over overcast layer through the
exhaust beam of the hunter. I can try to look at this tonight and cure the
--disable-clouds to really disable clouds.

Cheers,
-Fred



___
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel