Snippets

Advanced filtering tutorial

Terminal shaders base file

go

package main

import shaders "github.com/theokbokki/terminal-shaders"

type MyShader struct{}

func (s MyShader) Compute(uv shaders.Vec2, time float64) shaders.Vec3 {
	return shaders.Vec3{R: uv.X, G: uv.Y, B: 0.0}
}

func main() {
	shaders.SetFramerate(30) // 30 is the default
	shaders.SetAnsiMode(false) // false is the default

	shaders.RegisterShader("MyShader", MyShader{})

	shaders.Render("MyShader")
}