Assuming the material:
Code: Select all
material Water/Below
{
technique
{
pass
{
ambient 1.0 1.0 1.0 1.0
diffuse 0.0 0.2 0.5 1.0
cull_hardware none
cull_software none
vertex_program_ref Water/water_vp
{
}
fragment_program_ref Water/water_fp
{
}
// Noise
texture_unit
{
// Perlin noise volume
texture waves2.png
// min / mag filtering, no mip
filtering linear linear none
tex_address_mode mirror
}
// Reflection
texture_unit
{
content_type compositor Fresnel reflection
tex_address_mode mirror
}
// Refraction
texture_unit
{
content_type compositor Fresnel refraction
tex_address_mode mirror
}
}
}
}
What this code does?
Code: Select all
auto mat = Ogre::MaterialManager::getSingleton().getByName("Water/Above");
mat->getTechnique(0)
->getPass(0)
->getTextureUnitState(0)
->setProjectiveTexturing(true, mCamera);
while printing
Code: Select all
std::cout << mat->getTechnique(0)
->getPass(0)
->getTextureUnitState(0)->getTextureName() << "\n";
prints "waves2.png"