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: 11

    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_v2

    Description
    Creates a render target with multiple render targets (MRTs).

    Languages: Lua - Python

    Parameters
  • width, height [INTEGER]: size of the render target.
  • num_color_targets [INTEGER]: number of color targets.

    Return Values
  • rt_id [INTEGER]: render target identifier

    Code sample :

    rt_id = gh_render_target.create_v2(2048, 2048, 4)


    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_ex_v3

    Description
    Creates a render target with multiple render targets (MRTs).

    Languages: Lua - Python

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

    Return Values
  • rt_id [INTEGER]: render target identifier

    Code sample :

    num_color_targets = 4
    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
    PF_F16_RGB = 8
    PF_F16_RGBA = 9
    PF_F16_R = 10
    PF_U8_R = 11
    PF_U8_RG = 12
    linear_filtering = 1
    clamp_addressing = 1
    msaa_samples = 4
    rt_id = gh_render_target.create_ex_v3(2048, 2048, num_color_targets, 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
    PF_F16_RGB = 8
    PF_F16_RGBA = 9
    PF_F16_R = 10
    PF_U8_R = 11
    PF_U8_RG = 12
    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-2014 Geeks3D