away3d/away3d-core-fp11 — pull request #387 by MarcelKlammer (2012-08-16 13:01:44+00:00)
Title: Occlusion: Hiding objects behind invisible objects.

The workflow is:
Call context.setColorMask(false, false, false, false);
Draw the object, that shall hide other objects.
Call context.setColorMask(true, true, true, true);

The OcclusionMaterial is a ColorMaterial, that calls
context.setColorMask(false, false, false, false); in its updateMaterial method
and
context.setColorMask(true, true, true, true); in its cleanMaterial method.

Added cleanMaterial beside updateMaterial in MaterialBase.
clean Material is called in DefaultRenderer.drawRenderables

I'm not sure, whether this fits your engine.