On Tue, Sep 16, 2008 at 9:20 PM, Alexis Bory - xiii
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> We now have to add a <factor-prop> to the <emission> part. I fear a lot
> of aircrafts may be impacted by this, though it's not a bigdeal to add
> some ugly thing like this:
>
> <factor-prop>utilities/numeral-1</factor-prop>
>
> I'm really sorry, I can't say precisely when this has changed.
Looking at cvs history I don't see how this ever worked on the osg branch.
The trouble seems to be with the material animation optimization.
Looks like fully static animations are never applied as the
UpdateCallback in SGMaterialAnimation.cxx skips entries that are not
live().
(this means any "-prop" entry will fix it, doesn't have to be the factor-prop)
I guess static animations should be applied once initially. I have
made a sample patch for the emission property. However it only seems
to work for me and not anybody else. Hopefully somebody can come up
with a proper fix.
--
Cheers,
Csaba/Jester
Index: simgear/scene/model/SGMaterialAnimation.cxx
===================================================================
RCS file: /var/cvs/SimGear-0.3/source/simgear/scene/model/SGMaterialAnimation.cxx,v
retrieving revision 1.7
diff -u -r1.7 SGMaterialAnimation.cxx
--- simgear/scene/model/SGMaterialAnimation.cxx 16 Feb 2008 17:01:01 -0000 1.7
+++ simgear/scene/model/SGMaterialAnimation.cxx 16 Sep 2008 21:24:55 -0000
@@ -337,6 +337,8 @@
}
traverse(node, nv);
}
+
+ ColorSpec& emission() { return _emission; }
private:
SGSharedPtr<const SGCondition> _condition;
SGSharedPtr<const SGPropertyNode> _textureProp;
@@ -404,6 +406,9 @@
alphaFunc->setReferenceValue(threshold);
stateSet->setAttribute(alphaFunc, osg::StateAttribute::OVERRIDE);
}
+ UpdateCallback* callback = new UpdateCallback(texturePathList,
+ getCondition(),
+ getConfig(), inputRoot);
unsigned suppliedColors = 0;
if (getConfig()->hasChild("ambient"))
@@ -490,12 +495,13 @@
// No overlap between the animation and color mode, so leave
// the color mode alone.
}
+ if (suppliedColors & EMISSION)
+ mat->setEmission(osg::Material::FRONT_AND_BACK,
+ callback->emission().rgbaVec4());
stateSet->setAttribute(mat,(osg::StateAttribute::ON
| osg::StateAttribute::OVERRIDE));
}
- group->setUpdateCallback(new UpdateCallback(texturePathList,
- getCondition(),
- getConfig(), inputRoot));
+ group->setUpdateCallback(callback);
parent.addChild(group);
return group;
}
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel