tracer

package
v0.0.0-...-e791307 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: MIT Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockRequest

type BlockRequest struct {
	// Frame dimensions.
	FrameW uint32
	FrameH uint32

	// Block dimensions.
	BlockX uint32
	BlockY uint32
	BlockW uint32
	BlockH uint32

	// The number of emitted rays per traced pixel.
	SamplesPerPixel uint32

	// The number of bounces to trace.
	NumBounces uint32

	// Number of bounces before applying russian roulette to terminate paths.
	MinBouncesForRR uint32

	// The exposure value controls HDR -> LDR mapping.
	Exposure float32

	// A random seed value for the tracer's random number generator.
	Seed uint32

	// Number of sequential rendered frames from current camera position.
	AccumulatedSamples uint32
}

A unit of work that is processed by a tracer.

type BlockScheduler

type BlockScheduler interface {
	// Split frame into row blocks of variable height and assign to the pool
	// of tracers using feedback collected from previous frames.
	Schedule(tracers []Tracer, frameH uint32) []uint32
}

The BlockScheduler interface is implemented by all block scheduling algorithms.

func NaiveScheduler

func NaiveScheduler() BlockScheduler

Create a new naive scheduler

func PerfectScheduler

func PerfectScheduler() BlockScheduler

Create a new perfect scheduler instance

type ChangeType

type ChangeType uint8
const (
	FrameDimensions ChangeType = iota
	SceneData
	CameraData
)

Supported update data.

type Flag

type Flag uint8
const (
	// Locally attached device
	Local Flag = 1 << iota

	// Remote device.
	Remote

	// CPU-based
	CpuDevice
)

Tracer or-able flag list.

type Stats

type Stats struct {
	// The rendered block dimensions.
	BlockW uint32
	BlockH uint32

	// The time for applying queued scene changes.
	UpdateTime time.Duration

	// The time for rendering this block
	RenderTime time.Duration
}

Tracer statistics.

type Tracer

type Tracer interface {
	// Get tracer id.
	Id() string

	// Get tracer flags.
	Flags() Flag

	// Get the computation speed estimate (in GFlops).
	Speed() uint32

	// Initialize tracer.
	Init() error

	// Shutdown and cleanup tracer.
	Close()

	// Retrieve last frame statistics.
	Stats() *Stats

	// Update tracer state.
	UpdateState(UpdateMode, ChangeType, interface{}) (time.Duration, error)

	// Process block request.
	Trace(*BlockRequest) (time.Duration, error)

	// Merge accumulator output from another tracer into this tracer's buffer.
	MergeOutput(Tracer, *BlockRequest) (time.Duration, error)

	// Run post-process filters to the accumulated trace data and
	// update the output frame buffer.
	SyncFramebuffer(*BlockRequest) (time.Duration, error)
}

type UpdateMode

type UpdateMode uint8
const (
	Synchronous UpdateMode = iota
	Asynchronous
)

Supported update type.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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