Home    Features    Download    Screenshots    Manual    Reference    Forums    License    Contact    Blog   
 
 
  Forums
    FAQ    Search    Memberlist    Profile    Log in to check your private messages    Register    Log in   
Cartoon-Shader no texture support?

 
Post new topic   Reply to topic    Panda3D Forum Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
Anon



Joined: 29 Oct 2009
Posts: 60

PostPosted: Sat Oct 31, 2009 2:37 am    Post subject: Cartoon-Shader no texture support? Reply with quote

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
View user's profile Send private message
ThomasEgi



Joined: 28 Jul 2006
Posts: 1384
Location: Germany,Koblenz

PostPosted: Sat Oct 31, 2009 7:03 am    Post subject: Reply with quote

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
View user's profile Send private message
Anon



Joined: 29 Oct 2009
Posts: 60

PostPosted: Sat Oct 31, 2009 8:03 am    Post subject: Reply with quote

Toon effect without shader:

The black colour doesnt shade right.
Back to top
View user's profile Send private message
Anon



Joined: 29 Oct 2009
Posts: 60

PostPosted: Sun Nov 01, 2009 4:33 am    Post subject: Reply with quote

heres my model:
http://www.wikiupload.com/download_page.php?id=186707
I think the problem is in my model, because:
Back to top
View user's profile Send private message
rdb



Joined: 04 Dec 2006
Posts: 4557
Location: Netherlands

PostPosted: Sun Nov 01, 2009 5:23 am    Post subject: Reply with quote

Hm, does your model have vertex normals?
_________________
I was formerly known as pro-rsoft
Back to top
View user's profile Send private message Send e-mail
Anon



Joined: 29 Oct 2009
Posts: 60

PostPosted: Sun Nov 01, 2009 6:25 am    Post subject: Reply with quote

I have uploaded the model.
You can find the download link in my previous post.
Back to top
View user's profile Send private message
Anon



Joined: 29 Oct 2009
Posts: 60

PostPosted: Sun Nov 01, 2009 8:16 am    Post subject: Reply with quote

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
View user's profile Send private message
Anon



Joined: 29 Oct 2009
Posts: 60

PostPosted: Tue Nov 03, 2009 6:26 am    Post subject: Reply with quote

Like i said ive uploaded my model:
http://www.wikiupload.com/download_page.php?id=186707
Its just a placeholder. But its the same for my other models...
Back to top
View user's profile Send private message
sunbull



Joined: 13 Oct 2009
Posts: 15
Location: Beijing, China

PostPosted: Fri Nov 06, 2009 11:43 am    Post subject: Reply with quote

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
View user's profile Send private message
rdb



Joined: 04 Dec 2006
Posts: 4557
Location: Netherlands

PostPosted: Fri Nov 06, 2009 12:03 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
sunbull



Joined: 13 Oct 2009
Posts: 15
Location: Beijing, China

PostPosted: Fri Nov 06, 2009 1:48 pm    Post subject: Reply with quote

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
View user's profile Send private message
Anon



Joined: 29 Oct 2009
Posts: 60

PostPosted: Sat Nov 07, 2009 2:37 am    Post subject: Reply with quote

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
View user's profile Send private message
sunbull



Joined: 13 Oct 2009
Posts: 15
Location: Beijing, China

PostPosted: Sat Nov 07, 2009 2:57 am    Post subject: Reply with quote

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
View user's profile Send private message
Anon



Joined: 29 Oct 2009
Posts: 60

PostPosted: Sat Nov 07, 2009 3:57 am    Post subject: Reply with quote

Ah, it's finally solved...

I will probably modify the chicken script. I would still call this a 'bug'.
Back to top
View user's profile Send private message
sunbull



Joined: 13 Oct 2009
Posts: 15
Location: Beijing, China

PostPosted: Sat Nov 07, 2009 4:19 am    Post subject: Reply with quote

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
View user's profile Send private message
Anon



Joined: 29 Oct 2009
Posts: 60

PostPosted: Sat Nov 07, 2009 4:48 am    Post subject: Reply with quote

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
View user's profile Send private message
sunbull



Joined: 13 Oct 2009
Posts: 15
Location: Beijing, China

PostPosted: Sat Nov 07, 2009 5:00 am    Post subject: Reply with quote

I really learnt a lot from that. Thank you!
_________________
by Mario, with best regards.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Panda3D Forum Forum Index -> General Discussion All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
screenshot
Flight Simulator, created by Carnegie Mellon students
screenshot
Blackout: a game using high-end lighting for ambiance.
screenshot
Keepsake: a short interactive movie, themes of loss