osg.Uniform¶
-
class
osg.
Uniform
¶ Represents: c++ class Wraps: osg::Uniform Bases: osg.Object
osg.Uniform
encapsulatesglUniform
(https://www.khronos.org/registry/OpenGL-Refpages/es2.0/xhtml/glUniform.xml) values. For convenience and visibility in Lua there are a number of setters and getters kind ofset<VaueType><Dimension>
andget<VaueType><Dimension>
(e.g.osg.Uniform.setInt2()
andosg.Uniform.getInt2()
) for setting and geting values of corresspondingosg.Uniform
object. Static functions for creating anosg.Uniform
of specified type are also provided and has signatureosg.Uniform.<ValueType><Dimension>
(e.g.osg.Uniform.Vec2d()
).Constructors:
-
osg.
Uniform
()¶
-
osg.
Uniform
(osg.Uniform.Type type, std.string name, int numElements) -
Параметры: - type (osg.Uniform.Type) –
- name (std.string) –
- numElements (int) –
-
osg.
Uniform
(osg.Uniform.Type type, std.string name) -
Параметры: - type (osg.Uniform.Type) –
- name (std.string) –
Methods:
-
:
setType
(osg.Uniform.Type type)¶ Set the type of glUniform, ensuring it is only set once.
Параметры: type (osg.Uniform.Type) –
-
:
getType
()¶ Get the type of glUniform as enum.
Тип результата: osg.Uniform.Type
-
:
setNumElements
(int num)¶ Set the length of a uniform, ensuring it is only set once (1 == scalar).
Параметры: num (int) –
-
:
getNumElements
()¶ Get the number of GLSL elements of the
osg.Uniform
(1 == scalar).Тип результата: int
-
:
setFloat
(double v)¶ -
Параметры: v (double) –
-
:
setDouble
(double v)¶ -
Параметры: v (double) –
-
:
setInt
(int v)¶ -
Параметры: v (int) –
-
:
setInt2
(int v1, int v2)¶ -
Параметры: - v1 (int) –
- v2 (int) –
-
:
setInt3
(int v1, int v2, int v3)¶ -
Параметры: - v1 (int) –
- v2 (int) –
- v3 (int) –
-
:
setInt4
(int v1, int v2, int v3, int v4)¶ -
Параметры: - v1 (int) –
- v2 (int) –
- v3 (int) –
- v4 (int) –
-
:
setUnsigned
(unsigned v)¶ -
Параметры: v (unsigned) –
-
:
setUnsigned2
(unsigned v1, unsigned v2)¶ -
Параметры: - v1 (unsigned) –
- v2 (unsigned) –
-
:
setUnsigned3
(unsigned v1, unsigned v2, unsigned v3)¶ -
Параметры: - v1 (unsigned) –
- v2 (unsigned) –
- v3 (unsigned) –
-
:
setUnsigned4
(unsigned v1, unsigned v2, unsigned v3, unsigned v4)¶ -
Параметры: - v1 (unsigned) –
- v2 (unsigned) –
- v3 (unsigned) –
- v4 (unsigned) –
-
:
setBool
(bool v)¶ -
Параметры: v (bool) –
-
:
setBool2
(bool v1, bool v2)¶ -
Параметры: - v1 (bool) –
- v2 (bool) –
-
:
setBool3
(bool v1, bool v2, bool v3)¶ -
Параметры: - v1 (bool) –
- v2 (bool) –
- v3 (bool) –
-
:
setBool4
(bool v1, bool v2, bool v3, bool v4)¶ -
Параметры: - v1 (bool) –
- v2 (bool) –
- v3 (bool) –
- v4 (bool) –
-
:
setMatrix
(osg.Matrix v)¶ -
Параметры: v (osg.Matrix) –
-
:
setMatrix2
(osg.Matrix2 v)¶ -
Параметры: v (osg.Matrix2) –
-
:
setMatrix3
(osg.Matrix3 v)¶ -
Параметры: v (osg.Matrix3) –
-
:
getFloat
()¶
-
:
getDouble
()¶
-
:
getInt
()¶
-
:
getInt2
()¶
-
:
getInt3
()¶
-
:
getInt4
()¶
-
:
getUnsigned
()¶
-
:
getUnsigned2
()¶
-
:
getUnsigned3
()¶
-
:
getUnsigned4
()¶
-
:
getBool
()¶
-
:
getBool2
()¶
-
:
getBool3
()¶
-
:
getBool4
()¶
-
:
getVec2f
()¶
-
:
getVec2d
()¶
-
:
getVec3f
()¶
-
:
getVec3d
()¶
-
:
getVec4f
()¶
-
:
getVec4d
()¶
-
:
getMatrix
()¶
-
:
getMatrix2
()¶
-
:
getMatrix3
()¶
Static Methods:
-
.
getTypename
(osg.Uniform.Type type)¶ Return the name of a
osg.Uniform.Type
enum as string.Параметры: type (osg.Uniform.Type) – Тип результата: std.string
-
.
getTypeId
(std.string name)¶ Return the
osg.Uniform.Type
enum of aosg.Uniform
typename string.Параметры: name (std.string) – Тип результата: osg.Uniform.Type
-
.
getGlApiType
(osg.Uniform.Type type)¶ Return the GL API type corresponding to a GLSL type
Параметры: type (osg.Uniform.Type) – Тип результата: osg.Uniform.Type
-
.
getInternalArrayType
(osg.Uniform.Type type)¶ Return the internal data array type corresponding to a GLSL type
Параметры: type (osg.Uniform.Type) – Тип результата: GLenum.Value
-
.
Float
(std.string name, double v)¶ -
Параметры: - name (std.string) –
- v (double) –
Тип результата:
-
.
Double
(std.string name, double v)¶ -
Параметры: - name (std.string) –
- v (double) –
Тип результата:
-
.
Int
(std.string name, int v)¶ -
Параметры: - name (std.string) –
- v (int) –
Тип результата:
-
.
Unsigned
(std.string name, unsigned v)¶ -
Параметры: - name (std.string) –
- v (unsigned) –
Тип результата:
-
.
Bool
(std.string name, bool v)¶ -
Параметры: - name (std.string) –
- v (bool) –
Тип результата:
-
.
Vec2f
(std.string name, osg.Vec2 v)¶ -
Параметры: - name (std.string) –
- v (osg.Vec2) –
Тип результата:
-
.
Vec2d
(std.string name, osg.Vec2 v)¶ -
Параметры: - name (std.string) –
- v (osg.Vec2) –
Тип результата:
-
.
Vec3f
(std.string name, osg.Vec3 v)¶ -
Параметры: - name (std.string) –
- v (osg.Vec3) –
Тип результата:
-
.
Vec3d
(std.string name, osg.Vec3 v)¶ -
Параметры: - name (std.string) –
- v (osg.Vec3) –
Тип результата:
-
.
Vec4f
(std.string name, osg.Vec4 v)¶ -
Параметры: - name (std.string) –
- v (osg.Vec4) –
Тип результата:
-
.
Vec4d
(std.string name, osg.Vec4 v)¶ -
Параметры: - name (std.string) –
- v (osg.Vec4) –
Тип результата:
-
.
Matrix
(std.string name, osg.Matrix v)¶ -
Параметры: - name (std.string) –
- v (osg.Matrix) –
Тип результата:
-
.
Matrix2
(std.string name, osg.Matrix2 v)¶ -
Параметры: - name (std.string) –
- v (osg.Matrix2) –
Тип результата:
-
.
Matrix3
(std.string name, osg.Matrix3 v)¶ -
Параметры: - name (std.string) –
- v (osg.Matrix3) –
Тип результата:
-
.
Int2
(std.string name, int v1, int v2)¶ -
Параметры: - name (std.string) –
- v1 (int) –
- v2 (int) –
Тип результата:
-
.
Int3
(std.string name, int v1, int v2, int v3)¶ -
Параметры: - name (std.string) –
- v1 (int) –
- v2 (int) –
- v3 (int) –
Тип результата:
-
.
Int4
(std.string name, int v1, int v2, int v3, int v4)¶ -
Параметры: - name (std.string) –
- v1 (int) –
- v2 (int) –
- v3 (int) –
- v4 (int) –
Тип результата:
-
.
Unsigned2
(std.string name, unsigned v1, unsigned v2)¶ -
Параметры: - name (std.string) –
- v1 (unsigned) –
- v2 (unsigned) –
Тип результата:
-
.
Unsigned3
(std.string name, unsigned v1, unsigned v2, unsigned v3)¶ -
Параметры: - name (std.string) –
- v1 (unsigned) –
- v2 (unsigned) –
- v3 (unsigned) –
Тип результата:
-
.
Unsigned4
(std.string name, unsigned v1, unsigned v2, unsigned v3, unsigned v4)¶ -
Параметры: - name (std.string) –
- v1 (unsigned) –
- v2 (unsigned) –
- v3 (unsigned) –
- v4 (unsigned) –
Тип результата:
-
.
Bool2
(std.string name, bool v1, bool v2)¶ -
Параметры: - name (std.string) –
- v1 (bool) –
- v2 (bool) –
Тип результата:
-
.
Bool3
(std.string name, bool v1, bool v2, bool v3)¶ -
Параметры: - name (std.string) –
- v1 (bool) –
- v2 (bool) –
- v3 (bool) –
Тип результата:
-
.
Bool4
(std.string name, bool v1, bool v2, bool v3, bool v4)¶ -
Параметры: - name (std.string) –
- v1 (bool) –
- v2 (bool) –
- v3 (bool) –
- v4 (bool) –
Тип результата:
-