Easy3D Module can't handle alpha channels?

Started by Akril15, Sat 30/05/2015 23:00:57

Previous topic - Next topic

Akril15

I want to include a brief 3D "gimmick" in my otherwise 2D game. Unfortunately, this has turned out to be much harder than I thought it would be.

I've finally got a room working using the Easy3D module, but now I've run into another problem which I can't seem to get around: if I use a sprite with an alpha channel to create a wall, it always turns out opaque, with pink filling in the areas that should be transparent. Both the sprite and the background are 32-bit, so I don't think mismatched color depths are the problem here. I tried opening the game in AGS 3.3.3 (I was editing it in 3.2.1) and setting the sprite alpha rendering style to "proper alpha blending", but nothing changed. I think the problem be a DrawingSurface issue, and I'm still pretty unfamiliar with that part of AGS.

If there's anyone who might be able to give me some advice on getting around this problem, I would truly appreciate it.

Cassiebsg

Try re-importing your sprite and make sure you choose "import with alpha channel".
If this is not the problem, then you need someone more knowledgeable than me. ;)
There are those who believe that life here began out there...

Akril15

I have imported all the sprites I'm using with alpha channels. I'm using some of the same sprites in the scene as objects, and with them, there's no problems with transparency at all. It's the walls (generated from regions within a room, with sprites mapped onto them) that are causing problems.

Snarky

I guess you never did any 3D game level editing in in the nineties (Doom, Duke Nukem 3D, Hexen, etc.)? Walls can't be transparent, by definition. A wall defines the limit of the visible regions of the world. As soon as the engine hits a wall, it stops; it doesn't continue checking what's behind it. In effect, anything outside the walls is impassable and opaque.

Akril15

I see...

I guess that means I either have to work with solid green blocks with no transparency or use objects instead of walls. However, this would mean having to display some of the objects at a right angle, and I'm not sure if this is possible in this module.

Monsieur OUXX

#5
Quote from: Akril15 on Sun 31/05/2015 23:50:41
this would mean having to display some of the objects at a right angle
That's called a "billboard" in 3D dialect. I'm 100% positive you might find a quick implementation of that using Google. And actualy the screenshjot of the 3D module shows that every 2D sprite in the scene is billboard. So it's already there I guess.

That said, what Snarky said about "opaque" walls was indeed right in the 90's but noawadays most 3D engines allow you to use a texture with transparent areas. So it all dépends on how this module was implemented. I've never used that one.
 

Crimson Wizard

#6
Quote from: Snarky on Sun 31/05/2015 09:12:04
I guess you never did any 3D game level editing in in the nineties (Doom, Duke Nukem 3D, Hexen, etc.)? Walls can't be transparent, by definition. A wall defines the limit of the visible regions of the world. As soon as the engine hits a wall, it stops; it doesn't continue checking what's behind it. In effect, anything outside the walls is impassable and opaque.

(Off-topic nitpicking follows)
Spoiler

Walls could be transparent in both Doom and Duke Nukem 3D, and there were partially transparent textures too.
There are examples of partially transparent textures in Doom:
Spoiler



[close]
And same for Duke Nukem and another game using same engine (Shadow Warrior):
Spoiler



[close]

AFAIK Doom did not support translucent textures, but Duke Nukem seem to be capable of it, at least judging by the second screenshot (frankly I do not remember the specifics of latter well enough).

There was a distinction between one-sided(solid, opaque) and two-sided(passable, transparent) lines in 2d space, first forming the main walls of the level, and second acting for many purposes, including event triggering, but could be made non-passable to simulate fences and glass walls.
The transparent and half-transparent textures could be assigned to solid walls as well.
The problem was that the way Doom and alike engines worked they could not draw what appears behind the solid walls.
Doom engine, for instance, simply did not draw anything upon transparent spots, but at the same time it never cleared the previously drawn parts of the world from screen, which caused (in)famous "hall of mirrors" effect:
http://doom.wikia.com/wiki/Hall_of_mirrors_effect
In Duke Nukem it just showed blackness, IIRC.
[close]

Snarky

Quote from: Crimson Wizard on Fri 05/06/2015 11:02:24
There was a distinction between one-sided(solid, opaque) and two-sided(passable, transparent) lines in 2d space, first forming the main walls of the level, and second acting for many purposes, including event triggering, but could be made non-passable to simulate fences and glass walls.

As I recall, though, you could not actually assign a texture to these two-sided dividers (which I wouldn't normally call "walls"). Or rather, you could, but it would only be displayed if there was a difference in elevation of the floor or ceiling between the two regions (which was one of the main uses of dividing rooms into different sections, for stairs, platforms etc.), on the "step" wall section created by the drop, never on the "passable" part.

In the screenshots, you can see this in the second Doom screenshot (the part of the "wall" above the entrance to the corridor, where the ceiling is lower) and the Duke 3D screenshot (the sides of the skylight sticking up from the surface of the roof). I'm pretty sure the transparent two-sided "walls" are not actually walls at all, but created as sprites.

QuoteThe transparent and half-transparent textures could be assigned to solid walls as well.
The problem was that the way Doom and alike engines worked they could not draw what appears behind the solid walls.
Doom engine, for instance, simply did not draw anything upon transparent spots, but at the same time it never cleared the previously drawn parts of the world from screen, which caused (in)famous "hall of mirrors" effect:
http://doom.wikia.com/wiki/Hall_of_mirrors_effect
In Duke Nukem it just showed blackness, IIRC.

Yeah, I didn't think going into all of that was necessary. The point is that it doesn't work.

Crimson Wizard

#8
Quote from: Snarky on Fri 05/06/2015 11:43:44
As I recall, though, you could not actually assign a texture to these two-sided dividers (which I wouldn't normally call "walls"). Or rather, you could, but it would only be displayed if there was a difference in elevation of the floor or ceiling between the two regions

A double-sided line in Doom could have 6 textures, 3 for each side (although not all of them would be active at once).
Single-sided could have only 1.
Spoiler

[close]

In general, I wanted to point out that you could make a half-transparent wall in the middle of room, something Akril15 was probably refering to.


Regarding Duke Nukem, I do not remember clearly, to be honest. I remember it supported assigning any image to the static "thing" object, both sprite and texture, so it might be the case.

Snarky

Yes, it seems you are right; I misremembered exactly how this was achieved. My initial comment really just discussed one-way walls, though, not the sector-connecting kind (known in Build jargon as "portals"). I haven't played around with the Easy3D module, but I wouldn't expect it to support something like that.

Akril15

The Easy 3D module actually can generate billboards with alpha channels by creating them from objects (unlike the walls, which are generated from regions). The problem is that they will always be shown with the flat side facing the viewer (there doesn't seem to be any way of changing the angle), and they will always be drawn in front of all the walls. This is a problem, since there's a puzzle I've planned that involves looking at a billboard object (with an alpha channel) from around a wall so that the wall is overlapping the object.

SMF spam blocked by CleanTalk