render.setShaderAuto() removes glossy reflections

I have some gltf-exported pool ball models that are illuminated by 5 point lights. Since they have a low roughness value, you can see the reflection of each light in each of the balls:

In my opinion, this looks fantastic.

The problem is that I want the balls to cast shadows onto the table, so as a first step I’ve added the line render.setShaderAuto(). But this line removes these beautiful reflections:

Is there a way to get these reflections back? I dug around and found this dated page about gloss maps. Maybe its useful?

Thanks in advance.

Ok I found out the problem. I am using simplepbr which comes with its own shaders, which are overridden with render.setShaderAuto(). To enable simplepbr shaders, I need to do so during my init call of simplepbr with simplepbr.init(enable_shadows=True), and avoid setShaderAuto() altogether.

I found this out from this useful thread: Best practice for lighting in a cave or dark house? - #6 by rdb

One important note is that point lights do not cast shadows if spotlights or directional lights are in the scene, so I’ll be changing my point lights to spotlights I guess. Pinging you @Moguri to see if there is any progress on that front.

I believe the issue with mixing spotlights and directional lights with point lights has been mostly addressed in recent Panda versions. However, using point lights as shadow casters is still unsupported by simplepbr and trying to enable shadow casting on them will probably result in GLSL errors.

I believe the issue with mixing spotlights and directional lights with point lights has been mostly addressed in recent Panda versions. However, using point lights as shadow casters is still unsupported by simplepbr and trying to enable shadow casting on them will probably result in GLSL errors.

Ok, that’s awesome to hear.

I am having issues with some, but not all, of my point lights giving off light. My first guess was that it was related to the point light issues described in that post, but now I’ve tried it without shadow casting or simplepbr, and still some of my point lights are ‘duds’. I will make a new post about it.

My first guess is that you have more than 8 lights and need to increase simplepbr’s max_lights to match your scene/usage.

Oh of course. Thanks @Moguri it’s one of the first things in the README you wrote. :man_facepalming: