| 588 | } |
| 589 | |
| 590 | void SkyBox::_initMaterial() |
| 591 | { |
| 592 | if ( mMatInstance ) |
| 593 | SAFE_DELETE( mMatInstance ); |
| 594 | |
| 595 | if ( mMaterial ) |
| 596 | mMatInstance = mMaterial->createMatInstance(); |
| 597 | else |
| 598 | mMatInstance = MATMGR->createMatInstance( "WarningMaterial" ); |
| 599 | |
| 600 | // We want to disable culling and z write. |
| 601 | GFXStateBlockDesc desc; |
| 602 | desc.setCullMode( GFXCullNone ); |
| 603 | desc.setBlend( true ); |
| 604 | desc.setZReadWrite( true, false ); |
| 605 | mMatInstance->addStateBlockDesc( desc ); |
| 606 | |
| 607 | // Also disable lighting on the skybox material by default. |
| 608 | FeatureSet features = MATMGR->getDefaultFeatures(); |
| 609 | features.removeFeature( MFT_RTLighting ); |
| 610 | features.removeFeature( MFT_Visibility ); |
| 611 | features.addFeature(MFT_SkyBox); |
| 612 | |
| 613 | // Now initialize the material. |
| 614 | mMatInstance->init(features, getGFXVertexFormat<GFXVertexPNT>()); |
| 615 | } |
| 616 | |
| 617 | void SkyBox::_updateMaterial() |
| 618 | { |
nothing calls this directly
no test coverage detected