Animated textures

This is the location for all mods to collaborate. Anyone making or planning their own mod should post help requests, screen shots and news here.

Moderators: Omega, tillias, Mod Contributor

Post Reply
w03
Mercenary
Mercenary
Posts: 125
Joined: Sat Apr 11, 2009 1:47 am

Animated textures

Post by w03 »

I am trying, but failing to put animated textures on a mesh. Blender doesn't let me texture using a .ani file, and when I change the map kd element on a .mtl file to that of an ani file, it still doesn't play in game, and there is no animation element in the resulting xmesh. I am utterly confused.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Animated textures

Post by klauss »

Perhaps you can't do it with a direct .obj -> bfxm conversion.

I think you must go through xmesh, since you have to tell it it's an animation. I could also fix mesher to detect an "ani" extension.

EDIT: correction, mesher already detects .ani extensions on the textures given in the .mtl file. Maybe you're messing not in the conversion but in putting the converted files into the engine. Animations, for instance, IIRC, have to be in the /data/animations folder.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
w03
Mercenary
Mercenary
Posts: 125
Joined: Sat Apr 11, 2009 1:47 am

Re: Animated textures

Post by w03 »

I reconverted the files again without changing the mtl file to a .ani texture. Only one of the textures shows up if I convert to XMESH. Mesher tells me there is an error: Bad case in switch<textype> in file from_BFXM.cpp: type=1996458796 index=0
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Animated textures

Post by klauss »

Can you attach the files so I can give it a try?

It sounds like a mesher bug.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
w03
Mercenary
Mercenary
Posts: 125
Joined: Sat Apr 11, 2009 1:47 am

Re: Animated textures

Post by w03 »

I can't attach the files... board attachment quota was already reached.
w03
Mercenary
Mercenary
Posts: 125
Joined: Sat Apr 11, 2009 1:47 am

Re: Animated textures

Post by w03 »

Here's the files... Finally got below the quota by deleting an old attachment.

Sorry for the delays... I've been very busy the past few days.

Thanks for helping!
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Animated textures

Post by klauss »

Hey, thanks for the file.

The bug seems more complex than I'd expected, somehow the BFXM parser gets... desynchronized... starts decoding garbage and, well, that isn't good.

I'll keep you posted
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Animated textures

Post by klauss »

I just found the bug.

I put up the fix for review, and will shortly be committed.

:)
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
w03
Mercenary
Mercenary
Posts: 125
Joined: Sat Apr 11, 2009 1:47 am

Re: Animated textures

Post by w03 »

Thanks!
w03
Mercenary
Mercenary
Posts: 125
Joined: Sat Apr 11, 2009 1:47 am

Re: Animated textures

Post by w03 »

I seem to have missed an important error - when I convert bfxm -> xmesh, mesher splits the bfxm into several different xmesh files (one for each material) - I didn't notice until the missing xmesh files were found at the top of my folder. Sorry for not reporting this earlier! :oops:

This is still happening w/ the SVN mesher.exe after update.
pheonixstorm
Elite
Elite
Posts: 1567
Joined: Tue Jan 26, 2010 2:03 am

Re: Animated textures

Post by pheonixstorm »

the mesher.exe (unless you compiled the copy) hasn't been updated yet.
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
pheonixstorm
Elite
Elite
Posts: 1567
Joined: Tue Jan 26, 2010 2:03 am

Re: Animated textures

Post by pheonixstorm »

mesher.exe has been updated with the lasted bug fixes by klauss.
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
w03
Mercenary
Mercenary
Posts: 125
Joined: Sat Apr 11, 2009 1:47 am

Re: Animated textures

Post by w03 »

The bug is still present after update... Strange!
pheonixstorm
Elite
Elite
Posts: 1567
Joined: Tue Jan 26, 2010 2:03 am

Re: Animated textures

Post by pheonixstorm »

I can attempt to track it down.. but I doubt it.. will give it a try and maybe release something you can use soon.

Heres hoping!

BTW give me a step by step on what you are doing with mesher so I can repeat it and see whats going on. Never used mesher so no clue on how to do whatever it is you are attempting.
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
w03
Mercenary
Mercenary
Posts: 125
Joined: Sat Apr 11, 2009 1:47 am

Re: Animated textures

Post by w03 »

Sorry for the delay... finals for all my classes was a killer.

1. I run mesher.exe from the copy of cmd.exe that is in my conversion folder.
2. Copy the .obj, texture, etc. files into the conversion folder (I have designated a folder on my hard drive just for conversions to keep everything neat. Just to clarify, it does have expat.dll and everything else needed to run mesher.exe).
3. Convert the obj file to bfxm (usually something like "mesher shipname.obj shipname.bfxm obc)
4. Convert the bfxm to xmesh (usually something like "mesher shipname.bfxm shipname.xmesh bxc)

This is where I get an error, the xmesh is split into several files, one for each material I used in the file.

Thanks!
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Animated textures

Post by klauss »

It's weird... that same procedure works fine for me (linux).
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
w03
Mercenary
Mercenary
Posts: 125
Joined: Sat Apr 11, 2009 1:47 am

Re: Animated textures

Post by w03 »

Hmm, still doesn't work for me.

With direct obj -> bfxm conversion, the ani textures don't animate. When it gets converted to xmesh, the file is split up into 1 xmesh file per texture, and the ani textures still don't work unless I change the "ONE ZERO" setting to "ONE ONE".

Would it be possible to have mesher recognize an ani extension and change it to the equivalent of the "ONE ONE" xmesh tag at the same time?

Thanks
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Animated textures

Post by klauss »

It's supposed to split the mesh in submeshes, one per texture - that's a GPU limitation, GPUs can't render multiple textures at once, so they have to be split.

It's a common game modelling task to bake your multiple textures into one mamooth texture before shipping.

About ONE ONE / ONE ZERO, it shouldn't matter for the animation. Blinking lights obviously need the ONE ONE to look correct, but the animation should play the same.

You can add a "BLEND 1" line to your mtl file to any material that needs ONE ONE blending (that's additive blending). "BLEND 0.5" does standard alpha blending, and "BLEND 0" does no blending (opaque blending).
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
w03
Mercenary
Mercenary
Posts: 125
Joined: Sat Apr 11, 2009 1:47 am

Re: Animated textures

Post by w03 »

Thank you! Everything works now.
w03
Mercenary
Mercenary
Posts: 125
Joined: Sat Apr 11, 2009 1:47 am

Re: Animated textures

Post by w03 »

hmm - new problem - the animation becomes invisible when it goes into shadow, even if I make the material shadeless and unable to recieve shadows on blender. How would I make the streak animation so that it can always be seen, like on the ariston?

thanks
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Animated textures

Post by klauss »

You have to put it as a glowmap.

IIRC, "Map_ke"
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
strook
ISO Party Member
ISO Party Member
Posts: 461
Joined: Fri Sep 03, 2010 12:10 pm

Re: Animated textures

Post by strook »

Correction, if you use c++, you can with ogre manually modify the alpha channel of a texture.
I'm trying it out in the moment.
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Animated textures

Post by klauss »

strook wrote:Correction, if you use c++, you can with ogre manually modify the alpha channel of a texture.
I'm trying it out in the moment.
I don't think it has anything to do with the issues here.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
Post Reply