Skip to content

ToonShader wont compile on ps4 build #35

Open
@Kyrw

Description

@Kyrw

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions