| 172 | } |
| 173 | |
| 174 | void ProcessedFFMaterial::setTextureStages(SceneRenderState * state, const SceneData& sgData, U32 pass) |
| 175 | { |
| 176 | // We may need to do some trickery in here for fixed function, this is just copy/paste from MatInstance |
| 177 | #ifdef TORQUE_DEBUG |
| 178 | AssertFatal( pass<mPasses.size(), "Pass out of bounds" ); |
| 179 | #endif |
| 180 | RenderPassData *rpd = mPasses[pass]; |
| 181 | for( U32 i=0; i<rpd->mNumTex; i++ ) |
| 182 | { |
| 183 | U32 currTexFlag = rpd->mTexType[i]; |
| 184 | if (!LIGHTMGR || !LIGHTMGR->setTextureStage(sgData, currTexFlag, i, NULL, NULL)) |
| 185 | { |
| 186 | switch( currTexFlag ) |
| 187 | { |
| 188 | case Material::NoTexture: |
| 189 | if (rpd->mTexSlot[i].texObject) |
| 190 | GFX->setTexture( i, rpd->mTexSlot[i].texObject ); |
| 191 | break; |
| 192 | |
| 193 | case Material::NormalizeCube: |
| 194 | GFX->setCubeTexture(i, Material::GetNormalizeCube()); |
| 195 | break; |
| 196 | |
| 197 | case Material::Lightmap: |
| 198 | GFX->setTexture( i, sgData.lightmap ); |
| 199 | break; |
| 200 | |
| 201 | case Material::Cube: |
| 202 | // TODO: Is this right? |
| 203 | GFX->setTexture( i, rpd->mTexSlot[0].texObject ); |
| 204 | break; |
| 205 | |
| 206 | case Material::SGCube: |
| 207 | // No cubemap support just yet |
| 208 | //GFX->setCubeTexture( i, sgData.cubemap ); |
| 209 | GFX->setTexture( i, rpd->mTexSlot[0].texObject ); |
| 210 | break; |
| 211 | |
| 212 | case Material::BackBuff: |
| 213 | GFX->setTexture( i, sgData.backBuffTex ); |
| 214 | break; |
| 215 | } |
| 216 | } |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | MaterialParameters* ProcessedFFMaterial::allocMaterialParameters() |
| 221 | { |
nothing calls this directly
no test coverage detected