Skip to content

FaceRasterizer

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/webgpu/FaceRasterizer.ts for the most up-to-date information.

Overview

Class FaceRasterizer

import { FaceRasterizer } from 'scenerystack/alpenglow';

Constructor

new FaceRasterizer( providedOptions : FaceRasterizerOptions )

Instance Methods

getCanvasContext( canvas : HTMLCanvasElement, colorSpace : 'srgb' | 'display-p3' ) : GPUCanvasContext

runRenderProgram( program : RenderProgram, providedRunOptions : StrictOmit<FaceRasterizerRunOptions, 'renderableFaces'>, rasterizeOptions? : RasterizationOptions ) : Promise<void>

run( providedOptions : FaceRasterizerRunOptions ) : Promise<void>

dispose()

Type FaceRasterizerExecutionInfo

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

Type FaceRasterizerOptions

TODO: doc

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

import type { FaceRasterizerOptions } from 'scenerystack/alpenglow';
  • deviceContext: DeviceContext
  • supportsGridFiltering?: boolean
  • supportsBilinear?: boolean
  • supportsMitchellNetravali?: boolean
  • maxRenderableFaces?: number
    TODO: add limits support for everything nested
  • maxInitialEdges?: number
  • maxRenderProgramInstructions?: number
  • maxCoarseRenderableFaces?: number
  • maxCoarseEdges?: number
  • maxFineFaces?: number
  • maxFineEdges?: number
  • maxBins?: number

Type FaceRasterizerRunOptions

import type { FaceRasterizerRunOptions } from 'scenerystack/alpenglow';
  • renderableFaces: RenderableFace[]
    TODO: ideally run with no tile size (large!)
  • canvasContext: GPUCanvasContext
  • rasterWidth: number
  • rasterHeight: number
  • colorSpace?: "srgb" | "display-p3"
  • filterType?: PolygonFilterType
  • filterScale?: number

Source Code

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