[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43999] trunk/blender/doc/python_api/rst/ gpu.rst: Style cleanup of gpu rst file.
Campbell Barton
ideasman42 at gmail.com
Thu Feb 9 07:39:08 CET 2012
Revision: 43999
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43999
Author: campbellbarton
Date: 2012-02-09 06:38:54 +0000 (Thu, 09 Feb 2012)
Log Message:
-----------
Style cleanup of gpu rst file.
Modified Paths:
--------------
trunk/blender/doc/python_api/rst/gpu.rst
Modified: trunk/blender/doc/python_api/rst/gpu.rst
===================================================================
--- trunk/blender/doc/python_api/rst/gpu.rst 2012-02-09 03:16:21 UTC (rev 43998)
+++ trunk/blender/doc/python_api/rst/gpu.rst 2012-02-09 06:38:54 UTC (rev 43999)
@@ -1,13 +1,14 @@
+*******************
GPU functions (gpu)
-===================
+*******************
.. module:: gpu
This module provides access to materials GLSL shaders.
-*****
+
Intro
-*****
+=====
Module to provide functions concerning the GPU implementation in Blender, in particular
the GLSL shaders that blender generates automatically to render materials in the 3D view
@@ -15,16 +16,15 @@
.. warning::
- The API provided by this module should be consider unstable. The data exposed by the API
- are are closely related to Blender's internal GLSL code and may change if the GLSL code
- is modified (e.g. new uniform type).
+ The API provided by this module should be consider unstable. The data exposed by the API
+ are are closely related to Blender's internal GLSL code and may change if the GLSL code
+ is modified (e.g. new uniform type).
-*********
Constants
-*********
+=========
---------------
+
GLSL data type
--------------
@@ -59,15 +59,15 @@
.. data:: GPU_DATA_3F
three floats
-
+
:value: 4
-
+
.. data:: GPU_DATA_4F
four floats
-
+
:value: 5
-
+
.. data:: GPU_DATA_9F
matrix 3x3 in column-major order
@@ -86,448 +86,450 @@
:value: 8
------------------
+
GLSL uniform type
-----------------
.. _uniform-type:
-Constants that specify the type of uniform used in a GLSL shader.
+Constants that specify the type of uniform used in a GLSL shader.
The uniform type determines the data type, origin and method
-of calculation used by Blender to compute the uniform value.
+of calculation used by Blender to compute the uniform value.
The calculation of some of the uniforms is based on matrices available in the scene:
- .. _mat4_cam_to_world:
- .. _mat4_world_to_cam:
+ .. _mat4_cam_to_world:
+ .. _mat4_world_to_cam:
- *mat4_cam_to_world*
- Model matrix of the camera. OpenGL 4x4 matrix that converts
- camera local coordinates to world coordinates. In blender this is obtained from the
- 'matrix_world' attribute of the camera object.
+ *mat4_cam_to_world*
+ Model matrix of the camera. OpenGL 4x4 matrix that converts
+ camera local coordinates to world coordinates. In blender this is obtained from the
+ 'matrix_world' attribute of the camera object.
- Some uniform will need the *mat4_world_to_cam*
- matrix computed as the inverse of this matrix.
+ Some uniform will need the *mat4_world_to_cam*
+ matrix computed as the inverse of this matrix.
- .. _mat4_object_to_world:
- .. _mat4_world_to_object:
+ .. _mat4_object_to_world:
+ .. _mat4_world_to_object:
- *mat4_object_to_world*
- Model matrix of the object that is being rendered. OpenGL 4x4 matric that converts
- object local coordinates to world coordinates. In blender this is obtained from the
- 'matrix_world' attribute of the object.
-
- Some uniform will need the *mat4_world_to_object* matrix, computed as the inverse of this matrix.
-
- .. _mat4_lamp_to_world:
- .. _mat4_world_to_lamp:
+ *mat4_object_to_world*
+ Model matrix of the object that is being rendered. OpenGL 4x4 matric that converts
+ object local coordinates to world coordinates. In blender this is obtained from the
+ 'matrix_world' attribute of the object.
- *mat4_lamp_to_world*
- Model matrix of the lamp lighting the object. OpenGL 4x4 matrix that converts lamp
- local coordinates to world coordinates. In blender this is obtained from the
- 'matrix_world' attribute of the lamp object.
-
- Some uniform will need the *mat4_world_to_lamp* matrix
- computed as the inverse of this matrix.
+ Some uniform will need the *mat4_world_to_object* matrix, computed as the inverse of this matrix.
+ .. _mat4_lamp_to_world:
+ .. _mat4_world_to_lamp:
+
+ *mat4_lamp_to_world*
+ Model matrix of the lamp lighting the object. OpenGL 4x4 matrix that converts lamp
+ local coordinates to world coordinates. In blender this is obtained from the
+ 'matrix_world' attribute of the lamp object.
+
+ Some uniform will need the *mat4_world_to_lamp* matrix
+ computed as the inverse of this matrix.
+
.. data:: GPU_DYNAMIC_OBJECT_VIEWMAT
- The uniform is a 4x4 GL matrix that converts world coordinates to
- camera coordinates (see mat4_world_to_cam_). Can be set once per frame.
- There is at most one uniform of that type per shader.
+ The uniform is a 4x4 GL matrix that converts world coordinates to
+ camera coordinates (see mat4_world_to_cam_). Can be set once per frame.
+ There is at most one uniform of that type per shader.
- :value: 1
+ :value: 1
.. data:: GPU_DYNAMIC_OBJECT_MAT
- The uniform is a 4x4 GL matrix that converts object coordinates
- to world coordinates (see mat4_object_to_world_). Must be set before drawing the object.
- There is at most one uniform of that type per shader.
+ The uniform is a 4x4 GL matrix that converts object coordinates
+ to world coordinates (see mat4_object_to_world_). Must be set before drawing the object.
+ There is at most one uniform of that type per shader.
- :value: 2
+ :value: 2
.. data:: GPU_DYNAMIC_OBJECT_VIEWIMAT
- The uniform is a 4x4 GL matrix that converts coordinates
- in camera space to world coordinates (see mat4_cam_to_world_).
- Can be set once per frame.
- There is at most one uniform of that type per shader.
+ The uniform is a 4x4 GL matrix that converts coordinates
+ in camera space to world coordinates (see mat4_cam_to_world_).
+ Can be set once per frame.
+ There is at most one uniform of that type per shader.
- :value: 3
+ :value: 3
.. data:: GPU_DYNAMIC_OBJECT_IMAT
- The uniform is a 4x4 GL matrix that converts world coodinates
- to object coordinates (see mat4_world_to_object_).
- Must be set before drawing the object.
- There is at most one uniform of that type per shader.
-
- :value: 4
-
+ The uniform is a 4x4 GL matrix that converts world coodinates
+ to object coordinates (see mat4_world_to_object_).
+ Must be set before drawing the object.
+ There is at most one uniform of that type per shader.
+
+ :value: 4
+
.. data:: GPU_DYNAMIC_OBJECT_COLOR
- The uniform is a vector of 4 float representing a RGB color + alpha defined at object level.
- Each values between 0.0 and 1.0. In blender it corresponds to the 'color' attribute of the object.
- Must be set before drawing the object.
- There is at most one uniform of that type per shader.
-
- :value: 5
-
+ The uniform is a vector of 4 float representing a RGB color + alpha defined at object level.
+ Each values between 0.0 and 1.0. In blender it corresponds to the 'color' attribute of the object.
+ Must be set before drawing the object.
+ There is at most one uniform of that type per shader.
+
+ :value: 5
+
.. data:: GPU_DYNAMIC_LAMP_DYNVEC
- The uniform is a vector of 3 float representing the direction of light in camera space.
- In Blender, this is computed by
+ The uniform is a vector of 3 float representing the direction of light in camera space.
+ In Blender, this is computed by
- mat4_world_to_cam_ * (-vec3_lamp_Z_axis)
+ mat4_world_to_cam_ * (-vec3_lamp_Z_axis)
- as the lamp Z axis points to the opposite direction of light.
- The norm of the vector should be unity. Can be set once per frame.
- There is one uniform of that type per lamp lighting the material.
+ as the lamp Z axis points to the opposite direction of light.
+ The norm of the vector should be unity. Can be set once per frame.
+ There is one uniform of that type per lamp lighting the material.
- :value: 6
-
+ :value: 6
+
.. data:: GPU_DYNAMIC_LAMP_DYNCO
- The uniform is a vector of 3 float representing the position of the light in camera space.
- Computed as
-
- mat4_world_to_cam_ * vec3_lamp_pos
+ The uniform is a vector of 3 float representing the position of the light in camera space.
+ Computed as
- Can be set once per frame.
- There is one uniform of that type per lamp lighting the material.
-
- :value: 7
-
+ mat4_world_to_cam_ * vec3_lamp_pos
+
+ Can be set once per frame.
+ There is one uniform of that type per lamp lighting the material.
+
+ :value: 7
+
.. data:: GPU_DYNAMIC_LAMP_DYNIMAT
- The uniform is a 4x4 GL matrix that converts vector in camera space to lamp space.
- Computed as
+ The uniform is a 4x4 GL matrix that converts vector in camera space to lamp space.
+ Computed as
- mat4_world_to_lamp_ * mat4_cam_to_world_
+ mat4_world_to_lamp_ * mat4_cam_to_world_
- Can be set once per frame.
- There is one uniform of that type per lamp lighting the material.
+ Can be set once per frame.
+ There is one uniform of that type per lamp lighting the material.
- :value: 8
+ :value: 8
.. data:: GPU_DYNAMIC_LAMP_DYNPERSMAT
- The uniform is a 4x4 GL matrix that converts a vector in camera space to shadow buffer depth space.
- Computed as
+ The uniform is a 4x4 GL 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_ * mat4_lamp_to_perspective_ * mat4_world_to_lamp_ * mat4_cam_to_world_.
- .. _mat4_perspective_to_depth:
+ .. _mat4_perspective_to_depth:
- *mat4_perspective_to_depth* is a fixed matrix defined as follow::
+ *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
+ 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
- This uniform can be set once per frame. There is one uniform of that type per lamp casting shadow in the scene.
+ This uniform can be set once per frame. There is one uniform of that type per lamp casting shadow in the scene.
- :value: 9
+ :value: 9
.. data:: GPU_DYNAMIC_LAMP_DYNENERGY
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list