Cartoon shader problems?

Hi there,

I am making a cartoon render for my program, following the cartoon shader example.
Without lightingGen.sha, my shader works as follows.


When lightingGen.sha is set, the shader outputs the following result:
The color was lost.

I didn’t make any change to the lightingGen.sha file.

Also, when I use a stick model shown in the following figure.
image
The program reports assertion failure:
Assertion failed: has_mat() at line 595 of c:\buildslave\sdk-windows-i386\build\built\include\transformState.I
:linmath(warning): Tried to invert singular LMatrix3.

Have you encountered similar problems?
Thank you in advance.

Does your scene actually have a light in it?

Does the colour come from a texture, from vertex colours, or otherwise?

As for the second problem you gave, this kind of error usually happens when there is an invalid transform on one of the objects, for example an object with scale 0.

Thank you.
I changed vtx_color into attr_material[1].
It is now somewhat working.

But, the objects without materials, especially those objects colored using nodepath.setColor,
are still white.

Also, when I set the shader to a node path instead of render, the same assertion error appears:
Assertion failed: has_mat() at line 595 of c:\buildslave\sdk-windows-i386\build\built\include\transformState.I
:linmath(warning): Tried to invert singular LMatrix3.
I personally think it is not a problem related to 0 scale.