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