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
path: root/doc
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2016-06-10 01:28:19 +0300
committerBenoit Bolsee <benoit.bolsee@online.be>2016-06-11 23:24:18 +0300
commitc0bf881ebfa93784946ee3d03ccf15122c1b74c3 (patch)
tree5a3f2e87a27ea5837913d684b2bae113226025d2 /doc
parentfa9bb2ffe97334a5c686b954673af118c41d1a6d (diff)
BL_Shader.setUniformEyef(name)
defines a uniform that reflects the eye being rendered in stereo mode: 0.0 for the left eye, 0.5 for the right eye. In non stereo mode, the value of the uniform is fixed to 0.0. The typical use of this uniform is in stereo mode to sample stereo textures containing the left and right eye images in a top-bottom order. python: shader = obj.meshes[0].materials[mat].getShader() shader.setUniformEyef("eye") shader: uniform float eye; uniform sampler2D tex; void main(void) { vec4 color; float ty, tx; tx = gl_TexCoord[0].x; ty = eye+gl_TexCoord[0].y*0.5; // ty will be between 0 and 0.5 for the left eye render // and 0.5 and 1.0 for the right eye render. color = texture(tex, vec2(tx, ty)); ... }
Diffstat (limited to 'doc')
-rw-r--r--doc/python_api/rst/bge_types/bge.types.BL_Shader.rst10
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/python_api/rst/bge_types/bge.types.BL_Shader.rst b/doc/python_api/rst/bge_types/bge.types.BL_Shader.rst
index f4f5c0d62ba..a389f68ee04 100644
--- a/doc/python_api/rst/bge_types/bge.types.BL_Shader.rst
+++ b/doc/python_api/rst/bge_types/bge.types.BL_Shader.rst
@@ -214,6 +214,16 @@ base class --- :class:`PyObjectPlus`
:arg iList: a list (2, 3 or 4 elements) of integer values
:type iList: list[integer]
+ .. method:: setUniformEyef(name)
+
+ Set a uniform with a float value that reflects the eye being render in stereo mode:
+ 0.0 for the left eye, 0.5 for the right eye. In non stereo mode, the value of the uniform
+ is fixed to 0.0. The typical use of this uniform is in stereo mode to sample stereo textures
+ containing the left and right eye images in a top-bottom order.
+
+ :arg name: the uniform name
+ :type name: string
+
.. method:: validate()
Validate the shader object.