diff options
author | Ulysse Martin <you.le@live.fr> | 2016-01-17 20:41:37 +0300 |
---|---|---|
committer | Thomas Szepe <HG1_public@gmx.net> | 2016-01-17 20:47:14 +0300 |
commit | c4c2bd1350a52e18f973bba7e52e929f94ff6496 (patch) | |
tree | cb0bba24307411a8a601373806b781d49d2343c3 /doc | |
parent | a5c419f4ccb19b0c01f3cbf5929f8a43bc503eff (diff) |
BGE: Allow access to light shadow settings with python
This patch adds a new API which allow us to access light shadow settings from python. The new API can be used to write custom GLSL materials with shadows.
Reviewers: brecht, kupoman, agoose77, panzergame, campbellbarton, moguri, hg1
Reviewed By: agoose77, panzergame, campbellbarton, moguri, hg1
Projects: #game_engine
Differential Revision: https://developer.blender.org/D1690
Diffstat (limited to 'doc')
-rw-r--r-- | doc/python_api/rst/bge_types/bge.types.KX_LightObject.rst | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/doc/python_api/rst/bge_types/bge.types.KX_LightObject.rst b/doc/python_api/rst/bge_types/bge.types.KX_LightObject.rst index 2b2bdf76b4f..f4d5b114372 100644 --- a/doc/python_api/rst/bge_types/bge.types.KX_LightObject.rst +++ b/doc/python_api/rst/bge_types/bge.types.KX_LightObject.rst @@ -48,6 +48,78 @@ base class --- :class:`KX_GameObject` :type: float + .. attribute:: shadowClipStart + + The shadowmap clip start, below which objects will not generate shadows. + + :type: float (read only) + + .. attribute:: shadowClipEnd + + The shadowmap clip end, beyond which objects will not generate shadows. + + :type: float (read only) + + ..attribute:: shadowFrustumSize + + Size of the frustum used for creating the shadowmap. + + :type: float (read only) + + ..attribute:: shadowBindId + + The OpenGL shadow texture bind number/id. + + :type: int (read only) + + ..attribute:: shadowMapType + + The shadow shadow map type (0 -> Simple; 1 -> Variance) + + :type: int (read only) + + ..attribute:: shadowBias + + The shadow buffer sampling bias. + + :type: float (read only) + + ..attribute:: shadowBleedBias + + The bias for reducing light-bleed on variance shadow maps. + + :type: float (read only) + + ..attribute:: useShadow + + Returns True if the light has Shadow option activated, else returns False. + + :type: boolean (read only) + + .. attribute:: shadowColor + + The color of this light shadows. Black = (0.0, 0.0, 0.0), White = (1.0, 1.0, 1.0). + + :type: :class:`mathutils.Color` (read only) + + .. attribute:: shadowMatrix + + Matrix that converts a vector in camera space to shadow buffer depth space. + + Computed as: + mat4_perspective_to_depth * mat4_lamp_to_perspective * mat4_world_to_lamp * mat4_cam_to_world. + + mat4_perspective_to_depth is a fixed matrix defined as follow: + + 0.5 0.0 0.0 0.5 + 0.0 0.5 0.0 0.5 + 0.0 0.0 0.5 0.5 + 0.0 0.0 0.0 1.0 + Note: + There is one matrix of that type per lamp casting shadow in the scene. + + :type: Matrix4x4 (read only) + .. attribute:: distance The maximum distance this light can illuminate. (SPOT and NORMAL lights only). |