| View previous topic :: View next topic |
| Author |
Message |
Anon

Joined: 29 Oct 2009 Posts: 60
|
Posted: Sat Oct 31, 2009 2:37 am Post subject: Cartoon-Shader no texture support? |
|
|
So i got all excited with built-in toon support and demo shader, loaded my model... but looks like a textured model isnt supported?
With the shader its white,
without shader only the outline works
PS. I have zero shader programming experience
Last edited by Anon on Sat Oct 31, 2009 8:07 am; edited 1 time in total |
|
| Back to top |
|
 |
ThomasEgi

Joined: 28 Jul 2006 Posts: 1384 Location: Germany,Koblenz
|
Posted: Sat Oct 31, 2009 7:03 am Post subject: |
|
|
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 http://www.panda3d.org/phpbb2/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. _________________ rig: dell inspiron 1720; ubuntu 9.04_64 ;panda 1.6.2
may a catgirl be with you. nyaan nyan~~ ^.^ |
|
| Back to top |
|
 |
Anon

Joined: 29 Oct 2009 Posts: 60
|
Posted: Sat Oct 31, 2009 8:03 am Post subject: |
|
|
Toon effect without shader:
The black colour doesnt shade right. |
|
| Back to top |
|
 |
Anon

Joined: 29 Oct 2009 Posts: 60
|
|
| Back to top |
|
 |
rdb

Joined: 04 Dec 2006 Posts: 4557 Location: Netherlands
|
Posted: Sun Nov 01, 2009 5:23 am Post subject: |
|
|
Hm, does your model have vertex normals? _________________ I was formerly known as pro-rsoft |
|
| Back to top |
|
 |
Anon

Joined: 29 Oct 2009 Posts: 60
|
Posted: Sun Nov 01, 2009 6:25 am Post subject: |
|
|
I have uploaded the model.
You can find the download link in my previous post. |
|
| Back to top |
|
 |
Anon

Joined: 29 Oct 2009 Posts: 60
|
Posted: Sun Nov 01, 2009 8:16 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Anon

Joined: 29 Oct 2009 Posts: 60
|
|
| Back to top |
|
 |
sunbull
Joined: 13 Oct 2009 Posts: 15 Location: Beijing, China
|
Posted: Fri Nov 06, 2009 11:43 am Post subject: |
|
|
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. _________________ by Mario, with best regards.
Last edited by sunbull on Fri Nov 06, 2009 1:07 pm; edited 1 time in total |
|
| Back to top |
|
 |
rdb

Joined: 04 Dec 2006 Posts: 4557 Location: Netherlands
|
Posted: Fri Nov 06, 2009 12:03 pm Post subject: |
|
|
It's a conundrum, and there has been a similar bug report about this:
| Code: | | https://bugs.launchpad.net/panda3d/+bug/424640 |
The workaround is to put this in your Config.prc file:
| Code: | | textures-power-2 none |
But yeah, you really shouldn't set the cartoon separation value so high. _________________ I was formerly known as pro-rsoft |
|
| Back to top |
|
 |
sunbull
Joined: 13 Oct 2009 Posts: 15 Location: Beijing, China
|
Posted: Fri Nov 06, 2009 1:48 pm Post subject: |
|
|
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:
 _________________ by Mario, with best regards. |
|
| Back to top |
|
 |
Anon

Joined: 29 Oct 2009 Posts: 60
|
Posted: Sat Nov 07, 2009 2:37 am Post subject: |
|
|
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.
| rdb wrote: | | But yeah, you really shouldn't set the cartoon separation value so high. |
I just set it high so you would notice it. By default it's few pixels wide but still bothering. |
|
| Back to top |
|
 |
sunbull
Joined: 13 Oct 2009 Posts: 15 Location: Beijing, China
|
Posted: Sat Nov 07, 2009 2:57 am Post subject: |
|
|
So that you should use rgb mode in your model's texture.
Add this line to you .egg file, after the line "panda.png":
| Code: | | <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. _________________ by Mario, with best regards. |
|
| Back to top |
|
 |
Anon

Joined: 29 Oct 2009 Posts: 60
|
Posted: Sat Nov 07, 2009 3:57 am Post subject: |
|
|
Ah, it's finally solved...
I will probably modify the chicken script. I would still call this a 'bug'. |
|
| Back to top |
|
 |
sunbull
Joined: 13 Oct 2009 Posts: 15 Location: Beijing, China
|
Posted: Sat Nov 07, 2009 4:19 am Post subject: |
|
|
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? _________________ by Mario, with best regards. |
|
| Back to top |
|
 |
Anon

Joined: 29 Oct 2009 Posts: 60
|
Posted: Sat Nov 07, 2009 4:48 am Post subject: |
|
|
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?
Also all the commercial games I have seen which dont use their own format use png or tga. Havent seen any with jpg (but maybe its the lisencing, I dont know). |
|
| Back to top |
|
 |
sunbull
Joined: 13 Oct 2009 Posts: 15 Location: Beijing, China
|
Posted: Sat Nov 07, 2009 5:00 am Post subject: |
|
|
I really learnt a lot from that. Thank you! _________________ by Mario, with best regards. |
|
| Back to top |
|
 |
|