[SOLVED] Cartoon-Shader no texture support?

Looks like a textured model isnt supported by toon shader?
With the shader its white,
without shader (shadergen) only the outline works
PS. I have zero shader programming experience

the toon shader sample was not build with texture-support in mind, so it has no support for texture. it can be added by modifying the shaderfile itself.
thought this has been discussed on the forum quite some times already. for example here https://discourse.panda3d.org/viewtopic.php?t=6929
using the serach function might bring up lot more results.
note: you can do cartoon-inking even without shaders,for example as workaround for veryveryvery old graficcards.

Toon effect without custom shader:

The black colour doesnt shade right.

heres my model:
I think the problem is in my model, because:

Hm, does your model have vertex normals?

I have uploaded the model.
You can find the download link in my previous post.

I guess built-in toon shading doesnt change specularity.
So i changed specular to 0 in Blender:

Still not bad. But outline doesnt work. If I press outline too much I get these black lines from top and right of the window. Those are present with the default panda model, too.

Like i said ive uploaded my model:
Its just a placeholder. But its the same for my other models…

yes, your zip file has broken.
Well, I got black lines from top right of window too if I outline too much. I think it’s the way shader runs. This part should not be the problem.

It’s a conundrum, and there has been a similar bug report about this:


The workaround is to put this in your Config.prc file:

textures-power-2 none

But yeah, you really shouldn’t set the cartoon separation value so high.

Anon, you should alter the texture by .jpg or some other. When using the .png you can mention that the render-to-texture has an error resault. I guess Toon doesnt support Alpha channel. Maybe your other models are the same.

here is the resault:

Thanks for the help.
But isnt this a bug then? I checked in GIMP and there wasn’t any alpha value.
JPG is lossy, BMPs are big, and PNGs are small, like few kbytes for few-color images like this anyway. So I would really like to use PNGs.

I just set it high so you would notice it. By default it’s few pixels wide but still bothering.

So that you should use rgb mode in your model’s texture.

Add this line to you .egg file, after the line “panda.png”:

<Scalar> format { rgb }

maybe because the export plugin didn’t consider situation like you. the resault is same with above so I do not repeat.

Ah, it’s finally solved…

I would still call this a ‘bug’.

But you are using png without alpha channel…
I cant understand that. isnt it a contrary way to original intention of png…
actually you can contral the compression rate of jpg. isnt it better?

No, png isn’t used only for the transparency. Jpg format has lossy compression. Even if you set it to 100% it is still noticeable, at least for me ( and in that case also big in filesize). Png uses lossless compression methods, so its bigger, but the image doesnt change visually. Png is of course bigger than a 75% jpg but its smaller than bmp ( which can be compressed but I have never seen one). Also png is really small if you use few colours.
I know that a jpg textured model cant be so bad visually, but why not use png if its almost the same size in my case?

I really learnt a lot from that. Thank you!

Anon I tried to download your model but without success:
at the end of download all I got is an empty zip file

This problem is solved long ago.
Unless you want the ugly panda model :b

hah no it isn’t ugly, not uglier than the one I’m trying to do by myself these days for sure - I mind to port your pandakid to blender and use it in place of the good ol fat panda for my purposes, rigging, animating and dressing it - I guess is faster for me to start from yours than wait I finish my own. of course sharing it back to panda ppl as I often do.