cigvis.vispynodes.shading_filter module#

class cigvis.vispynodes.shading_filter.HeadlightShadingFilter(shading='flat', ambient_coefficient=(1, 1, 1, 1), diffuse_coefficient=(1, 1, 1, 1), specular_coefficient=(1, 1, 1, 1), shininess=100, light_dir=(0, 0, 1), ambient_light=(1, 1, 1, 0.25), diffuse_light=(1, 1, 1, 0.7), specular_light=(1, 1, 1, 0.25), enabled=True)#

Bases: Filter

Apply shading to a MeshVisual using a camera-relative light source (headlamp style).

Key features: 1. The light source follows the camera (camera-relative lighting). 2. Supports screen-relative lighting offsets through light_dir. 3. Supports double-sided lighting, useful for thin structures such as seismic horizons.

Parameters#

shadingstr

‘flat’ or ‘smooth’.

light_dirtuple

Camera/screen-relative light direction (x, y, z). (0, 0, 1) means the light points straight into the screen. (10, 5, 10) means the light comes from the upper-right screen direction.

Other Parameters#

**kwargs

Other parameters match the original VisPy shading filter.

property ambient_coefficient#
property ambient_light#
property diffuse_coefficient#
property diffuse_light#
property enabled#

True to enable the filter, False to disable.

property light_dir#

The light direction relative to the camera (Document Space). Format: (x, y, z) Example: (0, 0, 1) points from eye to scene center.

on_mesh_data_updated(event)#
property shading#

The shading method.

property shininess#
property specular_coefficient#
property specular_light#