Harald JOHSEN:
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.
This commit is contained in:
parent
44b882abe4
commit
05f626e9fb
2 changed files with 11 additions and 1 deletions
|
@ -2154,6 +2154,7 @@ void FGTower::RemovePlane(string ID) {
|
|||
if((*twrItr)->plane.callsign == ID) {
|
||||
t = *twrItr;
|
||||
twrItr = depList.erase(twrItr);
|
||||
twrItr--;
|
||||
depListItr = depList.begin();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue