"No one can be told what GeeXLab is, you have to see it for yourself!"

"Stop Playing Games and Start Making Them! With GeeXLab, your are on your way!"


Quick Links
What is GeeXLab
Download GeeXLab
GeeXLab Requirements
Online Help
Articles and Tutorials
Samples Screenshots
Videos

GeeXLab Changelog

XML Ref. Guide
Scripting Ref. Guide
Code Samples

Purchase GeeXLab
GeeXLab SDK

Shader Library

Follow GeeXLab's News
GeeXLab news, articles, tutorials and demos @ Geeks3D.com
GeeXLab @ Twitter GeeXLab RSS Feed

Subscribe to GeeXLab news by email

[ Back to Geeks3D.com ]

GeeXLab

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


Description
Low level rendering library

Number of functions: 46

HYP_Renderer.SetVsyncState

Description
Sets vertical synchronization (VSYNC) state.

Languages: Lua - Python

Parameters
  • state [INTEGER]: enables (1) or disables (0) VSYNC. - Values = 0|1

    Code sample :

    HYP_Renderer.SetVsyncState(0)


    HYP_Renderer.ClearColorBuffer

    Description
    Clear the color buffer with an uniform value.

    Languages: Lua - Python

    Parameters
  • r [REAL]: red channel value
  • g [REAL]: green channel value
  • b [REAL]: blue channel value
  • a [REAL]: alpha channel value

    Code sample :

    HYP_Renderer.ClearColorBuffer(r, g, b, 1.0)


    HYP_Renderer.ClearDepthStencilBuffers

    Description
    Clear the depth and stencil buffers.

    Languages: Lua - Python

    Parameters
  • z [REAL]: z buffer value
  • s [INTEGER]: stencil buffer value

    Code sample :

    HYP_Renderer.ClearDepthStencilBuffers(1.0, 0)


    HYP_Renderer.SetBlendingState

    Description
    Sets blending state.

    Languages: Lua - Python

    Parameters
  • state [INTEGER]: enables (1) or disables (0) blending. - Values = 0|1

    Code sample :

    HYP_Renderer.SetBlendingState(1)


    HYP_Renderer.SetBlendingFactors

    Description
    Set blending factors.

    Languages: Lua - Python

    Parameters
  • 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)

    Code sample :

    FACTOR_ONE = 1
    FACTOR_SRC_ALPHA = 2
    HYP_Renderer.SetBlendingFactors(FACTOR_SRC_ALPHA, FACTOR_ONE)


    HYP_Renderer.DrawTriangle

    Description
    Draws a triangle.

    Languages: Lua - Python

    Parameters
  • 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.

    Code sample :

    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

    Description
    Draws a vertex.

    Languages: Lua - Python

    Parameters
  • x0, y0, z0 [REAL]: Vertex's position.
  • r0, g0, b0, a0 [REAL]: Vertex's color.

    Code sample :

    HYP_Renderer.DrawVertex(0.0, 10.0, 0.0, 1.0, 0.0, 0.0, 1.0)


    HYP_Renderer.DrawLine

    Description
    Draws a line.

    Languages: Lua - Python

    Parameters
  • 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.

    Code sample :

    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

    Description
    Sets line thickness for wireframe / line rendering.

    Languages: Lua - Python

    Parameters
  • thickness [REAL]: Line's thickness.

    Code sample :

    HYP_Renderer.SetLineThickness(2.0)


    HYP_Renderer.SetPointSize

    Description
    Sets point size fro point rendering.

    Languages: Lua - Python

    Parameters
  • size [REAL]: Point's size.

    Code sample :

    HYP_Renderer.SetPointSize(4.0)


    HYP_Renderer.DisableAllLights

    Description
    Disables all hardware lights.

    Languages: Lua - Python

    Code sample :

    HYP_Renderer.DisableAllLights()


    HYP_Renderer.SetViewport

    Description
    Sets the current viewport.

    Languages: Lua - Python

    Parameters
  • 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.

    Code sample :

    HYP_Renderer.SetViewport(0, 0, 320, 200)


    HYP_Renderer.GetCurrentFbo

    Description
    Gets the current FBO (frame buffer object) identifier. FBO is the technology under the hood of RenderTexture object.

    Languages: Lua - Python

    Return Values
  • fbo [INTEGER]: fbo identifier

    Code sample :

    fbo = HYP_Renderer.GetCurrentFbo()


    HYP_Renderer.BindFbo

    Description
    Binds a FBO (frame buffer object). If FBO==0, the regular Windows frambuffer is actived.

    Languages: Lua - Python

    Parameters
  • fbo [INTEGER]: fbo identifier

    Code sample :

    HYP_Renderer.BindFbo(fbo)


    HYP_Renderer.SetDepthTestState

    Description
    Enables (1) or disables (0) depth tests.

    Languages: Lua - Python

    Parameters
  • state [INTEGER]: depth tests state - Values = 0|1

    Code sample :

    HYP_Renderer.SetDepthTestState(0)


    HYP_Renderer.SetDepthTestFunction

    Description
    Sets the depth test comparison function.

    Languages: Lua - Python

    Parameters
  • 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)

    Code sample :

    CMP_FUNC_LESS = 1
    HYP_Renderer.SetDepthTestFunction(CMP_FUNC_LESS)


    HYP_Renderer.SetDepthTestWritingState

    Description
    Sets the depth test read / write mode.

    Languages: Lua - Python

    Parameters
  • state [INTEGER]: Enables (1) or disables (0) depth buffer writing. - Values = 0|1

    Code sample :

    HYP_Renderer.SetDepthTestWritingState(0)


    HYP_Renderer.SetLightingState

    Description
    Sets the lighting state. Only for fixed pipeline.

    Languages: Lua - Python

    Parameters
  • state [INTEGER]: Enables (1) or disables (0) lighting calculations. - Values = 0|1

    Code sample :

    HYP_Renderer.SetLightingState(1)


    HYP_Renderer.SetFaceCullingState

    Description
    Sets the face culling state.

    Languages: Lua - Python

    Parameters
  • state [INTEGER]: Enables (1) or disables (0) face culling. - Values = 0|1

    Code sample :

    HYP_Renderer.SetFaceCullingState(1)


    HYP_Renderer.SetFaceCullingMode

    Description
    Sets the face culling mode.

    Languages: Lua - Python

    Parameters
  • mode [INTEGER]: Face culling mode. - Values = NO_FACE_CULLING(0), BACK_FACE_CULLING(1), FRONT_FACE_CULLING(2), FRONT_BACK_FACE_CULLING(3)

    Code sample :

    FRONT_FACE_CULLING = 2
    HYP_Renderer.SetFaceCullingMode(FRONT_FACE_CULLING)


    HYP_Renderer.SetTexture2DState

    Description
    Sets 2D texture mapping state.

    Languages: Lua - Python

    Parameters
  • state [INTEGER]: Enables (1) or disables (0) 2D texture mapping. - Values = 0|1

    Code sample :

    HYP_Renderer.SetTexture2DState(1)


    HYP_Renderer.SetAlphaTestState

    Description
    Sets hardware alpha test state.

    Languages: Lua - Python

    Parameters
  • state [INTEGER]: Enables (1) or disables (0) alpha test. - Values = 0|1

    Code sample :

    HYP_Renderer.SetAlphaTestState(1)


    HYP_Renderer.SetAlphaTestFunction

    Description
    Sets hardware alpha test comparison function.

    Languages: Lua - Python

    Parameters
  • 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.

    Code sample :

    CMP_FUNC_GREATER = 3
    ref = 0.5
    HYP_Renderer.SetAlphaTestFunction(CMP_FUNC_GREATER, 0.5)


    HYP_Renderer.SetUserClipPlane

    Description
    Sets user clipping plane.

    Languages: Lua - Python

    Parameters
  • clipPlane [INTEGER]: clip plane to enable. - Values = [0 ; 6]
  • a, b, c, d [REAL]: plane equation.

    HYP_Renderer.DisableUserClipPlane

    Description
    Disables an user clipping plane.

    Languages: Lua - Python

    Parameters
  • clipPlane [INTEGER]: clip plane to disable. - Values = [0 ; 6]

    HYP_Renderer.SetShadingMode

    Description
    Sets shading mode.

    Languages: Lua - Python

    Parameters
  • mode [INTEGER]: shading mode. - Values = FLAT_SHADING_MODE(0), GOURAUD_SHADING_MODE(1)

    HYP_Renderer.MatrixSetMode

    Description
    Sets current matrix mode.

    Languages: Lua - Python

    Parameters
  • mode [INTEGER]: matrix mode. - Values = PROJECTION(0), MODELVIEW(3)

    HYP_Renderer.MatrixSetIdentity

    Description
    Sets to identity the current matrix.

    Languages: Lua - Python

    HYP_Renderer.MatrixLoad

    Description
    Loads a 4x4 matrix in OpenGL conventions.

    Languages: Lua - Python

    Parameters
  • m0, ..., m15 [REAL]: Matrix elements: 0 to 15.

    Code sample :

    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

    Description
    Multiplies a the current matrix by a 4x4 matrix in OpenGL conventions.

    Languages: Lua - Python

    Parameters
  • m0, ..., m15 [REAL]: Matrix elements: 0 to 15.

    HYP_Renderer.MatrixGetModelView

    Description
    Gets the current 4x4 model vierw matrix in OpenGL conventions.

    Languages: Lua - Python

    Return Values
  • m0, ..., m15 [REAL]: Matrix elements: 0 to 15.

    HYP_Renderer.ActiveTextureUnit

    Description
    Active a specific texture unit. Some texture operations like HYP_Texture.Bind() are relative to the current texture unit.

    Languages: Lua - Python

    Parameters
  • textureUnit [INTEGER]: texture unit to be activated. - Values = [0 ; 7[

    Code sample :

    HYP_Renderer.ActiveTextureUnit(0)


    HYP_Renderer.ApplyCurrentViewMatrix

    Description
    Apply the current view matrix set by the previous call to HYP_Camera.ApplyToRenderer().

    Languages: Lua - Python

    Code sample :

    HYP_Renderer.ApplyCurrentViewMatrix()


    HYP_Renderer.GPUShaderBind

    Description
    Binds a GPU shader at the renderer level (the shader will be enabled). Bind 0 to disable the current shader program.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: OpenGL shader name.

    Code sample :

    HYP_Renderer.GPUShaderBind(id)


    HYP_Renderer.GPUShaderLink

    Description
    Links a GPU shader at the renderer level.

    Languages: Lua - Python

    Parameters
  • id [INTEGER]: OpenGL shader name.

    Return Values
  • ret [INTEGER]: 1 if ok or 0 if error.

    Code sample :

    ret = HYP_Renderer.GPUShaderLink(id)
    if (ret==1) then
    str = HYP_Renderer.GPUShaderGetLastErrorStr()
    end


    HYP_Renderer.GPUShaderGetLastErrorStr

    Description
    Returns the last GPU shader string error at the renderer level.

    Languages: Lua - Python

    Return Values
  • str [STRING]: error string.

    Code sample :

    str = HYP_Renderer.GPUShaderGetLastErrorStr()


    HYP_Renderer.GPUShaderGetUniformLocation

    Description
    Returns the location of an uniform variable at the renderer level (OpenGL).

    Languages: Lua - Python

    Parameters
  • shaderOpenGLId [INTEGER]: OpenGL shader name.
  • uniformName [STRING]: uniform name.

    Return Values
  • loc [INTEGER]: Uniform location.

    Code sample :

    loc = HYP_Renderer.GPUShaderGetUniformLocation(shaderOpenGLId, uniformName)


    HYP_Renderer.GPUShaderSetUniform1i

    Description
    Set an integer 1D uniform value.

    Languages: Lua - Python

    Parameters
  • loc [INTEGER]: Uniform location.
  • x [INTEGER]: uniform value.

    Code sample :

    loc = HYP_Renderer.GPUShaderGetUniformLocation(shaderOpenGLId, uniformName)
    HYP_Renderer.GPUShaderSetUniform1i(loc, x)


    HYP_Renderer.GPUShaderSetUniform2i

    Description
    Set an integer 2D uniform value.

    Languages: Lua - Python

    Parameters
  • loc [INTEGER]: Uniform location.
  • x, y [INTEGER]: uniform value.

    Code sample :

    loc = HYP_Renderer.GPUShaderGetUniformLocation(shaderOpenGLId, uniformName)
    HYP_Renderer.GPUShaderSetUniform2i(loc, x, y)


    HYP_Renderer.GPUShaderSetUniform3i

    Description
    Set an integer 3D uniform value.

    Languages: Lua - Python

    Parameters
  • loc [INTEGER]: Uniform location.
  • x, y, z [INTEGER]: uniform value.

    Code sample :

    loc = HYP_Renderer.GPUShaderGetUniformLocation(shaderOpenGLId, uniformName)
    HYP_Renderer.GPUShaderSetUniform3i(loc, x, y, z)


    HYP_Renderer.GPUShaderSetUniform4i

    Description
    Set an integer 4D uniform value.

    Languages: Lua - Python

    Parameters
  • loc [INTEGER]: Uniform location.
  • x, y, z, w [INTEGER]: uniform value.

    Code sample :

    loc = HYP_Renderer.GPUShaderGetUniformLocation(shaderOpenGLId, uniformName)
    HYP_Renderer.GPUShaderSetUniform4i(loc, x, y, z, w)


    HYP_Renderer.GPUShaderSetUniform1f

    Description
    Set a float 1D uniform value.

    Languages: Lua - Python

    Parameters
  • loc [INTEGER]: Uniform location.
  • x [REAL]: uniform value.

    Code sample :

    loc = HYP_Renderer.GPUShaderGetUniformLocation(shaderOpenGLId, uniformName)
    HYP_Renderer.GPUShaderSetUniform1f(loc, x)


    HYP_Renderer.GPUShaderSetUniform2f

    Description
    Set a float 2D uniform value.

    Languages: Lua - Python

    Parameters
  • loc [INTEGER]: Uniform location.
  • x, y [REAL]: uniform value.

    Code sample :

    loc = HYP_Renderer.GPUShaderGetUniformLocation(shaderOpenGLId, uniformName)
    HYP_Renderer.GPUShaderSetUniform2f(loc, x, y)


    HYP_Renderer.GPUShaderSetUniform3f

    Description
    Set a float 3D uniform value.

    Languages: Lua - Python

    Parameters
  • loc [INTEGER]: Uniform location.
  • x, y, z [REAL]: uniform value.

    Code sample :

    loc = HYP_Renderer.GPUShaderGetUniformLocation(shaderOpenGLId, uniformName)
    HYP_Renderer.GPUShaderSetUniform3f(loc, x, y, z)


    HYP_Renderer.GPUShaderSetUniform4f

    Description
    Set a float 4D uniform value.

    Languages: Lua - Python

    Parameters
  • loc [INTEGER]: Uniform location.
  • x, y, z, w [REAL]: uniform value.

    Code sample :

    loc = HYP_Renderer.GPUShaderGetUniformLocation(shaderOpenGLId, uniformName)
    HYP_Renderer.GPUShaderSetUniform4f(loc, x, y, z, w)


    HYP_Renderer.GPUShaderSetUniform4x4f

    Description
    Set a float 4x4 uniform value.

    Languages: Lua - Python

    Parameters
  • loc [INTEGER]: Uniform location.
  • m0, ..., m15 [REAL]: uniform value (4x4 matrix).

    Code sample :

    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)




  • Random Projects

    Depth Buffer Visualization
    Depth Buffer Visualization

    Chromatic Aberration
    Chromatic Aberration

    Depth Buffer Visualization
    Depth Buffer Visualization


    Random Code Samples

    3D fonts
    3D fonts

    Anaglyph Stereoscopic 3D
    Anaglyph Stereoscopic 3D

    3DS Format Loading
    3DS Format Loading



    (C)2009-2010 Geeks3D.com