Color Depth Issues in Game Salad
jhamond987
Member Posts: 2
I'm noticing some color depth issues with my Game Salad game. I'm saving high quality PNGs, with very nice, subtle gradients. They look good in the creator preview, but one the device they look like garbage.
The gradients you see in this screenshot should be smooth gradients, not harsh, color stepped gradients. It seems like the engine is reducing the number of colors in the image.
Is this standard behavior? Any workaround?
Thanks!
Comments
This is a known issue with GameSalad. I believe if you Google gradients gamesalad you should find forum posts about it. I think the solution has to do with adding a single transparent pixel to the image or something like that.
Here's a thread: https://forums.gamesalad.com/discussion/38139/gradients-looking-terrible
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I recall using the 'transparent pixel trick' at some point years ago and it worked well.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
This is an issue with Box2D rather than GameSalad itself . . . . the solution is to force your images to be read as 32bit (rather than 24bit), if you use Photoshop you can do this by firstly making sure the layer you are working on is a 'Layer' rather than the 'Background', then select a single pixel . . . set the eraser tool to 1% and run it over the pixel, which should mean the pixel is now 99% opaque (or 1% transparent).
This is enough to force the PNG to be read as a 32bit file by Box2D.
This method ends up with a smooth image/gradient with the near undetectable compromise of a single pixel with 99% opacity (rather than 100%), but any process that forces 32bit will do the trick.
Well, probably OpenGL and not Box2D (Box2D only handles collision shapes and movement).
Since I haven't touched the render pipeline yet, I'm only 80% sure, but I think it's something to do with how OpenGL renders the texture. The other 20% guess is that it's how we load the image and convert it into a texture.
I could take a looks someday, but with all the other work we have, I think we can chalk this up to something that we won't fix because there's a work-a-round.
solved.!!