Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2011-09-09 15:55:38 +0400
committerBenoit Bolsee <benoit.bolsee@online.be>2011-09-09 15:55:38 +0400
commit01744abd8187d1566b336bf38033673aa05b6786 (patch)
tree848742d2ce1be126a4b6381aecf03b6c2e9d93b4 /source/blender/python/intern/gpu.h
parent2b33c6b0b27c0a4fee5a1a405e012eb4032bba05 (diff)
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.
Diffstat (limited to 'source/blender/python/intern/gpu.h')
-rw-r--r--source/blender/python/intern/gpu.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/source/blender/python/intern/gpu.h b/source/blender/python/intern/gpu.h
new file mode 100644
index 00000000000..d604c7c6201
--- /dev/null
+++ b/source/blender/python/intern/gpu.h
@@ -0,0 +1,41 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This shader is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. The Blender
+ * Foundation also sells licenses for use in proprietary software under
+ * the Blender License. See http://www.blender.org/BL/ for information
+ * about this.
+ *
+ * This shader is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this shader; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2005 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Benoit Bolsee.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/python/intern/gpu.h
+ * \ingroup pythonintern
+ */
+
+/**
+ * Initalizes the gpu Python module.
+ */
+PyObject* GPU_initPython(void);
+