[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 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 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 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