Dynamic Textures?
by Anthony McCrary · in General Discussion · 03/10/2002 (10:53 pm) · 23 replies
Is there any support for this built into the engine?
What I mean is, being able to create a texture on the fly and map it onto a model? Like a counter?
For example, the ammo indicator on Unreal Tournament's rocket launcher. I know the Unreal Engine has it, not sure about the quake one though.
What I mean is, being able to create a texture on the fly and map it onto a model? Like a counter?
For example, the ammo indicator on Unreal Tournament's rocket launcher. I know the Unreal Engine has it, not sure about the quake one though.
About the author
#2
05/14/2002 (2:02 am)
It's possible. This is what I did for my MapGui (ressource posted in Code Snipits).
#3
Ever seen the movie Aliens? (or played AVP2)
The guns have a meter on the model that displays the current number of bullets in the gun. So the model's texture itself gets updated when you fire the weapon (and subtracts the the bullet from the models counter).
05/14/2002 (2:20 am)
Hmm, that's not exactly what I mean (I don't think).Ever seen the movie Aliens? (or played AVP2)
The guns have a meter on the model that displays the current number of bullets in the gun. So the model's texture itself gets updated when you fire the weapon (and subtracts the the bullet from the models counter).
#4
To make a texture from a bitmap:
05/14/2002 (2:46 am)
You want to have a counter onto a 3D model. So in GuiMap.cc, you will find how to make a texture from a bitmap. Then you just need to update the materialList of your shape. To make a texture from a bitmap:
GBitmap* bitmap = new GBitmap(sizex, sizey, false, GBitmap::RGB);
...put your text in that bitmap...
...you can do the same thing that is done in the gFont.cc
newCounter = TextureHandle("tfImage", bitmap, true);Change the material of the shape (it means that you have a specific texture for the counter)TSMaterialList* materialList = mModel->getMaterialList(); materialList->mMaterials[idCounter] = newCounter;For sure, it has not been tested and need a lot of things around it to work; but it was to give you the main idea. Moreover, I do not think it's the fastest solution (you may use decal on your object, or something like that too).
#6
my thoughts on generating this texture..
why?
I dont think the others did..
if anything there would be a pool of texture numbers that is used for this with some simple array access done ..
no need to be building textures all the time
05/14/2002 (4:37 am)
..my thoughts on generating this texture..
why?
I dont think the others did..
if anything there would be a pool of texture numbers that is used for this with some simple array access done ..
no need to be building textures all the time
#7
05/14/2002 (3:32 pm)
But doesn't torque only support 1 texture per object? If you had a texture for each number, that would require a lot of memory... right?
#8
what I would do for this need,
I would take the popular method of having a texture image that has the numerics on it.
and use that one texture to map the quad that holds the numerals,
by using only the portions of the texture that correspond to the numerals I wish to represent.
05/14/2002 (3:41 pm)
No,what I would do for this need,
I would take the popular method of having a texture image that has the numerics on it.
and use that one texture to map the quad that holds the numerals,
by using only the portions of the texture that correspond to the numerals I wish to represent.
#9
05/15/2002 (7:04 am)
@Antony : what BadGuy suggest is exactly what is done when drawing font. You should look at it.
#10
05/15/2002 (7:28 am)
one texture per number = ten textures, not a lot of memory as they only need to be like 32x32 at most
#11
I bumped into it ages ago, and have since lost the link.
I believe that would be the ultimate dynamic texture?
ring any bells?
05/18/2002 (3:55 am)
a little of the topic, but has anyone seen the directx mapping of flash animation to 3d objects?I bumped into it ages ago, and have since lost the link.
I believe that would be the ultimate dynamic texture?
ring any bells?
#12
Because it's vector based if takes up less memory, but it more cpu intenstive to draw (it's just a bunch of calculations).
05/18/2002 (10:01 am)
Flash is vector based, I don't think it would be the greatest idea to use.Because it's vector based if takes up less memory, but it more cpu intenstive to draw (it's just a bunch of calculations).
#13
and ive seen examples of early tests.
I think providing it could be done in an efficent manor, it would be a very handy unification of technologies.
attractive navigable informative 3d environments, yes please.
sam
05/20/2002 (12:50 am)
It is possible though?and ive seen examples of early tests.
I think providing it could be done in an efficent manor, it would be a very handy unification of technologies.
attractive navigable informative 3d environments, yes please.
sam
#14
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4051
05/24/2004 (3:11 am)
This is not exactly what you guys are talking about, but might interest people reading this article:http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4051
#15
05/24/2004 (3:40 am)
This thread is 2 years old...
#16
And yes, this is an old thread. Let's let it die. :)
05/24/2004 (8:27 am)
Dynamically reuploading the texture for that area of the gun wouldn't be a big performance hit.And yes, this is an old thread. Let's let it die. :)
#17
05/25/2004 (4:45 pm)
Yes, this is an old thread, but I must say that it is the first one I ran into when I did a search for "dynamic", and Richard's link gave me the info I was looking for. Thanks!
#18
Any advice?
06/27/2005 (6:33 am)
Lets say i have 20 armors 10 sets of boots and and 15 sets of legings. And i want to dynamicly mesh these items on a player mesh so say player A has armor #1 boots #4 and leggings # 11 and player B uses armor # 7 boots #4 and leggings #1 but both players use the same mesh. Is this possible without makeing textures with all possible combinations? I thought it may be possible with some sort of apha mask tecnique but not sure about how to do it.Any advice?
#19
06/27/2005 (6:52 am)
@Bobby: You can have different textures on different parts of a model (in 3d studio it's done with a multi/sub-object material). This is what we're doing in Minions of Mirth, the character models use 6 different textures; feet, legs, chest, arms, hands and head and then they're simply switched out to the correct one in the game.
#20
06/27/2005 (9:16 am)
Anyone know how to do this procedure in blender?
Torque Owner Anthony McCrary