Documentation
¶
Overview ¶
Package render is the drawing side of gram, knowing nothing of Stages, Scenes or plugins: what a Scene and a plugin draw with. Everything is drawn on the GPU (internal/gpu), in WGSL; the engine hands render its window's device (UseDevice, Present).
A Scene's parts are [Renderer]s, drawing on the screen once a frame; a Picture is what is in the world before a camera, drawn through the camera it is handed and shown by a Feed at a size (Surface): whole, in layers or with its figures sharp. A Reporter adds lines to the telemetry panel.
The world's picture is a Composer of [Source]s, each handing its pieces to a Frame where they lie (At), drawn back to front against the depth; a Direct source draws its part itself with a shader of its own (NewMeshShaderWith, [Image.DrawMesh]; instances that stand are kept on the GPU, Instances), in the passes it asks for: the opaque ground ([Frame.DrawOpaque]), the cutouts after it ([Frame.DrawCutout]: what stands whole, cut at half its alpha, writing the depth, in no order, so what stands behind or under it is hidden), and among what is seen through ([Frame.DrawAt]); Sprites as instances, [Sprites.Cutout] naming those of the cutout pass; Sprites lay what is seen from afar as points too, a pixel at least, as opaque as they cover of it. What must show under what covers it is uncovered ([Frame.DrawUncovered], before the cutouts, into a depth of its own, Target.Uncovered): what gives way is left out in part where it lies nearer ([Sprites.Uncover], [Sprites.GiveWay]). What is worked out per pixel is a material (RegisterMaterials), what every shader of a frame reads beside the uniforms an image (RegisterImage, [Frame.Image]).
Pictures are [Image]s on the GPU, drawn into and filled ([Image.FillRect] and kin); sprites are painted on the CPU into an Atlas (SpriteDrawer, Solid and kin, Blob one seen from afar) or shot on the GPU into their places on it ([Atlas.AddShot]), text in a Font, and by points of the world, as deep as they stand, in Labels (text and badges). A Look is a drawer, a material or frames (Phases, Loops); an Appearance is the sprite a thing is drawn from. A color.RGBA given to render is straight alpha; render premultiplies it for the GPU.
The machinery is render/internal's: gpu (the device), wgsl (the shaders' library, the materials and the frame's images), gfx (images, depths, meshes, shaders), atlas, text, feed, compose (the composer and its frame) and instanced (sprites as instances); render names their types by alias.
Index ¶
- Constants
- Variables
- func ActualFPS() float64
- func BadgeWidth(n int, shape BadgeShape, size float32) float32
- func Compile() error
- func DebugPrintAt(dst *Image, s string, x, y int)
- func Files(fs embed.FS, names ...string) []byte
- func MeanColour(draw SpriteDrawer, size int) color.RGBA
- func Prepare() error
- func Present(enc *wgpu.CommandEncoder, view *wgpu.TextureView, ...) error
- func RegisterImage(name string)
- func SetRates(fps float64)
- func SetSpent(update, draw, present time.Duration)
- func ShaderSource() string
- func Spent() (update, draw, present time.Duration)
- func StyleOf[S Style](s *Styles, id SpriteID) (S, bool)
- func Submit()
- func UseDevice(dev *wgpu.Device, backend gputypes.Backend) error
- func VisitWrapImages(box plane.AABB, worldW, worldH float32, ...)
- func Windowed()
- type Appearance
- type At
- type Atlas
- type AtlasSource
- type BadgeShape
- type Beam
- type Beat
- type Block
- type BlockSet
- type Buffered
- type Canvas
- type Casting
- type Composer
- type Corners
- type Depth
- type Direct
- type Distant
- type DrawImageOptions
- type DrawMeshOptions
- type DrawTrianglesShaderOptions
- type Fade
- type Feed
- type Filter
- type Font
- type Frame
- type GeoM
- type Glass
- type GroundHeights
- type GroundShade
- type Illumination
- type Image
- type IndexRange
- type Indices
- type InstanceRange
- type Instances
- type Labels
- type Laid
- type Lamp
- type Lattice
- type Light
- type Lights
- type Look
- type Loops
- type MaterialID
- type Opening
- type Overlay
- type Overlying
- type Pass
- type Phases
- type Picture
- type Renderer
- type Reporter
- type Shade
- type Shader
- type ShadowPolicy
- type Shadowing
- type Sheet
- type Shelter
- type SolidBackground
- type Source
- type SpriteDrawer
- func Arrow(angleDeg float64, width float32, c color.RGBA) SpriteDrawer
- func Blob(draw SpriteDrawer) SpriteDrawer
- func Border(c color.RGBA) SpriteDrawer
- func Cross(c color.RGBA) SpriteDrawer
- func Diamond(c color.RGBA) SpriteDrawer
- func Dot(radius float32, c color.RGBA) SpriteDrawer
- func Hexagon(c color.RGBA) SpriteDrawer
- func Solid(c color.RGBA) SpriteDrawer
- type SpriteID
- type Sprited
- type Sprites
- type Style
- type Styles
- type Surface
- type Taking
- type Target
- type Umbra
- type Uniform
- type Uniforms
- type Vertex
- type World
Constants ¶
const ( Opaque = compose.Opaque Uncovered = compose.Uncovered Cutout = compose.Cutout SeeThrough = compose.SeeThrough )
The passes: the opaque ground first, then what is uncovered, into a depth of its own, then the cutouts, what stands whole cut at half its alpha and writing the depth, then what is seen through, back to front.
const ( TakesRelief = compose.TakesRelief TakesBlocks = compose.TakesBlocks TakesClouds = compose.TakesClouds TakesLamps = compose.TakesLamps Shines = compose.Shines TakesAll = compose.TakesAll )
The shades a drawn thing takes.
const ( FilterNearest = gfx.FilterNearest FilterLinear = gfx.FilterLinear )
The filters.
const ( Patch = light.Patch Silhouette = light.Silhouette Baked = light.Baked NoShadow = light.NoShadow )
The ways a thing casts its shadow (light.Patch…).
const ( // BadgeDisc is a round badge. BadgeDisc = instanced.BadgeDisc // BadgeDiamond is a square badge standing on a corner. BadgeDiamond = instanced.BadgeDiamond )
const LayerFeather = feed.LayerFeather
LayerFeather is the shown pixels an inner layer's edge fades over.
const MaxLamps = wgsl.Lamps
MaxLamps is how many lamps at most light a picture: the nearest its camera.
const MaxOpenings = light.MaxOpenings
MaxOpenings is how many of a shelter's openings let the distant light in.
const MaxSprites = 1 << 16
MaxSprites is how many sprites an atlas holds: the range of SpriteID.
const ShadeBands = compose.ShadeBands
ShadeBands is how many bands of rows down the ground's shade fade on their own.
const ShadowReach = light.ShadowReach
ShadowReach is how many times its caster's height any shadow reaches at most (light.ShadowReach).
Variables ¶
var ( // Furthest is behind the whole world: the sky. Furthest = compose.Furthest // Nearest is before the whole world: what falls through the air. Nearest = compose.Nearest )
var WhiteLight = Illumination{Light: Light{1, 1, 1}, Takes: TakesAll}
WhiteLight is a thing drawn as it is, taking every shade: a world without a light plugin.
Functions ¶
func ActualFPS ¶ added in v0.3.0
func ActualFPS() float64
ActualFPS is how many frames the engine drew in the last second.
func BadgeWidth ¶ added in v0.20.0
func BadgeWidth(n int, shape BadgeShape, size float32) float32
BadgeWidth is how many shown pixels across a badge of shape at least size across is to hold n written in its middle, nothing written where n is not positive; it may be asked on any goroutine.
func Compile ¶ added in v0.3.0
func Compile() error
Compile compiles the composer's shader now rather than at its first draw.
func DebugPrintAt ¶ added in v0.3.0
DebugPrintAt prints s with its top-left corner at (x, y), a line of it under another at each newline, in the fixed debug text.
func MeanColour ¶ added in v0.19.0
func MeanColour(draw SpriteDrawer, size int) color.RGBA
MeanColour is the colour a Blob of draw drawn size x size fills its disc with, opaque: draw's mean weighted by its alpha; clear for a clear sprite.
func Prepare ¶ added in v0.5.0
func Prepare() error
Prepare compiles every shader, fills every image deferred and puts on the GPU every texture whose pixels wait on the CPU: what a stage's first frame would do on its own, done before it.
func Present ¶ added in v0.5.0
func Present(enc *wgpu.CommandEncoder, view *wgpu.TextureView, format gputypes.TextureFormat, w, h int, screen *Image) error
Present draws screen over the window's surface view, w by h pixels of format, into enc, the window's frame encoder. Everything drawn before is submitted first.
func RegisterImage ¶ added in v0.3.0
func RegisterImage(name string)
RegisterImage names an image every shader built on the materials may read, a texture_2d<f32> of that name in WGSL, which a frame hands them (Frame.Image). It panics once a shader has been built, for a name given twice and past gpu.FrameImages names.
func SetRates ¶ added in v0.3.0
func SetRates(fps float64)
SetRates notes the frames the engine drew in the last second, on the frame's barrier.
func SetSpent ¶ added in v0.3.0
SetSpent notes where a frame's time went on average over the last second, on the frame's barrier: its tick (the simulation and the publishing), its drawing and its presenting.
func ShaderSource ¶ added in v0.3.0
func ShaderSource() string
ShaderSource is the composer's shader as it compiles.
func StyleOf ¶ added in v0.3.0
StyleOf is the style of type S declared for the sprite id, false where none was; a nil Styles has none.
func UseDevice ¶ added in v0.5.0
UseDevice has render draw on dev, the device of the engine's window, made by backend: Vulkan takes a program's SPIR-V kept on disk, the others want its WGSL.
Types ¶
type Appearance ¶ added in v0.3.0
type Appearance struct {
SpriteID SpriteID
Sway float32
// Angle turns the look about the middle of the entity's box, in degrees, 0 east, against the
// clock with the screen's y growing down. The box stays axis-aligned: content past the circle
// inscribed in it swings outside the box as the sprite turns.
Angle float32
}
Appearance is the sprite a thing is drawn from and how far it sways where what lays it leans what sways, 0 not at all to 1 in full.
func (Appearance) Knob ¶ added in v0.3.0
func (Appearance) Knob()
Knob: an effect may turn it (effect.Knob).
type At ¶ added in v0.3.0
At is where a piece of the picture lies: at a height in the world, or on top of it as a mark.
type Atlas ¶
Atlas is an AtlasSource built by adding sprites, each at a size of its own, and then Close, which lays the sheet out and bakes it.
type AtlasSource ¶
type AtlasSource = gfx.AtlasSource
AtlasSource supplies the sprite sheet a Frame draws from.
type BadgeShape ¶ added in v0.20.0
type BadgeShape = instanced.BadgeShape
BadgeShape is the outline of a badge Labels draws.
type BlockSet ¶ added in v0.20.0
BlockSet is the blocks standing in one part of the world, versioned (light.BlockSet).
type Buffered ¶ added in v0.5.0
type Buffered[T any] struct { // contains filtered or unexported fields }
Buffered is what a source draws, kept twice: Back is written by its publisher while Front is drawn, and Swap, while nothing draws, trades them.
func (*Buffered[T]) Back ¶ added in v0.5.0
func (b *Buffered[T]) Back() *T
Back is what is drawn next, being written.
type Casting ¶ added in v0.5.0
Casting is how a thing casts its shadow on the ground (light.Casting).
type Composer ¶ added in v0.3.0
Composer is a Picture drawing its Sources as one picture, laid in layers as a Laid one.
func NewComposer ¶ added in v0.3.0
NewComposer composes sources into one picture; a nil source is left out.
type Corners ¶ added in v0.3.0
Corners are a quad's screen corners: top-left, top-right, bottom-left, bottom-right.
type Direct ¶ added in v0.3.0
Direct is a Source that draws a part of the picture itself, with a shader of its own.
type Distant ¶ added in v0.5.0
Distant is a light from far off, the same everywhere (light.Distant).
type DrawImageOptions ¶ added in v0.3.0
type DrawImageOptions = gfx.DrawImageOptions
DrawImageOptions is how Image.DrawImage draws.
type DrawMeshOptions ¶ added in v0.3.0
type DrawMeshOptions = gfx.DrawMeshOptions
DrawMeshOptions is how Image.DrawMesh draws a mesh.
type DrawTrianglesShaderOptions ¶ added in v0.3.0
type DrawTrianglesShaderOptions = gfx.DrawTrianglesShaderOptions
DrawTrianglesShaderOptions is what Image.DrawTrianglesShader draws with.
type Fade ¶ added in v0.3.0
Fade is how many pixels each side of a soft quad takes to fade out; 0 leaves a side hard.
type Feed ¶ added in v0.3.0
Feed is the world seen through a camera: a Picture drawn through it every frame at its camera's resolution, in layers or with its figures sharp as the camera says, shown at its size.
type Font ¶ added in v0.3.0
Font is a typeface at a size, its glyphs drawn on demand into a sheet of its own; Draw draws a string in it.
func DefaultBoldFont ¶ added in v0.3.0
func DefaultBoldFont() *Font
DefaultBoldFont is Go Bold at 14 pixels, DefaultFont's weight for a heading.
func DefaultFont ¶ added in v0.3.0
func DefaultFont() *Font
DefaultFont is Go Regular at 14 pixels, which has the Latin letters of every European language.
func DefaultLargeFont ¶ added in v0.3.0
func DefaultLargeFont() *Font
DefaultLargeFont is Go Bold at 28 pixels, for a screen's title.
type Frame ¶ added in v0.3.0
Frame gathers what the sources of a Composer draw for one viewport, in screen pixels, each piece where it lies (At), and where the Direct sources draw themselves.
type Glass ¶ added in v0.3.0
Glass is a Source drawing on the glass over its picture, after everything laid over it.
type GroundHeights ¶ added in v0.3.0
type GroundHeights = compose.GroundHeights
GroundHeights is the ground's heights for the shaders to read.
type GroundShade ¶ added in v0.3.0
type GroundShade = compose.GroundShade
GroundShade is the sun on the ground for the shaders to read.
type Illumination ¶ added in v0.3.0
type Illumination = light.Illumination
Illumination is the light a thing is drawn in (light.Illumination).
type Image ¶ added in v0.3.0
Image is a picture on the GPU: a texture, or a rectangle of one, drawn into and read.
type IndexRange ¶ added in v0.3.0
type IndexRange = gfx.IndexRange
IndexRange is Count of a mesh's indices from First.
type Indices ¶ added in v0.3.0
Indices are a mesh's triangles, kept on the GPU once drawn.
func NewIndices ¶ added in v0.3.0
NewIndices keeps the triangles of indices.
type InstanceRange ¶ added in v0.22.0
type InstanceRange = gfx.InstanceRange
InstanceRange is Count of the instances kept from First.
func JoinSpan ¶ added in v0.22.0
func JoinSpan(spans []InstanceRange, r InstanceRange) []InstanceRange
JoinSpan is spans with r after them, one with the last where it follows it at once.
type Instances ¶ added in v0.22.0
Instances are an instanced mesh's instances, kept on the GPU once drawn.
func NewInstances ¶ added in v0.22.0
NewInstances keeps the instances of data, to be drawn as DrawMeshOptions.Kept.
func PackInstances ¶ added in v0.22.0
PackInstances keeps the instances of every block's groups, floats each, a block after another and a block's groups in the order of their keys, and says where each group lies.
type Labels ¶ added in v0.20.0
Labels is text a Direct source draws on the GPU by points of the world, standing upright on each point for the depth test, and badges with a number in.
type Lights ¶ added in v0.5.0
Lights are a scene's lights for a frame, which a Composer lights its frames by (Composer.Light; light.Lights).
type Look ¶ added in v0.3.0
type Look interface {
~func(dst *Canvas, size int) | MaterialID | Phases | Loops
}
Look is the ways a look is painted: drawn once into the sheet (a SpriteDrawer), worked out per pixel every frame (a MaterialID), frames along an effect's course (Phases) or frames round and round by the clock (Loops).
type Loops ¶ added in v0.3.0
type Loops struct {
N int
Period time.Duration
Beat []Beat
Draw func(frame int) SpriteDrawer
DrawFacing func(angleDeg float64, frame int) SpriteDrawer
}
Loops is a look of N frames shown round and round while an effect is on: in turn, each for Period of game time, or to a Beat. One of Draw and DrawFacing draws a frame.
func LoopedFacing ¶ added in v0.3.0
func LoopedFacing(n int, period time.Duration, draw func(angleDeg float64, frame int) SpriteDrawer) Loops
LoopedFacing is the look of n frames round and round, each shown period, of a sprite that faces every way: draw draws each frame at each angle.
func Timed ¶ added in v0.3.0
func Timed(beat []Beat, draw func(frame int) SpriteDrawer) Loops
Timed is the look going round a beat, frame after frame each for its span, drawn by draw once a frame named: a blink of 150 ms every 3 s is two beats of two frames.
func TimedFacing ¶ added in v0.3.0
func TimedFacing(beat []Beat, draw func(angleDeg float64, frame int) SpriteDrawer) Loops
TimedFacing is Timed for a sprite that faces n ways: draw draws each frame at each angle.
type MaterialID ¶ added in v0.3.0
type MaterialID = wgsl.MaterialID
MaterialID is a material registered with RegisterMaterials, which the shader works an Overlay out with.
func RegisterMaterials ¶ added in v0.3.0
func RegisterMaterials(source []byte, reads []Uniform, entry ...string) []MaterialID
RegisterMaterials adds to the composer's shader the materials of source, WGSL with the uniforms it reads (U.Name), one material for each of entries, the function an Overlay of it is handed to:
fn Entry(p: vec2<f32>, red: f32, fraction: f32, custom: vec4<f32>) -> vec4<f32>
It panics once a shader has been built on the materials.
type Opening ¶ added in v0.22.0
Opening is where a shelter's wall lets the distant light in (light.Opening).
type Overlay ¶ added in v0.3.0
Overlay is a quad laid over a sprite for a material to work out in the shader.
type Phases ¶ added in v0.3.0
type Phases struct {
N int
Draw func(frame int) SpriteDrawer
DrawFacing func(angleDeg float64, frame int) SpriteDrawer
}
Phases is a look of n frames spread along an effect's course, from the first as the effect begins to the last as it runs out, once; a look an atlas takes Under an effect that Lasts. One of Draw and DrawFacing draws a frame, the latter for each way a facing sprite looks.
func Phased ¶ added in v0.3.0
func Phased(n int, draw func(frame int) SpriteDrawer) Phases
Phased is the look of n frames along an effect's course, each drawn by draw for its frame.
func PhasedFacing ¶ added in v0.3.0
func PhasedFacing(n int, draw func(angleDeg float64, frame int) SpriteDrawer) Phases
PhasedFacing is Phased for a sprite that faces n ways: draw draws each frame at each angle.
type Picture ¶ added in v0.3.0
Picture is what is in the world before a camera, drawn through the camera it is handed.
type Renderer ¶
type Renderer interface {
Draw(screen *Image)
}
Renderer draws once a frame on the whole screen, in screen pixels.
type Reporter ¶ added in v0.3.0
type Reporter interface {
Report(line func(label, value string))
}
Reporter is a plugin's part of the telemetry panel: lines it adds under the standard ones, each a label and a value, asked for after the ticks, not as a frame is drawn.
type Shade ¶ added in v0.3.0
Shade is the light a piece is drawn in at its corners, blended across it.
type Shader ¶ added in v0.3.0
Shader is a WGSL fragment with its uniforms, built on the materials.
func NewMeshShaderWith ¶ added in v0.3.0
NewMeshShaderWith is a mesh's shader, as NewShaderWith, whose source has a vertex stage of its own: vs_main and fs_main, and fs_prime for a mesh drawn Primed.
func NewShaderWith ¶ added in v0.3.0
NewShaderWith is a shader on the composer's library and every material registered, with fragment's own uniforms and fragment after them. No material may be registered once it has been built.
type ShadowPolicy ¶ added in v0.5.0
type ShadowPolicy = light.ShadowPolicy
ShadowPolicy is how a thing casts its live shadow at a distance from the eye (light.ShadowPolicy).
type Shadowing ¶ added in v0.5.0
Shadowing is how a thing casts its shadow and which shade it takes (light.Shadowing).
type Sheet ¶ added in v0.3.0
type Sheet struct {
// contains filtered or unexported fields
}
Sheet is an image of sprites laid out in cells of one size, a frame cut out by its column and row, pixel for pixel: drawn into a square sprite, a frame of another shape is stretched, and an entity's box of the frame's shape draws it true.
func DecodeSheet ¶ added in v0.3.0
DecodeSheet is the PNG data as a sheet of frames w by h pixels; name says which file in a panic.
func (Sheet) At ¶ added in v0.3.0
func (s Sheet) At(col, row int) SpriteDrawer
At is the drawer of the frame in column col and row row, counted from zero.
type Shelter ¶ added in v0.22.0
Shelter is a roof over part of the world, the distant light getting in by its openings (light.Shelter).
type SolidBackground ¶
SolidBackground fills the screen with one colour.
func (SolidBackground) Draw ¶
func (b SolidBackground) Draw(screen *Image)
type Source ¶ added in v0.3.0
Source is what draws a part of the world by handing its pieces to a Frame.
type SpriteDrawer ¶
type SpriteDrawer = atlas.SpriteDrawer
SpriteDrawer paints one sprite's size x size pixels into dst.
func Blob ¶ added in v0.18.0
func Blob(draw SpriteDrawer) SpriteDrawer
Blob is a SpriteDrawer filling a disc in the middle of the sprite with draw's mean colour, weighted by its alpha, the disc's radius half the sprite's times the root of the share draw covers: a kind seen from afar.
func Border ¶
func Border(c color.RGBA) SpriteDrawer
Border is a SpriteDrawer outlining the sprite with c, transparent inside.
func Cross ¶
func Cross(c color.RGBA) SpriteDrawer
Cross is a SpriteDrawer filling a cross with c, transparent outside.
func Diamond ¶
func Diamond(c color.RGBA) SpriteDrawer
Diamond is a SpriteDrawer filling a diamond with c, transparent outside.
func Hexagon ¶ added in v0.3.0
func Hexagon(c color.RGBA) SpriteDrawer
Hexagon is a SpriteDrawer filling a pointy-top hexagon with c, transparent at the corners. Drawn over a cell of width √3·r and height 2·r it is regular.
func Solid ¶
func Solid(c color.RGBA) SpriteDrawer
Solid is a SpriteDrawer filling the whole sprite with c.
type Sprited ¶ added in v0.3.0
Sprited is whoever is drawn from one slot of the sheet: a kind's handle, or a bare SpriteID, which stands for itself.
type Sprites ¶ added in v0.3.0
Sprites is sprites a Direct source draws on the GPU as instances, by Layer or else in the order they came, one call a run sharing an atlas.
type Style ¶ added in v0.3.0
type Style interface{ Style() }
Style is how a plugin draws about a kind of entity (an outline, a cone, a route): a value of the plugin's own type, declared on the kind's slot of the world's atlas by a figure's Look. A type is one by its method Style(), a mark never called, confirmed beside the type.
type Styles ¶ added in v0.3.0
type Styles struct {
// contains filtered or unexported fields
}
Styles keeps the styles declared on an atlas, one of each type a sprite at most; StyleOf reads them by type.
type Surface ¶ added in v0.3.0
type Surface interface {
// Resize gives the surface its size in pixels.
Resize(w, h int)
// Draw is the picture for this frame, drawn anew; nil while it has no size.
Draw() *Image
}
Surface is a picture shown at a size whoever shows it gives it.
type Uniform ¶ added in v0.3.0
Uniform is one of a shader's uniforms: Size floats, 1 to 4.
func SharedUniforms ¶ added in v0.3.0
func SharedUniforms() []Uniform
SharedUniforms are the uniforms every shader built on the materials has: the library's and those the registered materials read, for a shader of one's own to keep its names apart.
type Uniforms ¶ added in v0.3.0
Uniforms is the composer's shader's uniforms this frame, by name, for a Direct source.
func UniformsOf ¶ added in v0.3.0
UniformsOf is the uniforms m, by name, each a []float32, or an *Image for a frame's image.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package gputest readies the GPU for a test that draws.
|
Package gputest readies the GPU for a test that draws. |
|
internal
|
|
|
atlas
Package atlas is sprites painted on the CPU, each on a Canvas, laid out on one sheet and baked to the GPU, and sprites drawn there into their places on it (Atlas.AddShot).
|
Package atlas is sprites painted on the CPU, each on a Canvas, laid out on one sheet and baked to the GPU, and sprites drawn there into their places on it (Atlas.AddShot). |
|
compose
Package compose is the world's picture: Sources hand their pieces to a Frame where they lie (At); the Composer draws the opaque ground, then the rest back to front against the depth, the Direct sources in the passes they ask for, then the marks.
|
Package compose is the world's picture: Sources hand their pieces to a Frame where they lie (At); the Composer draws the opaque ground, then the rest back to front against the depth, the Direct sources in the passes they ask for, then the marks. |
|
feed
Package feed is the world seen through a camera at a size: a Picture drawn whole, in layers from one composition (Laid) or with its figures sharp over its ground.
|
Package feed is the world seen through a camera at a size: a Picture drawn whole, in layers from one composition (Laid) or with its figures sharp over its ground. |
|
gfx
Package gfx is what draws straight into an image on the GPU: images and their depths, meshes and shaders built on the materials, the 2D fills and the soft blit, and the sprite sheet a frame draws from.
|
Package gfx is what draws straight into an image on the GPU: images and their depths, meshes and shaders built on the materials, the 2D fills and the soft blit, and the sprite sheet a frame draws from. |
|
gpu
Package gpu draws for render on WebGPU (gogpu/wgpu): textures images live in, programs drawing triangles into them with a fragment written in WGSL, and the frame's commands, gathered and submitted at once.
|
Package gpu draws for render on WebGPU (gogpu/wgpu): textures images live in, programs drawing triangles into them with a fragment written in WGSL, and the frame's commands, gathered and submitted at once. |
|
instanced
Package instanced is the sprites a Direct source draws on the GPU as instances, by layer or in the order they came.
|
Package instanced is the sprites a Direct source draws on the GPU as instances, by layer or in the order they came. |
|
light
Package light is how render lights a scene: the distant light and the lamps, the light on what is drawn, and the shadows cast.
|
Package light is how render lights a scene: the distant light and the lamps, the light on what is drawn, and the shadows cast. |
|
text
Package text is fonts, their glyphs drawn on demand into a sheet of their own, and the fixed debug text.
|
Package text is fonts, their glyphs drawn on demand into a sheet of their own, and the fixed debug text. |
|
wgsl
Package wgsl is what every shader built on the materials shares: the library's WGSL and uniforms, the materials registered and the frame's images, sealed once a shader is built on them.
|
Package wgsl is what every shader built on the materials shares: the library's WGSL and uniforms, the materials registered and the frame's images, sealed once a shader is built on them. |