Now I am trying to resolve this without using a material file but instead pure code. This is what I am at currently (I am new to ogre and graphics all together so feel free to correct my useless attempts):
Code: Select all
void TutorialApplication::createTexture (const TCHAR* pName, const TCHAR* pImageFilename)
{
Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().create(pName, "General", true );
Ogre::Technique* tech = mat->getTechnique(0);
Ogre::Pass* pass = tech->getPass(0);
Ogre::TextureUnitState* tex = pass->createTextureUnitState();
pass->setVertexColourTracking(Ogre::TVC_DIFFUSE);
tex->setTextureName(pImageFilename);
tex->setNumMipmaps(4);
tex->setTextureAnisotropy(1);
tex->setTextureFiltering(Ogre::FO_POINT, Ogre::FO_POINT, Ogre::FO_POINT);
tex->setColourOperationEx(Ogre::LBX_MODULATE, Ogre::LBS_DIFFUSE, Ogre::LBS_TEXTURE);
}
Code: Select all
MeshChunk->position(x, y, z+1); MeshChunk->normal(-1,0,0); MeshChunk->textureCoord(0, 1); MeshChunk->colour(1.0F, 1.0F, 1.0F);
MeshChunk->position(x, y+1, z+1); MeshChunk->normal(-1,0,0); MeshChunk->textureCoord(1, 1); MeshChunk->colour(1.0F, 1.0F, 1.0F);
MeshChunk->position(x, y+1, z); MeshChunk->normal(-1,0,0); MeshChunk->textureCoord(1, 0); MeshChunk->colour(1.0F, 1.0F, 1.0F);
MeshChunk->position(x, y, z); MeshChunk->normal(-1,0,0); MeshChunk->textureCoord(0, 0); MeshChunk->colour(1.0F, 1.0F, 1.0F);
Thanks in advance!