Quick Links
> Homepage
|-- Overview
|-- Download
|-- Screenshots
|-- Community

> Code Sample Pack

> Reference Guide

> Changelog

> Overview of GLSL Hacker
> Live Coding
> Hack your first GLSL Code
> Moon3D


GLSL Hacker Articles

> Compute shaders on Radeon
> Distance functions in GLSL
> GLSL Interpolation Qualifiers
> Tessellation Spacing Modes
> Normal Visualizer with GS
> 3D Surface Plots
> Normal Mapping
> Circle and Disc in GLSL
> PhysX 3 Flag Demo
> GLSL Hacker on Raspberry Pi
GLSL Hacker

Reference Guide
Host-API Lua / Python



Back to Homepage
Back to Developer's Guide Index

gh_render_target Library


Description
gh_render_target is the module that manages render targets. A render target is used in render to texture and post processing effects.

Number of functions: 9

gh_render_target.create

Description
Creates a render target.

Languages: Lua - Python

Parameters
  • width, height [INTEGER]: size of the render target.

    Return Values
  • rt_id [INTEGER]: render target identifier

    Code sample :

    rt_id = gh_render_target.create(2048, 2048)


    gh_render_target.create_ex

    Description
    Creates a render target.

    Languages: Lua - Python

    Parameters
  • width, height [INTEGER]: size of the render target.
  • pixel_format [INTEGER]: pixel format of color target.
  • linear_filtering [INTEGER]: performs linear filtering (1) or not (0).
  • msaa_samples [INTEGER]: number of antialiasing samples.

    Return Values
  • rt_id [INTEGER]: render target identifier

    Code sample :

    PF_U8_RGB = 1
    PF_U8_BGR = 2
    PF_U8_RGBA = 3
    PF_U8_BGRA = 4
    PF_F32_RGB = 5
    PF_F32_RGBA = 6
    PF_F32_R = 7
    linear_filtering = 1
    msaa_samples = 4
    rt_id = gh_render_target.create_ex(2048, 2048, PF_F32_RGBA, linear_filtering, msaa_samples)


    gh_render_target.create_rb

    Description
    Creates a color depth render buffer.

    Languages: Lua - Python

    Parameters
  • width, height [INTEGER]: size of the render target.
  • pixel_format [INTEGER]: pixel format of color target.
  • msaa_samples [INTEGER]: number of antialiasing samples.

    Return Values
  • rt_id [INTEGER]: render target identifier

    Code sample :

    PF_U8_RGB = 1
    PF_U8_BGR = 2
    PF_U8_RGBA = 3
    PF_U8_BGRA = 4
    PF_F32_RGB = 5
    PF_F32_RGBA = 6
    PF_F32_R = 7
    msaa_samples = 4
    rt_id = gh_render_target.create_rb(2048, 2048, PF_F32_RGBA, msaa_samples)


    gh_render_target.create_depth

    Description
    Creates a depth only render target.

    Languages: Lua - Python

    Parameters
  • width, height [INTEGER]: size of the render target.
  • linear_filtering [INTEGER]: performs linear filtering (1) or not (0).

    Return Values
  • rt_id [INTEGER]: render target identifier

    Code sample :

    rt_id = gh_render_target.create_depth(2048, 2048, 0)


    gh_render_target.kill

    Description
    Kills (cleanup + free resources) a render target.

    Languages: Lua - Python

    Parameters
  • rt_id [INTEGER]: render target identifier.

    Code sample :

    gh_render_target.kill(rt_id)


    gh_render_target.bind

    Description
    Binds the render target.

    Languages: Lua - Python

    Parameters
  • rt_id [INTEGER]: render target identifier.

    Code sample :

    gh_render_target.bind(rt_id)
    ...
    gh_render_target.bind(0) -- unbinds


    gh_render_target.resize

    Description
    Resizes a render target.

    Languages: Lua - Python

    Parameters
  • rt_id [INTEGER]: render target identifier
  • width, height [INTEGER]: size of the render target.

    Code sample :

    gh_render_target.resize(rt_id, new_width, new_height)


    gh_render_target.resolve_multisampling

    Description
    Resolves multisampling.

    Languages: Lua - Python

    Parameters
  • rt_src [INTEGER]: multisampled source render target.
  • rt_dst [INTEGER]: regular destination render target.

    Code sample :

    gh_render_target.resolve_multisampling(ms_rt, rt)


    gh_render_target.use_with_syphon

    Description
    Specifies that this render target can be a source for Syphon (Mac OSX only).

    Languages: Lua - Python

    Parameters
  • rt_id [INTEGER]: render target identifier.

    Code sample :

    gh_render_target.use_with_syphon(rt)





  • (C)2012-2013 Geeks3D