I'm changing the texture like this
Code: Select all
material->getTechnique(0)>getPass(0)>getTextureUnitState(0)->setTextureName("new_tex")
Code: Select all
material->getTechnique(0)>getPass(0)>getTextureUnitState(0)->setTextureName("new_tex")
Code: Select all
mMaterial->getBestTechnique()->getPass(0)->getTextureUnitState(0)->setTextureName(textureName);
Code: Select all
strTexture =mMaterial->getBestTechnique()->getPass(0)->getTextureUnitState(0)->getTextureName();
Code: Select all
mMoonBillboardSet->setMaterial(mMaterial);
Code: Select all
fragment_program CaelumPhaseMoonFP cg
{
source CaelumPhaseMoon.cg
entry_point PhaseMoonFP
profiles ps_2_0 arbfp1 fp30
default_params
{
param_named phase float 0.3
}
}
material CaelumPhaseMoon
{
receive_shadows off
technique
{
pass Main
{
lighting off
depth_check off
depth_write off
fog_override true none
ambient 0 0 0
diffuse 0 0 0
scene_blend alpha_blend
fragment_program_ref CaelumPhaseMoonFP
{
}
texture_unit
{
texture moon_disc.dds 2d
}
}
}
technique
{
pass
{
lighting off
depth_check off
depth_write off
scene_blend alpha_blend
fog_override true none
texture_unit MoonDisc
{
texture moon_disc.dds 2d
}
}
}
}