Hi Wojtek, It looks to me that you avoiding a crash by limiting the number of qauds drawn so ignoring the excess that can't be fitted into the small set. This will a bug, rather a crash, but it's still a bug no less.
I would very much like to fix the problem directly, and I'm not yet clear on how we might do it. One approach I'm currently favoring is to do a series of State::drawQuads calls that draw the quads in sections, to achieve this we'd need to update all the currently active vertex pointers to the new offsets required to keep the first value to 0. Such a fix is rather complicated though, we'd need an inner drawQuads method and then another that saves the current vertex pointer values then does a loop through the range of quads required updating the vertex pointers and calling the inner drawQuads method. Does this sound feasible? Robert. 2010/10/15 Wojciech Lewandowski <[email protected]>: > This is a code fix that keeps the spirit of original code. Changes are: > > - fix for a crash when number of indices was larger than number hold in > _quadIndices array. > - changed number of elements of _quadIndices[6] to _quadIndices[4]. > - modified the limit of the number of drawn quads depending on max > addressable vertex not a max index == 0x10000. > > Problem was happening with really large number of particles. I basically > created a missile object flying with 800m per second and attached SmokeTrail > effect to the model. After a while number of particles was larger than > 0x10000 and this was crashing drawQuads. > > Cheers, > Wojtek Lewandowski > > From: Wojciech Lewandowski > Sent: Friday, October 15, 2010 8:21 AM > To: [email protected] > Subject: Re: [osg-submissions] Fix for State::drawQuads > Hi Robert, > > I was thinking a bit more what was the original idea behind drawQuads code > and I think I have finally figured it out. My apologies. I admit I have > misunderstood it completely. However, there is still a problem with crash I > observe and two other items could be still improved. I will send another > modification later today. > > Cheers, > Wojtek > From: Wojciech Lewandowski > Sent: Thursday, October 14, 2010 5:57 PM > To: [email protected] > Subject: [osg-submissions] Fix for State::drawQuads > Hi Robert, > > I have noticed that emitting large number of particles from > osgParticle::SmokeEffect crashes in State::drawQuads method. > I looked inside and tried to figure out whats going on in this method. But > either I am in really bad shape today or the author of this piece had a > really bad day when writing it, because I was not able to understand > it, but instead have noticed larger number of issues. > > Look at my comment above former piece of code. I ended up replacing it > completely. I have put all my thoughts in the comments. > > I rewrote this method still using GLushort _quadIndices. But do you think > that speed gain on ushorts is worth the trouble with potentially large > vertex arrays ? Wouldn't it be safer to use GLint indices and avoid all the > hassle ? > > Cheers, > Wojtek > > > ________________________________ > > _______________________________________________ > osg-submissions mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org > > ________________________________ > > _______________________________________________ > osg-submissions mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org > > _______________________________________________ > osg-submissions mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org > > _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
