0
\$\begingroup\$

I have created a simple asset in photoshop (teal square) with transparency. To make the square semi-transparent, I just changed the layer opacity from 100% --> 50%, then exported the file as a .png.

In unity, I boot up a base 2D project and import the .png. I create a white canvas and place an image over the UI canvas with the teal square as the image. The color is identical to the photoshop image on a white background.

But when I do the same in 3D project, the image has a slightly different (lighter) color. Below are screengrabs of each of the images. Clearly the 3D project image is a lot different than the other two, and this has been really frustrating for setting up my UI in my 3D project. Additionally, the inspector settings are identical for the sprite in the 2D and 3D projects. Anybody know what's going on?

Inspector

enter image description here

3D project

enter image description here

2D project

enter image description here

Photoshop

enter image description here

\$\endgroup\$
2
  • \$\begingroup\$ Is it possible your 3D project was configured with HDR, linear colour space blending, or colour grading post effects by default? \$\endgroup\$
    – DMGregory
    Commented Dec 21, 2022 at 14:29
  • 1
    \$\begingroup\$ Hey, your comment helped me get to this bottom of this. It appears the default colour space for 3D projects is linear, while the default for 2D projects is Gamma. When changing from Linear to Gamma in 3D projects, the color is identical to photoshop! \$\endgroup\$ Commented Dec 21, 2022 at 21:55

1 Answer 1

2
\$\begingroup\$

Finally figured this out. In 3D unity projects, the default color space setting is "Linear" while in 2D projects it is "Gamma". You can change this setting by going into Project Settings > Player > Color Space.

I'll also add that from reading a bit, "Linear" is the preferred color space for 3D projects because it is much more optimized than Gamma. In the end, I'm just going to live with this difference in UI color from Photoshop, save all of my assets without any transparency, and change the transparency of my UI in unity rather than baking it in for photoshop.

There are apparently more complex solutions where you can render particular elements (i.e. UI elements) in Gamma rather than Linear, but it involves quite a bit of messing around and writing your own script/package to properly achieve this.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .