Skip to content

ToonShader did not receive flat and gradient Ambient #395

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

Open
Thaina opened this issue Feb 23, 2025 · 8 comments · Fixed by #396
Open

ToonShader did not receive flat and gradient Ambient #395

Thaina opened this issue Feb 23, 2025 · 8 comments · Fixed by #396

Comments

@Thaina
Copy link

Thaina commented Feb 23, 2025

Describe the bug
ToonShader did not receive flat and gradient Ambient

I don't see toonshader use any unity_AmbientEquator unity_AmbientGround unity_AmbientSky to set light source color

To Reproduce
Steps to reproduce the behavior:

  1. Using any model with ToonShader
  2. Click on Window > Rendering > Lighting > Environment
  3. Change Environment Lighting source to Gradient and tweak any color
  4. Other model with UniversalShader/Lit change color from ambient but toonshader would not

Expected behavior
toonshader would colored from all ambient gradient as well as other lit shader

Screenshots

Normal
Image

Current
Image

Expect
Image

Desktop (please complete the following information):

  • Windows
  • Chrome

Additional context
Also I don't understand how unity's own Lit shader can get AmbientMode. I would like to fix it myself and made pull request but this AmbientMode have me confused

@sindharta-tanuwijaya
Copy link

Hello.
Thank you very much for your feedback and even a PR to fix this issue !

Just in case, would it be possible for you to share this test project that you are using ?

In the meantime, I'd like to let you know that due to the company reset last year, we at Unity have had to deprioritize the development of the ToonShader package at the moment.
Consequently, we have very limited resources at the moment to address existing bugs, although the above info that you provide will be beneficial for discussions with the community.

That being said, this could change in the near future, though I can’t provide any guarantees at this time.

We appreciate your understanding and support.

@Thaina
Copy link
Author

Thaina commented Feb 26, 2025

For test project, I think you could use the test scene in this repo directly

ToonShader scene would be easiest one I think

Setting the material's Light Probe Intensity to 0.5-1 and change Environment lighting source to Color or Gradient to test

Image

@Thaina
Copy link
Author

Thaina commented Feb 27, 2025

@sindharta-tanuwijaya To be honest I am not really sure if my fix was the right formula. It just seem alright but maybe it should not related to env / intensity and GI, or it is?

@sindharta-tanuwijaya
Copy link

Thank you for sharing your honest opinion! :)
I just wanted to run the CI tests first to identify any errors that might come up.

And yes, before merging the fix into the main branch, we'll make sure to thoroughly validate it.

@H3idi-X
Copy link
Collaborator

H3idi-X commented Mar 27, 2025

@Thaina

Hi, thank you for reporting the issue.
I tried to reproduce the problem, but as far as I can see, the Unity-Chan face appears to be affected by Environmental Lighting. Could you provide more details about the issue, or share a reproducible project with us?

2025-03-27.08-46-33.mp4

@Thaina
Copy link
Author

Thaina commented Mar 27, 2025

@H3idi-X I am using test project from this repo directly

https://github.com/Unity-Technologies/com.unity.toonshader/tree/development/v1/TestProjects/UniversalGraphicsTest-6000.0

The commit is 1ded2ba

And this is what I see

Image

Image

Image

Image

Or are there any setting I need to set before the material will take ambient light?

@H3idi-X
Copy link
Collaborator

H3idi-X commented Mar 28, 2025

Thanks for providing more detailed information.
We succeeded to produce the isuue.
We will check what cause the difference between what I posted yesterday and the following.

2025-03-28.12-20-27.mp4

@H3idi-X
Copy link
Collaborator

H3idi-X commented Apr 14, 2025

Hi, we have confirmed that this issue occurs in versions newer than 6000.0. We are investigating the most appropriate fix to maintain compatibility.

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

Successfully merging a pull request may close this issue.

3 participants