Need Help Creating Custom Textures with Transparency

For Descent, Descent II and Descent3 level editing and modification assistance.
Post Reply
User avatar
Najarati
DBB Ace
DBB Ace
Posts: 33
Joined: Mon Aug 15, 2016 1:27 am

Need Help Creating Custom Textures with Transparency

Post 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?
User avatar
Najarati
DBB Ace
DBB Ace
Posts: 33
Joined: Mon Aug 15, 2016 1:27 am

Re: Need Help Creating Custom Textures with Transparency

Post 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.
User avatar
LightWolf
DBB Captain
DBB Captain
Posts: 908
Joined: Sat Mar 09, 2013 2:27 pm
Location: Yes

Re: Need Help Creating Custom Textures with Transparency

Post by LightWolf »

Use DMBII or SDLDEVIL.
Whatever I just said, I hope you understood it correctly. Understood what I meant, I mean.
#AllLivesMatter
User avatar
Sirius
DBB Master
DBB Master
Posts: 5616
Joined: Fri May 28, 1999 2:01 am
Location: Bellevue, WA
Contact:

Re: Need Help Creating Custom Textures with Transparency

Post 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.
User avatar
Najarati
DBB Ace
DBB Ace
Posts: 33
Joined: Mon Aug 15, 2016 1:27 am

Re: Need Help Creating Custom Textures with Transparency

Post 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.
Post Reply