Mastering Pymol: Two-Sided Lighting Techniques

Joan Jul 01, 2026

In the realm of molecular visualization, PyMOL stands out as a powerful tool, offering a plethora of features to enhance 3D molecular structures. One such feature is the ability to apply two-sided lighting, which can significantly improve the visual appeal and comprehension of your molecular models. Let's delve into the world of PyMOL two-sided lighting, exploring its benefits, how to implement it, and some best practices.

Charlotte Perriand 'Applique à Volet Pivotant Double' Wall Light in Aluminum
Charlotte Perriand 'Applique à Volet Pivotant Double' Wall Light in Aluminum

Before we dive in, let's briefly understand what two-sided lighting is. In computer graphics, two-sided lighting refers to the ability to light both sides of a surface, creating more realistic and visually appealing shading. In the context of PyMOL, this means you can illuminate both the front and back faces of your molecular structures, revealing intricate details and improving the overall aesthetics of your visualizations.

two wall lights mounted to the side of a white wall next to a wooden pole
two wall lights mounted to the side of a white wall next to a wooden pole

Understanding Two-Sided Lighting in PyMOL

PyMOL's two-sided lighting feature is designed to provide a more realistic representation of molecular structures. By default, PyMOL uses one-sided lighting, which can sometimes make your models appear flat or lack depth. Two-sided lighting addresses this by casting light on both sides of your molecular surfaces, creating a more three-dimensional effect.

two lights that are on the side of a building in front of some grass and trees
two lights that are on the side of a building in front of some grass and trees

To illustrate the difference, consider a protein structure. With one-sided lighting, only the front face of the protein would be illuminated, potentially hiding important details on the back side. With two-sided lighting, both sides are lit, allowing you to see the full structure and its intricacies, such as pockets or cavities that might be crucial for drug discovery.

Enabling Two-Sided Lighting

two light fixtures mounted on the side of a white wall next to a door way
two light fixtures mounted on the side of a white wall next to a door way

Enabling two-sided lighting in PyMOL is a straightforward process. Here's how you can do it:

1. Open your molecular structure in PyMOL. You can load a PDB file, for instance, using the command `load pdb YourFile.pdb`.

2. To enable two-sided lighting, use the `set` command followed by `two_sided_lighting` and `on`. The command looks like this: `set two_sided_lighting, on`.

LUNELLE
LUNELLE

Customizing Two-Sided Lighting

PyMOL offers several customization options for two-sided lighting. You can adjust the intensity, color, and other properties of the light sources to achieve the desired effect. Here are a few examples:

To change the color of the light, use the `light` command followed by the color name or code. For instance, to change the light color to blue, you would use: `light blue`.

DUNLIN Up Down Light Raw Brass, Indoor
DUNLIN Up Down Light Raw Brass, Indoor

To adjust the intensity of the light, you can use the `light` command followed by the intensity value. For example, to set the intensity to 50%, you would use: `light 0.5`.

Best Practices for Using Two-Sided Lighting

two suspended lights are hanging from the ceiling in an empty room with gray walls and flooring
two suspended lights are hanging from the ceiling in an empty room with gray walls and flooring
LightsStory Series Geometric Wall Sconce | Triple Sloping Block Hand-Carved Natural Alabaster Stone, Matte Black and Brass finish for Modern Living Rooms and Hallways
LightsStory Series Geometric Wall Sconce | Triple Sloping Block Hand-Carved Natural Alabaster Stone, Matte Black and Brass finish for Modern Living Rooms and Hallways
three different colored lights hanging from the ceiling
three different colored lights hanging from the ceiling
three lights hanging from the ceiling in a room with white walls and ceilings, one light is
three lights hanging from the ceiling in a room with white walls and ceilings, one light is
Large Charlotte Perriand 'Applique À Volet Pivotant Double' Wall Light in White
Large Charlotte Perriand 'Applique À Volet Pivotant Double' Wall Light in White
Duo Pendant - Black
Duo Pendant - Black
Morandi Double-Headed Wall Lamp Red+Pink
Morandi Double-Headed Wall Lamp Red+Pink
two lights hanging from the ceiling in a room
two lights hanging from the ceiling in a room
there are two lights on the wall and one is shaped like a curved wave,
there are two lights on the wall and one is shaped like a curved wave,
a red light on a white wall in the shape of a doorknobl
a red light on a white wall in the shape of a doorknobl
Oxidized Brass Wall Light, Black Patina Wall Sconce,  Vintage Indoor Lightning Fixtures
Oxidized Brass Wall Light, Black Patina Wall Sconce, Vintage Indoor Lightning Fixtures
Christmas Sale | Hot Sale | Lighting
Christmas Sale | Hot Sale | Lighting
Lito Series - Good Design
Lito Series - Good Design
a tall brick building with two lights on it's side
a tall brick building with two lights on it's side
Applique a Volet Pivotant LED Wall Light by Nemo | AVP LWN 31 | NIL583164
Applique a Volet Pivotant LED Wall Light by Nemo | AVP LWN 31 | NIL583164
Wandlampen
Wandlampen
a wall mounted light on the side of a white wall
a wall mounted light on the side of a white wall
Gelule - Plug Lighting
Gelule - Plug Lighting
a person is holding onto a light that is attached to the side of a wall
a person is holding onto a light that is attached to the side of a wall

While two-sided lighting can greatly enhance your molecular visualizations, it's essential to use it judiciously. Here are some best practices to keep in mind:

1. **Balance realism and clarity**: Two-sided lighting can make your models look more realistic, but it can also make them more complex. Ensure that the added realism doesn't compromise the clarity of your visualizations.

2. **Consider your audience**: The level of detail and realism you should aim for depends on your audience. If you're presenting to a scientific audience, they might appreciate the added realism. However, if you're communicating with a non-scientific audience, simplicity and clarity might be more important.

Combining Two-Sided Lighting with Other Features

Two-sided lighting can be combined with other PyMOL features to create stunning visualizations. For instance, you can use it in conjunction with transparency, surface representation, or color schemes to highlight specific features of your molecular structures.

To create a semi-transparent surface with two-sided lighting, you can use the `show` command followed by `surface` and the desired color. Then, adjust the transparency using the `set` command followed by `surface_quality` and the desired value. For example: `show surface, blue; set surface_quality, 20`.

Optimizing Performance

While two-sided lighting can significantly improve the visual quality of your models, it can also increase the computational load. To optimize performance, you can adjust the level of detail in your models or use techniques like ray tracing to create high-quality visualizations without excessive computational costs.

To reduce the level of detail in your models, you can use the `set` command followed by `dot_solvent` and `on` to hide water molecules, or `set` followed by `stick_radius` and a smaller value to reduce the size of sticks.

In conclusion, PyMOL's two-sided lighting feature is a powerful tool for creating more realistic and visually appealing molecular visualizations. By understanding how to use and customize this feature, you can enhance your molecular models and communicate your scientific findings more effectively. So, go ahead, experiment with two-sided lighting, and let your molecular structures shine in all their glory!