Game Development Community

How do I get the skin for the default Torque model? (needed for

by Matt W · in Torque Game Engine · 01/19/2002 (7:26 pm) · 6 replies

I am currently "coolifying" the rather borked Cloak effect that comes with the engine.

Right now it just removes the model's texture and does an alpha fade on the untextured object (it turns out this is because of an incorrect path in the source)

Even still... it's just plain boring.

So I've got it changed so that when you cloak your model (with texture) does an alpha fade to 0% and then a nice sound plays and blam. You look like a cloaked player should look! (like in Perfect Dark)

Anyway... in order to get the alpha fade to work correctly (the code I have right now is pointing to a file of the skin needed... and if I try to rip it out it will not do an alpha fade at all)

I know... this is a hack, but I've spent the last 6 hours running through the code and I Can't figure out why it won't do the alpha fade on the existing texture :(

Any suggestions on how to get the original skin (blue soldier guy) for the default player.dts model.

Thank you!

Oh, and once I get this cloak effect polished up I'll make sure to share it with all of you.

#1
01/19/2002 (9:19 pm)
I wrote some code to change a shape's skin on the fly. This is what I used:

gNetStringTable->lookupString(mSkinTag);


I don't think T2 didn't use the player's skin though. It used a texture called "cloak texture.png".

It gives a really nice water-like effect.


Dark
#2
01/19/2002 (10:42 pm)
I changed some of the code (well... just a path. it was incorrect) and made a few minor changes and I got the good ol' "water" effect from Tribes 2 working... unfortunately it looks too "cool" and not realistic enough hehe.

I wanted a "hidden" feel so that it would represent stealth (someone hiding you might just barely make out their outline.

It was easy to do (in fact, the watery effect is in the code we have, just not turned on correctly)

What it turned out was Microsoft Image viewer and Photoshop don't read the player.png file that comes with the SDK correctly. Open it up in ps or Macroshaft's viewer and you'll see what I mean :\

What's a wierd coincidence is that image you see in MS viewer or Photoshop is the image used when cloaking with my code... wtf did I do? Lol.

With only the default png image that came with the sdk it is somehow reading out the normal blue skin and a light highlight skin. The former is what shows up when you open player.png in paint shop pro... but the latter shows up in the other graphics programs.

Wierd :\

Well, I ended up getting my original goal to work

1. Player model with original skin fades out to 0% alpha.
2. Fades from 0% alpha to 40% alpha of "cloak" skin while playing a "bzzt" sound.

The problem is... with complex models alpha fading looks like ass.

Not good ass even... Rosie O'Donnel kinda ass!

Because culling is on (or off, I always get it mixed up) it renders the polygons of the objects that are normally obscured (afterall, you can't look through your back to see whats on the other side... including your arm or gun)

The problem is transparancy ends up being additive. So if you look directly through the models "head" its fine since there's no model part on the other side... but if you look through his ass you see parts of his hands and gun... which ends up "adding" to the image thus making it 2-3x less transparent.

Anyway... I've changed it to this order now:

1. "Techy" flicker. Goes from normal skin to a quick flicker of 90% alpha of "highlight" cloak skin.
2. Fades to 20% alpha
3. Then cuts directly to 50% alpha.

Overall, it looks nice but I need a good sound that syncs up with it hehe.

Oh... and just to make sure that people can't be too "uber" with cloak on (like I said... it's just supposed to increase the difficulty to see certain people) their shadow still renders (which took a whopping 1 character change to do!)

Hehe, well this is my first experiementation with the graphic rendering in Torque, so it's a great learning experience.

If a few people are looking for more details on cloaking
I will try to write up implementing a few types of cloaking in game (watery cloaking, outline cloaking, and just plain alpha fade cloaking)


Oh and everyone... PS and MS Photo Viewer don't view alpha transparancies in Pngs correctly, so be alert!
#3
01/19/2002 (11:16 pm)
I noticed that too. Where you can see other parts of the model through the model. It doesn't look good like that.

Another thing I noticed is the fade function. Try %obj.startFade(15000,0,true);

It will fade slow enough so you can see what I mean. It doesn't allow you to see parts of the model through the model.


Dark
#4
01/20/2002 (1:58 am)
Ah cool, ill look into that Chris :)
#5
01/20/2002 (6:42 am)
Why not switch face culling on yourself.

glEnable(GL_CULL_FACE);


make sure you get the right cullmode though :))

Phil.
#6
01/20/2002 (1:48 pm)
I'll try the cullmode activation first... then "fade" function. Thanks!