+ // The layers need to be drawn in order because they are
+ // translucent, but OSG transparency sorting doesn't work because
+ // the cloud polys are huge. However, the ordering is simple: the
+ // bottom polys should be drawn from high altitude to low, and the
+ // top polygons from low to high. The altitude can be used
+ // directly to order the polygons!
+ layer_root->getChild(0)->getStateSet()->setRenderBinDetails(-(int)layer_asl,
+ "RenderBin");
+ layer_root->getChild(1)->getStateSet()->setRenderBinDetails((int)layer_asl,
+ "RenderBin");