animating textures

Hello folks, can anyone tell me whether, in Unity Pro, you can animate the texture offset/scale/position or UV map? Is this possible through the interface or scripting? If scripting which command should I be looking at?

Cheers,
Paul Mikulecky
Lost Pencil Animation Studios Inc.
http://www.lostpencil.com

“The art of character animation is to try
to catch lightning in a bottle… one volt
at a time.” Brad Bird

At the moment - no, unless you can write your own vertex shader to do that (then just pass UV animation parameters as a vector, and use that in the shader).

But I see a very good point on having that. It will be in the next Unity release, as the functions in Material class to access texture placement.

So then i’ll be able to use a texture for storing smaller chunks of animationphases?

For example if i use a 1024x1024 texture, i could say my animations have a size of 128x128 pixels and there are 30 frames in there.

Later on i say show me frame 20 of the animation x please. This would be fine.

Again it would be nice to have support of non power of 2 texturesizes as you can store much more animations like when you only need 90x90 sizes for instance.

Does it makes sense to support more than one texture for storing animations instead of using a larger texture which might slow down the system? Haven’t tried this out yet if it matters if you only crop from those…

Regards,

taumel

Yes. You’ll have complete control over the texture scale and offset from the script (at the moment you can only do it manually via the inspector).

If you pack your frames into one big power-of-2 texture then you’re fine to use any frame sizes as you like. Just setup scale&offset to the needed values. The reason Unity does not support non-power-of-2 textures (except for render textures) is that almost no graphics hardware supports it!

It depends a lot on the graphics card, on the amount of textures and the way you use them.

If you pack your frames into one big power-of-2 texture then you’re fine to use any frame sizes as you like. Just setup scale&offset to the needed values. The reason Unity does not support non-power-of-2 textures (except for render textures) is that almost no graphics hardware supports it!<<<

Yep, but what i was asking for is support of non power of 2 textures in terms of that (unity) scales them up/down before using them to power of 2 textures which will benefit you in a lot of practical cases!

Regards,

taumel

Thanks for the info! Much appreciated.

Cheers,
Paul Mikulecky
Lost Pencil Animation Studios Inc.
http://www.lostpencil.com

“The art of character animation is to try
to catch lightning in a bottle… one volt
at a time.” Brad Bird