Search code examples
unity-game-engineshader

UNITY_SAMPLE_TEXCUBE isn't working in Unity


I met a strange problem that in our company's project(let's say project A), I used UNITY_SAMPLE_TEXCUBE(unity_SpecCube0,i.uvCube) to sample the default skybox but it always returns black color. On the other hand, if I create a new project(let's say project B) and do the same thing, it returns default skybox's color.

I'm trying to clear the project settings and library of project A, also copying the project B's project settings to project A, however, both of them are not working. I'm confused what caused this issue, any clue?

PS. both projects are in Unity 2018.4.0f1 version


Solution

  • The amazing thing happened!

    I change color space from Gamma space to linear space and then everything works.

    Unbelievable!!!