[prev in list] [next in list] [prev in thread] [next in thread] 

List:       flightgear-cvs
Subject:    [Flightgear-cvslogs] CVS: FlightGear/src/Main renderer.cxx, 1.21,
From:       Erik Hofman <ehofman () flightgear ! org>
Date:       2005-06-26 17:21:20
Message-ID: E1Dmaoq-0004qj-00 () baron ! me ! umn ! edu
[Download RAW message or body]

Update of /var/cvs/FlightGear-0.9/FlightGear/src/Main
In directory baron:/tmp/cvs-serv18552/src/Main

Modified Files:
	renderer.cxx 
Log Message:
Harald JOHNSEN:

Changes
=======

New volumetric shadows for FlightGear.

There is now two new checkboxes in the rendering dialog to enable/disable shadows
for the user aircraft and for static scenery objects (ie those defined in the .stg \
files). AI and random objects are not handled for the moment.


known bugs
==========
- ghost objects


Index: renderer.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/FlightGear/src/Main/renderer.cxx,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -r1.21 -r1.22
*** renderer.cxx	25 Jun 2005 11:21:18 -0000	1.21
--- renderer.cxx	26 Jun 2005 17:21:18 -0000	1.22
***************
*** 52,55 ****
--- 52,57 ----
  #include <simgear/environment/visual_enviro.hxx>
  
+ #include <simgear/scene/model/shadowvolume.hxx>
+ 
  #include <Scenery/tileentry.hxx>
  #include <Time/light.hxx>
***************
*** 116,119 ****
--- 118,123 ----
  ssgSimpleState *menus;
  
+ SGShadowVolume *shadows;
+ 
  FGRenderer::FGRenderer()
  {
***************
*** 171,174 ****
--- 175,183 ----
      menus->disable( GL_TEXTURE_2D );
      menus->enable( GL_BLEND );
+ 
+     shadows = new SGShadowVolume;
+     shadows->init( fgGetNode("/sim/rendering", true) );
+     shadows->addOccluder( globals->get_scenery()->get_aircraft_branch(), \
SGShadowVolume::occluderTypeAircraft ); + 
  }
  
***************
*** 442,445 ****
--- 451,462 ----
  
          thesky->reposition( sstate, delta_time_sec );
+ 
+         shadows->setupShadows( 
+           current__view->getLongitude_deg(),
+           current__view->getLatitude_deg(),
+           globals->get_time_params()->getGst(),
+           globals->get_ephem()->getSunRightAscension(),
+           globals->get_ephem()->getSunDeclination(),
+           l->get_sun_angle());
      }
  
***************
*** 681,684 ****
--- 698,708 ----
          fgGetDouble("/velocities/airspeed-kt", 0.0));
  
+     // compute shadows and project them on screen
+     bool is_internal = globals->get_current_view()->getInternal();
+     // draw before ac because ac internal rendering clear the depth buffer
+ 
+     if( is_internal )
+         shadows->endOfFrame();
+ 
      if ( draw_otw ) {
          FGTileMgr::set_tile_filter( false );
***************
*** 697,700 ****
--- 721,726 ----
          globals->get_aircraft_model()->select( true );
      }
+ 	if( !is_internal )
+ 		shadows->endOfFrame();
  
      // display HUD && Panel


_______________________________________________
Flightgear-cvslogs mailing list
Flightgear-cvslogs@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-cvslogs
2f585eeea02e2c79d7b1d8c4963bae2d


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic