ray_tracing

package
v0.0.0-...-98f3f52 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilmSplat

type FilmSplat struct {
	Pixel         int
	WavelengthNM  float64
	WavelengthPDF float64
	Value         float64
	// contains filtered or unexported fields
}

FilmSplat is an unnormalized contribution produced by a global path sample.

type Handler

type Handler struct {
	MaxRayLevel          int64                    `json:"max_ray_level"`
	RussianRouletteDepth int64                    `json:"russian_roulette_depth"`
	MaxArc               float64                  `json:"max_arc"` // total geodesic distance budget per ray (0 ⇒ unbounded)
	Space                geometry.SceneSpace      `json:"-"`
	BlockCols            int                      `json:"block_cols"`
	BlockRows            int                      `json:"block_rows"`
	WavelengthSampler    optics.WavelengthSampler `json:"-"`
	RayPool              sync.Pool                `json:"ray_pool"`
}

func NewHandler

func NewHandler(space geometry.SceneSpace) *Handler

func (*Handler) TraceRay

func (h *Handler) TraceRay(objTree *object.ObjectTree, ray *optics.Ray, level int64)

func (*Handler) TraceScene

func (h *Handler) TraceScene(job RenderJob) error

TraceScene selects one scene-level integrator and delegates the complete render schedule to it.

func (*Handler) TraceSpectral

func (h *Handler) TraceSpectral(job RenderJob, index ...int) []renderfilm.SpectralSample

func (*Handler) TraceSpectralSample

func (h *Handler) TraceSpectralSample(
	job RenderJob,
	ray *optics.Ray,
	wavelengthSampler optics.WavelengthSampler,
	u float64,
	index ...int,
) renderfilm.SpectralSample

type IntegratorKind

type IntegratorKind string

IntegratorKind is the serialized name of a light-transport algorithm.

const (
	IntegratorPathTracing  IntegratorKind = "path"
	IntegratorBDPT         IntegratorKind = "bdpt"
	IntegratorLightTracing IntegratorKind = "light_tracing"
)

func ParseIntegratorKind

func ParseIntegratorKind(value string) (IntegratorKind, error)

ParseIntegratorKind accepts only canonical Engine protocol names.

type PreparedIntegratorState

type PreparedIntegratorState interface {
	// contains filtered or unexported methods
}

type RenderJob

type RenderJob struct {
	// contains filtered or unexported fields
}

RenderJob is the single resolved representation of one render. Its public construction validates all required values; runtime-only state is attached to a private copy by Handler.TraceScene.

func NewRenderJob

func NewRenderJob(
	integrator IntegratorKind,
	renderCamera camera.RayCamera,
	renderFilm *film.Film,
	output string,
	objectTree *object.ObjectTree,
	samples int64,
	threadNum int,
	wavelengthSamples int,
) (RenderJob, error)

func (RenderJob) Camera

func (j RenderJob) Camera() camera.RayCamera

func (RenderJob) Film

func (j RenderJob) Film() *film.Film

func (RenderJob) Integrator

func (j RenderJob) Integrator() IntegratorKind

func (RenderJob) Output

func (j RenderJob) Output() string

func (RenderJob) Samples

func (j RenderJob) Samples() int64

func (RenderJob) ThreadNum

func (j RenderJob) ThreadNum() int

func (RenderJob) WavelengthSamples

func (j RenderJob) WavelengthSamples() int

type SceneIntegrator

type SceneIntegrator interface {
	Prepare(*RenderJob) (PreparedIntegratorState, error)
	Run(*RenderJob, PreparedIntegratorState) error
	EffectiveSampleCount(*RenderJob) int64
	ConcurrentFilmWrites() bool
}

SceneIntegrator owns a work-distribution model. Algorithms are injected as kernels, so pixel-driven and splat-driven transports share one lifecycle without pretending to have the same scheduling semantics.

func NewSceneIntegrator

func NewSceneIntegrator(kind IntegratorKind) (SceneIntegrator, error)

NewSceneIntegrator resolves configuration once, before rendering begins.

type SegmentTransmittance

type SegmentTransmittance struct {
	Power    float64
	Identity bool
}

SegmentTransmittance is scalar attenuation at the path's sampled wavelength.

func (SegmentTransmittance) ApplyToPower

func (t SegmentTransmittance) ApplyToPower(value float64) float64

func (SegmentTransmittance) ApplyToRay

func (t SegmentTransmittance) ApplyToRay(ray *renderray.Ray)

type SurfaceInteraction

type SurfaceInteraction struct {
	Hit           *object.SurfaceHit
	Object        *object.Object
	Frame         maths.Frame
	EmissionFrame maths.Frame
	WoLocal       maths.Direction
	WoEmission    maths.Direction
	Context       bxdf.ShadingContext
}

type TileCoordinate

type TileCoordinate struct {
	X0 int
	X1 int
	Y0 int
	Y1 int
}

Jump to

Keyboard shortcuts

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