Documentation ¶
Index ¶
- Constants
- func AssignMeshTextures(samplers cache.SamplerCache, msh mesh.Mesh, slots []texture.Slot) uniform.TextureIds
- type AmbientOcclusionDescriptors
- type AmbientOcclusionParams
- type AmbientOcclusionPass
- type BasicDescriptors
- type BlurDescriptors
- type BlurPass
- type Cascade
- type DeferredDescriptors
- type DeferredGeometryPass
- type DeferredLightPass
- type DepthPass
- type ForwardDescriptors
- type ForwardPass
- type GeometryBuffer
- type GuiConfig
- type GuiDescriptors
- type GuiDrawable
- type GuiPass
- type HemisphereNoise
- type LightDescriptors
- type LightShader
- type LinePass
- type OutputDescriptors
- type OutputPass
- type PostProcessDescriptors
- type PostProcessPass
- type RenderGroup
- type RenderObject
- type RenderPlan
- type ShadowCache
- type Shadowmap
- type ShadowmapLookupFn
- type Shadowpass
Constants ¶
const ( DiffuseAttachment attachment.Name = "diffuse" NormalsAttachment attachment.Name = "normals" PositionAttachment attachment.Name = "position" OutputAttachment attachment.Name = "output" )
const LightingSubpass renderpass.Name = "lighting"
const MainSubpass = renderpass.Name("main")
const SSAOSamples = 32
Variables ¶
This section is empty.
Functions ¶
func AssignMeshTextures ¶
func AssignMeshTextures(samplers cache.SamplerCache, msh mesh.Mesh, slots []texture.Slot) uniform.TextureIds
Types ¶
type AmbientOcclusionDescriptors ¶
type AmbientOcclusionDescriptors struct { descriptor.Set Params *descriptor.Uniform[AmbientOcclusionParams] Position *descriptor.Sampler Normal *descriptor.Sampler Noise *descriptor.Sampler }
type AmbientOcclusionParams ¶
type AmbientOcclusionPass ¶
type AmbientOcclusionPass struct {
// contains filtered or unexported fields
}
func NewAmbientOcclusionPass ¶
func NewAmbientOcclusionPass(app engine.App, target engine.Target, gbuffer GeometryBuffer) *AmbientOcclusionPass
func (*AmbientOcclusionPass) Destroy ¶
func (p *AmbientOcclusionPass) Destroy()
func (*AmbientOcclusionPass) Name ¶
func (p *AmbientOcclusionPass) Name() string
type BasicDescriptors ¶
type BasicDescriptors struct { descriptor.Set Camera *descriptor.Uniform[uniform.Camera] Objects *descriptor.Storage[uniform.Object] }
type BlurDescriptors ¶
type BlurDescriptors struct { descriptor.Set Input *descriptor.Sampler }
type BlurPass ¶
type BlurPass struct {
// contains filtered or unexported fields
}
func NewBlurPass ¶
type Cascade ¶
type Cascade struct { Texture *texture.Texture Frame *framebuffer.Framebuffer Descriptors []*BasicDescriptors }
type DeferredDescriptors ¶
type DeferredDescriptors struct { descriptor.Set Camera *descriptor.Uniform[uniform.Camera] Objects *descriptor.Storage[uniform.Object] Textures *descriptor.SamplerArray }
type DeferredGeometryPass ¶
type DeferredGeometryPass struct {
// contains filtered or unexported fields
}
func NewDeferredGeometryPass ¶
func NewDeferredGeometryPass( app engine.App, depth engine.Target, gbuffer GeometryBuffer, ) *DeferredGeometryPass
func (*DeferredGeometryPass) Destroy ¶
func (p *DeferredGeometryPass) Destroy()
func (*DeferredGeometryPass) Name ¶
func (p *DeferredGeometryPass) Name() string
type DeferredLightPass ¶
type DeferredLightPass struct {
// contains filtered or unexported fields
}
func NewDeferredLightingPass ¶
func NewDeferredLightingPass( app engine.App, target engine.Target, gbuffer GeometryBuffer, shadows *Shadowpass, occlusion engine.Target, ) *DeferredLightPass
func (*DeferredLightPass) Destroy ¶
func (p *DeferredLightPass) Destroy()
func (*DeferredLightPass) Name ¶
func (p *DeferredLightPass) Name() string
type ForwardDescriptors ¶
type ForwardDescriptors struct { descriptor.Set Camera *descriptor.Uniform[uniform.Camera] Objects *descriptor.Storage[uniform.Object] Lights *descriptor.Storage[uniform.Light] Textures *descriptor.SamplerArray }
type ForwardPass ¶
type ForwardPass struct {
// contains filtered or unexported fields
}
func NewForwardPass ¶
func NewForwardPass( app engine.App, target engine.Target, depth engine.Target, shadowPass *Shadowpass, ) *ForwardPass
func (*ForwardPass) Destroy ¶
func (p *ForwardPass) Destroy()
func (*ForwardPass) Name ¶
func (p *ForwardPass) Name() string
type GeometryBuffer ¶
type GeometryBuffer interface { Width() int Height() int Frames() int Diffuse() image.Array Normal() image.Array Position() image.Array Destroy() }
func NewGbuffer ¶
func NewGbuffer(device *device.Device, size engine.TargetSize) (GeometryBuffer, error)
type GuiDescriptors ¶
type GuiDescriptors struct { descriptor.Set Config *descriptor.Uniform[GuiConfig] Quads *descriptor.Storage[widget.Quad] Textures *descriptor.SamplerArray }
type GuiDrawable ¶
type HemisphereNoise ¶
func NewHemisphereNoise ¶
func NewHemisphereNoise(width, height int) *HemisphereNoise
func (*HemisphereNoise) Key ¶
func (n *HemisphereNoise) Key() string
func (*HemisphereNoise) LoadTexture ¶
func (n *HemisphereNoise) LoadTexture(fs.Filesystem) *texture.Data
func (*HemisphereNoise) Version ¶
func (n *HemisphereNoise) Version() int
type LightDescriptors ¶
type LightDescriptors struct { descriptor.Set Camera *descriptor.Uniform[uniform.Camera] Lights *descriptor.Storage[uniform.Light] Diffuse *descriptor.Sampler Normal *descriptor.Sampler Position *descriptor.Sampler Occlusion *descriptor.Sampler Shadow *descriptor.SamplerArray }
type LightShader ¶
type LightShader struct {
// contains filtered or unexported fields
}
func NewLightShader ¶
func NewLightShader(app engine.App, pass *renderpass.Renderpass, gbuffer GeometryBuffer, occlusion engine.Target) *LightShader
func (*LightShader) Descriptors ¶
func (ls *LightShader) Descriptors(frame int) *LightDescriptors
func (*LightShader) Destroy ¶
func (ls *LightShader) Destroy()
type LinePass ¶
type LinePass struct {
// contains filtered or unexported fields
}
func NewLinePass ¶
type OutputDescriptors ¶
type OutputDescriptors struct { descriptor.Set Output *descriptor.Sampler }
type OutputPass ¶
type OutputPass struct {
// contains filtered or unexported fields
}
func NewOutputPass ¶
func (*OutputPass) Destroy ¶
func (p *OutputPass) Destroy()
func (*OutputPass) Name ¶
func (p *OutputPass) Name() string
type PostProcessDescriptors ¶
type PostProcessDescriptors struct { descriptor.Set Input *descriptor.Sampler LUT *descriptor.Sampler }
type PostProcessPass ¶
func NewPostProcessPass ¶
func (*PostProcessPass) Destroy ¶
func (p *PostProcessPass) Destroy()
func (*PostProcessPass) Name ¶
func (p *PostProcessPass) Name() string
type RenderGroup ¶
type RenderGroup struct { Pipeline *cache.Pipeline Objects []RenderObject }
RenderGroup is a batch of objects that share the same material. All the objects in a group will be rendered using a single indirect draw call.
func (*RenderGroup) Add ¶
func (m *RenderGroup) Add(mat *cache.Pipeline, object RenderObject)
func (*RenderGroup) Clear ¶
func (m *RenderGroup) Clear()
type RenderObject ¶
type RenderObject struct { // Handle is the index of the object in the object storage buffer Handle int // Indices is the number of indices to render Indices int }
func (RenderObject) DrawIndirect ¶
func (r RenderObject) DrawIndirect() command.Draw
DrawIndirect returns a command.Draw object that can be used to render the object
type RenderPlan ¶
type RenderPlan struct {
// contains filtered or unexported fields
}
RenderPlan is a collection of render groups, each group containing objects that share the same material. The render plan maintains the ordering of object batches
func NewRenderPlan ¶
func NewRenderPlan() *RenderPlan
func (*RenderPlan) Add ¶
func (r *RenderPlan) Add(pipe *cache.Pipeline, object RenderObject)
Add an object to the render plan If the material is already in the plan, the object will be added to the existing group Otherwise a new group will be created
func (*RenderPlan) AddOrdered ¶
func (r *RenderPlan) AddOrdered(pipe *cache.Pipeline, object RenderObject)
Add an object to the end of the render plan If the material is already in the last item in the plan, the object will be added to the existing group
func (*RenderPlan) Clear ¶
func (r *RenderPlan) Clear()
Clear the rendre plan, preserving the allocated memory
func (*RenderPlan) Draw ¶
func (r *RenderPlan) Draw(cmd *command.Buffer, indirect *command.IndirectDrawBuffer)
type ShadowCache ¶
type ShadowCache struct {
// contains filtered or unexported fields
}
func NewShadowCache ¶
func NewShadowCache(samplers cache.SamplerCache, lookup ShadowmapLookupFn) *ShadowCache
func (*ShadowCache) Flush ¶
func (s *ShadowCache) Flush(samplers *descriptor.SamplerArray)
Flush the underlying sampler cache
type Shadowpass ¶
type Shadowpass struct {
// contains filtered or unexported fields
}
func NewShadowPass ¶
func NewShadowPass(app engine.App, target engine.Target) *Shadowpass
func (*Shadowpass) Destroy ¶
func (p *Shadowpass) Destroy()
func (*Shadowpass) Name ¶
func (p *Shadowpass) Name() string