PDA

View Full Version : Q: animated textures


LSaberDuelist
10-07-2005, 12:56 PM
I tried to add some animated textures to the mask I am working on(http://www.lucasforums.com/showthread.php?t=153253), but I ran into difficulties... The only information I have on the animated textures is from http://ccg.dladventures.com/index.php?title=Textures&printable=yes, but this article is not very detailed. Does anyone know a better source of information?

What I was trying to do is to make the eye glow with animated textures. I had a look at some animated textures from the game like fx_baodur and so on...
I appears to me these animated textures are like gifs and that they store the frames of animation. Animation type and animation parameters are declared in the corresponding *.txi file.(?) But I couldn't figure out how to control the animation exactely. What I did so far:
-define a 1024x1024 fx_texture to store 16 frames of animation each frame is a 256x256 block in the texture(I guessed...)
-apply the fx_texture to the eye
-map the eye to first frame(the 256x256 block in the upper left corner)
-In the txi file I declared proceduretype cycle, numx 4 numy 4 and fps 1

There is some a cycle of different frames, but not the ones I wanted...

Does anyone know how to do this or a better source of information on the animated textures?

Darkkender
10-07-2005, 01:06 PM
Animations are all relatively unknown territory for all of us making the information base very slim. So your guess would be as good as most of ours. I wager to say trial and error will be your friend in this territory.

Darth333
10-07-2005, 01:14 PM
Several modders have made animated textures in the past, including T7, oldflash, MdKnightR and a few others. Wait until they get online :) I'd help but graphics and modelling are just not my branch. Edit: but to my knowledge, you are on the right track and the animation parameters are declared in the .txi file.

MdKnightR
10-07-2005, 02:12 PM
Well, thanks for the credit, D333, but I can't take claim for it. Oldflash is the one to ask. When I designed the Heart of the Force Sabers, my intention was to have the animated areas simply glow with the color of the blade. It was oldflash's idea to animate them. He is certainly the one to ask about such things. I wish you success with the mask! If you pull it off, I would love to download it. It would make a lovely complement to my sabers. ;)

