kubatp
26-04-2011 09:10:47
Hi,
I have been trying to find a solution for a while, however it seems like the problem is in Mogre.
I need to set custom parameter for static geometry to pass a value to a pixel shader. The only way (please correct me if I am wrong) I have found (in Ogre forums) is to do this:
staticGeometry.GetRegionIterator
-> region.GetLodIterator()
---> lodBucket.GetMaterialIterator()
-----> material.GetGeometryIterator()
and for every geometrybucket in geometryiterator call setcustomparameter.
unfortunately GetGeometryIterator is not implemented in Mogre material class.
Is there a way to get an actual geometryiterator from the underlying ogre class and from this geometryiterator call setcustomparameter for each geometrybucket?
Something like :
Is it possible to do this somehow? Plese help
I have been trying to find a solution for a while, however it seems like the problem is in Mogre.
I need to set custom parameter for static geometry to pass a value to a pixel shader. The only way (please correct me if I am wrong) I have found (in Ogre forums) is to do this:
staticGeometry.GetRegionIterator
-> region.GetLodIterator()
---> lodBucket.GetMaterialIterator()
-----> material.GetGeometryIterator()
and for every geometrybucket in geometryiterator call setcustomparameter.
unfortunately GetGeometryIterator is not implemented in Mogre material class.
Is there a way to get an actual geometryiterator from the underlying ogre class and from this geometryiterator call setcustomparameter for each geometrybucket?
Something like :
Ogre.StaticGeometry.MaterialBucket mb = material.GetUnderlyingObject(); //this will give me the real OGRE class (not MOGRE)
Ogre.VectorIterator gi = mb.getGeometryIterator();
while (hasMoreElements (gi))
{
Ogre.StaticGeometry.GeometryBucket gb = gi.current();
gb.SetCustomParameter(1, customParameter);
}
Is it possible to do this somehow? Plese help