[SOLVED] Rendering Specular / Glow to texture

I think I might have missed something rudimentary.

If I’m using FilterManager.renderSceneInto to fill colour, depth, and normal textures to pass to a shader, how would I then also pass specular/material/glow information into the same shader?

self.depth = Texture()
self.albedo = Texture()
self.normal = Texture()

FilterManager.renderSceneInto(colortex = self.albedo, depthtex = self.depth, auxtex = self.normal,auxbits = AuxBitplaneAttrib.ABOAuxNormal)

light.setShaderInput("albedo", self.albedo)
light.setShaderInput("depth", self.depth)
light.setShaderInput("normal", self.normal)

Even if I got another texture, how would I fill that, since I’m currently using the COLOR0 and COLOR1 outputs in the shader I’ve applied my models?

Would it be correct in saying that I’d need to create a buffer at a lower level, like this:
panda3d.org/manual/index.php … nd_Buffers

This page seems to indicate I’d get 4 Aux outputs in my for my shaders?
panda3d.org/reference/1.7.2/ … Output.php

Am I on the right track? Or can the FilterManager support more then 1 Aux bitplane somehow? (Which might be easier)

You are allowed to use more than one auxiliary texture attachment.

You can also embed information into the alpha channel of another attachment. For instance, ABO_glow encodes the glow information into the alpha channel of the colour texture.

We don’t currently define an AuxBitplaneAttrib setting for gloss/specular, but I’d be happy to add this feature for you if you need it.

You’re right, that should be fixed. It was probably done this way because the shader generator only supports one aux bitplane.

I suppose, but you don’t need transparency for your normal vector.

Hmm, it seems your reply was somehow merged with mine - thats weird :confused:

Sweet, I can keep my edits in FilterManager.py, but happy for it to be added in if it doesn’t break other peoples code :slight_smile:

True, I could have put glow into the normals, but then I’d still need room for spec and gloss.

Heres the output with the extra aux channel being a combination of spec/gloss/emissive. The smileys I made very specular, but the ground matte.

Texture isn’t mine, but was a good way to test out the buffers.

Thanks for the pointers!

Ouch! I must have accidentally clicked the “edit” instead of the “quote” button on your post. My apologies! It’s sometimes hard to see the difference.

I’ve checked in a fix to FilterManager.py. You can now use the keys “aux0” and “aux1” in the “textures” dictionary passed to renderSceneInto.

The screenshot looks great!