Categorygithub.com/unitoftime/glitch
modulepackage
0.0.0-20250308153812-9356d31f98b9
Repository: https://github.com/unitoftime/glitch.git
Documentation: pkg.go.dev

# README

Go Reference build

Warning: This library is very much a work in progress. But you're welcome to check it out and provide feedback/bugs if you want.

Overview

Glitch is a shader based rendering library built on top of OpenGL and WebGL. At a high level, I'd like glitch to be data driven. Shaders are just programs that run on the GPU, so my objective is to make Glitch a platform that makes it easier to do the things that are hard in rendering:

  1. Efficiently ordering, moving, and batching data to the GPU
  2. Efficiently executing programs on that copied data

Platform Support

Currently, we compile to:

  • Desktop (Windows, Linux)
  • Browser (via WebAssembly)

Platforms that I'd like to add, but haven't added or haven't tested:

  • Desktop (MacOS - OpenGL is deprecated, I also don't own a mac. So it's hard to test)
  • Mobile Apps
  • Mobile Browsers

Usage

You can look at the examples folder, sometimes they go out of date, but I try to keep them working. Because APIs are shifting I don't have definite APIs defined yet.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
TODO: Ideally this wouldn't return an error.
No description provided by the author
No description provided by the author
Point generation functions:.
No description provided by the author
No description provided by the author
TODO: This won't work for wasm yet For text-keys, we return the upper case version of the key.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Type? Color, depth, stencil?.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Basically a quad mesh, but with a centered position.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Hides and locks the cursor.
A normal cursor, but not rendered.
A normal cursor.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
Note: these are based on the key location for a qwerty keyboard.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Mouse buttons.
Mouse buttons.
Mouse buttons.
Mouse buttons.
Mouse buttons.
Note: 6, 7, 8 dont exist in browsers MouseButton6 = Key(glfw.MouseButton6) MouseButton7 = Key(glfw.MouseButton7) MouseButton8 = Key(glfw.MouseButton8).
Mouse buttons.
Mouse buttons.
No description provided by the author
No description provided by the author
Sort by the computed drawCommand.command.
No description provided by the author
Sort based on the X position.
Sort based on the Y position.
Sort based on the Z position.
Opposite order to SoftwareSortZ.

# Variables

No description provided by the author
No description provided by the author
No description provided by the author

# Structs

TODO - instead of creating a single atlas ahead of time.
No description provided by the author
No description provided by the author
-------------------------------------------------------------------------------- For batching multiple meshes into one mesh.
BufferPool TODO - Idea Improvements: You'd be able to calculate in the pass how many draws with the same material you'd be doing.
No description provided by the author
--------------------------------------------------------------------------------.
TODO - I feel like camera should be a higher-up abstraction and not held here.
For batching multiple sprites into one.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
TODO: You could pack this down even more Shader: shader slot lut ID 256 maximum Texture: texture slot lut ID 256 maximum Uniform: uniform slot lut ID 256 maximum.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SDF ./msdf-atlas-gen/build/bin/msdf-atlas-gen -font ./Lato-Black.ttf -imageout atlas.png -json atlas.json -pots -size 32 -yorigin top -pxrange 10 PlaneBounds: https://github.com/Chlumsky/msdf-atlas-gen/issues/2.
No description provided by the author
No description provided by the author
you were here creating the sorter 1.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author
TODO - rename.
No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

Note: These are all packed into uint8s to reduce size of the Material object.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author