Are Your Lights Actually Visible in SAMSON? Avoid This Common Pitfall.

When building molecular scenes in SAMSON, many modelers encounter a simple but confusing problem: lights are present in the document but have no visible effect. Sometimes, it seems like you’ve configured everything correctly—yet the lighting feels like it’s missing. One of the most common reasons stems from an often-overlooked set of properties: the visible, visibilityFlag, and hidden attributes of the light nodes.

If you’re working with the Node Specification Language (NSL), there’s a very efficient way to query, debug, and solve visibility issues using the light attribute space (also called li).

Common Use Case: Light Not Affecting the Scene

You’re rendering a scene with advanced shaders. Shadows, reflections, and ambient lighting are on. You added multiple light sources, but their effects are missing or incomplete. Here’s how to quickly assess light node visibility through NSL.

Step 1: Check if Lights Are Visible

Use this NSL query:

This returns all light nodes that are currently visible. If the result is empty, none of your lights are actually contributing to the scene.

Step 2: Investigate Visibility Flags

Even if a node is set to visible, its visibilityFlag might block it from rendering properly. Use:

Or, the inverse:

to find lights that are not allowed to be visible because of their internal visibility flag.

Step 3: Uncover Hidden Lights

Lights may be hidden explicitly. Run:

to get a list of hidden light nodes. To find lights that are not hidden:

Combining Queries

You can get powerful insights with combined queries:

This combination returns lights that are visible, not hidden, and have their visibility flag set—i.e., they are fully active in the scene.

Use Case: Finding Broken Light Configurations

Suppose some lights are still nonfunctional. Try isolating configurations like:

This detects all lights in the document that are not visible for any reason. It’s a quick way to debug the problem.

Light Naming for Organization

You can also use the name attribute to identify or group lights:

Or use wildcards:

to select all lights with names starting with “L”.

Summary

When lights don’t behave as expected in SAMSON, it’s often due to the interplay between visible, visibilityFlag, and hidden attributes. The NSL framework lets you pinpoint these issues in seconds. Use queries like li.v, li.vf, and li.h to identify, debug, and organize your lighting setup more effectively.

To learn more about light attributes in NSL, visit the full documentation page: https://documentation.samson-connect.net/users/latest/nsl/light/

SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.

Comments are closed.