cartoon shader + default shader at same time?[ solved ]

Is it possible in panda3D to, for example, use one type of shader(ex: the default panda shader one) only in the game scenario, and another type of shader(ex: cartoon shader) only in the game charaters?

If it´s possible in Panda3D, can you direct me to a tutorial or something similar? Give A example perhaphs?

EDIT: below are some links I have already found.

Found some things maybe are related to what I want, in part or fully:

wow…had to look the 57 pages of this forum category to get that…

It seems the techinic is know as multipass rendering. Still trying to figure out how to use it thought.

Well, I have ignored this issue long enough. As I always say, there is no shame in asking so, take a look at this piece of code, and correct me if I´m wrong:

I also have this class, currently deactivated:

Why my charater isn´t being rendered? What remains to be done?

The ideia I had, as I said before, is to have one camera rendering charaters with cartoon shader, and another rendering all the rest as the default shader.

Thanks in advance for any help. Problem solution to be posted here as usual

What’s missing is a display region for the camera to render into, either map it to screen, or make it render to a texture.

You will have to be careful about occlusion though, since this technique kinda kills z-sorting.

And how do I do that? Could someone provide me with examples about setting display region for new cameras ( the two ways )? And with your oppinion about which one is best?

Here what i got now, not sure if this is what you meant by map to screen:


The Render class is now activated, and get nothing more than a gray screen and blank bufferviewer windows too. Also, when I reparented the camera2 to, hoping camera 2 would follow movements. The problem is objects attached to render2 do not get rendered at all

Kill Z sorting? I wouldn´t want that. But why in most games diferrent shaders together looks allright? How would I prevent or minimize these Z sorting problems?

How foolish of me, I have already suceeded at EDIT1 in using two cameras with a shader in each one. I just have configures wrong where the display region of camera 2 would be.

So I just made these corrections here:
To get fullscreen display
display2 = 0, 1, 0, 1 )

But two things. First, if your display area do not appear, it may be a rendering order issue. withe the “yourdisplayhere”.setSort you can correct this, if this is really the problem. Displays with higher sort number get rendered last, staying on top of the others with smaller numbers.

Second, do not reparent the secundary camera to the base camera if you use this techinc, since the camera2 will render the base render stuff, and not things you put to the secundary render.

I´m having to set up manually the camera2, so it moves exactly like the base camera. So, do not use the reparent to stuff in this case, just to make the secondary camera follows the base camera.

And about Z sorting, for new programmers who would like to know: