[SOLVED] Toon Shading Techniques

They had updated the functionality of getModelMatrix()

To fix this, replace the skinned Vertex Shader (transformToonEdgeSkinnedVS) with this:

uniform float edgeSize;

mat4 getModelMatrix() {
	#ifdef DYNAMICBATCH
	return getBoneMatrix(vertex_boneIndices);
	#elif defined(SKIN)
	return matrix_model * getSkinMatrix(vertex_boneIndices, vertex_boneWeights);
	#elif defined(INSTANCING)
	return mat4(instance_line1, instance_line2, instance_line3, instance_line4);
	#else
	return matrix_model;
	#endif
}

vec4 getPosition() {
    dModelMatrix = getModelMatrix();
    vec4 posW = dModelMatrix * vec4(vertex_position, 1.0);
    //posW.xyz += skinPosOffset;
    dNormalMatrix = mat3(dModelMatrix[0].xyz, dModelMatrix[1].xyz, dModelMatrix[2].xyz);
    vec3 normal = normalize(dNormalMatrix * vertex_normal);
    posW.xyz += (normal / 100.0) * edgeSize;
    dPositionW = posW.xyz;
    return matrix_viewProjection * posW;
}

vec3 getWorldPosition() {
    return dPositionW;
}

Notice that the ‘dModelMatrix’ is directly calling getModelMatrix() now, it does not need to be multiplied as that is already handled in the matrix function.

Edit: Credit to @kprimo for exposing the PC shaders Standard Material Shaders Share

4 Likes