RenderPhong¶
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/RenderPhong.ts for the most up-to-date information.
Overview¶
RenderProgram for a phong 3d reflection model
@author Jonathan Olson <jonathan.olson@colorado.edu>
Class RenderInstructionPhong¶
Constructor¶
new RenderInstructionPhong( alpha : number, numLights : number )¶
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 ) : RenderInstructionPhong¶
Class RenderPhong¶
Constructor¶
new RenderPhong( alpha : number, ambientColorProgram : RenderProgram, diffuseColorProgram : RenderProgram, specularColorProgram : RenderProgram, positionProgram : RenderProgram, normalProgram : RenderProgram, lights : RenderLight[] )¶
Instance Methods¶
getName() : string¶
withChildren( children : RenderProgram[] ) : RenderPhong¶
equalsTyped( other : this ) : boolean¶
(protected)
getSimplified( children : RenderProgram[] ) : RenderProgram | null¶
(protected)
getPhong( ambientColor : Vector4, diffuseColor : Vector4, specularColor : Vector4, position : Vector4, normal : Vector4, lightDirections : Vector4[], lightColors : Vector4[] ) : Vector4¶
evaluate( context : RenderEvaluationContext ) : Vector4¶
writeInstructions( instructions : RenderInstruction[] )¶
serialize() : SerializedRenderPhong¶
Type SerializedRenderPhong¶
- type: "RenderPhong"
- children: SerializedRenderProgram[]
- alpha: number
Source Code¶
See the source for RenderPhong.ts in the alpenglow repository.