MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / _initMaterial

Method _initMaterial

Engine/source/environment/skySphere.cpp:590–617  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

588}
589
590void 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
619void SkySphere::_updateMaterial()
620{

Callers

nothing calls this directly

Calls 8

setCullModeMethod · 0.80
setBlendMethod · 0.80
setZReadWriteMethod · 0.80
removeFeatureMethod · 0.80
addFeatureMethod · 0.80
createMatInstanceMethod · 0.45
addStateBlockDescMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected