Making LineSeg more visible

Is there a way to make certain lights affect certain nodes and only that node? if not, how could I possibly draw Lines with lineSeg in a Dark scene and have them look for example really bright green, independent from the current lighting of the scene.

For more context: i want to display the Earth, lit by a D-Light as the sun and then display orbit paths, groundstations and satellites as lines and points with constant color around the earth.

You can try to turn off the lighting setLightOff ()

1 Like

Or, approaching it from the converse, you could apply the light to just the Earth by calling “setLight” from the Earth’s NodePath instead of render. (I’m not sure offhand of whether it’s important that the light be parented below the Earth instead of render, too.)

Something like this:

self.lightNodePath = self.earthModel.attachNewNode(self.lightNode)
self.earthModel.setLight(self.lightNodePath)

However, if you have other objects that are to be lit, and your line-segments all have a common ancestor-node that isn’t also an ancestor of the objects to be lit, then serega-kkz’s solution is likely the simpler.

your reply brought me into the right direction

alight = AmbientLight('alight')
alight.setColor(VBase4(1, 1, 1, 1))
alnp = line_np.attachNewNode(alight)
line_np.setLight(alnp)

basically the ambientlight is just applied to the line_np. For others coming across: line_np is the lineSeg nodepath and its glowing green now, while preserving the scenes light settings for the earth.

Another way is to set the color scale to values greater than 1 (the larger the number the greater the effect).