[Flightgear-devel] statistics: usage of texture memory (shocking!)

2006-04-20 Thread Melchior FRANZ
I've put a debug message into plib/src/ssg/ssgLoadSGI.cxx to show how
much texture memory is used in an almost standard fgfs run with the ufo
in KSFO.[3] The message is next to the memory allocation instruction,
so it'll most likely be right. Some of the stuff can get deallocated
later, though.

See below for the logs -- files are listed as they are loaded into
memory. Doubles and *cough* 28-tuples *cough* are listed verbatim.

Textures.high:   221,051,328 Bytes total [1]
Textures:170,629,568 Bytes total [2]

This is with the following scenarios enabled:

  aircraft_demo, nimitz_demo, (Georg's) container_demo

Note that several textures are loaded multiple times! This is especially
painful for textures that are >1MB and don't really contain anything
meaningful, such as the Nimitz' red.rgb halo, which is loaded 28 times
into memory!

m.


[1] http://members.aon.at/mfranz/texsize.high
[2] http://members.aon.at/mfranz/texsize

[3]
Index: ssgLoadSGI.cxx
===
RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadSGI.cxx,v
retrieving revision 1.17
diff -u -p -r1.17 ssgLoadSGI.cxx
--- ssgLoadSGI.cxx  14 Mar 2004 11:26:56 -  1.17
+++ ssgLoadSGI.cxx  20 Apr 2006 21:13:18 -
@@ -258,6 +258,8 @@ ssgSGIHeader::ssgSGIHeader ()
   image_fd = NULL ;
 }

+#include 
+using namespace std;
 ssgSGIHeader::ssgSGIHeader ( const char *fname, ssgTextureInfo* info )
 {
   ssgSGIHeader *sgihdr = this ;
@@ -277,6 +279,8 @@ ssgSGIHeader::ssgSGIHeader ( const char
  sgihdr->ysize *
  sgihdr->zsize ] ;

+  cerr << "PLIB " << fname << " " << sgihdr->xsize * sgihdr->ysize * 
sgihdr->zsize << endl;
+
   GLubyte *ptr = image ;

   unsigned char *rbuf = new unsigned char [ sgihdr->xsize 
] ;


---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] statistics: usage of texture memory (shocking!)

2006-04-20 Thread Robicd

Note that several textures are loaded multiple times! This is especially
painful for textures that are >1MB and don't really contain anything
meaningful, such as the Nimitz' red.rgb halo, which is loaded 28 times
into memory!


A technical question, Melchior, what happens when the same 3d object is 
present multiple times in the scene, does fgfs load into memory multiple 
copies of the same texture? Even if the texture is always the same? Or 
does it point to same memory for multiple instances of the same texture?


  Roberto


---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] statistics: usage of texture memory (shocking!)

2006-04-21 Thread Erik Hofman

Melchior FRANZ wrote:


Note that several textures are loaded multiple times! This is especially
painful for textures that are >1MB and don't really contain anything
meaningful, such as the Nimitz' red.rgb halo, which is loaded 28 times
into memory!


A few weeks back I already had a hunch something like this was happening 
(back when I used the sun halo texture for the runway lights). The best 
way to handle this is to create a caching mechanism where the absolute 
path of the texture is the key and the texture-id is cached for future use.


Erik


--
http://www.ehtw.info (Dutch)Future of Enschede Airport Twente
http://www.ehofman.com/fgfs FlightGear Flight Simulator


---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] statistics: usage of texture memory (shocking!)

2006-06-15 Thread Olaf Flebbe
Hi,

let me add two points:

~ 8% of the startup time is consumed generating the mibmaps
(ssgMakeMibMaps) (measured with Intel VTune). I.e. is used for
downsampling textures.

The tremendous texture memory is a performance killer for lowend
graphics like intel 91x. (I got 1 Frame/sec.) I worked out a patch to
plib, reducing all flightgear texture sizes and got 15 Frames/sec.

Olaf


___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] statistics: usage of texture memory (shocking!)

2006-06-15 Thread Sava? Yatmaz
Per 15 Haz 2006 14:44 tarihinde, Olaf Flebbe ?unlar? yazm??t?: 
> Hi,
>
> let me add two points:
>
> ~ 8% of the startup time is consumed generating the mibmaps
> (ssgMakeMibMaps) (measured with Intel VTune). I.e. is used for
> downsampling textures.
>
> The tremendous texture memory is a performance killer for lowend
> graphics like intel 91x. (I got 1 Frame/sec.) I worked out a patch to
> plib, reducing all flightgear texture sizes and got 15 Frames/sec.
>
> Olaf

Will you provide the patch?

Regards

Savas

___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] statistics: usage of texture memory (shocking!)

