Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Alcom Isst on September 07, 2014, 12:16:33 am

Title: What's up with transparency?
Post by: Alcom Isst on September 07, 2014, 12:16:33 am
LEGO Swarm Interceptor
UEF Uriel
SD Demon

Whenever I view these models in the F3 view with the transparent effect, they all appear like this:
(http://i.imgur.com/t2qXCnK.png)

As opposed to a normal ship:
(http://i.imgur.com/ncasMyS.png)

Why? I'm asking because I've been trying to add transparency to some LEGO models in FSO (because some bricks are transparent), but the transparent effect turns out exactly like the effect on the top models, where some polygons are opaque and others are not visible, seemingly at random.
Title: Re: What's up with transparency?
Post by: z64555 on September 07, 2014, 12:25:14 am
Backface culling...
Title: Re: What's up with transparency?
Post by: Nyctaeus on September 07, 2014, 07:00:17 am
At the top of the screen in F3 Viewer you have Render Options. You have to deselect some option. I don't remember what was it's name.
Title: Re: What's up with transparency?
Post by: Phantom Hoover on September 07, 2014, 07:30:23 am
I like how if you reverse the order of the previous two posts they make much better sense.
Title: Re: What's up with transparency?
Post by: Dragon on September 07, 2014, 09:01:58 am
Transparency in FSO is tricky. It's tied to object hierarchy and... something else, as well. With simple stuff, it's easy to do, but if you want things like entirely transparent ships, it becomes a bit more difficult.
At the top of the screen in F3 Viewer you have Render Options. You have to deselect some option. I don't remember what was it's name.
He's not asking about F3 view, he's asking about getting transparency right. He likely enabled this view on purpose, it makes the whole ship transparent (I don't know what it's good for).
Title: Re: What's up with transparency?
Post by: Alcom Isst on September 07, 2014, 11:48:07 am
I like how if you reverse the order of the previous two posts they make much better sense.
At the top of the screen in F3 Viewer you have Render Options. You have to deselect some option. I don't remember what was it's name.
Backface culling...

SD Demon and UEF Uriel
Transparency: on
No Z-Buffer:  off
No Culling:   off = Broken transparency

Transparency: on
No Z-Buffer:  off
No Culling:   on = Broken transparency again

Transparency: off
No Z-Buffer:  on
No Culling:   on = Same effect as broken transparency

GTF Ulysses
Transparency: on
No Z-Buffer:  off
No Culling:   off = Working transparency

Transparency: on
No Z-Buffer:  off
No Culling:   on = Working transparency

Transparency: off
No Z-Buffer:  on
No Culling:   on = Same effect as broken transparency
Title: Re: What's up with transparency?
Post by: mjn.mixael on September 07, 2014, 12:08:10 pm
Transparency in FSO is tricky. It's tied to object hierarchy and... something else, as well. With simple stuff, it's easy to do, but if you want things like entirely transparent ships, it becomes a bit more difficult.
At the top of the screen in F3 Viewer you have Render Options. You have to deselect some option. I don't remember what was it's name.
He's not asking about F3 view, he's asking about getting transparency right. He likely enabled this view on purpose, it makes the whole ship transparent (I don't know what it's good for).

Not anymore, it's not. Well, it is but you don't have to think about that anymore. If you have a texture with transparency, name it 'SOMENAME-trans'. (You'll then have 'SOMENAME-trans-glow' or whatever. Then make sure your diffuse -trans texture has an alpha channel. That should do it.

Though, you'll need to make sure to model whatever is being the transparent texture is it allows viewing into the ship. Clear Lego bricks should probably have modeled bricks or Lego people behind them.

NOTE: Last I did this, it did not look right in PCS2, but FSO was fine.

EDIT: The transparency option in the F3 Lab is unrelated to creating transparent glass (or bricks) on ships. Just FYI.
Title: Re: What's up with transparency?
Post by: Alcom Isst on September 07, 2014, 12:40:18 pm
Not anymore, it's not. Well, it is but you don't have to think about that anymore. If you have a texture with transparency, name it 'SOMENAME-trans'. (You'll then have 'SOMENAME-trans-glow' or whatever. Then make sure your diffuse -trans texture has an alpha channel. That should do it.

Though, you'll need to make sure to model whatever is being the transparent texture is it allows viewing into the ship. Clear Lego bricks should probably have modeled bricks or Lego people behind them.

NOTE: Last I did this, it did not look right in PCS2, but FSO was fine.

EDIT: The transparency option in the F3 Lab is unrelated to creating transparent glass (or bricks) on ships. Just FYI.

I renamed the diffuse texture to "SInterceptor-Trans", changed the pof to refer to "SInterceptor-Trans", checked that the texture had an alpha channel, and the model (viewed with default settings) broke, same No-Z-buffer-no-culling effect.

I got experimental and removed the alpha channel. This time, the whole model appeared to be transparent by default, but without the alpha channel this means I can't control which bricks are transparent unless I isolate them and assign them a different diffuse texture.
Title: Re: What's up with transparency?
Post by: fightermedic on September 07, 2014, 01:13:35 pm
-trans means the engine uses the amount of black as transparency = the darker the texture the more transparent it is
for normal texture, all you need to do for transparency is to have an alpha channel
Title: Re: What's up with transparency?
Post by: z64555 on September 07, 2014, 03:33:31 pm
I like how if you reverse the order of the previous two posts they make much better sense.

Stupid brain of mine is time traveling again.  :rolleyes:
Title: Re: What's up with transparency?
Post by: mjn.mixael on September 07, 2014, 09:14:49 pm
-trans means the engine uses the amount of black as transparency = the darker the texture the more transparent it is
for normal texture, all you need to do for transparency is to have an alpha channel

No, that is not correct. -Trans forces the polygons mapped with that texture to the end of the rendering list so that transparency works correctly without having to make sure they are the last polygons listed on the model's data structure.


Not anymore, it's not. Well, it is but you don't have to think about that anymore. If you have a texture with transparency, name it 'SOMENAME-trans'. (You'll then have 'SOMENAME-trans-glow' or whatever. Then make sure your diffuse -trans texture has an alpha channel. That should do it.

Though, you'll need to make sure to model whatever is being the transparent texture is it allows viewing into the ship. Clear Lego bricks should probably have modeled bricks or Lego people behind them.

NOTE: Last I did this, it did not look right in PCS2, but FSO was fine.

EDIT: The transparency option in the F3 Lab is unrelated to creating transparent glass (or bricks) on ships. Just FYI.

I renamed the diffuse texture to "SInterceptor-Trans", changed the pof to refer to "SInterceptor-Trans", checked that the texture had an alpha channel, and the model (viewed with default settings) broke, same No-Z-buffer-no-culling effect.

I got experimental and removed the alpha channel. This time, the whole model appeared to be transparent by default, but without the alpha channel this means I can't control which bricks are transparent unless I isolate them and assign them a different diffuse texture.

Can you PM me the files and I'll take a look to see where things are going wrong? Or at least show me images of what you are trying to do.