Documentation ¶
Index ¶
- Constants
- Variables
- func NewTracer(id string, device *device.Device, ctx *cl.Context, pipeline *Pipeline) (tracer.Tracer, error)
- type DebugFlag
- type Pipeline
- type PipelineStage
- type Tracer
- func (tr *Tracer) Close()
- func (tr *Tracer) Flags() tracer.Flag
- func (tr *Tracer) Id() string
- func (tr *Tracer) Init() error
- func (tr *Tracer) MergeOutput(other tracer.Tracer, blockReq *tracer.BlockRequest) (time.Duration, error)
- func (tr *Tracer) Speed() uint32
- func (tr *Tracer) Stats() *tracer.Stats
- func (tr *Tracer) SyncFramebuffer(blockReq *tracer.BlockRequest) (time.Duration, error)
- func (tr *Tracer) Trace(blockReq *tracer.BlockRequest) (time.Duration, error)
- func (tr *Tracer) UpdateState(mode tracer.UpdateMode, changeType tracer.ChangeType, data interface{}) (time.Duration, error)
Constants ¶
View Source
const ( NoDebug DebugFlag = 0 PrimaryRayIntersectionDepth = 1 << iota PrimaryRayIntersectionNormals AllEmissiveSamples VisibleEmissiveSamples OccludedEmissiveSamples Throughput Accumulator FrameBuffer )
Variables ¶
View Source
var ( ErrContextCreationFailed = errors.New("opencl tracer: could not create opencl context") ErrCmdQueueCreationFailed = errors.New("opencl tracer: could not create opencl command queue") ErrAlreadySetup = errors.New("opencl tracer: tracer already set up") ErrProgramCreationFailed = errors.New("opencl tracer: program creation failed") ErrProgramBuildFailed = errors.New("opencl tracer: program compilation failed") ErrKernelCreationFailed = errors.New("opencl tracer: could not create compute kernel") ErrGettingWorkgroupInfo = errors.New("opencl tracer: could not get kernel work group info") ErrAllocatingBuffer = errors.New("opencl tracer: could not allocate device buffer") ErrCopyingDataToHost = errors.New("opencl tracer: could not copy device data to host buffer") ErrCopyingDataToDevice = errors.New("opencl tracer: could not copy host data to device buffer") ErrSettingKernelArgument = errors.New("opencl tracer: error setting kernel argument") ErrKernelExecutionFailed = errors.New("opencl tracer: kernel execution failed") ErrUnsupportedChangeType = errors.New("opencl tracer: unsupported change type") ErrInvalidChangeData = errors.New("opencl tracer: invalid data type for change") ErrInvalidOption = errors.New("opencl tracer: invalid tracer option") ErrNoSceneData = errors.New("opencl tracer: no scene data uploaded") )
Functions ¶
Types ¶
type Pipeline ¶
type Pipeline struct { // Reset the tracer state. This stage is executed whenever the camera // is moved or the sample counter is reset. Reset PipelineStage // This stage is executed whenever the tracer generates a new set // of primary rays. Depending on the samples per pixel this stage // may be invoked more than once. PrimaryRayGenerator PipelineStage // This stage implements an integrator function to trace the primary // rays and add their contribution into the accumulation buffer. Integrator PipelineStage // A set of post-processing stages that are executed prior to // rendering the final frame. PostProcess []PipelineStage }
The list of pluggable of stages that are used to render the scene.
func DefaultPipeline ¶
type PipelineStage ¶
An alias for functions that can be used as part of the rendering pipeline.
func CopyFrameBufferToOpenGLTexture ¶
func CopyFrameBufferToOpenGLTexture() PipelineStage
Copy RGBA screen buffer to opengl texture. This function assumes that the caller has enabled the appropriate 2D texture target.
func MonteCarloIntegrator ¶
func MonteCarloIntegrator(debugFlags DebugFlag) PipelineStage
Use a montecarlo pathtracer implementation.
func PerspectiveCamera ¶
func PerspectiveCamera() PipelineStage
Use a perspective camera for the primary ray generation stage.
func SaveFrameBuffer ¶
func SaveFrameBuffer(imgFile string) PipelineStage
Save a copy of the RGBA framebuffer.
func TonemapSimpleReinhard ¶
func TonemapSimpleReinhard() PipelineStage
Apply simple Reinhard tone-mapping.
type Tracer ¶
func (*Tracer) MergeOutput ¶
func (tr *Tracer) MergeOutput(other tracer.Tracer, blockReq *tracer.BlockRequest) (time.Duration, error)
Merge accumulator output from another tracer into this tracer's buffer.
func (*Tracer) SyncFramebuffer ¶
Run post-process filters and update the framebuffer with the processed output.
func (*Tracer) UpdateState ¶
func (tr *Tracer) UpdateState(mode tracer.UpdateMode, changeType tracer.ChangeType, data interface{}) (time.Duration, error)
Update tracer state
Source Files ¶
Click to show internal directories.
Click to hide internal directories.