Directional light and Rope

Hello all,
First, I would like to thank all you Panda folks for providing a terrific piece of software. I’m using Panda for 2 commercial projects and so far it is doing everything I need.

Anyway, I’ve added a rope to my scene but am having problems with lighting. My environment has low level ambient lighting and a directional light. All my geometry seems to be picking up both lights except the rope, which doesn’t seem to be picking up the directional so that it looks black (almost) as it is just being affected by the ambient. Any idea why this would be so? Help much appreciated :slight_smile:

    self.filaments = render.attachNewNode(PandaNode('filaments'))

    r = Rope()

    r.setup(4, [(None, (-500,  0, 60)),
                (None, (0,   100, 60)),
                (None, (250, 150, 60)),
                (None, (500,   0, 60))])

    texture = loader.loadTexture('red.png')

    ts = TextureStage("ts")
    r.setTexture(ts, texture)

The render mode RMBillboard doesn’t have any normals; it can’t, because it’s just a flat strip of tape that rotates to keep its flat side towards the camera. Lighting doesn’t make sense on this kind of rope.

If you want to light your rope, use RMTube instead. You’ll also need to call r.ropeNode.setNormalMode(RopeNode.NMVertex), since even with RMTube, normals aren’t generated by default (there’s an extra cost to generating normals). You may also want to call setNumSlices(20) or so, whatever minimum number looks good with your rope size.


I wondered if it was a normal problem. I guess I assumed that it would have normals continuously oriented towards the camera. For texturing reasons, I think I need to use the billboard render mode. Is there an easy way to just give the Rope its own luminosity value and take care of it that way? I don’t really need any shading on the rope itself.

Thanks much for the help!

Sure. You can turn off all lights on your rope (or ensure that it is never lighted in the first place). With all lights off, it is a special case, and means lighting will be disabled for your rope–so it will be 100% light. (You get the same effect by adding just one full-white ambient light to the rope.)

To turn off all lights on the rope, use r.setLightOff(). This will override any lights inherited from a node above, and disable lighting on the rope.

Or, simply avoid putting the lights on the rope in the first place, by putting the lights only on nodes that actually want to be illuminated (instead of putting the lights on render).


Excellent, works great. Thank you very much!