Roman Grigoriev wrote: > I try to dig clouds problem and come across to this situation Clouds > particles > are improperly sorted from back to front So DepthRenderBin doesn’t sort cloud > particles Here is to screen shots First I made by manual placing clouds > particles so 1st particle is near to viewer and 10th is far Here we have > incorrect.jpg but when I placed 1 particle far from viewer and 10th near you > see > correct picture correct.jpg Maybe if we are using shaders and osg::Drawable > depthrenderbin sorting in osg doesn't work? > And we have to do sorting manually?
I have come to the same conclusion. The depthrenderbin sorting doesn't work in this case because the draw order of the sprites is defined by the CloudShaderGeometry itself. The solution as you have pointed out is to do the sorting manually before rendering. Unfortunately this needs to happen every frame (in CloudShaderGeometry::drawImplementation) The sort needs to be on the z axis of the view fustrum, which can be derived by passing the sprite positions through the Camera ViewMatrix. I'm working on code to do all this, but don't expect to have code available until sometime next week. If anyone wants to look at it before then, they are very welcome! -Stuart ------------------------------------------------------------------------- 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 Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel