Re: [Flightgear-users] how do I disable 'dynamic' textures?

2005-01-27 Thread Arnt Karlsen
On Wed, 26 Jan 2005 20:08:56 -0600, D wrote in message 
[EMAIL PROTECTED]:

 ... looking forward to seeing how the actual scenery
 CORRELATES, that is.  Stupid spell cheakcer!  :-)

..yeah, spank it!  ;o)

-- 
..med vennlig hilsen = with Kind Regards from Arnt... ;-)
...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-users mailing list
Flightgear-users@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-users
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-users] how do I disable 'dynamic' textures?

2005-01-27 Thread David Luff


On 26/01/2005 at 13:54 D Wysong wrote:

Another question -- can I use plib to manage what I'm doing if my 
texture data is already in memory instead of in a file?  I poked at the 
classes in ssg but all I found were load() methods that used filenames.  
I can write a class... but if it's already there I'd rather avoid the 
extra work.

D


How about this one from ssg.h, line 729:

  // use this constructor if you already have the texture in memory
  ssgTexture ( const char *fname, GLubyte *image, int xsize, int ysize, int
zsize, 
 int wrapu = TRUE, int wrapv = TRUE);


The need for the filename is explained in ssgTexture.cxx:


ssgTexture::ssgTexture ( const char *fname, GLubyte *image,
 int xsize, int ysize, int zsize, 
 int _wrapu, int _wrapv )
// fname is used when saving the ssgSimpleState to disk.
// If there is no associated file, you can use a dummy name.
{


Cheers - Dave




This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.


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


[Flightgear-users] how do I disable 'dynamic' textures?

2005-01-26 Thread D Wysong
Can I keep FG from going back into plib and fiddling with
textures once the sim is up/initialized!?

I'm using a custom texture that I created using OpenGL
directly (instead of via plib) and I'm getting HOSED when FG
decides to go load new textures (... or when it does whatever
it does when it starts making calls to ssgLoadTextures,
ssgMakeMipMaps, etc., after the sim is executing).  AArrgh!

Are there any reasons why plib wouldn't let me build/use my
own textures? (... I posted a similar question on the
plib-users list to see if I get any replies)

Why does FG need to load anything once the sim is executing? 
Are textures not allocated/created by FG until they're needed? 
Can this 'load-it-as-you-go' behavior be replaced with a
'load-everything' approach?
What are the consequences?

Thanks,

D

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


Re: [Flightgear-users] how do I disable 'dynamic' textures?

2005-01-26 Thread Christian Mayer
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

D Wysong schrieb:
 Can I keep FG from going back into plib and fiddling with
 textures once the sim is up/initialized!?
 
 I'm using a custom texture that I created using OpenGL
 directly (instead of via plib) and I'm getting HOSED when FG
 decides to go load new textures (... or when it does whatever
 it does when it starts making calls to ssgLoadTextures,
 ssgMakeMipMaps, etc., after the sim is executing).  AArrgh!
 
 Are there any reasons why plib wouldn't let me build/use my
 own textures? (... I posted a similar question on the
 plib-users list to see if I get any replies)
 
 Why does FG need to load anything once the sim is executing? 
 Are textures not allocated/created by FG until they're needed? 
 Can this 'load-it-as-you-go' behavior be replaced with a
 'load-everything' approach?
 What are the consequences?

Until someone who knows what he's talking about comes and gives you the
real answer, I'll try:

FlightGear doesn't handle it's own textures. It uses the scene graph
from PLIB. So it tells PLIB to display object foo on this position.

PLIB itself knows foo (i.e. the geometry and the textures). But PLIB
also knows quite a lot of different other objects. So it can sort the
drawing order in such a way that it can minimize the OpenGL state changes.


And there's a reason why we don't have all textures in memory. As you
fly along some new objects (with new textures) will come into your
viewport and others will go away.
As you'll have more and more objects (like Golden Gate bridge, Alcatraz,
...) this is very important - you'll never have enough memory to keep
all textures for all objects on the world in memory.


So what should you do?
Use PLIB! You'll probably need to derive your own SSGLeaf or so.
This is the part I'm totaly lost at and where the PLIB list will help you.

CU,
Christian

PS: This question also might be better asked at the flightgear-developer
list.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFB97G1lhWtxOxWNFcRAqMwAJ49O9TJ3FHm0ZTfzqRVexBF5PgtDQCfXwWN
r4UTCKyPiHwbVm+wa0IdTE8=
=GaH3
-END PGP SIGNATURE-

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


Re: [Flightgear-users] how do I disable 'dynamic' textures?

2005-01-26 Thread Curtis L. Olson
D Wysong wrote:
Can I keep FG from going back into plib and fiddling with
textures once the sim is up/initialized!?
I'm using a custom texture that I created using OpenGL
directly (instead of via plib) and I'm getting HOSED when FG
decides to go load new textures (... or when it does whatever
it does when it starts making calls to ssgLoadTextures,
ssgMakeMipMaps, etc., after the sim is executing).  AArrgh!
 

One thing you need to understand in OpenGL is state management.   
FlightGear is a complex program that needs to set different opengl 
parameters (i.e. states) in a number of different places in the code.  
If one section of the code isn't careful and doesn't reset things 
correctly, or makes some other wierd changes, then this could cause 
problems later.

Think about it like someone giving you turn by turn directions.  If they 
don't tell you to turn at all the right places, and in the right order, 
you aren't going to end up where you want to go.

Are there any reasons why plib wouldn't let me build/use my
own textures? (... I posted a similar question on the
plib-users list to see if I get any replies)
 

This should all work fine.  FlightGear has places where it loads or 
builds it's own textures too.

Why does FG need to load anything once the sim is executing? 
Are textures not allocated/created by FG until they're needed? 
Can this 'load-it-as-you-go' behavior be replaced with a
'load-everything' approach?
What are the consequences?
 

What are the consequences of loading 12Gb of world data and associated 
textures and code all at once into main RAM?

I would hunt for an opengl state management issue in your code.  Also, 
don't forget that you must do all your texture loading in the main 
thread.  If you mix opengl calls in different threads, they will get 
mixed arbitrarily and sent to the single opengl context, and you will 
get unpredictable results ... well actually you'll most likely get a 
program crash.

Regards,
Curt.
--
Curtis Olsonhttp://www.flightgear.org/~curt
HumanFIRST Program  http://www.humanfirst.umn.edu/
FlightGear Project  http://www.flightgear.org
Unique text:2f585eeea02e2c79d7b1d8c4963bae2d
___
Flightgear-users mailing list
Flightgear-users@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-users
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-users] how do I disable 'dynamic' textures?

2005-01-26 Thread D Wysong
I'm religiously preserving the OpenGL state around everything
that I'm doing (glPushAttrib() and glPopAttrib() with
GL_ALL_ATTRIB_BITS).  Is there something more bulletproof?

Glad to know that FlightGear uses non-plib textures, too.  Can
you point me to a place in the source code where this occurs?

To rephrase my initial question, is there a way to limit the
world in which FlightGear operates to, say, 100 sq miles
around my home airport and force it to load everything it
needs up front (thus avoiding the '12 GB of data' consequence)?

Thanks for the help.

D
 Original message 
Date: Wed, 26 Jan 2005 09:36:20 -0600
From: Curtis L. Olson [EMAIL PROTECTED]  
Subject: Re: [Flightgear-users] how do I disable 'dynamic'
textures?  
To: FlightGear user discussions flightgear-users@flightgear.org

D Wysong wrote:

Can I keep FG from going back into plib and fiddling with
textures once the sim is up/initialized!?

I'm using a custom texture that I created using OpenGL
directly (instead of via plib) and I'm getting HOSED when FG
decides to go load new textures (... or when it does whatever
it does when it starts making calls to ssgLoadTextures,
ssgMakeMipMaps, etc., after the sim is executing).  AArrgh!
  


One thing you need to understand in OpenGL is state
management.   
FlightGear is a complex program that needs to set different
opengl 
parameters (i.e. states) in a number of different places in
the code.  
If one section of the code isn't careful and doesn't reset
things 
correctly, or makes some other wierd changes, then this could
cause 
problems later.

Think about it like someone giving you turn by turn
directions.  If they 
don't tell you to turn at all the right places, and in the
right order, 
you aren't going to end up where you want to go.

Are there any reasons why plib wouldn't let me build/use my
own textures? (... I posted a similar question on the
plib-users list to see if I get any replies)
  


This should all work fine.  FlightGear has places where it
loads or 
builds it's own textures too.

Why does FG need to load anything once the sim is executing? 
Are textures not allocated/created by FG until they're needed? 
Can this 'load-it-as-you-go' behavior be replaced with a
'load-everything' approach?
What are the consequences?
  


What are the consequences of loading 12Gb of world data and
associated 
textures and code all at once into main RAM?

I would hunt for an opengl state management issue in your
code.  Also, 
don't forget that you must do all your texture loading in the
main 
thread.  If you mix opengl calls in different threads, they
will get 
mixed arbitrarily and sent to the single opengl context, and
you will 
get unpredictable results ... well actually you'll most
likely get a 
program crash.

Regards,

Curt.

-- 
Curtis Olsonhttp://www.flightgear.org/~curt
HumanFIRST Program  http://www.humanfirst.umn.edu/
FlightGear Project  http://www.flightgear.org
Unique text:2f585eeea02e2c79d7b1d8c4963bae2d


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

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


Re: [Flightgear-users] how do I disable 'dynamic' textures?

2005-01-26 Thread Frederic Bouvier
Quoting D Wysong :

 To rephrase my initial question, is there a way to limit the
 world in which FlightGear operates to, say, 100 sq miles
 around my home airport and force it to load everything it
 needs up front (thus avoiding the '12 GB of data' consequence)?

First, get only the sceneries you need and put them in your scenery folder.

Second, look at the visibility commands ( those bound to z/Z ) to see how the
radius of the scenery cache loader is managed.

-Fred

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


Re: [Flightgear-users] how do I disable 'dynamic' textures?

2005-01-26 Thread D Wysong
Here's the deal -- I'm projecting NTSC video frames (my textures) onto a 
'screen' that I've placed under the HUD b/c I'd really like to use the 
synthetic scenery as a backdrop for live flight video (UAV 
groundstation).  It works... except for this texture conflict thing I 
keep getting hit with.

My textures (video frames) are actually being loaded and displayed by 
FlightGear just fine (I can send pics!)... which leads me to believe the 
attributes are Ok.  I'll glPush the attributes specifically to see if it 
helps, though.  I'm also following the rules (glGenTextures, etc) to 
keep from conflicting with everyone else.

I'm using the C-172 w/ 2D panel and my class calls are all made from 
within hud.cxx.  I'm calling my Init() method (allocates the system 
memory region for the frame grabber) when the HUD is turned on via the 
masterswitch (h).  I'm calling my Render() method (gets/displays a 
scaled subimage of the grabbed frame) from within drawHud().  Is this 
within the main thread that Curtis is talking about?  Should I be 
doing this stuff elsewhere?

If I let the sim come up and then enable the HUD (h), my video happily 
appears.  The segfault I'm seeing only occurs (according to gdb traces) 
when FlightGear begins to load/allocate other textures.  This appears to 
occur when I either (1) leave the immediate area, or (2) attempt to 
minimize the panel (s) AFTER I activate my video.  If I minimize the 
panel (thus getting all of the texture init stuff out of the way) and 
THEN activate my video (h), I can switch back and forth between the 2D 
panel and mini panel all day with my video active..

Another question -- can I use plib to manage what I'm doing if my 
texture data is already in memory instead of in a file?  I poked at the 
classes in ssg but all I found were load() methods that used filenames.  
I can write a class... but if it's already there I'd rather avoid the 
extra work.

D
---
Curtis L. Olson wrote:
D Wysong wrote:
I'm religiously preserving the OpenGL state around everything
that I'm doing (glPushAttrib() and glPopAttrib() with
GL_ALL_ATTRIB_BITS).  Is there something more bulletproof?
 

Hmmm, I seem to recall that there are some issues with 
glPush/PopAttrib().  I don't think they handle *every* possible state 
change, just the more common ones.  You need to carefully read the 
opengl manual to make sure that the things you are changing are indeed 
covered with glPush/PopAttrib().  Also, I think we've found 
occaisional bugs where glPush/PopAttrib() doesn't always work as 
advertised.  If your modified app is crashing, I suspect that either 
you will eventually find a state management problem, you are trying to 
do opengl calls outside of the main render thread, or you have a bug 
and are doing something (or a sequence of somethings) that opengl 
thinks is illegal or can't deal with.

Glad to know that FlightGear uses non-plib textures, too.  Can
you point me to a place in the source code where this occurs?
 

The opening splash screen does this, as does the 2d instrument 
panels.  Cloud textures might also be loaded outside of plib.

Curt.

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


Re: [Flightgear-users] how do I disable 'dynamic' textures?

2005-01-26 Thread D Wysong
Problem solved.
I was using glPixelStore to set the image pixel width of my textures and 
it wasn't being properly reset.  glPushAttrib/glPopAttrib doesn't give 
any protection for this so I had to manually reset the parameter (Good 
call, Curt!).

Thanks for the help, everyone.
___
Flightgear-users mailing list
Flightgear-users@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-users
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-users] how do I disable 'dynamic' textures?

2005-01-26 Thread Curtis L. Olson
D Wysong wrote:
Problem solved.
I was using glPixelStore to set the image pixel width of my textures 
and it wasn't being properly reset.  glPushAttrib/glPopAttrib doesn't 
give any protection for this so I had to manually reset the parameter 
(Good call, Curt!).

Thanks for the help, everyone.

Glad you got it working!  Your project sounds really intersting.  If you 
can share any video or picts, that would be great.

Regards,
Curt.
--
Curtis Olsonhttp://www.flightgear.org/~curt
HumanFIRST Program  http://www.humanfirst.umn.edu/
FlightGear Project  http://www.flightgear.org
Unique text:2f585eeea02e2c79d7b1d8c4963bae2d
___
Flightgear-users mailing list
Flightgear-users@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-users
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-users] how do I disable 'dynamic' textures?

2005-01-26 Thread D Wysong
We'll fly the system on a manned aircraft in the Spring and
will capture plenty of video.  I'm looking forward to seeing
how the actual scenery corolates with what FlightGear generates!

I'll certainly post a link once we've captured something worth
looking at.

D

 Original message 
Date: Wed, 26 Jan 2005 16:05:09 -0600
From: Curtis L. Olson [EMAIL PROTECTED]  
Subject: Re: [Flightgear-users] how do I disable 'dynamic'
textures?  
To: FlightGear user discussions flightgear-users@flightgear.org

D Wysong wrote:

 Problem solved.

 I was using glPixelStore to set the image pixel width of my
textures 
 and it wasn't being properly reset. 
glPushAttrib/glPopAttrib doesn't 
 give any protection for this so I had to manually reset the
parameter 
 (Good call, Curt!).

 Thanks for the help, everyone.


Glad you got it working!  Your project sounds really
intersting.  If you 
can share any video or picts, that would be great.

Regards,

Curt.

-- 
Curtis Olsonhttp://www.flightgear.org/~curt
HumanFIRST Program  http://www.humanfirst.umn.edu/
FlightGear Project  http://www.flightgear.org
Unique text:2f585eeea02e2c79d7b1d8c4963bae2d


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

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


Re: [Flightgear-users] how do I disable 'dynamic' textures?

2005-01-26 Thread D Wysong
... looking forward to seeing how the actual scenery
CORRELATES, that is.  Stupid spell cheakcer!  :-)

 Original message 
Date: Wed, 26 Jan 2005 20:04:35 -0600
From: D Wysong [EMAIL PROTECTED]  
Subject: Re: [Flightgear-users] how do I disable 'dynamic'
textures?  
To: FlightGear user discussions flightgear-users@flightgear.org

We'll fly the system on a manned aircraft in the Spring and
will capture plenty of video.  I'm looking forward to seeing
how the actual scenery corolates with what FlightGear generates!

I'll certainly post a link once we've captured something worth
looking at.

D

 Original message 
Date: Wed, 26 Jan 2005 16:05:09 -0600
From: Curtis L. Olson [EMAIL PROTECTED]  
Subject: Re: [Flightgear-users] how do I disable 'dynamic'
textures?  
To: FlightGear user discussions
flightgear-users@flightgear.org

D Wysong wrote:

 Problem solved.

 I was using glPixelStore to set the image pixel width of my
textures 
 and it wasn't being properly reset. 
glPushAttrib/glPopAttrib doesn't 
 give any protection for this so I had to manually reset the
parameter 
 (Good call, Curt!).

 Thanks for the help, everyone.


Glad you got it working!  Your project sounds really
intersting.  If you 
can share any video or picts, that would be great.

Regards,

Curt.

-- 
Curtis Olsonhttp://www.flightgear.org/~curt
HumanFIRST Program  http://www.humanfirst.umn.edu/
FlightGear Project  http://www.flightgear.org
Unique text:2f585eeea02e2c79d7b1d8c4963bae2d


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

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

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