[ Back to Geeks3D.com ]
 GeeXLab
Laboratory for Real Time 3D Programming (prototyping and demos) OpenGL, Lua, Python, GLSL, PhysX and more...Reference Guide Host-API Lua / Python
» Back to Homepage
» Back to Developer's Guide Index
HYP_Renderer Library
Low level rendering library
Number of functions: 46
HYP_Renderer.SetVsyncState
Sets vertical synchronization (VSYNC) state.
: Lua - Python
state [INTEGER]: enables (1) or disables (0) VSYNC. - Values = 0|1
:
HYP_Renderer.SetVsyncState(0)
HYP_Renderer.ClearColorBuffer
Clear the color buffer with an uniform value.
: Lua - Python
r [REAL]: red channel value
g [REAL]: green channel value
b [REAL]: blue channel value
a [REAL]: alpha channel value
:
HYP_Renderer.ClearColorBuffer(r, g, b, 1.0)
HYP_Renderer.ClearDepthStencilBuffers
Clear the depth and stencil buffers.
: Lua - Python
z [REAL]: z buffer value
s [INTEGER]: stencil buffer value
:
HYP_Renderer.ClearDepthStencilBuffers(1.0, 0)
HYP_Renderer.SetBlendingState
Sets blending state.
: Lua - Python
state [INTEGER]: enables (1) or disables (0) blending. - Values = 0|1
:
HYP_Renderer.SetBlendingState(1)
HYP_Renderer.SetBlendingFactors
Set blending factors.
: Lua - Python
src_factor [INTEGER]: blending source factor. - Values = FACTOR_ZERO(0), FACTOR_ONE(1), FACTOR_SRC_ALPHA(2), FACTOR_ONE_MINUS_DST_ALPHA(3), FACTOR_ONE_MINUS_DST_COLOR(4), FACTOR_ONE_MINUS_SRC_ALPHA(5), FACTOR_DST_COLOR(6), FACTOR_DST_ALPHA(7), FACTOR_SRC_COLOR(8), FACTOR_ONE_MINUS_SRC_COLOR(9)
dst_factor [INTEGER]: blending destination factor. - Values = FACTOR_ZERO(0), FACTOR_ONE(1), FACTOR_SRC_ALPHA(2), FACTOR_ONE_MINUS_DST_ALPHA(3), FACTOR_ONE_MINUS_DST_COLOR(4), FACTOR_ONE_MINUS_SRC_ALPHA(5), FACTOR_DST_COLOR(6), FACTOR_DST_ALPHA(7), FACTOR_SRC_COLOR(8), FACTOR_ONE_MINUS_SRC_COLOR(9)
:
FACTOR_ONE = 1
FACTOR_SRC_ALPHA = 2
HYP_Renderer.SetBlendingFactors(FACTOR_SRC_ALPHA, FACTOR_ONE)
HYP_Renderer.DrawTriangle
Draws a triangle.
: Lua - Python
x0, y0, z0 [REAL]: position of the first vertex.
r0, g0, b0, a0 [REAL]: color of the first vertex.
u0, v0 [REAL]: tex coords of the first vertex.
nx0, ny0, nz0 [REAL]: normal of the first vertex.
x1, y1, z1 [REAL]: position of the second vertex.
r1, g1, b1, a1 [REAL]: color of the second vertex.
u1, v1 [REAL]: tex coords of the second vertex.
nx1, ny1, nz1 [REAL]: normal of the second vertex.
x2, y2, z2 [REAL]: position of the third vertex.
r2, g2, b2, a2 [REAL]: color of the third vertex.
u2, v2 [REAL]: tex coords of the third vertex.
nx2, ny2, nz2 [REAL]: normal of the third vertex.
:
HYP_Renderer.DrawTriangle(-10.0, -10.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0
10.0, -10.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0
0.0, 10.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0)
HYP_Renderer.DrawVertex
Draws a vertex.
: Lua - Python
x0, y0, z0 [REAL]: Vertex's position.
r0, g0, b0, a0 [REAL]: Vertex's color.
:
HYP_Renderer.DrawVertex(0.0, 10.0, 0.0, 1.0, 0.0, 0.0, 1.0)
HYP_Renderer.DrawLine
Draws a line.
: Lua - Python
x0, y0, z0 [REAL]: position of the first vertex.
r0, g0, b0 [REAL]: color of the first vertex.
x1, y1, z1 [REAL]: position of the second vertex.
r1, g1, b1 [REAL]: color of the second vertex.
:
HYP_Renderer.DrawLine(-10.0, -10.0, 0.0, 1.0, 0.0, 0.0, 1.0, 10.0, 10.0, 0.0, 0.0, 1.0, 0.0, 1.0)
HYP_Renderer.SetLineThickness
Sets line thickness for wireframe / line rendering.
: Lua - Python
thickness [REAL]: Line's thickness.
:
HYP_Renderer.SetLineThickness(2.0)
HYP_Renderer.SetPointSize
Sets point size fro point rendering.
: Lua - Python
size [REAL]: Point's size.
:
HYP_Renderer.SetPointSize(4.0)
HYP_Renderer.DisableAllLights
Disables all hardware lights.
: Lua - Python
:
HYP_Renderer.DisableAllLights()
HYP_Renderer.SetViewport
Sets the current viewport.
: Lua - Python
x [INTEGER]: start X position of the viewport. Position 0 is on the left.
y [INTEGER]: start Y position of the viewport. Position 0 is on the bottom.
width [INTEGER]: viewport width.
height [INTEGER]: viewport height.
:
HYP_Renderer.SetViewport(0, 0, 320, 200)
HYP_Renderer.GetCurrentFbo
Gets the current FBO (frame buffer object) identifier. FBO is the technology under the hood of RenderTexture object.
: Lua - Python
fbo [INTEGER]: fbo identifier
:
fbo = HYP_Renderer.GetCurrentFbo()
HYP_Renderer.BindFbo
Binds a FBO (frame buffer object). If FBO==0, the regular Windows frambuffer is actived.
: Lua - Python
fbo [INTEGER]: fbo identifier
:
HYP_Renderer.BindFbo(fbo)
HYP_Renderer.SetDepthTestState
Enables (1) or disables (0) depth tests.
: Lua - Python
state [INTEGER]: depth tests state - Values = 0|1
:
HYP_Renderer.SetDepthTestState(0)
HYP_Renderer.SetDepthTestFunction
Sets the depth test comparison function.
: Lua - Python
func [INTEGER]: depth test comparison function. - Values = CMP_FUNC_NEVER(0), CMP_FUNC_LESS(1), CMP_FUNC_LESS_OR_EQUAL(2), CMP_FUNC_GREATER(3), CMP_FUNC_GREATER_OR_EQUAL(4), CMP_FUNC_EQUAL(5), CMP_FUNC_NOT_EQUAL(6), CMP_FUNC_ALWAYS(7)
:
CMP_FUNC_LESS = 1
HYP_Renderer.SetDepthTestFunction(CMP_FUNC_LESS)
HYP_Renderer.SetDepthTestWritingState
Sets the depth test read / write mode.
: Lua - Python
state [INTEGER]: Enables (1) or disables (0) depth buffer writing. - Values = 0|1
:
HYP_Renderer.SetDepthTestWritingState(0)
HYP_Renderer.SetLightingState
Sets the lighting state. Only for fixed pipeline.
: Lua - Python
state [INTEGER]: Enables (1) or disables (0) lighting calculations. - Values = 0|1
:
HYP_Renderer.SetLightingState(1)
HYP_Renderer.SetFaceCullingState
Sets the face culling state.
: Lua - Python
state [INTEGER]: Enables (1) or disables (0) face culling. - Values = 0|1
:
HYP_Renderer.SetFaceCullingState(1)
HYP_Renderer.SetFaceCullingMode
Sets the face culling mode.
: Lua - Python
mode [INTEGER]: Face culling mode. - Values = NO_FACE_CULLING(0), BACK_FACE_CULLING(1), FRONT_FACE_CULLING(2), FRONT_BACK_FACE_CULLING(3)
:
FRONT_FACE_CULLING = 2
HYP_Renderer.SetFaceCullingMode(FRONT_FACE_CULLING)
HYP_Renderer.SetTexture2DState
Sets 2D texture mapping state.
: Lua - Python
state [INTEGER]: Enables (1) or disables (0) 2D texture mapping. - Values = 0|1
:
HYP_Renderer.SetTexture2DState(1)
HYP_Renderer.SetAlphaTestState
Sets hardware alpha test state.
: Lua - Python
state [INTEGER]: Enables (1) or disables (0) alpha test. - Values = 0|1
:
HYP_Renderer.SetAlphaTestState(1)
HYP_Renderer.SetAlphaTestFunction
Sets hardware alpha test comparison function.
: Lua - Python
func [INTEGER]: depth test comparison function. - Values = CMP_FUNC_NEVER(0), CMP_FUNC_LESS(1), CMP_FUNC_LESS_OR_EQUAL(2), CMP_FUNC_GREATER(3), CMP_FUNC_GREATER_OR_EQUAL(4), CMP_FUNC_EQUAL(5), CMP_FUNC_NOT_EQUAL(6), CMP_FUNC_ALWAYS(7)
ref [REAL]: Reference value for the comparison function. The function compares the ref value and the input alpha value.
:
CMP_FUNC_GREATER = 3
ref = 0.5
HYP_Renderer.SetAlphaTestFunction(CMP_FUNC_GREATER, 0.5)
HYP_Renderer.SetUserClipPlane
Sets user clipping plane.
: Lua - Python
clipPlane [INTEGER]: clip plane to enable. - Values = [0 ; 6]
a, b, c, d [REAL]: plane equation.
HYP_Renderer.DisableUserClipPlane
Disables an user clipping plane.
: Lua - Python
clipPlane [INTEGER]: clip plane to disable. - Values = [0 ; 6]
HYP_Renderer.SetShadingMode
Sets shading mode.
: Lua - Python
mode [INTEGER]: shading mode. - Values = FLAT_SHADING_MODE(0), GOURAUD_SHADING_MODE(1)
HYP_Renderer.MatrixSetMode
Sets current matrix mode.
: Lua - Python
mode [INTEGER]: matrix mode. - Values = PROJECTION(0), MODELVIEW(3)
HYP_Renderer.MatrixSetIdentity
Sets to identity the current matrix.
: Lua - Python
HYP_Renderer.MatrixLoad
Loads a 4x4 matrix in OpenGL conventions.
: Lua - Python
m0, ..., m15 [REAL]: Matrix elements: 0 to 15.
:
MODELVIEW = 3
HYP_Renderer.MatrixSetMode(MODELVIEW)
myMatrix = {}
InitMyMatrix(myMatrix)
HYP_Renderer.MatrixLoad(myMatrix[0], myMatrix[1], myMatrix[2], myMatrix[3],
myMatrix[4], myMatrix[5], myMatrix[6], myMatrix[7],
myMatrix[8], myMatrix[9], myMatrix[10], myMatrix[11],
myMatrix[12], myMatrix[13], myMatrix[14], myMatrix[15])
HYP_Renderer.MatrixMult
Multiplies a the current matrix by a 4x4 matrix in OpenGL conventions.
: Lua - Python
m0, ..., m15 [REAL]: Matrix elements: 0 to 15.
HYP_Renderer.MatrixGetModelView
Gets the current 4x4 model vierw matrix in OpenGL conventions.
: Lua - Python
m0, ..., m15 [REAL]: Matrix elements: 0 to 15.
HYP_Renderer.ActiveTextureUnit
Active a specific texture unit. Some texture operations like HYP_Texture.Bind() are relative to the current texture unit.
: Lua - Python
textureUnit [INTEGER]: texture unit to be activated. - Values = [0 ; 7[
:
HYP_Renderer.ActiveTextureUnit(0)
HYP_Renderer.ApplyCurrentViewMatrix
Apply the current view matrix set by the previous call to HYP_Camera.ApplyToRenderer().
: Lua - Python
:
HYP_Renderer.ApplyCurrentViewMatrix()
HYP_Renderer.GPUShaderBind
Binds a GPU shader at the renderer level (the shader will be enabled). Bind 0 to disable the current shader program.
: Lua - Python
id [INTEGER]: OpenGL shader name.
:
HYP_Renderer.GPUShaderBind(id)
HYP_Renderer.GPUShaderLink
Links a GPU shader at the renderer level.
: Lua - Python
id [INTEGER]: OpenGL shader name.
ret [INTEGER]: 1 if ok or 0 if error.
:
ret = HYP_Renderer.GPUShaderLink(id)
if (ret==1) then
str = HYP_Renderer.GPUShaderGetLastErrorStr()
end
HYP_Renderer.GPUShaderGetLastErrorStr
Returns the last GPU shader string error at the renderer level.
: Lua - Python
str [STRING]: error string.
:
str = HYP_Renderer.GPUShaderGetLastErrorStr()
HYP_Renderer.GPUShaderGetUniformLocation
Returns the location of an uniform variable at the renderer level (OpenGL).
: Lua - Python
shaderOpenGLId [INTEGER]: OpenGL shader name.
uniformName [STRING]: uniform name.
loc [INTEGER]: Uniform location.
:
loc = HYP_Renderer.GPUShaderGetUniformLocation(shaderOpenGLId, uniformName)
HYP_Renderer.GPUShaderSetUniform1i
Set an integer 1D uniform value.
: Lua - Python
loc [INTEGER]: Uniform location.
x [INTEGER]: uniform value.
:
loc = HYP_Renderer.GPUShaderGetUniformLocation(shaderOpenGLId, uniformName)
HYP_Renderer.GPUShaderSetUniform1i(loc, x)
HYP_Renderer.GPUShaderSetUniform2i
Set an integer 2D uniform value.
: Lua - Python
loc [INTEGER]: Uniform location.
x, y [INTEGER]: uniform value.
:
loc = HYP_Renderer.GPUShaderGetUniformLocation(shaderOpenGLId, uniformName)
HYP_Renderer.GPUShaderSetUniform2i(loc, x, y)
HYP_Renderer.GPUShaderSetUniform3i
Set an integer 3D uniform value.
: Lua - Python
loc [INTEGER]: Uniform location.
x, y, z [INTEGER]: uniform value.
:
loc = HYP_Renderer.GPUShaderGetUniformLocation(shaderOpenGLId, uniformName)
HYP_Renderer.GPUShaderSetUniform3i(loc, x, y, z)
HYP_Renderer.GPUShaderSetUniform4i
Set an integer 4D uniform value.
: Lua - Python
loc [INTEGER]: Uniform location.
x, y, z, w [INTEGER]: uniform value.
:
loc = HYP_Renderer.GPUShaderGetUniformLocation(shaderOpenGLId, uniformName)
HYP_Renderer.GPUShaderSetUniform4i(loc, x, y, z, w)
HYP_Renderer.GPUShaderSetUniform1f
Set a float 1D uniform value.
: Lua - Python
loc [INTEGER]: Uniform location.
x [REAL]: uniform value.
:
loc = HYP_Renderer.GPUShaderGetUniformLocation(shaderOpenGLId, uniformName)
HYP_Renderer.GPUShaderSetUniform1f(loc, x)
HYP_Renderer.GPUShaderSetUniform2f
Set a float 2D uniform value.
: Lua - Python
loc [INTEGER]: Uniform location.
x, y [REAL]: uniform value.
:
loc = HYP_Renderer.GPUShaderGetUniformLocation(shaderOpenGLId, uniformName)
HYP_Renderer.GPUShaderSetUniform2f(loc, x, y)
HYP_Renderer.GPUShaderSetUniform3f
Set a float 3D uniform value.
: Lua - Python
loc [INTEGER]: Uniform location.
x, y, z [REAL]: uniform value.
:
loc = HYP_Renderer.GPUShaderGetUniformLocation(shaderOpenGLId, uniformName)
HYP_Renderer.GPUShaderSetUniform3f(loc, x, y, z)
HYP_Renderer.GPUShaderSetUniform4f
Set a float 4D uniform value.
: Lua - Python
loc [INTEGER]: Uniform location.
x, y, z, w [REAL]: uniform value.
:
loc = HYP_Renderer.GPUShaderGetUniformLocation(shaderOpenGLId, uniformName)
HYP_Renderer.GPUShaderSetUniform4f(loc, x, y, z, w)
HYP_Renderer.GPUShaderSetUniform4x4f
Set a float 4x4 uniform value.
: Lua - Python
loc [INTEGER]: Uniform location.
m0, ..., m15 [REAL]: uniform value (4x4 matrix).
:
loc = HYP_Renderer.GPUShaderGetUniformLocation(shaderOpenGLId, uniformName)
HYP_Renderer.GPUShaderSetUniform4x4f(loc, m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15)
|