Wrecked Games

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're just that awesome.

Author Topic: ogre3d material definition  (Read 3595 times)

Anonymous

  • Guest
ogre3d material definition
« on: October 12, 2005, 09:34:03 PM »

Hi,

I've complied your plugin for ogre and it works fine (CEGUI example). I would like to use the simplest method for applying videos as textures.

Lets say I have one cube entity and something like:
material Example/TheoraVideoPlayer/Play
{
   technique
   {
      pass
      {
         texture_unit
         {
            texture_source ogg_video
            {
               filename test.ogg
               //play, pause, or loop are valid
               play_mode loop
            }
         }
      }
   }
}

In my material definition.

When I apply this material to cube entity, it is black.
Do I have to manually tell theora to start playing?

Another thing (from OGRE forums: http://www.ogre3d.org/phpBB2/viewtopic.php?t=14359):

In case I load plugin (by putting a line in plugins.cfg), my app runs jerky, i.e. loosing frames.

Everythink is ok, if I do one of these:
* remove material definition for theora movie
* remove video to which material definition is refering to
* remove theora plugin from plugin.cfg

This happens both in Debug and Release versions. Note that NO object is using theora video material definition.

I'm using ogre 1.0 & videoplugin CVS.

Thank you and keep up the good work.

Igor
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
ogre3d material definition
« Reply #1 on: October 13, 2005, 08:52:50 AM »

Hmm, the first problem... Perhaps specifying "play" instead of loop will start the video. I can not recal right now if loop starts playback or not. One thing to note - that using material files when creating movies, you will not get sound unless you speify "pause" in the material script.. and then setup the sound stuff in code before the first playback.

As for issue number 2.. Is this debug/release version? What are your system specs and OS/Compiler? Is this the cheer.ogg from my site? If not, can you test your file in VideoLan (VLC).. that should instantly tell us if your video is bad somehow.
Logged

ilautar

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 6
    • View Profile
ogre3d material definition
« Reply #2 on: October 13, 2005, 11:34:46 PM »

I've tried both loop and play, none works out-of-the-box.

I will try to do the same think you did in example, create a mClip and mVideo and start it runtime.


2. problem:
It happens with both debug and release versions. Video is cheer.ogg.

Regards,
Igor
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
ogre3d material definition
« Reply #3 on: October 15, 2005, 06:40:44 AM »

Sorry, I've been a bit under the weather lately, or I would have posted back sooner...

DId you make any progress with this? Also, you should post what your OS / IDE is... Might have some bearing on this.

I havn't tried the material script stuff in a while myself.. that could have some bearing on this... Perhaps playing without Audio the Timer is not functioning correct... I will look into running a video without audio and get back to you.
Logged

ilautar

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 6
    • View Profile
ogre3d material definition
« Reply #4 on: October 15, 2005, 08:11:29 AM »

Hi,

I haven't made any progres (other stuff to do), but will try tomorow, using your method by dynamically loading movie.

About the OS:
WinXP, Visual Studio .NET 2003, DX9c (the same thing with OpenGL)

I do not sound for now, thus there is no need for loading movie latter. But if this is the only way to go...

Thanks, I'll get back to you when I try runtime.

Regards,
Logged

ilautar

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 6
    • View Profile
ogre3d material definition
« Reply #5 on: October 15, 2005, 11:14:04 PM »

I've got it to work. After starting video runtime (mClip->..) and putting update routine to frameStarted(), it works.

Regards,
Igor
Logged

ilautar

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 6
    • View Profile
ogre3d material definition
« Reply #6 on: October 16, 2005, 04:35:26 AM »

It also works without sound, and there is no jerky movement. I can play multple videos at the same time (1.6 P m, 9700 128) and it works great.

Thank you for great work. I'll probaly have to add sound though. I'm sure there will be some more questions then :).

Regards,
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
ogre3d material definition
« Reply #7 on: October 16, 2005, 07:17:32 AM »

Oh wow.. I totally forgot about that change  :shock: Good find..

Sorry about that.. Yeah, you have to update the texture yourself everyframe. Before, it was done via a self registered framelistener. However, changes in Ogre franelistener destruction caused conflicts for stopping, pausing and destruction that I found easiest to resolve by just not using a framelistener anymore.
Logged