Skip to content

RenderRadialBlend

Overview

RenderProgram for a radial blend (essentially a chunk of a radial gradient with only a linear transition between two things.

RenderRadialBlend will interpolate between two different RenderPrograms based on the location. It will evaluate clamp( ( averageFragmentRadius - radius0 ) / ( radius1 - radius0 ), 0, 1 ), and will linearly blend between the "zero" program (when the value is 0) and the "one" program (when the value is 1).

It can be used in a standalone way, however it is primarily meant to be used when a RenderRadialGradient is circular, and is split into each radial-linear partition.

@author Jonathan Olson <jonathan.olson@colorado.edu>

Class RenderRadialBlend

import { RenderRadialBlend } from 'scenerystack/alpenglow';

Constructor

new RenderRadialBlend( transform : Matrix3, radius0 : number, radius1 : number, accuracy : RenderRadialBlendAccuracy, zero : RenderProgram, one : RenderProgram, logic? : RenderRadialBlendLogic )

Instance Methods

getName() : string

withChildren( children : RenderProgram[] ) : RenderRadialBlend

transformed( transform : Matrix3 ) : RenderProgram

equalsTyped( other : this ) : boolean

(protected)

getSimplified( children : RenderProgram[] ) : RenderProgram | null

(protected)

evaluate( context : RenderEvaluationContext ) : Vector4

writeInstructions( instructions : RenderInstruction[] )

serialize() : SerializedRenderRadialBlend

Instance Properties

logic : RenderRadialBlendLogic

(readonly)

Static Methods

deserialize( obj : SerializedRenderRadialBlend ) : RenderRadialBlend

Class RenderRadialBlendLogic

import { RenderRadialBlendLogic } from 'scenerystack/alpenglow';

Constructor

new RenderRadialBlendLogic( transform : Matrix3, radius0 : number, radius1 : number, accuracy : RenderRadialBlendAccuracy )

Instance Methods

equals( other : RenderRadialBlendLogic ) : boolean

computeLinearValue( context : RenderEvaluationContext ) : number

Instance Properties

inverseTransform : Matrix3

(readonly)

Type SerializedRenderRadialBlend

import type { SerializedRenderRadialBlend } from 'scenerystack/alpenglow';

Source Code

See the source for RenderRadialBlend.ts in the alpenglow repository.