Re: [Flightgear-devel] [PATCH] Simgear support for emissive animation for instruments (ver 2)

2005-01-31 Thread Frederic Bouvier
Erik Hofman a écrit :
Jim Wilson wrote:
Uggh...sometimes plib really sucks.  The ssg API seems pretty 
straight forward
until some quirk rears its ugly head.  There's just enough 
documentation to
make you think it'll work.

The above idea didn't pan out.  It seems odd that I can write a 
GL_EMISSIVE
state and it gets rendered next time, but the GL_DIFFUSE state update 
seems to
have no effect.  Anyone know why?

There has been a hack to get alpha blending to work when display lists 
are activated. Maybe this is having the opposite effect at this time?

You can disable that be commenting out the line ignore = true; for 
theSGBlendAnimation in simgear/scene/model/model.cxx

It's just a ild guess though.

This hack is working right for the ufo.
-Fred

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


Re: [Flightgear-devel] [PATCH] Simgear support for emissive animation for instruments (ver 2)

2005-01-31 Thread Erik Hofman
Jim Wilson wrote:
Uggh...sometimes plib really sucks.  The ssg API seems pretty straight forward
until some quirk rears its ugly head.  There's just enough documentation to
make you think it'll work.
The above idea didn't pan out.  It seems odd that I can write a GL_EMISSIVE
state and it gets rendered next time, but the GL_DIFFUSE state update seems to
have no effect.  Anyone know why?
There has been a hack to get alpha blending to work when display lists 
are activated. Maybe this is having the opposite effect at this time?

You can disable that be commenting out the line ignore = true; for 
theSGBlendAnimation in simgear/scene/model/model.cxx

It's just a ild guess though.
Erik
___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] [PATCH] Simgear support for emissive animation for instruments (ver 2)

2005-01-31 Thread Erik Hofman
Frederic Bouvier wrote:
Erik Hofman a écrit :

There has been a hack to get alpha blending to work when display lists 
are activated. Maybe this is having the opposite effect at this time?

You can disable that be commenting out the line ignore = true; for 
theSGBlendAnimation in simgear/scene/model/model.cxx

It's just a ild guess though.
This hack is working right for the ufo.
Yes, but Jim is trying it on a totally different way. As I understand it 
he even creates a new scenegraph subbranch every time there is a change.

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


Re: [Flightgear-devel] [PATCH] Simgear support for emissive animation for instruments (ver 2)

2005-01-30 Thread Jim Wilson
Erik Hofman said:

 Jim Wilson wrote:
 
  Hah. That's funny, I didn't even notice that code and it does almost the 
  same
  thing.  I'll fix the alpha-blend and send a patch...unless you've already
  gotten it.  The exact same code with the GL_DIFFUSE instead of GL_EMISSION,
  with a couple other minor changes should work.  Note that the material 
  states
  are often shared by different branches so it is important to clone the 
  one(s)
  you want to modify.
 
 That would be nice. People keep feeding me patches, I'm almost full now :-)
 
 Erik
 

Uggh...sometimes plib really sucks.  The ssg API seems pretty straight forward
until some quirk rears its ugly head.  There's just enough documentation to
make you think it'll work.

The above idea didn't pan out.  It seems odd that I can write a GL_EMISSIVE
state and it gets rendered next time, but the GL_DIFFUSE state update seems to
have no effect.  Anyone know why?

As far as the reason the existing alpha-blend code doesn't work may be related
to an update in 1.8.4 that was described in ChangeLog as smaller and cleaner
scene graphs.  That's just a WAG,  but it seems that this function would be
better accomplished through an API rather than writing directly back to
scenegraph memory from SimGear anyway (I find it mildly irritating that you
can even do that :-/).

Best,

Jim


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


Re: [Flightgear-devel] [PATCH] Simgear support for emissive animation for instruments (ver 2)

2005-01-29 Thread Erik Hofman
Jim Wilson wrote:
not part of cvs logtext
Note the diff file has been renamed from the earlier submission.  This version
works better with more complex models.
/not part of cvs logtext
This patch adds support to the model animation system for modifying emissive
states on the fly so that it is possible to make lights appear to dimm. 
It's committed. Thanks.
I have to figure out how you did this, the alpha-blend patch seemed to 
be broken at the moment, probably because of a change in plib :-/

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


Re: [Flightgear-devel] [PATCH] Simgear support for emissive animation for instruments (ver 2)

2005-01-29 Thread Frederic Bouvier
Erik Hofman wrote :
Jim Wilson wrote:
not part of cvs logtext
Note the diff file has been renamed from the earlier submission.  
This version
works better with more complex models.
/not part of cvs logtext

This patch adds support to the model animation system for modifying 
emissive
states on the fly so that it is possible to make lights appear to 
dimm. 

It's committed. Thanks.
I have to figure out how you did this, the alpha-blend patch seemed to 
be broken at the moment, probably because of a change in plib :-/
Or because of display lists. We did a trick a the time. Something to 
disallow the use of display lists for some animations

-Fred

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


Re: [Flightgear-devel] [PATCH] Simgear support for emissive animation for instruments (ver 2)

2005-01-29 Thread Erik Hofman
Frederic Bouvier wrote:
Erik Hofman wrote :

It's committed. Thanks.
I have to figure out how you did this, the alpha-blend patch seemed to 
be broken at the moment, probably because of a change in plib :-/

Or because of display lists. We did a trick a the time. Something to 
disallow the use of display lists for some animations
I thought so too, but that part is still in present in SimGear.
Erik
___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] [PATCH] Simgear support for emissive animation for instruments (ver 2)

2005-01-29 Thread Jim Wilson
Erik Hofman said:

 Jim Wilson wrote:
  not part of cvs logtext
  Note the diff file has been renamed from the earlier submission.  This 
  version
  works better with more complex models.
  /not part of cvs logtext
  
  This patch adds support to the model animation system for modifying emissive
  states on the fly so that it is possible to make lights appear to dimm. 
 
 It's committed. Thanks.
 I have to figure out how you did this, the alpha-blend patch seemed to 
 be broken at the moment, probably because of a change in plib :-/
 

Hah. That's funny, I didn't even notice that code and it does almost the same
thing.  I'll fix the alpha-blend and send a patch...unless you've already
gotten it.  The exact same code with the GL_DIFFUSE instead of GL_EMISSION,
with a couple other minor changes should work.  Note that the material states
are often shared by different branches so it is important to clone the one(s)
you want to modify.

Best,

Jim


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


Re: [Flightgear-devel] [PATCH] Simgear support for emissive animation for instruments (ver 2)

2005-01-29 Thread Frederic Bouvier
Jim Wilson wrote :
Erik Hofman said:
 

Jim Wilson wrote:
   

not part of cvs logtext
Note the diff file has been renamed from the earlier submission.  This version
works better with more complex models.
/not part of cvs logtext
This patch adds support to the model animation system for modifying emissive
states on the fly so that it is possible to make lights appear to dimm. 
 

It's committed. Thanks.
I have to figure out how you did this, the alpha-blend patch seemed to 
be broken at the moment, probably because of a change in plib :-/

   

Hah. That's funny, I didn't even notice that code and it does almost the same
thing.  I'll fix the alpha-blend and send a patch...unless you've already
gotten it.  The exact same code with the GL_DIFFUSE instead of GL_EMISSION,
with a couple other minor changes should work.  Note that the material states
are often shared by different branches so it is important to clone the one(s)
you want to modify.
 

Jim,
You should have a look at the constructor of your new animation. There 
are 2 unused local variables that have the same name than 2 members that 
should be initialized with 0.

Something like the code below.
-Fred
cvs -z4 -q diff -u simgear\scene\model\animation.cxx (in directory 
I:\FlightGear\cvs\SimGear\)
Index: simgear/scene/model/animation.cxx
===
RCS file: /var/cvs/SimGear-0.3/SimGear/simgear/scene/model/animation.cxx,v
retrieving revision 1.29
diff -u -r1.29 animation.cxx
--- simgear/scene/model/animation.cxx29 Jan 2005 10:31:25 -1.29
+++ simgear/scene/model/animation.cxx29 Jan 2005 19:27:12 -
@@ -1123,8 +1123,8 @@
  _color1 = props-getFloatValue(emiss-green, 0.0);
  _color2 = props-getFloatValue(emiss-blue, 0.0);
  _old_brightness = 0;
-  ssgSimpleState* _cached_material;
-  ssgSimpleState* _cloned_material;
+  _cached_material = 0;
+  _cloned_material = 0;
}

SGEmissionAnimation::~SGEmissionAnimation ()

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


Re: [Flightgear-devel] [PATCH] Simgear support for emissive animation for instruments (ver 2)

2005-01-29 Thread Jim Wilson
Frederic Bouvier said:

 Jim Wilson wrote :
 
 Erik Hofman said:
 
   
 
 Jim Wilson wrote:
 
 
 not part of cvs logtext
 Note the diff file has been renamed from the earlier submission.  This
version
 works better with more complex models.
 /not part of cvs logtext
 
 This patch adds support to the model animation system for modifying 
 emissive
 states on the fly so that it is possible to make lights appear to dimm. 
   
 
 It's committed. Thanks.
 I have to figure out how you did this, the alpha-blend patch seemed to 
 be broken at the moment, probably because of a change in plib :-/
 
 
 
 
 Hah. That's funny, I didn't even notice that code and it does almost the same
 thing.  I'll fix the alpha-blend and send a patch...unless you've already
 gotten it.  The exact same code with the GL_DIFFUSE instead of GL_EMISSION,
 with a couple other minor changes should work.  Note that the material states
 are often shared by different branches so it is important to clone the one(s)
 you want to modify.
   
 
 
 Jim,
 
 You should have a look at the constructor of your new animation. There 
 are 2 unused local variables that have the same name than 2 members that 
 should be initialized with 0.
 
 Something like the code below.
 
 -Fred
 
 cvs -z4 -q diff -u simgear\scene\model\animation.cxx (in directory 
 I:\FlightGear\cvs\SimGear\)
 Index: simgear/scene/model/animation.cxx
 ===
 RCS file: /var/cvs/SimGear-0.3/SimGear/simgear/scene/model/animation.cxx,v
 retrieving revision 1.29
 diff -u -r1.29 animation.cxx
 --- simgear/scene/model/animation.cxx29 Jan 2005 10:31:25 -1.29
 +++ simgear/scene/model/animation.cxx29 Jan 2005 19:27:12 -
 @@ -1123,8 +1123,8 @@
_color1 = props-getFloatValue(emiss-green, 0.0);
_color2 = props-getFloatValue(emiss-blue, 0.0);
_old_brightness = 0;
 -  ssgSimpleState* _cached_material;
 -  ssgSimpleState* _cloned_material;
 +  _cached_material = 0;
 +  _cloned_material = 0;
  }
  

Tsk, tsk.  I cut and pasted those from the function where they were originally
local...just to remind me to initialize them in the constructor.  That's from
hurrying too much after getting an idea.

Probably I should add other standard supported items to it (e.g.
interpolation, offsets) as well.

Best,

Jim



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


Re: [Flightgear-devel] [PATCH] Simgear support for emissive animation for instruments (ver 2)

2005-01-29 Thread Erik Hofman
Jim Wilson wrote:
Hah. That's funny, I didn't even notice that code and it does almost the same
thing.  I'll fix the alpha-blend and send a patch...unless you've already
gotten it.  The exact same code with the GL_DIFFUSE instead of GL_EMISSION,
with a couple other minor changes should work.  Note that the material states
are often shared by different branches so it is important to clone the one(s)
you want to modify.
That would be nice. People keep feeding me patches, I'm almost full now :-)
Erik
___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d