pass

package
v0.0.0-...-8e5a076 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2024 License: GPL-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DiffuseAttachment  attachment.Name = "diffuse"
	NormalsAttachment  attachment.Name = "normals"
	PositionAttachment attachment.Name = "position"
	OutputAttachment   attachment.Name = "output"
)
View Source
const LightingSubpass renderpass.Name = "lighting"
View Source
const MainSubpass = renderpass.Name("main")
View Source
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 AmbientOcclusionParams struct {
	Projection mat4.T
	Kernel     [SSAOSamples]vec4.T
	Samples    int32
	Scale      float32
	Radius     float32
	Bias       float32
	Power      float32
}

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

func (*AmbientOcclusionPass) Record

func (p *AmbientOcclusionPass) Record(cmds command.Recorder, args draw.Args, scene object.Component)

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

func NewBlurPass(app engine.App, output engine.Target, input engine.Target) *BlurPass

func (*BlurPass) Destroy

func (p *BlurPass) Destroy()

func (*BlurPass) Name

func (p *BlurPass) Name() string

func (*BlurPass) Record

func (p *BlurPass) Record(cmds command.Recorder, args draw.Args, scene object.Component)

type Cascade

type Cascade struct {
	Texture     *texture.Texture
	Frame       *framebuffer.Framebuffer
	Descriptors []*BasicDescriptors
}

func (*Cascade) Destroy

func (c *Cascade) Destroy()

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

func (*DeferredGeometryPass) Record

func (p *DeferredGeometryPass) Record(cmds command.Recorder, args draw.Args, scene object.Component)

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

func (*DeferredLightPass) Record

func (p *DeferredLightPass) Record(cmds command.Recorder, args draw.Args, scene object.Component)

type DepthPass

type DepthPass struct {
	// contains filtered or unexported fields
}

func NewDepthPass

func NewDepthPass(
	app engine.App,
	depth engine.Target,
) *DepthPass

func (*DepthPass) Destroy

func (p *DepthPass) Destroy()

func (*DepthPass) Name

func (p *DepthPass) Name() string

func (*DepthPass) Record

func (p *DepthPass) Record(cmds command.Recorder, args draw.Args, scene object.Component)

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

func (*ForwardPass) Record

func (p *ForwardPass) Record(cmds command.Recorder, args draw.Args, scene object.Component)

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 GuiConfig

type GuiConfig struct {
	Resolution vec2.T
	ZMax       float32
}

type GuiDescriptors

type GuiDescriptors struct {
	descriptor.Set
	Config   *descriptor.Uniform[GuiConfig]
	Quads    *descriptor.Storage[widget.Quad]
	Textures *descriptor.SamplerArray
}

type GuiDrawable

type GuiDrawable interface {
	object.Component
	DrawUI(widget.DrawArgs, *widget.QuadBuffer)
}

type GuiPass

type GuiPass struct {
	// contains filtered or unexported fields
}

func NewGuiPass

func NewGuiPass(app engine.App, target engine.Target) *GuiPass

func (*GuiPass) Destroy

func (p *GuiPass) Destroy()

func (*GuiPass) Name

func (p *GuiPass) Name() string

func (*GuiPass) Record

func (p *GuiPass) Record(cmds command.Recorder, args draw.Args, scene object.Component)

type HemisphereNoise

type HemisphereNoise struct {
	Width  int
	Height int
	// contains filtered or unexported fields
}

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) Bind

func (ls *LightShader) Bind(cmd *command.Buffer, frame int)

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

func NewLinePass(app engine.App, target engine.Target, depth engine.Target) *LinePass

func (*LinePass) Destroy

func (p *LinePass) Destroy()

func (*LinePass) Name

func (p *LinePass) Name() string

func (*LinePass) Record

func (p *LinePass) Record(cmds command.Recorder, args draw.Args, scene object.Component)

type OutputDescriptors

type OutputDescriptors struct {
	descriptor.Set
	Output *descriptor.Sampler
}

type OutputPass

type OutputPass struct {
	// contains filtered or unexported fields
}

func NewOutputPass

func NewOutputPass(app engine.App, target engine.Target, source engine.Target) *OutputPass

func (*OutputPass) Destroy

func (p *OutputPass) Destroy()

func (*OutputPass) Name

func (p *OutputPass) Name() string

func (*OutputPass) Record

func (p *OutputPass) Record(cmds command.Recorder, args draw.Args, scene object.Component)

type PostProcessDescriptors

type PostProcessDescriptors struct {
	descriptor.Set
	Input *descriptor.Sampler
	LUT   *descriptor.Sampler
}

type PostProcessPass

type PostProcessPass struct {
	LUT assets.Texture
	// contains filtered or unexported fields
}

func NewPostProcessPass

func NewPostProcessPass(app engine.App, target engine.Target, input engine.Target) *PostProcessPass

func (*PostProcessPass) Destroy

func (p *PostProcessPass) Destroy()

func (*PostProcessPass) Name

func (p *PostProcessPass) Name() string

func (*PostProcessPass) Record

func (p *PostProcessPass) Record(cmds command.Recorder, args draw.Args, scene object.Component)

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

func (*ShadowCache) Lookup

func (s *ShadowCache) Lookup(lit light.T, cascade int) (int, bool)

type Shadowmap

type Shadowmap struct {
	Cascades []Cascade
}

func (*Shadowmap) Destroy

func (s *Shadowmap) Destroy()

type ShadowmapLookupFn

type ShadowmapLookupFn func(light.T, int) *texture.Texture

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

func (*Shadowpass) Record

func (p *Shadowpass) Record(cmds command.Recorder, args draw.Args, scene object.Component)

func (*Shadowpass) Shadowmap

func (p *Shadowpass) Shadowmap(light light.T, cascade int) *texture.Texture

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL