The Mossmouth Forums

Games => Spelunky Support => Topic started by: NalaNosivad on August 24, 2013, 06:33:39 PM



Title: Transparency in character select screen issue
Post by: NalaNosivad on August 24, 2013, 06:33:39 PM
READ ME FIRST
While I do still feel this is a bug in the game, the issue appears to have a workaround. If you're experiencing this problem, just don't use Photoshop. Do your editing/saving in another program. Photoshop is apparently doing SOMETHING to the PNG's transparency that other programs don't in a way that causes the game to get screwy with it on the character select screen.

And here's the reason! Thanks for the input, kind dev deity!


Yeah, this is a known issue with the way Photoshop saves PNGs. There are plugins around to fix this as well. It was super annoying as we kept running into this while making the game too. Basically, Photoshop doesn't save color info for transparent pixels, it just leaves them white. But when you end up sampling the texture in D3D, you'll actually grab some of that white and blend it into the outer pixels, which causes the nasty halo effect.


Having looked into a problem someone was having (here), I found that for some reason the transparency of sprite sheets becomes.. rather screwy on the character selection screen, primarily with the standing frame, as you can see in that thread.

Having done some tests, I came up with the following images to demonstrate the problem:

(http://www.alandavison.co.uk/images/spelunky_hd/transparency1.png)
(http://www.alandavison.co.uk/images/spelunky_hd/transparency2.png)

The "character" shown on the character select screen is of course the various squiggles with various line hardnesses in the top-left of the second image. As you can see, most (but not all) are showing white edges where there should be (and is) transparency in the file itself.

So, I decided to test it using a gradient. The results are here (http://www.alandavison.co.uk/images/spelunky_hd/transparencybug.png). As you can see, the transparenncy just.. outright breaks, where it starts out okay. Underneath the screen captures, I've stuck the same gradient in the same position as the sprite on-screen to show what it should look like.


Title: Re: Transparency in character select screen issue
Post by: darkunderdog on August 25, 2013, 10:26:54 AM
Looks like the issue might resolved - I used SAI to save the PNG and the issue is now resolved...

SAI:
(https://dl.dropboxusercontent.com/u/16051044/fixeddarkunder.png)

Photoshop:
(https://dl.dropboxusercontent.com/u/16051044/whitedarkunder.png)

Thanks Mastastealth for catching this! :)


Title: Re: Transparency in character select screen issue
Post by: NalaNosivad on August 25, 2013, 11:25:00 AM
Looks like the issue might resolved - I used SAI to save the PNG and the issue is now resolved...

SAI:
(https://dl.dropboxusercontent.com/u/16051044/fixeddarkunder.png)

Photoshop:
(https://dl.dropboxusercontent.com/u/16051044/whitedarkunder.png)

Thanks Mastastealth for catching this! :)
Oh, Photoshop.. just out of curiosity, how were you saving the PNG in Photoshop/SAI? I'm beginning to suspect that it's Photoshop that's doing something funky to the transparency when using the save for web dialog.


Title: Re: Transparency in character select screen issue
Post by: Whooper1222 on August 25, 2013, 11:40:22 AM
Looks like the issue might resolved - I used SAI to save the PNG and the issue is now resolved...

SAI:
(https://dl.dropboxusercontent.com/u/16051044/fixeddarkunder.png)

Photoshop:
(https://dl.dropboxusercontent.com/u/16051044/whitedarkunder.png)

Thanks Mastastealth for catching this! :)
Oh, Photoshop.. just out of curiosity, how were you saving the PNG in Photoshop/SAI? I'm beginning to suspect that it's Photoshop that's doing something funky to the transparency when using the save for web dialog.
Yes, Photoshop is the culprit!


Title: Re: Transparency in character select screen issue
Post by: darkunderdog on August 25, 2013, 11:41:15 AM
I was just using the default settings in each, nothing special...


Title: Re: Transparency in character select screen issue
Post by: astrospoon on August 26, 2013, 10:20:12 AM
Yeah, this is a known issue with the way Photoshop saves PNGs. There are plugins around to fix this as well. It was super annoying as we kept running into this while making the game too. Basically, Photoshop doesn't save color info for transparent pixels, it just leaves them white. But when you end up sampling the texture in D3D, you'll actually grab some of that white and blend it into the outer pixels, which causes the nasty halo effect.


Title: Re: Transparency in character select screen issue
Post by: NalaNosivad on August 26, 2013, 04:28:56 PM
Yeah, this is a known issue with the way Photoshop saves PNGs. There are plugins around to fix this as well. It was super annoying as we kept running into this while making the game too. Basically, Photoshop doesn't save color info for transparent pixels, it just leaves them white. But when you end up sampling the texture in D3D, you'll actually grab some of that white and blend it into the outer pixels, which causes the nasty halo effect.
Photoshop seriously sees fit to leave them white? Way to go, Adobe! Time to go hunt down an alternative PNG exporter/plugin.