Author Topic: Opacity support  (Read 1658 times)

0 Members and 1 Guest are viewing this topic.

Offline aldo_14

  • Gunnery Control
  • 213
Can we use partially transparent (i.e. translucent) maps with the SCP?

(may be a stupid question, I've been out of the loop as to what gets added in the SCP)

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Isn't that what the alpha component of TGA textures is for?
-C

 

Offline aldo_14

  • Gunnery Control
  • 213
Quote
Originally posted by WMCoolmon
Isn't that what the alpha component of TGA textures is for?


Er.... I don't know.

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Hmm, well I really have no clue how to use it...here's what the wiki has to say:

Quote
TGA

This format creates fairly large file sizes but the key thing about this format is that it allows an alpha channel. An alpha channel lets you specify transparency as if it was another colour layer, just like red, green or blue, this allows 'shades' of transparency unlike the old system. The PCX image system of transparency uses pure green as a mask, a pixel is either fully transparent or not. With the system this flag activities the colour pure green has no significance and is processed like any other colour.

So what does this mean? Well when saving a TGA do not save as 32 bit unless you have an alpha channel set up. Otherwise the engine will assume there is an alpha channel but the lack of one will cause the entire texture, although loaded properly to display as fully transparent, i.e. invisible. A 32-bit TGA is just a 24-bit TGA with space for an alpha channel. Saving as 16 or 24 bit will not throw up this problem but for those formats you will not be able to use an alpha channel.

Now that you know about the alpha channel I'm going to tell you not to use it. At least not in the 3D engine, i.e. ship and effect textures. The FS2 engine has many limitations and rendering transparent textures correctly in 3D is one of them. Fixing this (or implementing it in any engine) is not trivial and is likely never to be attempted. If you choose to ignore this then you will probably find that the result of using it is different on various systems and that something that looks like its working in a simple in game scene will fall apart in larger situations.

Use of alpha channel transparency should be restricted to the same images that used pure green PCX masking, for interface graphics. This feature has many possibilities, many of which have not been trying in practical situations; I'm guessing that there may still be some bugs or limitations (depending how you wish to see it) to come to light.
-C

 

Offline aldo_14

  • Gunnery Control
  • 213
Ah.  Baws.

Guess I'll have to fudge it then.

 

Offline Lightspeed

  • Light Years Ahead
  • 212
Although it says you shouldnt use it, it seems to works fine.

Semi-Transparent stuff IS possible.
Modern man is the missing link between ape and human being.

  

Offline Liberator

  • Poe's Law In Action
  • 210
I was fixin' to say, didn't they fix that when they implemented the alternate texture formats?
So as through a glass, and darkly
The age long strife I see
Where I fought in many guises,
Many names, but always me.

There are only 10 types of people in the world , those that understand binary and those that don't.

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
despite that, what you want to use it for may allow it to work acceptably, for cockpits it should be good enough, though someowhat tricky to get working right, the thing is you can only realy controle render order on a single model, don't do anything that is going to have a texture blend from one ship to another, try to keep it from one part of a model to another, haveing the transparent textures as either part of the main hull or as a lower numbered subobject. this should work
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Nico

  • Venom
    Parlez-vous Model Magician?
  • 212
Yes/No. basically, what Bob said, excepted that FS2 will not render the parts of the ship behind it. Before, you could do by making the transparent part a separate subobject, but it seems that won't work anymore...  So I doubt you'll be please with the result.
SCREW CANON!

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
hey, you know,
you never sent me that cob/pof to see if I could get it working corectly...
:D
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Raptor

  • 210
This may not be what your looking for but...

When using PCX maps, pure green (0, 255, 0) is transparent in game.  Combine with shine/glow maps to put a slight sheen to the transparent areas, that might get what your after.  Maybe.
...There ought to be something surreal about a Zoid offering romantic advice...and yet there is not. It seems perfectly normal that the Liger is giving Bit advice on relationships, and it shouldn't, but it does. Dangit man, you've confused me again.[/I]
NGTM-R review of one of the chapters in my fanfic story :D Story is here! -> 'Ancient Legacies'

 

Offline Deepblue

  • Corporate Shill
  • 210
You mean shine/environment maps. :D

 

Offline aldo_14

  • Gunnery Control
  • 213
Quote
Originally posted by Raptor
This may not be what your looking for but...

When using PCX maps, pure green (0, 255, 0) is transparent in game.  Combine with shine/glow maps to put a slight sheen to the transparent areas, that might get what your after.  Maybe.


Pure green screws up the occlusion, though.  Doesn;t really matter - I'm not going to be doing modelling unless I can figure out a solution to my smoothing problem (that doesn't involve using TS)

 

Offline Nico

  • Venom
    Parlez-vous Model Magician?
  • 212
Quote
Originally posted by Bobboau
hey, you know,
you never sent me that cob/pof to see if I could get it working corectly...
:D


True that, completly forgot :p
But actually, just reskin a turret of, say, the orion with a transparent map and you'll have the same result :)
SCREW CANON!