(Solved) TextureStage.MDecal = no light shading?

I’m trying to add a decal to a model like this part of the manual: Texture Modes — Panda3D Manual

It displays fine, but the decal texture seems to be unaffected by light (is not shaded). Does anyone know why this is? Am I missing something obvious? Or does anyone know a different way of layering multiple textures by alpha channel that is then rendered once as a combined texture? Or would this require custom shaders?

Thanks in advance!

ah euh, I guess the manual states it too “Also note that the effects of lighting are lost for the decalled part of the texture.” …but why?

I solved my problem using PNMImage.blend_sub_image() all the images into a single image and sending it to a Texture. Works like a charm!

Still kind of odd a lot of the Texture Modes neglect any lighting. It makes them a lot less useful.

1 Like

The problem is that the fixed-function texture pipeline runs after lighting, not before. So anything that is not “modulate” will effectively overwrite the results of lighting.

You can mess about with combine modes, but the best fix is to write a shader.