Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLayerForScene ¶
NewLayerForScene returns the splitting-BSP layer: exact painter's order from ANY eye, with polygons that straddle a partition plane cut into pieces at build time. The tree is world-space and rebuilt only when world geometry changes, so its build cost amortises across camera motion — which makes this the layer for STATIC geometry under a moving eye. For per-frame dynamic geometry (noise fields, mocap) use layer/nsort, which orders for the current eye and cuts only on genuine occlusion cycles.
Types ¶
type Layer ¶
type Layer struct {
// contains filtered or unexported fields
}
Layer implements the layer.Layer interface.
type Planes ¶
func (Planes) EnterGroup ¶
func (b Planes) EnterGroup()
func (Planes) LeaveGroup ¶
func (b Planes) LeaveGroup()
type Shader ¶
type Shader struct {
Cache ShaderCache
// contains filtered or unexported fields
}
func NewShader ¶
func NewShader(cache ShaderCache) *Shader
func (*Shader) EnterGroup ¶
func (v *Shader) EnterGroup()
func (*Shader) LeaveGroup ¶
func (v *Shader) LeaveGroup()
func (*Shader) Shade ¶
func (shader *Shader) Shade(scene *seen.Scene, projection, viewport matrix.Matrix) (updated, world bool)
Shade updates the cache for every face in the scene. updated reports any change at all (including projection/viewport-only changes); world reports changes to world-space geometry — a face new to the cache, marked Dirty, or moved by its model transform. Consumers that derive world-space structures (the bsort BSP tree is built from world-space planes) should rebuild on world only: a camera or viewport change alone moves no plane.
type ShaderCache ¶
type ShaderCache map[int]ShaderFragment