Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

Wrong transparency color used in sprites #46

Open
WARUMBERG opened this issue Jan 24, 2018 · 4 comments
Open

Wrong transparency color used in sprites #46

WARUMBERG opened this issue Jan 24, 2018 · 4 comments

Comments

@WARUMBERG
Copy link

tModLoader v0.10.1.1
Tremor v1.3.2.7

Here's easy one, Due to differences in .NET 4.x and XNA implementations across various systems some players see big blocks of white color instead of fully transparent color.
The solution to this is to use single, properly supported transparency color, just like stock Terraria does do,
The HTML/HEX code of correct transparency is 00000000. (just 0 for short)
The HTML/HEX code of inproper transparency color which causes issues is FFFFFFFF.

To solve this just use any image editing tool with support for Large Batch/Multipicture edit, like Adobe Photoshop or Imagemagick or Nconvert, to change Color FFFFFFFF to Color 00000000 on all sprite files within given folder location.
Here's example tutorial how to do it in Photoshop, for the other tools it should be simpler, https://marckean.com/2011/12/18/use-photoshop-batch-to-process-all-photos-in-a-folder/

@Jofairden
Copy link
Collaborator

Actually, I can make code to support transparency. Thanks though

@WARUMBERG
Copy link
Author

Like some global function for it that would affect even other mods as long as one runs Tremor? It would be excellent since mods like Thorium or Calamity are affected by it too, some of the sprite authors put correct transparency in them and others don't.
My multiplayer pal that plays on Linux via Wine got this issue and I can reproduce it as well when I reboot to Win XP SP3 32bit, while it doesn't happen on Win 7 64bit on the same machine.

@Jofairden
Copy link
Collaborator

Yes. The big difficulty is getting all the textures. Basically some art programs save the file with every pixel having an RGBA where RGB is bigger than 0 but A may be 0 , where A would usually be transparency there, in XNA's texture loading the alpha channel is independent , and with terraria's draw mode it actually can do awesome things. In terraria, A channel signals additive<---> opaque
A pixel with 255 alpha draws fully opaque, a pixel with 0 alpha draws fully additive
So if you do say, 255,0,0,0 color, it would draw a fully additive red
Which can be awesome...except when your file saves the alpha channel of supposedly transparent pixels wrong. I already have a utility function that multiplies by alpha which solves the issue.

@WARUMBERG
Copy link
Author

I already have a utility function that multiplies by alpha which solves the issue.

Sound awesome, if you make it to fix the transparency issues globally and provide a build of .tmod for it then I can get it tested right away on my second os XP and on my pals Linux.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants