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

BL_Shader.py « PyDoc « gameengine « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8fd4ae7c7ac4e16b7d8b5b81f1935adc41083019 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248

from PyObjectPlus import *

class BL_Shader(PyObjectPlus):
	"""
	BL_Shader GLSL shaders.
	
	TODO - Description
	"""
	
	def setUniformfv(name, fList):
		"""
		Set a uniform with a list of float values
		
		@param name: the uniform name
		@type name: string
		
		@param fList: a list (2, 3 or 4 elements) of float values
		@type fList: list[float]
		"""

	def delSource():
		"""
		TODO - Description

		"""
	def getFragmentProg():
		"""
		Returns the fragment program.
		
		@rtype: string
		@return: The fragment program.
		"""
	def getVertexProg():
		"""
		Get the vertex program.
		
		@rtype: string
		@return: The vertex program.
		"""
	def isValid():
		"""
		Check if the shader is valid.

		@rtype: bool
		@return: True if the shader is valid
		"""
	def setAttrib(enum):
		"""
		Set attribute location. (The parameter is ignored a.t.m. and the value of "tangent" is always used.)
		
		@param enum: attribute location value
		@type enum: integer
		"""
	def setNumberOfPasses( max_pass ):
		"""
		Set the maximum number of passes. Not used a.t.m.
		
		@param max_pass: the maximum number of passes
		@type max_pass: integer
		"""
	def setSampler(name, index):
		"""
		Set uniform texture sample index.
		
		@param name: Uniform name
		@type name: string

		@param index: Texture sample index.
		@type index: integer
		"""
	def setSource(vertexProgram, fragmentProgram):
		"""
		Set the vertex and fragment programs
		
		@param vertexProgram: Vertex program
		@type vertexProgram: string

		@param fragmentProgram: Fragment program
		@type fragmentProgram: string
		"""
	def setUniform1f(name, fx):
		"""
		Set a uniform with 1 float value.
		
		@param name: the uniform name
		@type name: string
		
		@param fx: Uniform value
		@type fx: float
		"""
	def setUniform1i(name, ix):
		"""
		Set a uniform with an integer value.
		
		@param name: the uniform name
		@type name: string

		@param ix: the uniform value
		@type ix: integer
		"""
	def setUniform2f(name, fx, fy):
		"""
		Set a uniform with 2 float values
		
		@param name: the uniform name
		@type name: string

		@param fx: first float value
		@type fx: float
		
		@param fy: second float value
		@type fy: float
		"""
	def setUniform2i(name, ix, iy):
		"""
		Set a uniform with 2 integer values
		
		@param name: the uniform name
		@type name: string

		@param ix: first integer value
		@type ix: integer
		
		@param iy: second integer value
		@type iy: integer
		"""
	def setUniform3f(name, fx,fy,fz):
		"""
		Set a uniform with 3 float values.
		
		@param name: the uniform name
		@type name: string

		@param fx: first float value
		@type fx: float
		
		@param fy: second float value
		@type fy: float

		@param fz: third float value
		@type fz: float
		"""
	def setUniform3i(name, ix,iy,iz):
		"""
		Set a uniform with 3 integer values
		
		@param name: the uniform name
		@type name: string

		@param ix: first integer value
		@type ix: integer
		
		@param iy: second integer value
		@type iy: integer
		
		@param iz: third integer value
		@type iz: integer
		"""
	def setUniform4f(name, fx,fy,fz,fw):
		"""
		Set a uniform with 4 float values.
		
		@param name: the uniform name
		@type name: string

		@param fx: first float value
		@type fx: float
		
		@param fy: second float value
		@type fy: float

		@param fz: third float value
		@type fz: float

		@param fw: fourth float value
		@type fw: float
		"""
	def setUniform4i(name, ix,iy,iz, iw):
		"""
		Set a uniform with 4 integer values
		
		@param name: the uniform name
		@type name: string

		@param ix: first integer value
		@type ix: integer
		
		@param iy: second integer value
		@type iy: integer
		
		@param iz: third integer value
		@type iz: integer
		
		@param iw: fourth integer value
		@type iw: integer
		"""
	def setUniformDef(name, type):
		"""
		Define a new uniform
		
		@param name: the uniform name
		@type name: string

		@param type: uniform type
		@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
		"""
	def setUniformMatrix3(name, mat, transpose):
		"""
		Set a uniform with a 3x3 matrix value
		
		@param name: the uniform name
		@type name: string

		@param mat: A 3x3 matrix [[f,f,f], [f,f,f], [f,f,f]]
		@type mat: 3x3 matrix
		
		@param transpose: set to True to transpose the matrix
		@type transpose: bool
		"""
	def setUniformMatrix4(name, mat, transpose):
		"""
		Set a uniform with a 4x4 matrix value
		
		@param name: the uniform name
		@type name: string

		@param mat: A 4x4 matrix [[f,f,f,f], [f,f,f,f], [f,f,f,f], [f,f,f,f]]
		@type mat: 4x4 matrix
		
		@param transpose: set to True to transpose the matrix
		@type transpose: bool
		"""
	def setUniformiv(name, iList):
		"""
		Set a uniform with a list of integer values
		
		@param name: the uniform name
		@type name: string
		
		@param iList: a list (2, 3 or 4 elements) of integer values
		@type iList: list[integer]
		"""
	def validate():
		"""
		Validate the shader object.
		
		"""