Documentation
¶
Index ¶
- Constants
- type CubeTexture
- type CubeTextureData
- type DataFormat
- type DepthFunc
- type Framebuffer
- type FramebufferData
- type IndexWriter
- type Item
- type Pipeline
- type Program
- type ProgramData
- type RenderPrimitive
- type Renderer
- type Sequence
- type TwoDTexture
- type TwoDTextureData
- type VertexArray
- type VertexArrayData
- type VertexArrayLayout
- type VertexWriter
Constants ¶
View Source
const ( CoordAttributeIndex = 0 NormalAttributeIndex = 1 TangentAttributeIndex = 2 TexCoordAttributeIndex = 3 ColorAttributeIndex = 4 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CubeTexture ¶
type CubeTexture struct {
ID uint32
}
func (*CubeTexture) Allocate ¶
func (t *CubeTexture) Allocate(data CubeTextureData) error
func (*CubeTexture) Release ¶
func (t *CubeTexture) Release() error
type CubeTextureData ¶
type Framebuffer ¶
type Framebuffer struct { ID uint32 AlbedoTextureID uint32 NormalTextureID uint32 DepthTextureID uint32 Width int32 Height int32 }
func (*Framebuffer) Allocate ¶
func (b *Framebuffer) Allocate(data FramebufferData) error
func (Framebuffer) HasAlbedoAttachment ¶
func (b Framebuffer) HasAlbedoAttachment() bool
func (Framebuffer) HasDepthAttachment ¶
func (b Framebuffer) HasDepthAttachment() bool
func (Framebuffer) HasNormalAttachment ¶
func (b Framebuffer) HasNormalAttachment() bool
func (*Framebuffer) Release ¶
func (b *Framebuffer) Release() error
type FramebufferData ¶
type IndexWriter ¶
type IndexWriter struct {
// contains filtered or unexported fields
}
func NewIndexWriter ¶
func NewIndexWriter(vad VertexArrayData) *IndexWriter
func (*IndexWriter) Next ¶
func (w *IndexWriter) Next() *IndexWriter
func (*IndexWriter) SetIndex ¶
func (w *IndexWriter) SetIndex(index uint16) *IndexWriter
type Item ¶
type Item struct { Program *Program Primitive RenderPrimitive BackfaceCulling bool // TODO: Make uniforms generic through usage of // uniform type specifiers and []byte buffers ModelMatrix sprec.Mat4 Metalness float32 MetalnessTwoDTexture *TwoDTexture Roughness float32 RoughnessTwoDTexture *TwoDTexture AlbedoColor sprec.Vec4 AlbedoTwoDTexture *TwoDTexture AlbedoCubeTexture *CubeTexture AmbientReflectionTexture *CubeTexture AmbientRefractionTexture *CubeTexture NormalScale float32 NormalTwoDTexture *TwoDTexture LightDirectionWS sprec.Vec3 Exposure float32 VertexArray *VertexArray IndexOffset int IndexCount int32 }
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
func (*Pipeline) BeginSequence ¶
func (*Pipeline) EndSequence ¶
func (*Pipeline) SchedulePostRender ¶
func (p *Pipeline) SchedulePostRender(action func())
func (*Pipeline) SchedulePreRender ¶
func (p *Pipeline) SchedulePreRender(action func())
type Program ¶
type Program struct { ID uint32 VertexShaderID uint32 FragmentShaderID uint32 FBColor0TextureLocation int32 FBColor1TextureLocation int32 FBDepthTextureLocation int32 ProjectionMatrixLocation int32 ModelMatrixLocation int32 ViewMatrixLocation int32 CameraMatrixLocation int32 LightDirectionWSLocation int32 ExposureLocation int32 MetalnessLocation int32 MetalnessTwoDTextureLocation int32 RoughnessLocation int32 RoughnessTwoDTextureLocation int32 AlbedoColorLocation int32 AlbedoTwoDTextureLocation int32 AlbedoCubeTextureLocation int32 AmbientReflectionTextureLocation int32 AmbientRefractionTextureLocation int32 NormalScaleLocation int32 NormalTwoDTextureLocation int32 }
func (*Program) Allocate ¶
func (p *Program) Allocate(data ProgramData) error
type ProgramData ¶
type RenderPrimitive ¶
type RenderPrimitive int
const ( RenderPrimitivePoints RenderPrimitive = iota RenderPrimitiveLines RenderPrimitiveLineStrip RenderPrimitiveLineLoop RenderPrimitiveTriangles RenderPrimitiveTriangleStrip RenderPrimitiveTriangleFan )
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
func NewRenderer ¶
func NewRenderer() *Renderer
func (*Renderer) BeginPipeline ¶
func (*Renderer) EndPipeline ¶
type Sequence ¶
type Sequence struct { SourceFramebuffer *Framebuffer TargetFramebuffer *Framebuffer BlitFramebufferColor bool BlitFramebufferDepth bool BlitFramebufferSmooth bool BackgroundColor sprec.Vec4 TestDepth bool ClearColor bool ClearDepth bool WriteDepth bool DepthFunc DepthFunc ProjectionMatrix sprec.Mat4 ViewMatrix sprec.Mat4 CameraMatrix sprec.Mat4 // contains filtered or unexported fields }
type TwoDTexture ¶
type TwoDTexture struct {
ID uint32
}
func (*TwoDTexture) Allocate ¶
func (t *TwoDTexture) Allocate(data TwoDTextureData) error
func (*TwoDTexture) Release ¶
func (t *TwoDTexture) Release() error
type TwoDTextureData ¶
type VertexArray ¶
func (*VertexArray) Allocate ¶
func (a *VertexArray) Allocate(data VertexArrayData) error
func (*VertexArray) Release ¶
func (a *VertexArray) Release() error
func (*VertexArray) Update ¶
func (a *VertexArray) Update(data VertexArrayData) error
type VertexArrayData ¶
type VertexArrayData struct { VertexData []byte IndexData []byte Layout VertexArrayLayout }
func NewVertexArrayData ¶
func NewVertexArrayData(vertices, indices int, layout VertexArrayLayout) VertexArrayData
type VertexArrayLayout ¶
type VertexWriter ¶
type VertexWriter struct {
// contains filtered or unexported fields
}
func NewVertexWriter ¶
func NewVertexWriter(vad VertexArrayData) *VertexWriter
func (*VertexWriter) Next ¶
func (w *VertexWriter) Next() *VertexWriter
func (*VertexWriter) SetCoord ¶
func (w *VertexWriter) SetCoord(x, y, z float32) *VertexWriter
Source Files
¶
Click to show internal directories.
Click to hide internal directories.