Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linear vs Gamma colour space #9

Closed
Midda-C opened this issue May 9, 2018 · 3 comments
Closed

Linear vs Gamma colour space #9

Midda-C opened this issue May 9, 2018 · 3 comments

Comments

@Midda-C
Copy link

Midda-C commented May 9, 2018

Are you sick of me yet? ;)

So I was trying to figure out why the foam appeared so different in your project on GitHub compared to the same assets and scene in our own project. Turns out the issue is due to our project using linear colour space, and the Crest project using gamma space. The resulting changes from simply changing the colour space are very pronounced. The following image is the exact same location, on the same frame (I used the 'freeze time' option on the ocean prefab), with the only difference being the colour space.

Gamma Vs Linear Example

As you can see from the image, everything seems to be impacted to some degree—the colour, the foam, the transparency, and possibly the fresnel.

We're using linear space as it is the preferred workflow for PBR assets. Even though Unity themselves recommend a linear space workflow, Unity still, for whatever reason, seems to default to gamma (It's changed in Edit > Project Settings > Player > Other Settings)

At the moment, I don't know how to get the foam to behave correctly in linear colour space, is it seems to mostly just cover the surface of the water in a repeating pattern with little regard to what the wave behaviour is set to.

I think the way the actual assets are authored plays into this as well? It's not something I'm super knowledgeable on. Not sure if the impact on all of the other aspects (colour, opacity, etc) is something that needs to be considered also.

@huwb
Copy link
Contributor

huwb commented May 9, 2018

Are you sick of me yet? ;)

Nope - keep the feedback coming! I'll get on to this as soon as i can.

@huwb huwb closed this as completed in 0d80957 May 9, 2018
@huwb
Copy link
Contributor

huwb commented May 9, 2018

Thanks for reporting this... what a bug.. I did not realise it was rendering gamma space, and that the difference between gamma and linear is so pronounced (even for standard shaders). What a shocker.

I've switched the project over to linear and I just spent a not-so-fun few hours retweaking the surface appearance to make it work in correct space. The sun scattering through the waves looks much better. The foam looks ok but could use a rewrite. The fresnel/reflection has become realistic now. The directional lighting looks a bit better but more or less similar. I think i was able to make the depth fog (translucency) the same.

I'm hereby dropping support for gamma completely and have updated the setup instructions accordingly.

Thanks again for helping with this!

@Midda-C
Copy link
Author

Midda-C commented May 9, 2018

You work fast! Looks great now, thanks!

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

No branches or pull requests

2 participants