DepthOfFieldShader class final

depth_of_field.frag: a thin lens and a gather — gfx-34n.

Mirrors the GLSL operation for operation, the contract every shader in this package keeps. The golden angle and the sqrt on the radius are carried across literally: change either and the same picture stops coming out of the two implementations, which is the only thing keeping this one honest.

Inheritance

Constructors

DepthOfFieldShader()
Keeps no state, so one const instance serves every draw; builtinCpuShaders files it under DepthOfField.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
run(Float32List v, ShaderBindings b, FragmentContext c) → Vector4?
Returns linear RGBA for attachment zero. Null discards the fragment.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

circleOfConfusion(double depth, {required double focusDistance, required double focalLength, required double aperture, required double maxRadius, required double texelsPerMeter}) → double
CircleAt from the shader: the circle of confusion at depth metres, as a radius in texels.