| 69 | }; |
| 70 | |
| 71 | void 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 | } |
no test coverage detected