Transparent models?

Transparent models?

Share and discuss visual creations and creation practices like texturing, modelling and musing on the meaning of life.

Moderators: MR.D, Moderators

Post Reply
User avatar
Agon
Posts: 527
Joined: 16 May 2007, 18:33

Transparent models?

Post by Agon »

Is it possible to use transparent models in spring?
I don't mean a total transparent. Something between two values, like RGB 0 to 255.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Nope.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

With LUA, maybe. Trepan / Jk / Quantum / Whoever: can LUA get and read the primary / secondary texture of a given S3O now? Because alpha-trans should just require two OpenGL function calls, pretty much- read the blue channel, render model alpha per texel == blue value... if what I read on the OpenGL reference was as simple as it looked...
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

May as well use the alpha channel as it's already used for 1-bit transparency.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Yeah, but I suspect that might lead to borked results, since it'd get rendered twice, and the 1-bit thing is hard-coded.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Lua can easily change the render mode of a unit. You'll have to manually Z-sort your polies if you use alpha though and that will be a pain.
User avatar
LordLemmi
Posts: 272
Joined: 13 Apr 2006, 20:17

Post by LordLemmi »

i think he means not the full model just a peace of it... and that could be a prob than or much lua code.
User avatar
ianmac
Posts: 253
Joined: 02 Jul 2007, 01:40

Post by ianmac »

Isn't a Commander transparent when he cloaks. Correct me if I'm wrong.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

That's hardcoded.
User avatar
Agon
Posts: 527
Joined: 16 May 2007, 18:33

Post by Agon »

Hm, a missed feature?
How hard would it be to include it into spring?
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Post by jK »

it is damn hard to integrate.

As KDR said you need to z-order all those transparent polygons and render them in a 2nd render process (1. render all none transparent parts 2. render alpha transparent parts in correct z-order). The ordering is slow and you can't use buffered display lists anymore.

But Iirc can you set the drawing of an unit under full control of lua in the next spring release. But you would have to use a totaly different file format, if you want to use it to render alpha transparent parts, cause you need already to differ between 100% opac and alpha parts in the file format itself (lua is much slower in any cpu work, so you should still try to use display lists/vertex arrays etc. to shift work to the gpu).

Btw the full transparent model drawing (used for cloaking etc.) isn't 100% correct. You only can't see those issues 'cos the whole model is transparent! (-> not usable for alpha transparent units ...)
Post Reply

Return to “Art & Modelling”