|
|
Creating animated sprites and textures Difficulty: Intermediate |
| Category: CS:S > Sprites & GUIs | Author(s): |

To create an animated sprite or texture you must first create a tga for each frame of the animation. Name these images image001.tga, image002.tga, image003.tga, etc, etc.
Now create a text file with the following format and name it the same as the images (e.g. for the above example use image.txt):
"startframe" "1"
"endframe" "3"
Run the vtex command just as if you where creating a single texture, but instead of putting the tga on the command line use the .txt file, e.g.
vtex -mkdir -shader sprite materialsrc/mymaterials/image.txt
This will create a vmt and vtf file in materials/mymaterials
For a an animated sprite edit the vmt file to look like the following :
"Sprite"
{
"$spriteorientation" "parallel_upright"
"$spriteorigin" "[ 0.50 0.50 ]"
"$basetexture" "mymaterials/image"
}
NOTE: The frame rate and scale of the sprite are specified in the env_sprite entity
For an animated texture which can be used on walls or skyboxes you need a different vmt as follows
"LightMappedGeneric"
{
"$baseTexture" "mymaterials/image"
"Proxies"
{
"AnimatedTexture"
{
"animatedTextureVar" "$basetexture"
"animatedTextureFrameNumVar" "$frame"
"animatedTextureFrameRate" "2"
}
}
}
If you are creating a texture for a model, then change the shader from LightMappedGeneric to VertexLitGeneric. For animated textures the framerate is specified in the vmt file (In the above example it is 2 frame/sec)
NOTE: Setting framerate of a spraypaint's vmt-file doesn't seem to work!
Tutorial by CannonFodder, brought to CSB by [Xero]. |
| Added: 3 years ago | Tags: creating, animated, sprites, textures |
 Add Feedback Provide constructive feedback. What is "constructive"?You cannot post yet!Get involved on FPSB by posting your thoughts. Give authors your feedback to help them develop. To post in this submission register or login. |
 You cannot assess yet!Moderating FPSB is in your hands - when you assess a submission your vote determines its success or failure. To vote on this submission register or login. This Tutorial in a nutshell... Confusing & Helpful 3 x Confusing 1 x Helpful 1 x Handy You cannot stamp yet!Stamps let you apply characteristics to submissions to help others understand them. To stamp this submission register or login. None found ::Admin Bananite :: Admin, Skin Critic and UT3 Supervisor Want more? Find related tuts. |