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

ToonShader wont compile on ps4 build #35

Open
Kyrw opened this issue Jan 27, 2020 · 2 comments
Open

ToonShader wont compile on ps4 build #35

Kyrw opened this issue Jan 27, 2020 · 2 comments
Labels

Comments

@Kyrw
Copy link

Kyrw commented Jan 27, 2020

When compiling Toon_DoubleShadeWithFeather shader for PS4, the erros on the attached file show up. I used the compile and show code button on the shader inspector window, setting it to Custom Platform - PS4.

Here is 2 of the erros and, just as a sample:

Shader error in 'UnityChanToonShader/Toon_DoubleShadeWithFeather': Program 'vert', ambiguous call to 'lerp'. Found 3 possible candidates: at Assets/ThirdParty/Toon/Shader/UCTS_DoubleShadeWithFeather.cginc(229) (on ps4)

Shader error in 'UnityChanToonShader/Toon_DoubleShadeWithFeather': Program 'frag', ambiguous call to 'dot'. Found 3 possible candidates: at Assets/ThirdParty/Toon/Shader/UCTS_DoubleShadeWithFeather.cginc(175) (on ps4)

I was able to fix them by trying to fix the "ambiguous call" that the compiler was complaining about:
UCTS_DoubleShadeWithFeather.cginc(175) :
was
o.mirrorFlag = dot(crossFwd, UNITY_MATRIX_V[2]) < 0 ? 1 : -1;
changed to:
o.mirrorFlag = dot(crossFwd, UNITY_MATRIX_V[2].xyz) < 0 ? 1 : -1;

UCTS_DoubleShadeWithFeather.cginc(229):
was
float3 lightColor = max(0, lerp(addPassLightColor, lerp(0,min(addPassLightColor,addPassLightColor/pureIntencity),_WorldSpaceLightPos0.w),_Is_Filter_LightColor));
changed to:
float3 lightColor = max(0, lerp(addPassLightColor, lerp(float3(0,0,0),min(addPassLightColor,addPassLightColor/pureIntencity),_WorldSpaceLightPos0.w),_Is_Filter_LightColor));

UCTS_Outline.cginc(90):
was
float signVar = dot(normalize(v.vertex),normalize(v.normal))<0 ? -1 : 1;
changed to:
float signVar = dot(float(normalize(v.vertex)),float(normalize(v.normal)))<0 ? -1 : 1;

I'm not sure if those are the correct fixes for the erros, but those worked for me. As such, I would like have a confirmation if this fixes are correct or what are the correct ones.

Setup:
Unity 2019.2.11f1
Unity-Chan Toon Shader Ver.2.0.7
PS4 SDK: 6.500 (6.720.001)

Toonshader compile output error.txt

Regards

@Nobuyuki-Kobayashi
Copy link
Contributor

Thank you for your information.
We'll research it.

@Nobuyuki-Kobayashi Nobuyuki-Kobayashi added the bug Something isn't working label Mar 16, 2020
@Nobuyuki-Kobayashi Nobuyuki-Kobayashi added on hold and removed bug Something isn't working labels May 9, 2020
@H3idi-X
Copy link
Contributor

H3idi-X commented Feb 18, 2021

We are not able to use dev-kit because of this pandemic yet.

yuki4080 pushed a commit to yuki4080/com.unity.toonshader that referenced this issue Dec 22, 2022
* Removed warrnings in the shader unnecessary arg in a function.

* Updated Unity chan eye material.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants