engine: github.com/g3n/engine/renderer/shaders Index | Files

package shaders

import "github.com/g3n/engine/renderer/shaders"

Package shaders contains the several shaders used by the engine

Index

Package Files

shaders.go sources.go

func AddInclude Uses

func AddInclude(name string, source string)

AddInclude adds a chunk of shader code to the default shaders registry which can be included in a shader using the "#include <name>" directive

func AddProgram Uses

func AddProgram(name string, vertex string, frag string, others ...string)

AddProgram adds a shader program to the default registry of programs. Currently up to 3 shaders: vertex, fragment and geometry (optional) can be specified.

func AddShader Uses

func AddShader(name string, source string)

AddShader add a shader to default shaders registry. The specified name can be used when adding programs to the registry

func IncludeSource Uses

func IncludeSource(name string) string

IncludeSource returns the source code of the specified shader include chunk. If the name is not found an empty string is returned.

func Includes Uses

func Includes() []string

Includes returns list with the names of all include chunks currently in the default shaders registry.

func Programs Uses

func Programs() []string

Programs returns list with the names of all programs currently in the default shaders registry.

func ShaderSource Uses

func ShaderSource(name string) string

ShaderSource returns the source code of the specified shader in the default shaders registry. If the name is not found an empty string is returned

func Shaders Uses

func Shaders() []string

Shaders returns list with the names of all shaders currently in the default shaders registry.

type ProgramInfo Uses

type ProgramInfo struct {
    Vertex   string // Vertex shader name
    Fragment string // Fragment shader name
    Geometry string // Geometry shader name (optional)
}

ProgramInfo contains information for a registered shader program

func GetProgramInfo Uses

func GetProgramInfo(name string) ProgramInfo

GetProgramInfo returns ProgramInfo struct for the specified program name in the default shaders registry

Package shaders is imported by 2 packages. Updated 2018-08-16. Refresh now. Tools for package owners.