Exe w/ Animated Meshes, MuzzleFlash+Moving Guns,&Detail
-
- Developer
- Posts: 3980
- Joined: Fri Jan 03, 2003 4:53 am
- Location: Stanford, CA
- Contact:
Exe w/ Animated Meshes, MuzzleFlash+Moving Guns,&Detail
Ace123 uploaded a binary with all the features people have been requesting...
http://vegastrike.sourceforge.net/users/ace123
so let me list them for you:
a) I have now enabled detail textures that fade in slowly as you get close...
the way to enable these is to make a mesh with the following tagline:
<Mesh texture="combine4.bmp" texture1="combinePPL.jpg" detailTexture="grid.png" scale="30">
<DetailPlane x=".02" y=".02" z="0"/>
<DetailPlane x="0" y=".02" z=".02"/>
<Points>
... ... ...
</Mesh>
So let me explain what this means
First of all--the detail textures are applied through multitexturing--so they no speed hit for cards with multiple pipelines (anything decent these days) The other thigns require passes because simply they cannot just add up--they need to multiply with each other--so the speed hit from detailTexture is limited and will be able to be turned off easily.
Secondly... the DetailPlane... what is this?
ok well given that I can't expect everyone to edit all the models and retexture them with insane detailed detail textures--we have to pick a formula to apply the texture on the model so that it will look decent. these numbers were the first numbers I tried on the star fortress-and lo and behold it looks snazzy...
let me go into a bit of detail about how these planes work
first of all notice .02 ... that's how BIG the detail textures are... the smaller the number the bigger the detail texture and the earlier it will appear to the user. right now we're saying that the texture is 1/.02 or 50 units long. for a star fortress that's pretty small.
ok so why specify 2 and what are the x,y,z
well each detailtexture you wish to apply needs 2 DetailPlanes .
if you specify 4 then your starbase will have 2 layers of the detailTexture you chose.
the formula is.
the horizontal coordinate of the texture is determined by the first DetailPlane. It's the pointx*x+pointy*y+pointz*z where the point is the point of the polygon being textured
same for the vertical coordinate--but the second DetailPlane....
basically choose the magnification first...
then choose the most important plane of your ship...if your ship is a flying sauser with a huge xz plane then have your detail planes instead:
<DetailPlane x=".02" y="0" z=".02"/>
<DetailPlane x="0" y=".02" z=".02"/>
so that the xz plane is emphasized make sense?
and change .02 to whatever you think the player will be seing when he/she's clsoe
the last two config variables you'll need to worry about are:
"graphics","detail_texture_blankout","3"
"graphics","detail_texture_full_color","1"
if you want the detail texture to stay at full intensity for longer make 1 a higher number
if you want it to black out faster make 3 a higher number
these are in vegastrike.config
Now we move to animated meshes...
this will sound similar to LODs because I use the same code w00t
<Mesh ... ... >
.....
</Polygons>
<Logo>
...
</Logo>
<Material ...>
...
</Material>
<LOD meshfile="secondframe.xmesh" framespersecond="5" size="1"/>
<LOD meshfile="secondframe.xmesh" size="1"/>
<LOD meshfile="secondframe.xmesh" size="1"/>
<LOD meshfile="secondframe.xmesh" size="1"/>
<LOD meshfile="secondframe.xmesh" size="1"/>
</Mesh>
that maeans the animation will run at 5 fps...first using the first mesh then all the meshes listed inside it.
Ok so this is how detail textures and animated meshes work...what about muzzle flash? well that's just an animated mesh put on a gun...just make a file in meshes/weapons/laser.xmesh and meshes/weapons/laser_flare.xmesh
the flare will be your muzzle flare...you need to design that yourself.
first get the laser itself appearing...
unfortunately the meshes do need to be modified to have visible weapons
you need to make the weapons 1 unit long...
then modify the
<Mount size="....".. ... ... xyscale="5" zscale="10"/>
that will make the gun stick out 5 wide and 10 long on your particular mount...each mount can have a different sized weapon.
the weapon will animate when it's being fired (use animation technique above) not before not after.
now the one problem with animations is that LODs and Animations are mutually exclusive--but this is the one way I could accomplish both without slowing the whole (unanimated) engine down
so I hope you enjoy--no one seems to use lods anyway
http://vegastrike.sourceforge.net/users/ace123
so let me list them for you:
a) I have now enabled detail textures that fade in slowly as you get close...
the way to enable these is to make a mesh with the following tagline:
<Mesh texture="combine4.bmp" texture1="combinePPL.jpg" detailTexture="grid.png" scale="30">
<DetailPlane x=".02" y=".02" z="0"/>
<DetailPlane x="0" y=".02" z=".02"/>
<Points>
... ... ...
</Mesh>
So let me explain what this means
First of all--the detail textures are applied through multitexturing--so they no speed hit for cards with multiple pipelines (anything decent these days) The other thigns require passes because simply they cannot just add up--they need to multiply with each other--so the speed hit from detailTexture is limited and will be able to be turned off easily.
Secondly... the DetailPlane... what is this?
ok well given that I can't expect everyone to edit all the models and retexture them with insane detailed detail textures--we have to pick a formula to apply the texture on the model so that it will look decent. these numbers were the first numbers I tried on the star fortress-and lo and behold it looks snazzy...
let me go into a bit of detail about how these planes work
first of all notice .02 ... that's how BIG the detail textures are... the smaller the number the bigger the detail texture and the earlier it will appear to the user. right now we're saying that the texture is 1/.02 or 50 units long. for a star fortress that's pretty small.
ok so why specify 2 and what are the x,y,z
well each detailtexture you wish to apply needs 2 DetailPlanes .
if you specify 4 then your starbase will have 2 layers of the detailTexture you chose.
the formula is.
the horizontal coordinate of the texture is determined by the first DetailPlane. It's the pointx*x+pointy*y+pointz*z where the point is the point of the polygon being textured
same for the vertical coordinate--but the second DetailPlane....
basically choose the magnification first...
then choose the most important plane of your ship...if your ship is a flying sauser with a huge xz plane then have your detail planes instead:
<DetailPlane x=".02" y="0" z=".02"/>
<DetailPlane x="0" y=".02" z=".02"/>
so that the xz plane is emphasized make sense?
and change .02 to whatever you think the player will be seing when he/she's clsoe
the last two config variables you'll need to worry about are:
"graphics","detail_texture_blankout","3"
"graphics","detail_texture_full_color","1"
if you want the detail texture to stay at full intensity for longer make 1 a higher number
if you want it to black out faster make 3 a higher number
these are in vegastrike.config
Now we move to animated meshes...
this will sound similar to LODs because I use the same code w00t
<Mesh ... ... >
.....
</Polygons>
<Logo>
...
</Logo>
<Material ...>
...
</Material>
<LOD meshfile="secondframe.xmesh" framespersecond="5" size="1"/>
<LOD meshfile="secondframe.xmesh" size="1"/>
<LOD meshfile="secondframe.xmesh" size="1"/>
<LOD meshfile="secondframe.xmesh" size="1"/>
<LOD meshfile="secondframe.xmesh" size="1"/>
</Mesh>
that maeans the animation will run at 5 fps...first using the first mesh then all the meshes listed inside it.
Ok so this is how detail textures and animated meshes work...what about muzzle flash? well that's just an animated mesh put on a gun...just make a file in meshes/weapons/laser.xmesh and meshes/weapons/laser_flare.xmesh
the flare will be your muzzle flare...you need to design that yourself.
first get the laser itself appearing...
unfortunately the meshes do need to be modified to have visible weapons
you need to make the weapons 1 unit long...
then modify the
<Mount size="....".. ... ... xyscale="5" zscale="10"/>
that will make the gun stick out 5 wide and 10 long on your particular mount...each mount can have a different sized weapon.
the weapon will animate when it's being fired (use animation technique above) not before not after.
now the one problem with animations is that LODs and Animations are mutually exclusive--but this is the one way I could accomplish both without slowing the whole (unanimated) engine down
so I hope you enjoy--no one seems to use lods anyway
Last edited by hellcatv on Wed Sep 17, 2003 1:18 am, edited 1 time in total.
Vega Strike Lead Developer
http://vegastrike.sourceforge.net/
http://vegastrike.sourceforge.net/
-
- Elite
- Posts: 1671
- Joined: Fri Jan 03, 2003 12:46 am
- Location: Earth, Sol system.
- Contact:
-
- Elite
- Posts: 1465
- Joined: Thu Jan 02, 2003 12:01 pm
- Location: Seattle, WA
- Contact:
-
- Elite
- Posts: 1671
- Joined: Fri Jan 03, 2003 12:46 am
- Location: Earth, Sol system.
- Contact:
-
- Elite
- Posts: 1671
- Joined: Fri Jan 03, 2003 12:46 am
- Location: Earth, Sol system.
- Contact:
this isnt working for me, its just crashing VS whenver i try to start it...
my VS config looks like
my VS config looks like
any ideas?...
<section name="graphics">
<section name="mesh">
<var name="testvar" value="-4"/>
</section>
<var name="detail_texture_blankout" value="3"/>
<var name="detail_texture_full_color" value="1"/>
<var name="shield_texture" value="shield.bmp"/>
<var name="reflectivity" value=".8"/>
<var name="pan_on_auto" value="false"/>
...
-
- Developer
- Posts: 3980
- Joined: Fri Jan 03, 2003 4:53 am
- Location: Stanford, CA
- Contact:
it was my bad
I mixed up the width and height when computing mipmaps
so any texture that was passed in would have the wrong data read! whoops!
ace123 updated the exe
download it again after this post it should work dandy
I mixed up the width and height when computing mipmaps
so any texture that was passed in would have the wrong data read! whoops!
ace123 updated the exe
download it again after this post it should work dandy
Vega Strike Lead Developer
http://vegastrike.sourceforge.net/
http://vegastrike.sourceforge.net/
-
- Elite
- Posts: 1671
- Joined: Fri Jan 03, 2003 12:46 am
- Location: Earth, Sol system.
- Contact:
-
- Elite
- Posts: 1465
- Joined: Thu Jan 02, 2003 12:01 pm
- Location: Seattle, WA
- Contact:
-
- Elite
- Posts: 1671
- Joined: Fri Jan 03, 2003 12:46 am
- Location: Earth, Sol system.
- Contact:
-
- Elite
- Posts: 1465
- Joined: Thu Jan 02, 2003 12:01 pm
- Location: Seattle, WA
- Contact:
-
- Elite
- Posts: 1671
- Joined: Fri Jan 03, 2003 12:46 am
- Location: Earth, Sol system.
- Contact:
-
- Elite
- Posts: 1465
- Joined: Thu Jan 02, 2003 12:01 pm
- Location: Seattle, WA
- Contact:
dude!! (note: this 'dude!' translates as follows: "Please sir, do not overreact to my good-natured jibe. I value you too much as a person to be so insensitive as to needlessly insult you.")
Anyways, I did it. They may not be all dark enough... but they're going to be a LOT better this way.
http://students.washington.edu/peteyg/b ... l_dark.zip
Anyways, I did it. They may not be all dark enough... but they're going to be a LOT better this way.
http://students.washington.edu/peteyg/b ... l_dark.zip
-
- Elite
- Posts: 1671
- Joined: Fri Jan 03, 2003 12:46 am
- Location: Earth, Sol system.
- Contact:
-
- Lead Network Developer
- Posts: 2560
- Joined: Sun Jan 12, 2003 9:13 am
- Location: Palo Alto CA
- Contact:
A new binary has been uploaded with fixes for animated meshes.
Use
to take advantage of this new feature.
Also you can make animations get triggered (like transforming) by assigning a key (maybe capital-G) to "ToggleAnimation"
and adding a
NumAnimationStages="X"
attribute in <Description ... /> tag in the unit file.
The X is the number of stages, and it will evenly divide up the animations in the mesh into X parts)
Now you can make something like in spaceballs, where it turns from a big huge long capship into a maid with a vacuum cleaner.
Use
Code: Select all
<LOD ... ... size="X" framespersecond="15" />
<LOD ... ... size="X" />
...
...
<LOD ... ... size="X" />
</Mesh>
Also you can make animations get triggered (like transforming) by assigning a key (maybe capital-G) to "ToggleAnimation"
and adding a
NumAnimationStages="X"
attribute in <Description ... /> tag in the unit file.
The X is the number of stages, and it will evenly divide up the animations in the mesh into X parts)
Now you can make something like in spaceballs, where it turns from a big huge long capship into a maid with a vacuum cleaner.
-
- Artisan
- Posts: 1270
- Joined: Fri Jan 03, 2003 3:27 am
- Location: Perth, Western Australia
- Contact:
cool.......is it possible to have both lods and animations though? I would imagine that you could simply do it by saying that "if the framespersecond variable is present, then it's an animation..but if it isn't present, then treat the meshes as LODs"ace123 wrote:A new binary has been uploaded with fixes for animated meshes.
Useto take advantage of this new feature.Code: Select all
<LOD ... ... size="X" framespersecond="15" /> <LOD ... ... size="X" /> ... ... <LOD ... ... size="X" /> </Mesh>
Also you can make animations get triggered (like transforming) by assigning a key (maybe capital-G) to "ToggleAnimation"
and adding a
NumAnimationStages="X"
attribute in <Description ... /> tag in the unit file.
The X is the number of stages, and it will evenly divide up the animations in the mesh into X parts)
Now you can make something like in spaceballs, where it turns from a big huge long capship into a maid with a vacuum cleaner.
I think that would allow us to have both? unless it's a deeper internal thing of VS which would need changing to allow both :-/
Dan.a
-
- Developer
- Posts: 3980
- Joined: Fri Jan 03, 2003 4:53 am
- Location: Stanford, CA
- Contact:
we were only equipped to have either LODs or Animations
cus then each frame would need LODs and you'd have n^2 meshes...
so no it's not possible
basically limit animation to when you need it...not some trivial thing you use on every huge honkin mesh out there to make it wiggle a bit...
it's very deep inside VS...and to keep LODs for each frame would require tons of memory and a different organization.... in the future it may be possible but not recommended.
cus then each frame would need LODs and you'd have n^2 meshes...
so no it's not possible
basically limit animation to when you need it...not some trivial thing you use on every huge honkin mesh out there to make it wiggle a bit...
it's very deep inside VS...and to keep LODs for each frame would require tons of memory and a different organization.... in the future it may be possible but not recommended.
Vega Strike Lead Developer
http://vegastrike.sourceforge.net/
http://vegastrike.sourceforge.net/
-
- Elite
- Posts: 1516
- Joined: Sat May 10, 2003 5:26 pm
- Location: into the depths
-
- ISO Party Member
- Posts: 467
- Joined: Mon Jan 13, 2003 9:55 pm
- Location: Big, flat Kansas
- Contact:
Anims are per-mesh, correct? So If I just cut off the part that needs animating and make it a separate mesh, I could LOD-ize the rest of the ship?
-pincushionman
-pincushionman
Conquer space!
-pincushionman
---------------------------------------
Kansas really is flatter than a pancake!
http://www.improbable.com/airchives/pap ... ansas.html
-pincushionman
---------------------------------------
Kansas really is flatter than a pancake!
http://www.improbable.com/airchives/pap ... ansas.html
-
- Elite
- Posts: 1671
- Joined: Fri Jan 03, 2003 12:46 am
- Location: Earth, Sol system.
- Contact:
-
- Developer
- Posts: 3980
- Joined: Fri Jan 03, 2003 4:53 am
- Location: Stanford, CA
- Contact:
if you can tell me a blend mode that will do that...I'm really not sure I know of one that will add lighter and subtract darker.... but maybe it exists on video card...sure I could do it with pixel shaders but that's totally overkill and would quarter framerates wahahaa for those cards that support it...
I'll look around a bit... to see if detail textures can subtract...but I just don't know a blendmode that'll do it ....
as for pincushion man ...sure that's correct! it's per mesh--per material...just divide up the ship into the animated parts and the unanimated parts---like guns and rest of ship (guns are handled separately as well anyway)
As for making it have modes... look at ace123's post you can set the number of stopping points are the <Description NumAnimationStages=""/>
then bind a key to
ToggleAnimation
and voilla--you can transform into modes
I'll make the AI do it randomly if you wish
I'll look around a bit... to see if detail textures can subtract...but I just don't know a blendmode that'll do it ....
as for pincushion man ...sure that's correct! it's per mesh--per material...just divide up the ship into the animated parts and the unanimated parts---like guns and rest of ship (guns are handled separately as well anyway)
As for making it have modes... look at ace123's post you can set the number of stopping points are the <Description NumAnimationStages=""/>
then bind a key to
ToggleAnimation
and voilla--you can transform into modes
I'll make the AI do it randomly if you wish
Vega Strike Lead Developer
http://vegastrike.sourceforge.net/
http://vegastrike.sourceforge.net/
-
- Elite
- Posts: 1671
- Joined: Fri Jan 03, 2003 12:46 am
- Location: Earth, Sol system.
- Contact:
jdoom (using doomsday engine) uses the Opengl extension ARB_texture_env_combine.
The rest of my post can be found here: http://vegastrike.sourceforge.net/forum ... =9567#9567 since it has very big images in it.
The rest of my post can be found here: http://vegastrike.sourceforge.net/forum ... =9567#9567 since it has very big images in it.
-
- Developer
- Posts: 3980
- Joined: Fri Jan 03, 2003 4:53 am
- Location: Stanford, CA
- Contact:
you know what...I found this out myself before you mentioned it
GL_ADD_SIGNED, baby! it works like a charm!
may take some hacking to get a windows build up since windows has ungodly old GL.h files...but I'll get it up before the day is out so you all can have fun
GL_ADD_SIGNED, baby! it works like a charm!
may take some hacking to get a windows build up since windows has ungodly old GL.h files...but I'll get it up before the day is out so you all can have fun
Vega Strike Lead Developer
http://vegastrike.sourceforge.net/
http://vegastrike.sourceforge.net/
-
- Elite
- Posts: 1671
- Joined: Fri Jan 03, 2003 12:46 am
- Location: Earth, Sol system.
- Contact:
-
- Developer
- Posts: 3980
- Joined: Fri Jan 03, 2003 4:53 am
- Location: Stanford, CA
- Contact:
same place, different day
http://vegastrike.sourceforge.net/users/ace123
ok so a detail texture of all 128/256 (50% gray) will add NOTHING to your ship.
darker will subtract...lighter will add
happy?
can you give me some detail texture for the new rlaan and aera?
thanks
http://vegastrike.sourceforge.net/users/ace123
ok so a detail texture of all 128/256 (50% gray) will add NOTHING to your ship.
darker will subtract...lighter will add
happy?
can you give me some detail texture for the new rlaan and aera?
thanks
Vega Strike Lead Developer
http://vegastrike.sourceforge.net/
http://vegastrike.sourceforge.net/