MegaGlest Forum

Modding and game content creation => Tools => Topic started by: Mr War on 30 January 2011, 17:03:46

Title: TGA transparency
Post by: Mr War on 30 January 2011, 17:03:46
Hi,

I believe there are two types/treatments of transparency used in GLEST.
1) to show a team colour where the TGA is transparent
b) to be literally transparent - to show the tiles behind something

How do you achieve the latter? I want to add blending/shadow at the bottom of a building to give the effect of softening the edges to the ground
Title: Re: TGA transparency
Post by: John.d.h on 30 January 2011, 19:36:13
Alpha on double-sided meshes becomes team color in game.  Alpha on single-sided meshes becomes transparency in game.
Code: [Select]
[URL=http://img200.imageshack.us/i/57289533.png/][IMG]http://img200.imageshack.us/img200/5909/57289533.png[/img][/URL]
Title: Re: TGA transparency
Post by: Mr War on 30 January 2011, 20:30:24
Thanks, that's really useful!

Title: Re: TGA transparency
Post by: silnarm on 29 April 2011, 06:37:48
Is this seriously the way you mark a mesh as using team-texture ?!?

If so, then the blender export script is defective.

You should set a mesh as two-sided if (and-only-if) you intend for back facing facets to be seen (ie, have translucent/transparent mesh or texture, or 'holes' in the mesh).

There'll be a new model viewer/hacker tool available "very soon" (tm) that will let you change mesh properties (two-sided and team texture are separate properties) as well as mesh opacity and diffuse colour, and add/change textures for all five slots.

If the blender export script is using 'two-sided' to set both the two-sided and team-texture mesh props, it might get much more use than I expected.
Title: Re: TGA transparency
Post by: will on 29 April 2011, 06:40:32
If the blender export script is using 'two-sided' to set both the two-sided and team-texture mesh props, it might get much more use than I expected.

it had me shaking my head too
Title: Re: TGA transparency
Post by: John.d.h on 29 April 2011, 08:27:20
Aren't all meshes currently rendered two-sided in the game anyway?
Title: Re: TGA transparency
Post by: silnarm on 29 April 2011, 08:49:25
Aren't all meshes currently rendered two-sided in the game anyway?

Nope. Meshes with the two-sided property are, meshes without are not.
Title: Re: TGA transparency
Post by: John.d.h on 29 April 2011, 09:31:23
Then I fear your suspicions of a broken export script seem to be correct.

These planes are single-sided in Blender.  Not so in GAE.
Code: [Select]
[URL=http://img717.imageshack.us/i/screen2om.jpg/][IMG]http://img717.imageshack.us/img717/7582/screen2om.th.jpg[/img][/URL][URL=http://img717.imageshack.us/i/screen3hw.jpg/][IMG]http://img717.imageshack.us/img717/3064/screen3hw.th.jpg[/img][/URL]
So apparently the exporter is using the sidedness only to tell whether to use team color or transparency, and setting everything as double-sided regardless.

These meshes were not set as double-sided, as evidenced by the transparency (they're just bent planes), but they're clearly being rendered as double-sided in both the g3d viewer and the game.
Code: [Select]
[URL=http://img821.imageshack.us/i/screen4nv.jpg/][IMG]http://img821.imageshack.us/img821/245/screen4nv.th.jpg[/img][/URL][URL=http://img821.imageshack.us/i/screenshot4jy.jpg/][IMG]http://img821.imageshack.us/img821/3863/screenshot4jy.th.jpg[/img][/URL][URL=http://img848.imageshack.us/i/screenshot3z.jpg/][IMG]http://img848.imageshack.us/img848/8177/screenshot3z.th.jpg[/img][/URL]
Title: Re: TGA transparency
Post by: silnarm on 29 April 2011, 09:35:49
This should work under linux, (only doubt is the OpenTK dlls... but I think they are x-platform)

[Link to G3dHack alpha2 removed, see here  (https://forum.megaglest.org/index.php?topic=7083.msg72580#msg72580)for latest version]

needs mono + mono.winforms.