//---------------------------------------------------------------------------- void BoxSurface::DisableSorting () { for (int face = 0; face < 6; face++) { TriMesh* mesh = StaticCast<TriMesh>(GetChild(face)); MaterialInstance* instance = mesh->GetMaterialInstance(); const int numPasses = instance->GetNumPasses(); for (int p = 0; p < numPasses; ++p) { const MaterialPass* pass = instance->GetPass(p); CullProperty* cproperty = pass->GetCullProperty(); cproperty->Enabled = true; DepthProperty* dproperty = pass->GetDepthProperty(); dproperty->Enabled = true; dproperty->Writable = true; dproperty->Compare = DepthProperty::CM_LEQUAL; } } mDoSort = false; }