shaders

package
v0.2.72 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2025 License: BSD-2-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package shaders contains the several shaders used by the engine

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddProgram

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

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 Programs

func Programs() []string

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

func ShaderSource

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

func Shaders() []string

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

Types

type ProgramInfo

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

func GetProgramInfo(name string) ProgramInfo

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL