Documentation ¶
Index ¶
- Constants
- func NewAnimation(frames gpu.Frames) (index, count uint32)
- func NewMesh(v gpu.Vertices) (index, count uint32)
- func Open() (gpu.Context, error)
- func Render(model *gpu.Model)
- func Sync() error
- func Upload() error
- type Buffer
- type CompiledShader
- type Context
- func (Context) NewAnimation(frames gpu.Frames) (index, count uint32)
- func (Context) NewMaterial(texture gpu.Texture) (albedo, physical, normal, emission uint64)
- func (Context) NewMesh(vertices gpu.Vertices) (index, count uint32)
- func (Context) Render(model *gpu.Model, models []gpu.Model, transform *gpu.Transform)
- func (Context) Sync() error
- func (Context) Upload() error
- type DrawArraysIndirectCommand
- type DrawElementsIndirectCommand
- type FragmentShader
- type Program
- type Shader
- type VertexShader
Constants ¶
View Source
const Fragment = `
in vec4 blend;
out vec4 color;
void main() {
color = blend;
}`
View Source
const FragmentFallback = `` /* 14406-byte string literal not displayed */
View Source
const Vertex = `` /* 446-byte string literal not displayed */
View Source
const VertexFallback = `` /* 624-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func NewAnimation ¶
Types ¶
type Buffer ¶
type Buffer struct { //Data to buffer. Vertices, Normals, UVs []float32 VertexPointers []uint32 Colors []uint8 //There are 3 4x4 matrices. Transforms []gpu.Transform //Textures. ColorMaps []uint64 //Rendering queue. DrawArrayCommands []DrawArraysIndirectCommand DrawElementCommands []DrawElementsIndirectCommand // contains filtered or unexported fields }
type CompiledShader ¶
type CompiledShader uint32
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context is an OpenGL driver interface to the GPU implementing the gpu.GPU interface.
func (Context) NewMaterial ¶
NewMaterial implements gpu.Driver.NewMaterial
type DrawArraysIndirectCommand ¶
type DrawArraysIndirectCommand = C.DrawArraysIndirectCommand
type DrawElementsIndirectCommand ¶
type DrawElementsIndirectCommand = C.DrawElementsIndirectCommand
type FragmentShader ¶
type FragmentShader string
func (FragmentShader) Compile ¶
func (s FragmentShader) Compile() (CompiledShader, error)
type Program ¶
type Program struct { Shaders []Shader // contains filtered or unexported fields }
var DefaultProgram Program
func NewProgram ¶
func NewProgram() Program
type Shader ¶
type Shader interface {
Compile() (CompiledShader, error)
}
type VertexShader ¶
type VertexShader string
func (VertexShader) Compile ¶
func (s VertexShader) Compile() (CompiledShader, error)
Click to show internal directories.
Click to hide internal directories.