osg.Uniform

class osg.Uniform
Represents:c++ class
Wraps:osg::Uniform
Bases:osg.Object

osg.Uniform encapsulates glUniform (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 of set<VaueType><Dimension> and get<VaueType><Dimension> (e.g. osg.Uniform.setInt2() and osg.Uniform.getInt2()) for setting and geting values of corressponding osg.Uniform object. Static functions for creating an osg.Uniform of specified type are also provided and has signature osg.Uniform.<ValueType><Dimension> (e.g. osg.Uniform.Vec2d()).

Constructors:

osg.Uniform()

osg.Uniform(osg.Uniform.Type type, std.string name, int numElements)

Параметры:
osg.Uniform(osg.Uniform.Type type, std.string name)

Параметры:

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) –
:setVec2f(osg.Vec2 v)

Параметры:v (osg.Vec2) –
:setVec2d(osg.Vec2 v)

Параметры:v (osg.Vec2) –
:setVec3f(osg.Vec3 v)

Параметры:v (osg.Vec3) –
:setVec3d(osg.Vec3 v)

Параметры:v (osg.Vec3) –
:setVec4f(osg.Vec4 v)

Параметры:v (osg.Vec4) –
:setVec4d(osg.Vec4 v)

Параметры:v (osg.Vec4) –
: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 a osg.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)

Параметры:
Тип результата:

osg.Uniform

.Double(std.string name, double v)

Параметры:
Тип результата:

osg.Uniform

.Int(std.string name, int v)

Параметры:
Тип результата:

osg.Uniform

.Unsigned(std.string name, unsigned v)

Параметры:
Тип результата:

osg.Uniform

.Bool(std.string name, bool v)

Параметры:
Тип результата:

osg.Uniform

.Vec2f(std.string name, osg.Vec2 v)

Параметры:
Тип результата:

osg.Uniform

.Vec2d(std.string name, osg.Vec2 v)

Параметры:
Тип результата:

osg.Uniform

.Vec3f(std.string name, osg.Vec3 v)

Параметры:
Тип результата:

osg.Uniform

.Vec3d(std.string name, osg.Vec3 v)

Параметры:
Тип результата:

osg.Uniform

.Vec4f(std.string name, osg.Vec4 v)

Параметры:
Тип результата:

osg.Uniform

.Vec4d(std.string name, osg.Vec4 v)

Параметры:
Тип результата:

osg.Uniform

.Matrix(std.string name, osg.Matrix v)

Параметры:
Тип результата:

osg.Uniform

.Matrix2(std.string name, osg.Matrix2 v)

Параметры:
Тип результата:

osg.Uniform

.Matrix3(std.string name, osg.Matrix3 v)

Параметры:
Тип результата:

osg.Uniform

.Int2(std.string name, int v1, int v2)

Параметры:
Тип результата:

osg.Uniform

.Int3(std.string name, int v1, int v2, int v3)

Параметры:
  • name (std.string) –
  • v1 (int) –
  • v2 (int) –
  • v3 (int) –
Тип результата:

osg.Uniform

.Int4(std.string name, int v1, int v2, int v3, int v4)

Параметры:
  • name (std.string) –
  • v1 (int) –
  • v2 (int) –
  • v3 (int) –
  • v4 (int) –
Тип результата:

osg.Uniform

.Unsigned2(std.string name, unsigned v1, unsigned v2)

Параметры:
  • name (std.string) –
  • v1 (unsigned) –
  • v2 (unsigned) –
Тип результата:

osg.Uniform

.Unsigned3(std.string name, unsigned v1, unsigned v2, unsigned v3)

Параметры:
  • name (std.string) –
  • v1 (unsigned) –
  • v2 (unsigned) –
  • v3 (unsigned) –
Тип результата:

osg.Uniform

.Unsigned4(std.string name, unsigned v1, unsigned v2, unsigned v3, unsigned v4)

Параметры:
  • name (std.string) –
  • v1 (unsigned) –
  • v2 (unsigned) –
  • v3 (unsigned) –
  • v4 (unsigned) –
Тип результата:

osg.Uniform

.Bool2(std.string name, bool v1, bool v2)

Параметры:
  • name (std.string) –
  • v1 (bool) –
  • v2 (bool) –
Тип результата:

osg.Uniform

.Bool3(std.string name, bool v1, bool v2, bool v3)

Параметры:
  • name (std.string) –
  • v1 (bool) –
  • v2 (bool) –
  • v3 (bool) –
Тип результата:

osg.Uniform

.Bool4(std.string name, bool v1, bool v2, bool v3, bool v4)

Параметры:
  • name (std.string) –
  • v1 (bool) –
  • v2 (bool) –
  • v3 (bool) –
  • v4 (bool) –
Тип результата:

osg.Uniform