linsyking/elm-regl/3.0.0

NOTE: the latest version is 10.0.0

Renamed to elm-messenger/elm-regl. That is where the repository lives now. It has not been published as a package under the new name.

Versions published as linsyking/elm-regl still install under that name. 5 versions of 15 come from the new location (see their notes).

Rerouted (renamed, verified). The GitHub user or repository was renamed. The tag is still there, at the new name. The Lamdera package server serves a copy recovered from https://github.com/elm-messenger/elm-regl.

What we checked: The repo moved to github.com/elm-messenger/elm-regl. Rebuilt with git archive from commit 7053a707a913 of https://github.com/elm-messenger/elm-regl (zip prefix linsyking-elm-regl-55043ff/, America/Los_Angeles times): the zip is byte-identical to the one package.elm-lang.org recorded, SHA-1 b7a0ecd4f50897890333ce9d7d2a6633123d93ab.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

Details · package.elm-lang.org's zip: https://github.com/linsyking/elm-regl/zipball/3.0.0/

REGL.Program

Custom REGL Program

Users could define their own custom REGL program using this module. REGL programs could be used as a renderable generator, effect, or compositor.

Program Value

= DynamicValue String
| StaticValue Value
| DynamicTextureValue String

A value that can be either a static value or a dynamic value.

Program Construction

type alias REGLProgram =
{ frag : String
, vert : String
, attributes : Maybe (List ( String, ProgValue ))
, uniforms : Maybe (List ( String, ProgValue ))
, elements : Maybe ProgValue
, primitive : Maybe ProgValue
, count : Maybe ProgValue
}

A custom program that can be used with REGL.

encodeProgram : REGLProgram -> Value

Encode a custom program to an object.

Usually users could use the following functions to construct a custom program by only providing the fragment shader and uniforms:

makeEffectSimple : String -> List ( String, ProgValue ) -> REGLProgram

Make a custom effect program simply.

In the fragment shader, use texture2D(texture, vuv) to sample the texture.

You could also use vec2 view to get the size of virtual canvas.

makeCompositorSimple : String -> List ( String, ProgValue ) -> REGLProgram

Make a custom composite program simply.

t1 and t2 are the names of the texture uniforms in the program.

If more customization is needed, users could use the following functions:

makeCompositorProgram : String -> String -> REGLProgram -> REGLProgram

Make a custom composite program.

src and dst are the names of the texture uniforms in the program.

makeEffectProgram : String -> REGLProgram -> REGLProgram

Make a custom effect program.

texname is the name of the texture uniform in the program.