Page 1 of 1

Need Help Creating Custom Textures with Transparency

Posted: Sat Jun 03, 2017 4:28 pm
by Najarati
Hey folks,

I'm struggling with creating custom textures that have transparent portions. Way back in the day I was able to do this, but now I'm having no such luck. For my new map, I'm using the ice palette and have the tried the following colors to serve as the transparent color:

R:120, G:88, B:128 - A flavor of purple (this is what I remember from forever ago)
R:231, G:231, B:231 - An off-white, and supposedly the transparency color for the ice palette

So far, neither of these have worked. I import the texture into DLE and no dice; the "transparent" color is opaque. Heck, even if I export a default texture with transparency (like, say, a light) using DLE and immediately re-import it as a custom texture, the transparency effect is gone.

Also, I save my textures as 8-bit or 256-color bitmaps.

Any suggestions?

Re: Need Help Creating Custom Textures with Transparency

Posted: Sat Jun 03, 2017 7:11 pm
by Najarati
Well, I've discovered a few things:
  • The transparent color for the Ice palette appears to be: R:228, G:228, B:228 (a light gray)
  • Even if I use that particular RGB value in a texture and save it as an 8-bit bitmap (I'm using Paint.net), DLE seems to automatically change the color to a different, albeit similar, color upon import that causes the transparency effect to be lost.
All of that said, I've managed to achieve transparency, but there are some odd behaviors:
  • I have to manually use the "transparent" color in DLE's built-in texture editor, which adds a lot of needless work since it has virtually no tools or zoom.
  • The transparent portions still show as opaque in DLE, but appear transparent in Descent 2 Rebirth.
  • I get some really strange dark gray outlines happening at the border between transparent color and non-transparent color in Descent 2 Rebirth that aren't present in the texture as seen in DLE.
All in all, creating custom, transparent textures seems excessively tedious. I don't remember it being so painful, but it's been decades.

Re: Need Help Creating Custom Textures with Transparency

Posted: Sun Jun 04, 2017 2:49 pm
by LightWolf
Use DMBII or SDLDEVIL.

Re: Need Help Creating Custom Textures with Transparency

Posted: Mon Jun 05, 2017 10:52 pm
by Sirius
I have a feeling DLE is doing this because the bitmap palette isn't an exact match, so it's not sure exactly what color is supposed to be transparent, so it assumes all the colors are not supposed to be transparent. Does Paint.NET allow you to copy the palette from an existing bitmap (exported from DLE using ice.pig) to the new bitmap? That should work.

Whether or not it does, though, I need to rethink this workflow... having people accidentally putting transparent pixels in textures is bad, but so is making it a pain in the ass to figure out how to get them in there intentionally. Maybe a prompt is called for.

Re: Need Help Creating Custom Textures with Transparency

Posted: Thu Jun 08, 2017 10:39 pm
by Najarati
Sirius wrote:I have a feeling DLE is doing this because the bitmap palette isn't an exact match, so it's not sure exactly what color is supposed to be transparent, so it assumes all the colors are not supposed to be transparent. Does Paint.NET allow you to copy the palette from an existing bitmap (exported from DLE using ice.pig) to the new bitmap? That should work.

Whether or not it does, though, I need to rethink this workflow... having people accidentally putting transparent pixels in textures is bad, but so is making it a pain in the ass to figure out how to get them in there intentionally. Maybe a prompt is called for.
Paint.NET does not appear to allow me to extract a color palette from a bitmap; at least, not out of the box. I've already tried exporting a transparent bitmap from DLE and sampling the transparent color (resulting in R:228, G:228, B:228), but this didn't seem to work when used in DLE.

Perhaps, when editing a bitmap in DLE, let the user click a "Select Transparent Color" button and click somewhere on the displayed bitmap. Whatever color is selected is converted to the transparency color. Just be sure to let users clear it and set things back to opaque if desired.