Skip to content

RenderBarycentricBlend

Overview

RenderProgram for a triangular barycentric blend.

NOTE: Does not apply perspective correction, is purely a 2d blend.

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

Class RenderBarycentricBlend

import { RenderBarycentricBlend } from 'scenerystack/alpenglow';

Constructor

new RenderBarycentricBlend( pointA : Vector2, pointB : Vector2, pointC : Vector2, accuracy : RenderBarycentricBlendAccuracy, a : RenderProgram, b : RenderProgram, c : RenderProgram, logic? : RenderBarycentricBlendLogic )

Instance Methods

getName() : string

withChildren( children : RenderProgram[] ) : RenderBarycentricBlend

transformed( transform : Matrix3 ) : RenderProgram

equalsTyped( other : this ) : boolean

(protected)

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

(protected)

evaluate( context : RenderEvaluationContext ) : Vector4

writeInstructions( instructions : RenderInstruction[] )

serialize() : SerializedRenderBarycentricBlend

Instance Properties

logic : RenderBarycentricBlendLogic

(readonly)

Static Methods

deserialize( obj : SerializedRenderBarycentricBlend ) : RenderBarycentricBlend

Class RenderBarycentricBlendLogic

import { RenderBarycentricBlendLogic } from 'scenerystack/alpenglow';

Constructor

new RenderBarycentricBlendLogic( det : number, diffA : Vector2, diffB : Vector2, pointC : Vector2, accuracy : RenderBarycentricBlendAccuracy )

Instance Methods

equals( other : RenderBarycentricBlendLogic ) : boolean

apply( output : Vector4, context : RenderEvaluationContext, aColor : Vector4, bColor : Vector4, cColor : Vector4 )

Static Methods

from( pointA : Vector2, pointB : Vector2, pointC : Vector2, accuracy : RenderBarycentricBlendAccuracy ) : RenderBarycentricBlendLogic

Class RenderInstructionBarycentricBlend

import { RenderInstructionBarycentricBlend } from 'scenerystack/alpenglow';

Constructor

new RenderInstructionBarycentricBlend( logic : RenderBarycentricBlendLogic )

Instance Methods

toString() : string

equals( other : RenderInstruction, areLocationsEqual : ( a: RenderInstructionLocation, b: RenderInstructionLocation ) => boolean ) : boolean

execute( stack : RenderExecutionStack, context : RenderEvaluationContext, executor : RenderExecutor )

writeBinary( encoder : ByteEncoder, getOffset : ( location: RenderInstructionLocation ) => number )

getBinaryLength() : number

Static Methods

fromBinary( encoder : ByteEncoder, offset : number, getLocation : ( offset: number ) => RenderInstructionLocation ) : RenderInstructionBarycentricBlend

Type SerializedRenderBarycentricBlend

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

Source Code

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