renderer

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: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoTracers        = errors.New("renderer: no tracers attached")
	ErrSceneNotDefined  = errors.New("renderer: no scene defined")
	ErrCameraNotDefined = errors.New("renderer: no camera defined")
	ErrInterrupted      = errors.New("renderer: interrupted while rendering")
)

Functions

This section is empty.

Types

type FrameStats

type FrameStats struct {
	// Individual tracer stats.
	Tracers []TracerStat

	// Total render time for entire frame.
	RenderTime time.Duration
}

type Options

type Options struct {
	// Frame dims.
	FrameW uint32
	FrameH uint32

	// Number of indirect bounces.
	NumBounces uint32

	// Min bounces before applying russian roulette for path elimination.
	MinBouncesForRR uint32

	// Number of samples.
	SamplesPerPixel uint32

	// Exposure for tonemapping.
	Exposure float32

	// Device selection.
	BlackListedDevices []string
	ForcePrimaryDevice string
}

type Renderer

type Renderer interface {
	// Render frame.
	Render() error

	// Shutdown renderer and any attached tracer.
	Close()

	// Get render statistics.
	Stats() FrameStats
}

func NewDefault

func NewDefault(sc *scene.Scene, scheduler tracer.BlockScheduler, pipeline *opencl.Pipeline, opts Options) (Renderer, error)

Create a new default renderer using the specified block scheduler and tracing pipeline.

func NewInteractive

func NewInteractive(sc *scene.Scene, scheduler tracer.BlockScheduler, pipeline *opencl.Pipeline, opts Options) (Renderer, error)

Create a new interactive opengl renderer using the specified block scheduler and tracing pipeline.

type TracerStat

type TracerStat struct {
	// The tracer id.
	Id string

	// True if this is the primary tracer
	IsPrimary bool

	// The block height and the percentage of total frame area it represents.
	BlockH       uint32
	FramePercent float32

	// Render time for assigned block
	RenderTime time.Duration
}

Jump to

Keyboard shortcuts

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