Code: Select all
getMaterial(0).getTextureMatrix(0).setScale()/setTextureScale()/setTextureScaleCenter()
What I have tried so far:
- Using setScale()/setTextureScale()/setTextureScaleCenter()
- Scaling the mesh itself with mesh->setScale() and smgr->getMeshManipulator()->scale()
- Programatically resizing the texture by ITexture->IImage->copyToScaling->IImage->ITexture
- Manually resizing the texture image to 1/4th of the size
No matter what I do, the texture always has the same size.
Code: Select all
IAnimatedMesh* mesh = smgr->getMesh(data->get<stringc>("world.map.model"));
IMesh* tangentMesh = smgr->getMeshManipulator()->createMeshWithTangents(mesh->getMesh(0));
mapNode = smgr->addOctreeSceneNode(tangentMesh);
mapNode->setMaterialFlag(EMF_LIGHTING, false);
mapNode->setPosition(data->get<vector3df>("world.map.position"));
mapNode->setRotation(data->get<vector3df>("world.map.rotation"));
mapNode->setScale(data->get<vector3df>("world.map.scale"));
ITexture* texture = driver->getTexture("Data/textures/bricks/brick.png");
mapNode->getMaterial(1).setTexture(0, texture);
ITexture* normalMap = driver->getTexture("Data/textures/bricks/brick_height.png");
mapNode->getMaterial(1).getTextureMatrix(0).setScale(6.0f);
driver->makeNormalMapTexture(normalMap, 9.0f);
mapNode->getMaterial(1).setTexture(1, normalMap);
mapNode->getMaterial(1).getTextureMatrix(1).setScale(6.0f);
mapNode->getMaterial(1).MaterialType = EMT_PARALLAX_MAP_SOLID;
mapNode->getMaterial(1).MaterialTypeParam = 0.035f;
tangentMesh->drop();
smgr->addLightSceneNode(0, vector3df(0, 0, 0), SColorf(1.0f, 1.0f, 1.0f), 1800.0f);