shadertoy

package
v0.0.0-...-4a453a3 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IchannelNumRe = regexp.MustCompile(`^iChannel(\d+)$`)
)

Functions

func RegisterResourceType

func RegisterResourceType(name string, fn ResourceBuildFunc)

func ResolvePath

func ResolvePath(pwd, path string) (string, error)

Types

type GenTexFunc

type GenTexFunc func() uint32

type Mapping

type Mapping struct {
	Name      string
	Namespace string
	Value     string
	PWD       string
}

A Mapping is a parsed representation of a "map <name>=<namespace>:<value>" directive.

func ParseMapping

func ParseMapping(str, pwd string) (Mapping, error)

type Resource

type Resource interface {
	UniformSource() string
	PreRender(state renderer.RenderState)
	Close() error
}

type ResourceBuildFunc

type ResourceBuildFunc func(Mapping, GenTexFunc, renderer.RenderState) (Resource, error)

type ShaderToy

type ShaderToy struct {
	// contains filtered or unexported fields
}

ShaderToy implements a shader environment similar to the one on shadertoy.com.

func NewShaderToy

func NewShaderToy(
	shaderSources []renderer.SourceFile,
	overrideMappings []Mapping,
	glslVersion string,
) (*ShaderToy, error)

func (*ShaderToy) Close

func (st *ShaderToy) Close() error

func (ShaderToy) PreRender

func (st ShaderToy) PreRender(state renderer.RenderState)

func (*ShaderToy) Setup

func (st *ShaderToy) Setup(state renderer.RenderState) error

func (ShaderToy) Sources

func (st ShaderToy) Sources() (map[renderer.Stage][]renderer.Source, error)

func (ShaderToy) SubEnvironments

func (st ShaderToy) SubEnvironments() (map[string]renderer.SubEnvironment, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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