-
Notifications
You must be signed in to change notification settings - Fork 10
core.Class.QuadRenderer
@monogrid/gainmap-js / core / QuadRenderer
Utility class used for rendering a texture with a material
• TType extends TextureDataType
• TMaterial extends Material
new QuadRenderer<
TType,TMaterial>(options):QuadRenderer<TType,TMaterial>
Constructs a new QuadRenderer
• options: QuadRendererOptions<TType, TMaterial>
Parameters for this QuadRenderer
QuadRenderer<TType, TMaterial>
getcolorSpace():ColorSpace
ColorSpace
getheight():number
Height of the texture
setheight(value):void
• value: number
number
getmaterial():TMaterial
The Material used.
TMaterial
getrenderTarget():WebGLRenderTarget<Texture>
The WebGLRenderTarget used.
setrenderTarget(value):void
• value: WebGLRenderTarget<Texture>
WebGLRenderTarget<Texture>
getrenderer():WebGLRenderer
The renderer used
WebGLRenderer
gettype():TType
TType
getwidth():number
Width of the texture
setwidth(value):void
• value: number
number
dispose(
disposeRenderTarget?):void
Will dispose of all assets used by this renderer.
• disposeRenderTarget?: boolean
will dispose of the renderTarget which will not be usable later
set this to true if you passed the renderTarget.texture to a PMREMGenerator
or are otherwise done with it.
void
const loader = new HDRJPGLoader(renderer)
const result = await loader.loadAsync('gainmap.jpeg')
const mesh = new Mesh(geometry, new MeshBasicMaterial({ map: result.renderTarget.texture }) )
// DO NOT dispose the renderTarget here,
// it is used directly in the material
result.dispose()const loader = new HDRJPGLoader(renderer)
const pmremGenerator = new PMREMGenerator( renderer );
const result = await loader.loadAsync('gainmap.jpeg')
const envMap = pmremGenerator.fromEquirectangular(result.renderTarget.texture)
const mesh = new Mesh(geometry, new MeshStandardMaterial({ envMap }) )
// renderTarget can be disposed here
// because it was used to generate a PMREM texture
result.dispose(true)disposeOnDemandRenderer():
void
If using a disposable renderer, it will dispose it.
void
render():
void
Renders the input texture using the specified material
void
toArray():
TextureDataTypeToBufferType<TType>
Obtains a Buffer containing the rendered texture.
TextureDataTypeToBufferType<TType>
a TypedArray containing RGBA values from this renderer
Error if the browser cannot read pixels from this RenderTarget type.
toDataTexture(
options?):DataTexture
Performs a readPixel operation in the renderTarget and returns a DataTexture containing the read data
• options?: QuadRendererTextureOptions
DataTexture
options
staticinstantiateRenderer():WebGLRenderer
Instantiates a temporary renderer
WebGLRenderer