oldflash
10-07-2005, 06:17 PM
I tried to add some animated textures to the mask I am working on(http://www.lucasforums.com/showthread.php?t=153253), but I ran into difficulties... The only information I have on the animated textures is from http://ccg.dladventures.com/index.php?title=Textures&printable=yes, but this article is not very detailed. Does anyone know a better source of information?

What I was trying to do is to make the eye glow with animated textures. I had a look at some animated textures from the game like fx_baodur and so on...
I appears to me these animated textures are like gifs and that they store the frames of animation. Animation type and animation parameters are declared in the corresponding *.txi file.(?) But I couldn't figure out how to control the animation exactely. What I did so far:
-define a 1024x1024 fx_texture to store 16 frames of animation each frame is a 256x256 block in the texture(I guessed...)
-apply the fx_texture to the eye
-map the eye to first frame(the 256x256 block in the upper left corner)
-In the txi file I declared proceduretype cycle, numx 4 numy 4 and fps 1

There is some a cycle of different frames, but not the ones I wanted...

Does anyone know how to do this or a better source of information on the animated textures?

Ok, lets get started.

Here is "template" txi which I use

envmaptexture cm_baremetal
proceduretype cycle
#defaultwidth 128
#defaultheight 128
numx 3
numy 1
fps 15
#blending additive


So, "envmaptexture" is give you that chrome efect in game
Proceduretype is how will be animation, Here is something strange. For example if you have 3x3 animated texture the steps will be:
1 2 3
7 8 9
4 5 6
Defaultwidth and defaultheight seems to be useless because even if I put comment sign (chr #) or I modify values does not affect animation, so no need for those 2.
Important is numx and numy which define how many textures are horizontal and vertical.
FPS is how many frames /sec (NOT complete cycle).
Blend aditive I use sometimes to make transparent channel black

============
How to use this
============
First, when you make mapping use some sample tga and do all thing for static texture. After exporting model you will need to edit that texture.

Example. Here is a custom lightsaber hilt which I made-it for MdKnightR and is a good example: http://www.pcgamemods.com/mod/16451.html

Sorry for my bad english
I someone want to "translate" what I write will be welcome.

ps You can use animated definition for cm_baremetal or another custom texture used for chrome effect. In that way you can use 2 animations for your textures. :D In short time I will post some new models with multiple animated textures. (http://q-net.netfirms.com/wip/017.html)

Jackel
10-07-2005, 06:34 PM
Sorry for my bad english
Your english is fine, better then some people who have english as their first language.

Just one question about this though.

How does the size of the texture work, currently we use a 256 x 256 texture (for example) do we have to use a 256 x 768 texture size if we want a texture with three different textures? Or will the game automatically devide the texture up itself in game?

edit: and nice looking sword there, thats definately going to be a download for me

LSaberDuelist
10-07-2005, 08:11 PM
first of all thanks for the help so far, but I still got a problem. As long as I do not animate the texture everthing appears fine, here is a screenshot:
http://img254.imageshack.us/img254/8189/screen10yu.jpg
the txi file used here is simply envmaptexture cm_bright
here is what happens if I want to animate:
http://img254.imageshack.us/img254/3466/screen20qq.jpg
It is a little bit hard to see, but what happens is that the eye texture is no longer properly located.
this is my eye texture:
http://img254.imageshack.us/img254/7342/fxeyemask3hu.jpg
The txi file I use is:
envmaptexture cm_bright
proceduretype cycle
#defaultwidth 256
#defaultheight 256
numx 4
numy 4
fps 20
#blending additive
#decal 1

In the animation texture I mapped the eye to the upper left eye.

Any idea how this could happen and how to correct it?

oldflash
10-08-2005, 02:47 AM
I got some pic. I use my lightsaber for example. In that way you can see how it works (last lightsaber from here: http://www.pcgamemods.com/mod/16370.html)
This was my steps:
1. I map the hilt using a single texture 128x128
http://q-net.netfirms.com/anim/2.html
http://q-net.netfirms.com/anim/1.html
and done with uvw unwrap
2. Export model and test in TSL to see how it looks
3. In photoeditor
- I load original texture http://q-net.netfirms.com/anim/3.html
- create new file with custom size 384x384 (3*128) for using at 9 frames animation (pic called "untitled - 4")
- fill the new pic with original texture until I get 9 objects 128x128 ("w_shortsbr_009-anim.tga"
note: on w_shortsbr_009-anim.tga red mark and numbers are only to show you the animation order for proceduretype cycle
- I edit every object to gibe some "glow" effect in animation
- Save final texture overwriting the one which I use for mapping and create the txi file
to contain this

envmaptexture cm_baremetal
#cm_Bright1
proceduretype cycle
defaultwidth 128
defaultheight 128
numx 3
numy 3
fps 15
#blending additive
#decal 1

In your case:
Load model in 3deditor, unwrap uvw, select all verticles and make resize to fit with texture. NOT first frame, not second. Use all texture size.
http://q-net.netfirms.com/anim/4.html

Or more simple, convert w_shortsbr_009.mdl to ascii and look how is mapped.

note: all animations thing are photoeditor job. not 3deditor.
In txi file: lines which start with # are ignored and can be deleted

You have done something like this: http://q-net.netfirms.com/anim/01.html
but if you do mapping like this http://q-net.netfirms.com/anim/02.html it will be ok

One suggestion:
In your texture the cycle order is
1 2 3 4
13 14 15 16
9 10 11 12
5 6 7 8
You can use 2048x512 texture and the order is
1- 2 - 3 - 4 - 5 - 6 -7 -8
9-10-11-12-13-14-15-16

LSaberDuelist
10-08-2005, 03:54 AM
Yep ! Got it working... :D Thanks for the great help oldflash :thmbup1: What I did wrong was the mapping, I mapped to the first frame of the animation that was wrong. You have to map for example to a single 256x256 texture, compile everything. Then to get for example an animation with 9 frames take the old texture resize it to 768x768(to store the 9 frames) and fill it with the nine frames of the original version. The old mapping has to be preserved.

oldflash
10-08-2005, 04:10 AM
Glad to hear that. Good luck. I wait your mask (which I will convert to ascii, make some modif and sent-it back to you ;) )

cry_of_paine
10-10-2005, 02:04 AM
I'm wondering, can this technique be applied to an entire character? There was a character in Bloodrayne 2 that I thought looked cool that had that kind of effect. Second, if you are able to apply this to an entire character model, can you specify that it only occurs at a specific transition state (ie. LS is normal texture, DS is animated)?

oldflash
10-10-2005, 02:21 AM
Almost every texture can be animated. The problem is on dimensions.
About transitions.
Dartk transition is reflected in changing texture. That means you could have animated texture for ds and static one for neutral and ls. For more info about characters textures look in appearance.2da.

Darkkender
10-10-2005, 11:10 AM
I would like to nominate this thread for the how to stickies as we could use some mini-tuts on animation for all.

If any moderators hear this would they be so kind as to add this. Maybe even start a sub sticky for animations in the modeling and skinning stickies.

ChAiNz.2da
10-10-2005, 11:13 AM
I would like to nominate this thread for the how to stickies as we could use some mini-tuts on animation for all.
^^^
http://www.lucasforums.com/showthread.php?t=153502 ;)

More to come regarding this however.... so keep your eyes peeled :D

cry_of_paine
10-14-2005, 02:40 AM
Almost every texture can be animated. The problem is on dimensions.

So in that case, first, are you aware of any textures which specifically can't? And second, is there a limit on the size a texture can be?

oldflash
10-14-2005, 04:51 AM
I haven't tested all textures but from what I have test, bumpmap are not accesibles for edit. Special atention need on system textures (like cm_baremetal, cm_bright or other texture used for envmap), all "frames" must have same size as original.
About size limits.
Think about this: 1 animated texture with 4 frames means same thing as 4 static textures. It's all about dimensions and will be reflected on game performance.
A good advice will be to use animated texture on nonanimated models.
Separate the parts who need to have animated textures as new mesh and remap all objects. Look at LSaberDuelist model. He use 2 textures, one static for mask and one animated only for eye.