UnityChanToonShaderVer2_Project icon indicating copy to clipboard operation
UnityChanToonShaderVer2_Project copied to clipboard

ToonShader wont compile on ps4 build

Open Kyrw opened this issue 5 years ago • 2 comments

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

Kyrw avatar Jan 27 '20 16:01 Kyrw

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

Nobuyuki-Kobayashi avatar Mar 15 '20 00:03 Nobuyuki-Kobayashi

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

H3idi-X avatar Feb 18 '21 04:02 H3idi-X