Trouble combining shaders

I am new to shaders and need some help with using them to combine different effects. Specifically, I am trying to use a shader to make some individual nodepaths (but not the entire scene) glow and to create environmental fog with a shader.

I have successfully implemented the fog in a shader and the selective glow in a separate shader by modifying the technique from the glow shader sample. So I can create each effect independently, but I’m having trouble putting them together.

I know each node can only have one shader set, so initially I thought about adding the fog effect into the glow shader. However, since the output of the glow shader (and sequentially the blur shaders) is rendered to a texture and the output color is added on top of the rendered scene, there would be no way to subtract color and scene would not be darkened with fog.

I then thought I could apply the fog first, then output this to a buffer and apply the glow to that. This looks good, but since the glow is applied to the rendered texture, without having knowledge of the 3d vertex data of the nodepaths, it is applied globally - not just to the specific models that need it.

So this specific issue has me confused, but also I’d like to find some advice in general about combining shaders in Panda.

I think you dont understand how glow shader works. Glow is rendered into a buffer and blurred. So you just have to render different values to color buffer (fog) and glow values to glow camera buffer.

What i do is mark render with special var like “glow” which is true or false depending weather its running as the color camera or glow buffer.

OK, I looked at the fireflies sample and have a better understanding of how cameras, buffers, and shaders relate to each other.

I’m not sure I understand. Do you mean a shader input like k_glow?