hdr

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package hdr decodes Radiance RGBE panoramas without reducing their dynamic range. It is separate from the ordinary, eight-bit scene image decoders.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BakeEnvironment

func BakeEnvironment(data []byte, width, samples int) (*image.NRGBA, error)

BakeEnvironment decodes a 2:1 HDR panorama and bakes an RGBE environment atlas. Each texel retains its own exponent, so bright lights do not reduce the precision of dim sky and IBL colors elsewhere in the panorama. Decoding and convolution run once at asset loading, never during sampling.

func ImportEnvironment

func ImportEnvironment(data []byte, width, samples int) (graphics.EnvironmentImages, error)

ImportEnvironment retains the original background and filters lighting.

Types

type Panorama

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

Panorama owns top-left, row-major RGBE pixels (four bytes per pixel). Sampling returns linear RGB; stored exposure/color corrections are already applied to the pixels and are not applied again. RGB primaries are preserved.

func Decode

func Decode(data []byte) (*Panorama, error)

Decode accepts flat RGBE and component-RLE scanlines in all eight Radiance orientations. XYZE and obsolete pixel-run encoding are not supported. Image storage is bounded to 64 million pixels; the input is not retained.

func (*Panorama) At

func (p *Panorama) At(x, y int) mgl32.Vec3

At returns the unclipped linear value, or black outside the image.

func (*Panorama) Radiance

func (p *Panorama) Radiance(n mgl32.Vec3) mgl32.Vec3

Radiance bilinearly samples a unit direction in the engine's equirectangular convention. Longitude wraps, latitude clamps, and sampling allocates nothing.

func (*Panorama) Size

func (p *Panorama) Size() (int, int)

Jump to

Keyboard shortcuts

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