This past week, I have been attempting to upgrade one of my Ogre 1.7 applications to Ogre 1.9.0. But I am starting to think that this is not a very good idea. This post is just about ONE of the several deal-killing problems I have been experiencing.
I am going to bump this thread since I am experiencing the same problem with Ogre ver. 1.9.0.
the code:
Code: Select all
mMaterial->getBestTechnique()->getPass(0)->getTextureUnitState(0)->setTextureName(textureName);
produced the expected effect in previous versions. But not in the current version.
Following the above code, I confirmed that the material reports that the name of the texture has changed to the new name.
Code: Select all
strTexture =mMaterial->getBestTechnique()->getPass(0)->getTextureUnitState(0)->getTextureName();
But the output in the scene has not.
I am using this code to change the texture of a simple billboard.
Code: Select all
mMoonBillboardSet->setMaterial(mMaterial);
No change on the scene. The texture displayed is at all times the texture listed in the *.material file.
If I have no filename listed in the texture_unit of my *.material file, and then set the texture name using the standard code above, then the billboard display is either black or some kind of weird visual artifact.
So, despite that the LIST is updated with the new texture names, this information is never passed on to the renderer.
The effect shows up with either the DirectX9 driver and the OpenGL driver.
the ->setTextureNameAlias() workaround produced no improvement.
And finally, there is no evidence that my shader code is executing. Here is some of my material code...
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
}
}
}
}
This, is an application that has been very solid for several Ogre generations. In short -- Ogre 1.9.0 seems to be borked real bad.
Anybody have ideas on how to fix this? Or has the API significantly changed such that old methods for changing textures on-the-fly have been replaced by new methods? Am I missing something really obvious?
I have spent several days searching for the magic combination. But no luck. Help.
Thanks.