Skip to content

RenderRadialBlend

Under Construction

This documentation is auto-generated, and is a work in progress. Please see the source code at https://github.com/phetsims/alpenglow/blob/main/js/render-program/RenderRadialBlend.ts for the most up-to-date information.

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)

Type SerializedRenderRadialBlend

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

Source Code

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