Animated Materials Topic is solved

Problems building or running the engine, queries about how to use features etc.
PraetorBlue

Animated Materials

Post by PraetorBlue »

Is there an easy way to define/use an animated material in OGRE? I've looked through the discussions I could find on the topic, and the only way I've noticed is to use a controller to change the image as needed.

Ultimately, I'm going to be implementing many particle emitters. I could write them with normal non-animated materials, but for at least some of the emitters it would be useful to have animated particles (e.g. small explosions, etc.).

Thanks for your time.
User avatar
OberleutnantDan
Gnoblar
Posts: 5
Joined: Sun Oct 06, 2002 11:19 pm
Location: Milwaukee, Wisconsin, USA

anim_texture

Post by OberleutnantDan »

Yes, There is support for this. Its all documented in the tutorials found on the Ogre main page.
Here is a link to the .material format.
http://ogre.sourceforge.net/Tutorials/1 ... im_texture
hope that helps
--Dan
PraetorBlue

Yes

Post by PraetorBlue »

That's exactly what I was looking for, thanks. I don't know how many times I've read that file yet overlooked the part I needed. :?

I appreciate the help! :wink:
User avatar
SpannerMan
Gold Sponsor
Gold Sponsor
Posts: 446
Joined: Fri May 02, 2003 10:05 am
Location: UK

Post by SpannerMan »

I also have a question concerning animated materials, so I thought I'd post it in here.

I have an overlay with an animated texture. The texture and animation (a simple scroll_anim) are defined in a material file. I do not know exactly what processes go on in the background to keep these material's animated, but basically my material is no longer scrolling!

The only change made to my code (a rather big change, really) is that I moved my main game loop from a framelistener to a standard loop in a new class. This new class does not deal with an event time like it used to when it was in a framelistener. I wonder, could my materials animation cease working because I am not running any framelisteners?

It seems unlikely to me that this is the case. It's just strange how my overlays and all the materials are being displayed fine, but my material scrolling has stopped. Does any body have any ideas why this might be happening?
User avatar
cTh
Halfling
Posts: 81
Joined: Wed Dec 11, 2002 10:47 am
Location: Moscow/Russia

Post by cTh »

you must 'feed' the controller manager manualy if u dont use a frame listener, this code should help :

Code: Select all

SharedPtr<ControllerValue> ftc = ControllerManager::getSingleton().getFrameTimeSource();
FrameTimeControllerValue *cv = (FrameTimeControllerValue *)ftc.getPointer();
cv->frameStarted(mEvent);
just fill the FrameEvent (mEvent.timeSinceLastEvent and mEvent.timeSinceLastFrame) structure with your timmings...

Hope this helps...
User avatar
SpannerMan
Gold Sponsor
Gold Sponsor
Posts: 446
Joined: Fri May 02, 2003 10:05 am
Location: UK

Post by SpannerMan »

Thank you cTh, that sounds about right. I will look into this and let you know how I went...
User avatar
dennis
Gremlin
Posts: 157
Joined: Mon Nov 11, 2002 4:21 pm
x 4

Post by dennis »

It would be nice to use a single animation file (.mng using libmng?) instead of separate image files though.

[edit]
It seems that .mng is now also supported through devil.
[/edit]
Last edited by dennis on Sun Aug 10, 2003 2:06 pm, edited 1 time in total.
User avatar
SpannerMan
Gold Sponsor
Gold Sponsor
Posts: 446
Joined: Fri May 02, 2003 10:05 am
Location: UK

Post by SpannerMan »

Sorry cTh, I forgot to report back... that code of yours works a treat, all my material animations are back now. Thanks :)
koushiro
Gnoblar
Posts: 5
Joined: Sat Aug 28, 2004 3:57 pm

Post by koushiro »

since the link doesnt work anymore, can someone pls post a new one? i have the same problem. tnx
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »