]> git.mxchange.org Git - flightgear.git/commitdiff
Harald JOHSEN:
authorehofman <ehofman>
Mon, 18 Jul 2005 16:58:22 +0000 (16:58 +0000)
committerehofman <ehofman>
Mon, 18 Jul 2005 16:58:22 +0000 (16:58 +0000)
Changes
=======

- shadowvolume.cxx, renderer.cxx :
  - reduced the polygon offset a bit to eliminate some artifact ;
  - changed again the cleanup code for objects inside a tile because it could crash on rare occasion ;
  - the culling of shadow casters has been rewritten to traverse the scene graph, it should be
    a bit faster when there is a lot of objects ;
  - the range selector was not correctly handled, sometimes the wrong LOD was casting shadows.
  - added the option to display aircraft's transparent objects after the shadows, this will
    reduce the problem of shadows being hidden by the transparent object (propeller disk,
    rotor, etc). A side effect is that aircraft's transparent objects won't receive shadows
    anymore. This is usually a good thing except when the aircraft use a 'transparent'
    texture where it should not. A transparent texture in the plib context is a texture
    with an alpha channel or a material with alpha <= 0.99.

- model.cxx, animation.cxx, shadowvolume.cxx :
  - added an optional <condition> under the <noshadow> animation

- tower.cxx
  - correct a rare bug where all occurences of the aircraft are not deleted from the
  departure list causing a crash in FGTower::CheckDepartureList function.

src/ATC/tower.cxx
src/Main/renderer.cxx

index 1271e920a1b1ee85cd1bad46d53b1410158d82c6..11d076ebc0e87c4fc9289b9b56a427a4acbd19fc 100644 (file)
@@ -2154,6 +2154,7 @@ void FGTower::RemovePlane(string ID) {
                if((*twrItr)->plane.callsign == ID) {
                        t = *twrItr;
                        twrItr = depList.erase(twrItr);
+                       twrItr--;
                        depListItr = depList.begin();
                }
        }
index d8f6e8c309582e0f3f9c7f1dd27748556c0bd086..fe79a0425995790e44e904a1e362f10b5832f0be 100644 (file)
@@ -175,7 +175,7 @@ FGRenderer::build_states( void ) {
     menus->disable( GL_TEXTURE_2D );
     menus->enable( GL_BLEND );
 
-    shadows = new SGShadowVolume;
+    shadows = new SGShadowVolume( globals->get_scenery()->get_scene_graph() );
     shadows->init( fgGetNode("/sim/rendering", true) );
     shadows->addOccluder( globals->get_scenery()->get_aircraft_branch(), SGShadowVolume::occluderTypeAircraft );
 
@@ -701,6 +701,7 @@ FGRenderer::update( bool refresh_camera_settings ) {
     bool is_internal = globals->get_current_view()->getInternal();
     // draw before ac because ac internal rendering clear the depth buffer
 
+       globals->get_aircraft_model()->select( true );
     if( is_internal )
         shadows->endOfFrame();
 
@@ -715,11 +716,19 @@ FGRenderer::update( bool refresh_camera_settings ) {
         //  the aircraft in the global scenegraph
         // Otherwise, it just enables the aircraft: The scenegraph
         //  must be drawn again to see the plane.
+        ssgBranch *branch = globals->get_scenery()->get_aircraft_branch();
+        // in external view the shadows are drawn before the transparent parts of the ac
+        if( ! is_internal )
+            branch->setTravCallback( SSG_CALLBACK_POSTTRAV, SGShadowVolume::ACpostTravCB);
         ssgCullAndDraw( globals->get_scenery()->get_scene_graph() );
+        branch->setTravCallback( SSG_CALLBACK_POSTTRAV, 0);
         FGTileMgr::set_tile_filter( true );
         sgSetModelFilter( true );
         globals->get_aircraft_model()->select( true );
     }
+       // in 'external' view the ac can be culled, so shadows have not been draw in the
+       // posttrav callback, this would be a rare case if the getInternal was acting
+       // as expected (ie in internal view, getExternal returns false)
        if( !is_internal )
                shadows->endOfFrame();