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

Imported tutorial shader not working correctly on lighting. #19

Open
gpfl0712 opened this issue Apr 27, 2024 · 0 comments
Open

Imported tutorial shader not working correctly on lighting. #19

gpfl0712 opened this issue Apr 27, 2024 · 0 comments

Comments

@gpfl0712
Copy link

gpfl0712 commented Apr 27, 2024

First of all, your tutorial shader is greatly appreciated. Thanks for your hard work.

It's my first time to write a custom URP shader, so I'm trying to import your tutorial shader to my project. But there's something wrong with the lighting.

image
On a directional light, the character receives light from every direction(no dark sides).

image
On a point/spot light, the character does not receive any light. The most frustrating thing is, the character receives light from point/spot light when it's closer than 1.5-unit distance.(no matter how far the light range is)

Although, outlines are working properly, and the character produces shadows, other objects (using URP lit shader) normally receive shadows from it. So I'm curious if there's a problem with my project or configurations.

I tested on my project, unity 2021.3.7 LTS and URP 12.1.7, with this version of tutorial shader
https://github.com/ColinLeung-NiloCat/UnityURPToonLitShaderExample/tree/4802381d313d19c04fff97eca59f9a0b34a7e15a
And tested on a basic URP template project, unity 2022.3.20 LTS and URP 14.0.10, with current version of tutorial shader. Same results in both versions.

I made sure to apply material -> shader to tutorial shader, unity gameobject's mesh renderer component->cast shadows=On, unity light object component -> shadow type=hard/soft shadows, URP asset -> Lighting -> Main/Additional Light -> Per pixel, Cast Shadows = True.

This is my URP asset and Universal Render Data. And all the other settings are default.
image
image
image

Thank you for your help!

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

1 participant