picogl.backend.gl.lighting ========================== .. py:module:: picogl.backend.gl.lighting .. autoapi-nested-parse:: Fixed-function lighting value objects, presets, and drivers. Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/picogl/backend/gl/lighting/driver/index /autoapi/picogl/backend/gl/lighting/light/index /autoapi/picogl/backend/gl/lighting/presets/index /autoapi/picogl/backend/gl/lighting/system/index Attributes ---------- .. autoapisummary:: picogl.backend.gl.lighting.CAMERA_FIXED_LIGHTING picogl.backend.gl.lighting.CAMERA_ORIGIN_LIGHT picogl.backend.gl.lighting.CAMERA_ORIGIN_LIGHTING picogl.backend.gl.lighting.EYE_SPACE_LIGHTING picogl.backend.gl.lighting.LEGACY_EYE_LIGHT picogl.backend.gl.lighting.LIGHTING_PRESETS picogl.backend.gl.lighting.SECONDARY_LIGHTS picogl.backend.gl.lighting.WORLD_LIGHT picogl.backend.gl.lighting.WORLD_SPACE_LIGHTING Classes ------- .. autoapisummary:: picogl.backend.gl.lighting.GLLightingMode picogl.backend.gl.lighting.LightSource picogl.backend.gl.lighting.GLLightingSystem Functions --------- .. autoapisummary:: picogl.backend.gl.lighting.apply_light picogl.backend.gl.lighting.disable_light picogl.backend.gl.lighting.enable_light picogl.backend.gl.lighting.set_secondary_lights Package Contents ---------------- .. py:function:: apply_light(capability: picogl.backend.gl.capability.GLFixedFunctionCapability, light: picogl.backend.gl.lighting.light.LightSource) -> None Apply position and colour terms for a light source. .. py:function:: disable_light(capability: picogl.backend.gl.capability.GLFixedFunctionCapability) -> None Disable a fixed-function light capability. .. py:function:: enable_light(capability: picogl.backend.gl.capability.GLFixedFunctionCapability, light: picogl.backend.gl.lighting.light.LightSource | None = None) -> None Enable a light capability and optionally apply its parameters. .. py:class:: GLLightingMode Bases: :py:obj:`enum.Enum` GL Lighting mode .. py:attribute:: EYE_SPACE :value: 0 .. py:attribute:: CAMERA_FIXED :value: 1 .. py:attribute:: CAMERA_ORIGIN :value: 2 .. py:attribute:: WORLD_SPACE :value: 3 .. py:class:: LightSource Light Source Accidental construction of ``LightSource()`` produces a soft white directional light suitable for general rendering. .. py:attribute:: position :type: picogl.core.vec4.Vec4 .. py:attribute:: ambient :type: picogl.core.rgbcolor.RGBAColor .. py:attribute:: diffuse :type: picogl.core.rgbcolor.RGBAColor .. py:attribute:: specular :type: picogl.core.rgbcolor.RGBAColor .. py:method:: directional(direction: molib.pdb.materials.Vec3) -> LightSource :classmethod: .. py:method:: from_raw(position: picogl.core.data_type.vec4_tuple, ambient: picogl.core.data_type.rgba_tuple, diffuse: picogl.core.data_type.rgba_tuple, specular: picogl.core.data_type.rgba_tuple) -> LightSource :classmethod: .. py:method:: apply(light) apply the lighting .. py:data:: CAMERA_FIXED_LIGHTING .. py:data:: CAMERA_ORIGIN_LIGHT .. py:data:: CAMERA_ORIGIN_LIGHTING .. py:data:: EYE_SPACE_LIGHTING .. py:data:: LEGACY_EYE_LIGHT .. py:data:: LIGHTING_PRESETS :type: dict[picogl.backend.gl.lighting.light.GLLightingMode, picogl.backend.gl.lighting.system.GLLightingSystem] .. py:data:: SECONDARY_LIGHTS :type: dict[picogl.backend.gl.capability.GLFixedFunctionCapability, picogl.backend.gl.lighting.light.LightSource] .. py:data:: WORLD_LIGHT .. py:data:: WORLD_SPACE_LIGHTING .. py:function:: set_secondary_lights(enabled: bool) -> None Enable or disable the soft secondary fill lights. .. py:class:: GLLightingSystem Configuration for fixed-function lighting state. .. py:attribute:: mode :type: picogl.backend.gl.lighting.light.GLLightingMode .. py:attribute:: ambient :type: picogl.core.rgbcolor.RGBAColor .. py:attribute:: lights :type: dict[picogl.backend.gl.capability.GLFixedFunctionCapability, picogl.backend.gl.lighting.light.LightSource] .. py:attribute:: material_shininess :type: float | None :value: None .. py:attribute:: set_unpack_alignment :type: bool :value: False .. py:method:: apply() -> None Install this lighting configuration into the current GL context. .. py:method:: _enable_lights() -> None