How to disable the ambient light in a Panda3d environment?

Hi all, I’ve recently been creating a game using Panda3D. Initially, I was using tobspr’s RenderPipeline to handle lighting and shaders, but due to some performance issues on low-end hardware, I have also begun to implement a standard Panda3D renderer option into the game.

Unfortunately, I’ve found that the normal ambient lighting, that Panda illuminates an empty scene with, brightens objects too much for my purposes.

My question is simply this, is there a way to disable the default lighting, or at least darken it considerably?

Thanks, packof14eggies.

Panda3D does not apply ambient lighting by default. This only happens when you add an AmbientLight to the scene, and enable it using render.setLight. If you have an ambient light, you can darken it by multiplying its color value with a scalar factor.

Perhaps you are referring to what happens when you have 0 lights active in a scene? If you have no lights active, Panda3D will render objects at their full color value, as though you had an ambient light with color (1, 1, 1, 1). To disable this, simply enable any light on the scene, such as an AmbientLight with a completely black color, or a grey-ish color value to get a reduced tone.

If you don’t have any lights in your scene p3d will draw your models with vertex color * texture color. Usually vertex color is white so it looks the same as a full white ambient light. Add a light, any light to your scene and you should be good.

There are also some other deferred rendering solutions to be found here on the forum, some will even run on a cheap Atom tablet @30fps :wink:

EDIT: Argh, rdb was faster, but still posting, it took too long to type on my phone to throw away.

Thank you both for your replies. You’ve both been very helpful.

Also, wezu, you mentioned some other deferred rendering solutions. I was wondering if you had any suggestions for any specifically. Any advice would be greatly appreciated.

Thanks, packof14eggies.

I had this one in mind.