~ubuntu-branches/ubuntu/saucy/blender/saucy-proposed

« back to all changes in this revision

Viewing changes to doc/python_api/rst/bge_types/bge.types.BL_Shader.rst

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
BL_Shader(PyObjectPlus)
 
2
=======================
 
3
 
 
4
.. module:: bge.types
 
5
 
 
6
base class --- :class:`PyObjectPlus`
 
7
 
 
8
.. class:: BL_Shader(PyObjectPlus)
 
9
 
 
10
   BL_Shader GLSL shaders.
 
11
 
 
12
   TODO - Description
 
13
 
 
14
   .. method:: setUniformfv(name, fList)
 
15
 
 
16
      Set a uniform with a list of float values
 
17
 
 
18
      :arg name: the uniform name
 
19
      :type name: string
 
20
      :arg fList: a list (2, 3 or 4 elements) of float values
 
21
      :type fList: list[float]
 
22
 
 
23
   .. method:: delSource()
 
24
 
 
25
      Clear the shader. Use this method before the source is changed with :data:`setSource`.
 
26
 
 
27
   .. method:: getFragmentProg()
 
28
 
 
29
      Returns the fragment program.
 
30
 
 
31
      :return: The fragment program.
 
32
      :rtype: string
 
33
 
 
34
   .. method:: getVertexProg()
 
35
 
 
36
      Get the vertex program.
 
37
 
 
38
      :return: The vertex program.
 
39
      :rtype: string
 
40
 
 
41
   .. method:: isValid()
 
42
 
 
43
      Check if the shader is valid.
 
44
 
 
45
      :return: True if the shader is valid
 
46
      :rtype: boolean
 
47
 
 
48
   .. method:: setAttrib(enum)
 
49
 
 
50
      Set attribute location. (The parameter is ignored a.t.m. and the value of "tangent" is always used.)
 
51
 
 
52
      :arg enum: attribute location value
 
53
      :type enum: integer
 
54
 
 
55
   .. method:: setNumberOfPasses( max_pass )
 
56
 
 
57
      Set the maximum number of passes. Not used a.t.m.
 
58
 
 
59
      :arg max_pass: the maximum number of passes
 
60
      :type max_pass: integer
 
61
 
 
62
   .. method:: setSampler(name, index)
 
63
 
 
64
      Set uniform texture sample index.
 
65
 
 
66
      :arg name: Uniform name
 
67
      :type name: string
 
68
      :arg index: Texture sample index.
 
69
      :type index: integer
 
70
 
 
71
   .. method:: setSource(vertexProgram, fragmentProgram)
 
72
 
 
73
      Set the vertex and fragment programs
 
74
 
 
75
      :arg vertexProgram: Vertex program
 
76
      :type vertexProgram: string
 
77
      :arg fragmentProgram: Fragment program
 
78
      :type fragmentProgram: string
 
79
 
 
80
   .. method:: setUniform1f(name, fx)
 
81
 
 
82
      Set a uniform with 1 float value.
 
83
 
 
84
      :arg name: the uniform name
 
85
      :type name: string
 
86
      :arg fx: Uniform value
 
87
      :type fx: float
 
88
 
 
89
   .. method:: setUniform1i(name, ix)
 
90
 
 
91
      Set a uniform with an integer value.
 
92
 
 
93
      :arg name: the uniform name
 
94
      :type name: string
 
95
      :arg ix: the uniform value
 
96
      :type ix: integer
 
97
 
 
98
   .. method:: setUniform2f(name, fx, fy)
 
99
 
 
100
      Set a uniform with 2 float values
 
101
 
 
102
      :arg name: the uniform name
 
103
      :type name: string
 
104
      :arg fx: first float value
 
105
      :type fx: float
 
106
 
 
107
      :arg fy: second float value
 
108
      :type fy: float
 
109
 
 
110
   .. method:: setUniform2i(name, ix, iy)
 
111
 
 
112
      Set a uniform with 2 integer values
 
113
 
 
114
      :arg name: the uniform name
 
115
      :type name: string
 
116
      :arg ix: first integer value
 
