Please sort this bug in the toon shader project

https://playcanvas.com/project/489836/overview/toon-shader-with-skinning

this issue is happening in the latest version of the editor (1.62.0)

Please refer to the shader chunk migration notes to help with updating chunk code: Shader Chunk Migrations | Learn PlayCanvas

In this case, the function signature was changed for engine/lightDiffuseLambert.js at main · playcanvas/engine · GitHub

So we need to update the shader chunk from

uniform sampler2D texture_ramp;

float getLightDiffuse() {
    float light = max(dot(dNormalW, -dLightDirNormW), 0.0);
    return texture2D(texture_ramp, vec2(light, 0.0)).g;
}

to

uniform sampler2D texture_ramp;

float getLightDiffuse(vec3 worldNormal, vec3 viewDir, vec3 lightDir, vec3 lightDirNorm) {
    float light = max(dot(worldNormal, -lightDirNorm), 0.0);
    return texture2D(texture_ramp, vec2(light, 0.0)).g;
}

Fixed fork: https://playcanvas.com/project/1063707/overview/f-toon-shader-with-skinning

1 Like

@yaustar Hi I did try the fix you gave in the forked project, but i still face couple of issues. I have attached the screenshot. These issues are there when a build is created. It seems to be working fine in the editor.

It’s not an official shader by the team so unfortunately we can’t spend time supporting it beyond help it migrate to 1.62 where we can.

Maybe someone from the community can help if you provide a public reproducible project, the hosted build where it has issues and explain what the issues are.

@yaustar The bug is happening on mobile devices. The boxes in front and the floor do not have the shader attached. I guess something else is wrong.

@yaustar See it is working fine when the game is launched in PC.

issue is sorted and was related to batching.