Repository navigation
encode.webgpu.Class.SDRRenditionNode
@monogrid/gainmap-js / encode/webgpu / SDRRenditionNode
Defined in: src/encode/webgpu/nodes/SDRRenditionNode.ts:88
A TSL texture node holding the SDR rendition of an HDR image: the first step of gain map encoding.
The HDR input is exposed, tone mapped (with the three.js TSL tone mapping functions) and adjusted (brightness, contrast, saturation) into an 8 bit sRGB render target.
It renders only when something changed (input, tone mapping or any uniform value): sampling the node costs a single texture read, like any other texture.
import { SDRRenditionNode } from '@monogrid/gainmap-js/encode/webgpu'
import { AgXToneMapping, LinearToneMapping } from 'three/webgpu'
const sdr = new SDRRenditionNode(hdrTexture, { toneMapping: AgXToneMapping })
material.colorNode = sdr
sdr.exposure.value = 0.8 // renders again once, on the next frame
sdr.setToneMapping(LinearToneMapping)new SDRRenditionNode(
hdr,options?):SDRRenditionNode
Defined in: src/encode/webgpu/nodes/SDRRenditionNode.ts:112
HDR input, a texture or a TSL node returning a linear HDR color
SDRRenditionNode
if the input is a generic node and width or height are not provided
protected_material:NodeMaterial
Defined in: src/core/webgpu/RenderTargetNode.ts:42
protected_quadMesh:QuadMesh
Defined in: src/core/webgpu/RenderTargetNode.ts:41
readonlyhdr:Node
Defined in: src/encode/webgpu/nodes/SDRRenditionNode.ts:94
The HDR input, as a node
readonlyrenderTarget:RenderTarget
Defined in: src/core/webgpu/RenderTargetNode.ts:33
The render target holding the result
revision:
number=0
Defined in: src/core/webgpu/RenderTargetNode.ts:39
Incremented every time the render target is rendered, nodes depending on this one use it to know when to render again
readonlyuniforms:SDRRenditionNodeUniforms
Defined in: src/encode/webgpu/nodes/SDRRenditionNode.ts:99
Shared uniforms
get brightness():
UniformNode<"float",number>
Defined in: src/encode/webgpu/nodes/SDRRenditionNode.ts:146
Brightness offset applied after tone mapping
UniformNode<"float", number>
get contrast():
UniformNode<"float",number>
Defined in: src/encode/webgpu/nodes/SDRRenditionNode.ts:148
Contrast applied after tone mapping
UniformNode<"float", number>
get exposure():
UniformNode<"float",number>
Defined in: src/encode/webgpu/nodes/SDRRenditionNode.ts:144
Exposure applied to the HDR input before tone mapping
UniformNode<"float", number>
get height():
number
Defined in: src/encode/webgpu/nodes/SDRRenditionNode.ts:179
Height of the output, 0 while the input texture is not loaded
number
get saturation():
UniformNode<"float",number>
Defined in: src/encode/webgpu/nodes/SDRRenditionNode.ts:150
Saturation applied after tone mapping
UniformNode<"float", number>
get value():
Texture
Defined in: src/core/webgpu/RenderTargetNode.ts:139
Texture
set value(
value):void
Defined in: src/core/webgpu/RenderTargetNode.ts:133
Texture
void
get width():
number
Defined in: src/encode/webgpu/nodes/SDRRenditionNode.ts:172
Width of the output, 0 while the input texture is not loaded
number
get
statictype():string
Defined in: src/encode/webgpu/nodes/SDRRenditionNode.ts:89
string
protected_getDependencies():RenderTargetNode[]
Defined in: src/encode/webgpu/nodes/SDRRenditionNode.ts:233
Render target nodes read by this node, rendered (if needed) before this one
RenderTargetNode._getDependencies
protected_getState(): (number|undefined)[]
Defined in: src/encode/webgpu/nodes/SDRRenditionNode.ts:225
Values the result depends on, compared with === to the ones of the last render
(number | undefined)[]
protected_onRender():void
Defined in: src/core/webgpu/RenderTargetNode.ts:81
Called after the render target has been rendered
void
clone():
SDRRenditionNode
Defined in: src/core/webgpu/RenderTargetNode.ts:147
Clones created by sample() & co. are plain TextureNodes reading this node's texture,
they keep it updated before rendering as well
SDRRenditionNode
dispose():
void
Defined in: src/core/webgpu/RenderTargetNode.ts:158
Disposes the render target and the material
void
getToneMapping():
ToneMapping
Defined in: src/encode/webgpu/nodes/SDRRenditionNode.ts:155
The tone mapping applied to the SDR rendition
ToneMapping
invalidate():
SDRRenditionNode
Defined in: src/core/webgpu/RenderTargetNode.ts:87
Forces a render the next time RenderTargetNode.render is called, use it when something the node can't track changed (e.g. a custom input node)
SDRRenditionNode
render(
renderer):boolean
Defined in: src/core/webgpu/RenderTargetNode.ts:100
Renders into RenderTargetNode.renderTarget, only if something changed since the last render.
Called automatically when the node is part of a rendered node graph.
WebGPURenderer
boolean
true if the render target was rendered
setToneMapping(
value):SDRRenditionNode
Defined in: src/encode/webgpu/nodes/SDRRenditionNode.ts:164
Sets the tone mapping applied to the SDR rendition
(toneMapping can't be used as a property name: it's a TSL method of every node)
ToneMapping
any three.js tone mapping, e.g. ACESFilmicToneMapping, AgXToneMapping, NeutralToneMapping
or LinearToneMapping (which keeps the SDR rendition closest to the HDR input)
SDRRenditionNode