117
      :type ix: integer
 
118
      :arg iy: second integer value
 
119
      :type iy: integer
 
120
 
 
121
   .. method:: setUniform3f(name, fx, fy, fz)
 
122
 
 
123
      Set a uniform with 3 float values.
 
124
 
 
125
      :arg name: the uniform name
 
126
      :type name: string
 
127
      :arg fx: first float value
 
128
      :type fx: float
 
129
      :arg fy: second float value
 
130
      :type fy: float
 
131
      :arg fz: third float value
 
132
      :type fz: float
 
133
 
 
134
   .. method:: setUniform3i(name, ix, iy, iz)
 
135
 
 
136
      Set a uniform with 3 integer values
 
137
 
 
138
      :arg name: the uniform name
 
139
      :type name: string
 
140
      :arg ix: first integer value
 
141
      :type ix: integer
 
142
      :arg iy: second integer value
 
143
      :type iy: integer
 
144
      :arg iz: third integer value
 
145
      :type iz: integer
 
146
 
 
147
   .. method:: setUniform4f(name, fx, fy, fz, fw)
 
148
 
 
149
      Set a uniform with 4 float values.
 
150
 
 
151
      :arg name: the uniform name
 
152
      :type name: string
 
153
      :arg fx: first float value
 
154
      :type fx: float
 
155
      :arg fy: second float value
 
156
      :type fy: float
 
157
      :arg fz: third float value
 
158
      :type fz: float
 
159
      :arg fw: fourth float value
 
160
      :type fw: float
 
161
 
 
162
   .. method:: setUniform4i(name, ix, iy, iz, iw)
 
163
 
 
164
      Set a uniform with 4 integer values
 
165
 
 
166
      :arg name: the uniform name
 
167
      :type name: string
 
168
      :arg ix: first integer value
 
169
      :type ix: integer
 
170
      :arg iy: second integer value
 
171
      :type iy: integer
 
172
      :arg iz: third integer value
 
173
      :type iz: integer
 
174
      :arg iw: fourth integer value
 
175
      :type iw: integer
 
176
 
 
177
   .. method:: setUniformDef(name, type)
 
178
 
 
179
      Define a new uniform
 
180
 
 
181
      :arg name: the uniform name
 
182
      :type name: string
 
183
      :arg type: uniform type
 
184
      :type type: UNI_NONE, UNI_INT, UNI_FLOAT, UNI_INT2, UNI_FLOAT2, UNI_INT3, UNI_FLOAT3, UNI_INT4, UNI_FLOAT4, UNI_MAT3, UNI_MAT4, UNI_MAX
 
185
 
 
186
   .. method:: setUniformMatrix3(name, mat, transpose)
 
187
 
 
188
      Set a uniform with a 3x3 matrix value
 
189
 
 
190
      :arg name: the uniform name
 
191
      :type name: string
 
192
      :arg mat: A 3x3 matrix [[f, f, f], [f, f, f], [f, f, f]]
 
193
      :type mat: 3x3 matrix
 
194
      :arg transpose: set to True to transpose the matrix
 
195
      :type transpose: boolean
 
196
 
 
197
   .. method:: setUniformMatrix4(name, mat, transpose)
 
198
 
 
199
      Set a uniform with a 4x4 matrix value
 
200
 
 
201
      :arg name: the uniform name
 
202
      :type name: string
 
203
      :arg mat: A 4x4 matrix [[f, f, f, f], [f, f, f, f], [f, f, f, f], [f, f, f, f]]
 
204
      :type mat: 4x4 matrix
 
205
      :arg transpose: set to True to transpose the matrix
 
206
      :type transpose: boolean
 
207
 
 
208
   .. method:: setUniformiv(name, iList)
 
209
 
 
210
      Set a uniform with a list of integer values
 
211
 
 
212
      :arg name: the uniform name
 
213
      :type name: string
 
214
      :arg iList: a list (2, 3 or 4 elements) of integer values
 
215
      :type iList: list[integer]
 
216
 
 
217
   .. method:: validate()
 
218
 
 
219
      Validate the shader object.
 
220