| 588 | } |
| 589 | |
| 590 | void SkySphere::_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 | desc.zFunc = GFXCmpLessEqual; |
| 606 | mMatInstance->addStateBlockDesc(desc); |
| 607 | |
| 608 | // Also disable lighting on the skysphere material by default. |
| 609 | FeatureSet features = MATMGR->getDefaultFeatures(); |
| 610 | features.removeFeature(MFT_RTLighting); |
| 611 | features.removeFeature(MFT_Visibility); |
| 612 | features.removeFeature(MFT_ReflectionProbes); |
| 613 | features.addFeature(MFT_isBackground); |
| 614 | |
| 615 | // Now initialize the material. |
| 616 | mMatInstance->init(features, getGFXVertexFormat<GFXVertexPNT>()); |
| 617 | } |
| 618 | |
| 619 | void SkySphere::_updateMaterial() |
| 620 | { |
nothing calls this directly
no test coverage detected