2006-06-15 Thread Melchior FRANZ
* Olaf Flebbe -- Thursday 15 June 2006 13:44:
> The tremendous texture memory is a performance killer for lowend
> graphics like intel 91x. (I got 1 Frame/sec.) I worked out a patch to
> plib, reducing all flightgear texture sizes and got 15 Frames/sec.

That patch will probably collide with Fred's fix that is in CVS since
a few weeks (months?). Do you not use CVS/HEAD?

m.


___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] statistics: usage of texture memory (shocking!)

2006-06-15 Thread Frederic Bouvier
Melchior FRANZ wrote :
> * Olaf Flebbe -- Thursday 15 June 2006 13:44:
>   
>> The tremendous texture memory is a performance killer for lowend
>> graphics like intel 91x. (I got 1 Frame/sec.) I worked out a patch to
>> plib, reducing all flightgear texture sizes and got 15 Frames/sec.
>> 
>
> That patch will probably collide with Fred's fix that is in CVS since
> a few weeks (months?). Do you not use CVS/HEAD?
>   

I only removed duplicates. It is still possible to downsample textures
at load time. But I wouldn't want it to be done without my control.

-Fred

-- 
Frédéric Bouvier
http://frfoto.free.fr Photo gallery - album photo
http://www.fotolia.fr/p/2278  Other photo gallery
http://fgsd.sourceforge.net/  FlightGear Scenery Designer




___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] statistics: usage of texture memory (shocking!)

2006-06-15 Thread Olaf Flebbe
2006/6/15, Melchior FRANZ <[EMAIL PROTECTED]>:
> * Olaf Flebbe -- Thursday 15 June 2006 13:44:
> > The tremendous texture memory is a performance killer for lowend
> > graphics like intel 91x. (I got 1 Frame/sec.) I worked out a patch to
> > plib, reducing all flightgear texture sizes and got 15 Frames/sec.
>
> That patch will probably collide with Fred's fix that is in CVS since
> a few weeks (months?).

I didn't see a reduced memory size.

> Do you not use CVS/HEAD?

plib: No, Flightgear/simgear: Yes.

I did a plib tweak with a flightgear frontend to set the maximal
texture size. I do not have the low and laptop handy in order to
double check todays frames/second performance of fg. I did this
several months ago.

Cheers
   Olaf


___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] statistics: usage of texture memory (shocking!)

2006-06-15 Thread Arnt Karlsen
On Thu, 15 Jun 2006 17:43:12 +0200, Olaf wrote in message 
<[EMAIL PROTECTED]>:

> 2006/6/15, Melchior FRANZ <[EMAIL PROTECTED]>:
> > * Olaf Flebbe -- Thursday 15 June 2006 13:44:
> > > The tremendous texture memory is a performance killer for lowend
> > > graphics like intel 91x. (I got 1 Frame/sec.) I worked out a patch
> > > to plib, reducing all flightgear texture sizes and got 15
> > > Frames/sec.
> >
> > That patch will probably collide with Fred's fix that is in CVS
> > since a few weeks (months?).
> 
> I didn't see a reduced memory size.
> 
> > Do you not use CVS/HEAD?
> 
> plib: No, Flightgear/simgear: Yes.
> 
> I did a plib tweak with a flightgear frontend to set the maximal
> texture size. I do not have the low and laptop handy in order to
> double check todays frames/second performance of fg. I did this
> several months ago.

..in a similar vein:  Is there way to set the jpg-factory 
screen shot size, other than at compile time by editing  
this bit in SimGear/simgear/screen/jpgfactory.hxx ?:


typedef enum {
DEFAULT_XS = 320,
DEFAULT_YS = 240
} JPG_FACTORY_ENUM;


-- 
..med vennlig hilsen = with Kind Regards from Arnt... ;o)
...with a number of polar bear hunters in his ancestry...
  Scenarios always come in sets of three: 
  best case, worst case, and just in case.



___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] statistics: usage of texture memory (shocking!)

2006-06-15 Thread Olaf Flebbe
Hi,

> ..in a similar vein:  Is there way to set the jpg-factory
> screen shot size, other than at compile time by editing
> this bit in SimGear/simgear/screen/jpgfactory.hxx ?:
>
>
> typedef enum {
> DEFAULT_XS = 320,
> DEFAULT_YS = 240
> } JPG_FACTORY_ENUM;
>

Does this relate in any way to the discussion in this thread?

I doubt that this definitions is actually used in the code:  In
jpg-httpd the factory is initialized as 400x300.
JpgFactory->init(400,300);

screenshots (In FlightGear Menu called Snaphots) are done differently.

Size of snapshots are controlled by /sim/startup/xsize and ysize
respectivly. gui_funcs.cxx around line 570.

Olaf


___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] statistics: usage of texture memory (shocking!)

2006-06-15 Thread Arnt Karlsen
On Thu, 15 Jun 2006 21:24:52 +0200, Olaf wrote in message 
<[EMAIL PROTECTED]>:

> Hi,
> 
> > ..in a similar vein:  Is there way to set the jpg-factory
> > screen shot size, other than at compile time by editing
> > this bit in SimGear/simgear/screen/jpgfactory.hxx ?:
> >
> >
> > typedef enum {
> > DEFAULT_XS = 320,
> > DEFAULT_YS = 240
> > } JPG_FACTORY_ENUM;
> >
> 
> Does this relate in any way to the discussion in this thread?

..I dunno yet, I'm gonna find out after I get TerraGear built, your
fooling around in plib to hike fps up by 15 times tells me you 
might be able to point me the right way.

> I doubt that this definitions is actually used in the code:  In
> jpg-httpd the factory is initialized as 400x300.

..this matches what I see chking the jpeg's coming out.  
In the code,  where, FG? 

> JpgFactory->init(400,300);
> 
> screenshots (In FlightGear Menu called Snaphots) are done differently.
> 
> Size of snapshots are controlled by /sim/startup/xsize and ysize
> respectivly. gui_funcs.cxx around line 570.

..maybe, these change the display within the main window and 
probably the screen shot sizes too, and yeah, that's a different 
show from jpeg-factory.

..found it in FlightGear/src/Network/jpg-httpd.hxx:
> public:
> 
> HttpdImageChannel() : buffer(512) {
> setTerminator("\r\n");
> JpgFactory = new trJpgFactory();
> 
> // This is a terrible hack but it can't be initialized until
> // after OpenGL is up an running
> JpgFactory->init(400,300);
> }

..huh?  If OpenGL is dead, kill FG too, or ask if SW rendering is ok.

..is also possible to control jpg "fps" (5Hz) and picture 
quality (90%) at compile time now.

-- 
..med vennlig hilsen = with Kind Regards from Arnt... ;o)
...with a number of polar bear hunters in his ancestry...
  Scenarios always come in sets of three: 
  best case, worst case, and just in case.



___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] statistics: usage of texture memory (shocking!)

2006-06-15 Thread Arnt Karlsen
On Fri, 16 Jun 2006 00:06:25 +0200, Arnt wrote in message 
<[EMAIL PROTECTED]>:

..are we trigger happy today.  %o)

> On Thu, 15 Jun 2006 21:24:52 +0200, Olaf wrote in message 
> <[EMAIL PROTECTED]>:
> 
> > Hi,
> > 
> > > ..in a similar vein:  Is there way to set the jpg-factory
> > > screen shot size, other than at compile time by editing
> > > this bit in SimGear/simgear/screen/jpgfactory.hxx ?:
> > >
> > >
> > > typedef enum {
> > > DEFAULT_XS = 320,
> > > DEFAULT_YS = 240
> > > } JPG_FACTORY_ENUM;
> > >
> > 
> > Does this relate in any way to the discussion in this thread?
> 
> ..I dunno yet, I'm gonna find out after I get TerraGear built, your
> fooling around in plib to hike fps up by 15 times tells me you 
> might be able to point me the right way.
> 
> > I doubt that this definitions is actually used in the code:  In
> > jpg-httpd the factory is initialized as 400x300.
> 
> > JpgFactory->init(400,300);
> > 
> > screenshots (In FlightGear Menu called Snaphots) are done
> > differently.
> > 
> > Size of snapshots are controlled by /sim/startup/xsize and ysize
> > respectivly. gui_funcs.cxx around line 570.
> 
> ..maybe, these change the display within the main window and 
> probably the screen shot sizes too, and yeah, that's a different 
> show from jpeg-factory.
> 
> ..found it in FlightGear/src/Network/jpg-httpd.hxx:
> > public:
> > 
> > HttpdImageChannel() : buffer(512) {
> > setTerminator("\r\n");
> > JpgFactory = new trJpgFactory();
> > 
> > // This is a terrible hack but it can't be initialized until
> > // after OpenGL is up an running
> > JpgFactory->init(400,300);
> > }
> 
> ..huh?  If OpenGL is dead, kill FG too, or ask if SW rendering is ok.
> 
> ..is also possible to control jpg "fps" (5Hz) and picture 
> quality (90%) at compile time now.
 
..now, there's also runtime, and property trees to grow and poke.

-- 
..med vennlig hilsen = with Kind Regards from Arnt... ;o)
...with a number of polar bear hunters in his ancestry...
  Scenarios always come in sets of three: 
  best case, worst case, and just in case.



___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel