Hi Moritz,
On Tue, 2006-07-11 at 17:38 +0200, Carlo Moritz Goellner wrote:
>
> which "last two" do you mean? The last two methods of my pseudo code?
> Of course, these do not cause an execution of updateLowHighIndices. I meant
> the four field modifications in the first two methods of my pseudo code. :)
OK. ;)
> The relevant code in OSGGeomtry.cpp says:
>
> if(whichField & (IndicesFieldMask | LengthsFieldMask | TypesFieldMask
> | IndexMappingFieldMask))
> {
> updateLowHighIndices();
> }
>
> So, updateLowHighIndices() is called whenever one of these four fields
> changes,
> right? Thus, my method updateElementTypes() causes two calls due to the
> modification of LengthField and TypesField. And my method
> updateIndexMapping()
> causes two calls due to the modification of IndicesField and
> IndexMappingField.
> That's 2+2 = 4.
OK.
> I forgot to mention that I do not use change masks on the geometry core
> (except for
> the IndexMappingField). I'm editing the geo properties directly. Like this:
>
> void updateIndexMapping(...) {
> //-- upload new indices
> osg::GeoIndicesUI32Ptr meshIndices =
> osg::GeoIndicesUI32Ptr::dcast(meshGeometryCore->getIndices());
> beginEditCP(meshIndices);
> {
> // supply new indices
> }
> endEditCP(meshIndices);
> }
>
> Because, most of the time, I do not modfiy the geometry core's geo
> property ptr fields,
> but the contents of the geo properties.
Hm, I see. That's true, and it makes things more complicated...
> So basically I could do something like the following?
>
> osg::GeoIndicesUI32Ptr meshIndices =
> osg::GeoIndicesUI32Ptr::dcast(meshGeometryCore->getIndices());
> osg::GeoPTypesUI8Ptr meshPTs =
> osg::GeoPTypesUI8Ptr::dcast(meshGeometryCore->getTypes());
> osg::GeoPLengthsUI32Ptr meshPLs =
> osg::GeoPLengthsUI32Ptr::dcast(meshGeometryCore->getLengths());
>
> //-- modify meshIndices, meshPTs, meshPLs without begin/endEditCP
>
> //-- just "mention" the modified fields once
> beginEditCP(meshGeometryCore, Geometry::IndicesField,
> Geometry::TypesField, Geometry::LengthsField, Geometry::IndexMappingField);
> {
> meshGeometryCore->getIndexMapping().clear();
> meshGeometryCore->getIndexMapping().push_back(Geometry::PositionIndex);
> }
> endEditCP(meshGeometryCore, Geometry::IndicesField,
> Geometry::TypesField, Geometry::LengthsField, Geometry::IndexMappingField);
No, that wouldn't work, because then the changed values in the Props
would not be synced into the rendering thread.
> I one of my tests, I avoided the execution of updateLowHighIndices in
> one aspect using the
> IgnoreGLIdForAspect field.
Well, that's a bit of a hack. If it works for you that would be an
option.
> It's not only about the ranges for glDrawRangeElementsEXT.
> UpdateLowHighIndices does
> also compute the min and max indices for glLockArraysEXT.
I was just mentioning that because it's the reason for
UpdateLowHighIndices, without the call I can't use that extension
(sensibly).
So, to make it work I could add a flag for using that extension. If you
still want to use it but only want to call it once we could move the
update into the rendering method, but in that case it could easily end
up being called every frame, which is what I wanted to avoid.
I need to think about that, we may need more explicit stages in the
processing. IMHO the culling stage would be the right place to do it,
but there is currently no easy way to get in there.
Yours
Dirk
-------------------------------------------------------------------------
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
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users