Render Effects:

The attribute contains a table with the name and attributes for the specific render effect being applied. Currently the following effects are defined:

blur, geometry

blur

This effect will add a blur to the contents of the layer. The following blur attributes are defined:


Parameters:
        passes        This is a number value which is the number of blur passes
        composite     This is a boolean value.  When true the blur will be applied to the final composition
                      of this layer with the framebuffer content.  If false the blur is only applied to the
                      layer content.
        radius        This is a number value which defined the radius of the blur effect in pixels

Example:
                                

function cbBlurEffect(mapargs)
    local attrs = {}
    local effect = {}

    effect["name"] = "blur"
    effect["passes"] = 2
    effect["radius"] = 1
    effect["composite"] = false
    attrs["effect"] = effect
    gre.set_layer_attrs("background.control1",attrs)
end
                            
geometry

This effect will allow custom OpenGL ES geometry to be applied to the rendering of the control or layer. This includes custom vertices and UV coordinates. The following attributes are defined:


Parameters:
        width    The viewport width for the content
        height    The viewport height for the content
        type    The type of primitive to render:  fan | triangles
        nvert    The number of vertex coordinates.  Options are 2 (x,y) and 3 (x, y, z)
        nuv        The number of UV coordinates.  Options are 2 or 0
        data    The table containing the vertex data

Example:

                            

function cbSetGeometry(mapargs)
    local gdata = {}
    local dz = 0.0
    local offset = mapargs.offset
    local dz2 = -offset
    local w
    local h = 240

    dz2 = -offset
    w = 320 - offset
    gdata = {
      {x=w/2, y=h/2, z=dz2, u=0.5, v=0.5},

      {x=w, y=0, z=dz, u=1.0, v=0},
      {x=w/2, y=0, z=dz2, u=0.5, v=0},
      {x=0, y=0, z=dz, u=0, v=0},

      {x=0, y=h, z=dz, u=0, v=1.0},
      {x=w/2, y=h, z=dz2, u=0.5, v=1.0},
      {x=w, y=h, z=dz, u=1.0, v=1.0},

      {x=w, y=0, z=dz, u=1.0, v=0},
    }

    local attrs = {}
    attrs["geometry"] = {
        width = w,
        height = h,
        type = "fan",
        nvert = 3,
        nuv = 2,
        data = gdata
    }
    gre.set_layer_attrs("geometry.layer3",attrs)
end