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

Method init

Engine/source/renderInstance/renderOcclusionMgr.cpp:71–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69};
70
71void RenderOcclusionMgr::init()
72{
73 delete mMatInstance;
74
75 mMaterial = MATMGR->allocateAndRegister( String::EmptyString );
76 mMaterial->mDiffuse[0] = LinearColorF( 1, 0, 1, 1 );
77 mMaterial->mReceiveShadows[0] = false;
78 mMaterial->mAutoGenerated = true;
79
80 mMatInstance = mMaterial->createMatInstance();
81 FeatureSet features = MATMGR->getDefaultFeatures();
82 features.removeFeature( MFT_Visibility );
83 features.removeFeature( MFT_Fog );
84 features.removeFeature( MFT_HDROut );
85 mMatInstance->init( features, getGFXVertexFormat<GFXVertexP>() );
86
87 GFXStateBlockDesc d;
88 d.setBlend( false );
89 d.cullDefined = true;
90 d.cullMode = GFXCullCCW;
91 d.setZReadWrite( true, false );
92 d.setColorWrites( false, false, false, false );
93 mRenderSB = GFX->createStateBlock(d);
94
95 d.setZReadWrite( false, false );
96 mTestSB = GFX->createStateBlock(d);
97
98 mBoxBuff.set( GFX, 36, GFXBufferTypeStatic );
99 GFXVertexP *verts = mBoxBuff.lock();
100
101 U32 vertexIndex = 0;
102 U32 idx;
103 for(S32 i = 0; i < 6; i++)
104 {
105 idx = cubeFaces[i][0];
106 verts[vertexIndex].point = cubePoints[idx];
107 vertexIndex++;
108
109 idx = cubeFaces[i][1];
110 verts[vertexIndex].point = cubePoints[idx];
111 vertexIndex++;
112
113 idx = cubeFaces[i][3];
114 verts[vertexIndex].point = cubePoints[idx];
115 vertexIndex++;
116
117 idx = cubeFaces[i][1];
118 verts[vertexIndex].point = cubePoints[idx];
119 vertexIndex++;
120
121 idx = cubeFaces[i][3];
122 verts[vertexIndex].point = cubePoints[idx];
123 vertexIndex++;
124
125 idx = cubeFaces[i][2];
126 verts[vertexIndex].point = cubePoints[idx];
127 vertexIndex++;
128 }

Callers 1

renderMethod · 0.45

Calls 12

allocateAndRegisterMethod · 0.80
removeFeatureMethod · 0.80
setBlendMethod · 0.80
setZReadWriteMethod · 0.80
setColorWritesMethod · 0.80
createStateBlockMethod · 0.80
LinearColorFClass · 0.50
createMatInstanceMethod · 0.45
setMethod · 0.45
lockMethod · 0.45
unlockMethod · 0.45
getMeshMethod · 0.45

Tested by

no test coverage detected