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 /source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLLight.cpp | |
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 'source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLLight.cpp')
-rw-r--r-- | source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLLight.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLLight.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLLight.cpp index 8319b75331f..beb2d67f9f5 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLLight.cpp +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLLight.cpp @@ -177,6 +177,26 @@ bool RAS_OpenGLLight::HasShadowBuffer() return false; } +int RAS_OpenGLLight::GetShadowBindCode() +{ + GPULamp *lamp; + + if ((lamp = GetGPULamp())) + return GPU_lamp_shadow_bind_code(lamp); + return -1; +} + +MT_Matrix4x4 RAS_OpenGLLight::GetShadowMatrix() +{ + GPULamp *lamp; + + if ((lamp = GetGPULamp())) + return MT_Matrix4x4(GPU_lamp_dynpersmat(lamp)); + MT_Matrix4x4 mat; + mat.setIdentity(); + return mat; +} + int RAS_OpenGLLight::GetShadowLayer() { GPULamp *lamp; |