How to get the effect?

Problems building or running the engine, queries about how to use features etc.
Post Reply
rbagglo
Kobold
Posts: 36
Joined: Mon Dec 05, 2011 2:23 pm
x 1

How to get the effect?

Post by rbagglo »

I want get the effect that every entity is gradually appearing, and the process takes about one second. How to realize it?
Anyone could help me? Great thanks!
User avatar
areay
Bugbear
Posts: 819
Joined: Wed May 05, 2010 4:59 am
Location: Auckland, NZ
x 69

Re: Appearance Of Entity

Post by areay »

Manipulate the materials of all the objects you want to fade-in every frame.

Here's a simple method, if your materials all had their diffuse texture as texture 0 and used 'alpha_blend' scene_blend mode.

Code: Select all

myEntity->getSubEntity(0)->getMaterial().getPointer()->getTechnique(0)->getPass(0)->getTextureUnitState(0)
										->setAlphaOperation(Ogre::LBX_MODULATE, Ogre::LBS_MANUAL, Ogre::LBS_TEXTURE, theAmountOfAlphaDestired);
where you change the variable 'theAmountOfAlphaDestired' each frame.
rbagglo
Kobold
Posts: 36
Joined: Mon Dec 05, 2011 2:23 pm
x 1

Re: How to get the effect?

Post by rbagglo »

areay,thank u very much!
Post Reply