GPU: add gpu python module with export_shader() function to export GLSL shader.
authorBenoit Bolsee <benoit.bolsee@online.be>
Fri, 9 Sep 2011 11:55:38 +0000 (11:55 +0000)
committerBenoit Bolsee <benoit.bolsee@online.be>
Fri, 9 Sep 2011 11:55:38 +0000 (11:55 +0000)
commit01744abd8187d1566b336bf38033673aa05b6786
tree848742d2ce1be126a4b6381aecf03b6c2e9d93b4
parent2b33c6b0b27c0a4fee5a1a405e012eb4032bba05
GPU: add gpu python module with export_shader() function to export GLSL shader.

shader = gpu.export_shader(scene,material)

Returns the GLSL shader that blender generates to produce the visual effect
of material in scene for the purpose of reusing the shader in an external engine.
This function is meant to be used in a material exporter so that the GLSL
shader can be exported entirely. The return value is a dictionary containing the
shader source code and all associated data.

The full documentation is under sphinx.

Warning: there has been an API between the patch and this commit:
uniform['lamp'] and uniform['image'] now return python reference to
ID block instead of ID name as before. The X3D exporter that uses this
function must be adapted.
14 files changed:
doc/python_api/rst/gpu.rst [new file with mode: 0644]
source/blender/gpu/GPU_extensions.h
source/blender/gpu/GPU_material.h
source/blender/gpu/intern/gpu_codegen.c
source/blender/gpu/intern/gpu_codegen.h
source/blender/gpu/intern/gpu_extensions.c
source/blender/gpu/intern/gpu_material.c
source/blender/gpu/intern/gpu_shader_material.glsl
source/blender/gpu/intern/gpu_shader_material.glsl.c
source/blender/python/SConscript
source/blender/python/intern/CMakeLists.txt
source/blender/python/intern/bpy_interface.c
source/blender/python/intern/gpu.c [new file with mode: 0644]
source/blender/python/intern/gpu.h [new file with mode: 0644]