-
-
Notifications
You must be signed in to change notification settings - Fork 36.3k
TSL: Add support for rendering to integer-format render targets #33283
Copy link
Copy link
Open
Labels
TSLThree.js Shading LanguageThree.js Shading Language
Milestone
Description
Description
Currently it seems to not be possible to render to an integer-buffer render target, which can be useful for all kinds of utilities like picking, occlusion culling, etc. Note this is supported with shader materials and is used in this example, already. This issue is about adding support outputting a uint value:
const target = new RenderTarget( width, height, {
format: RedFormat,
type: UnsignedIntType,
} );
const material = new NodeMaterial();
material.outputNode = uint( 10 );
const mesh = new Mesh( geometry, material );
renderer.render( mesh, camera );Solution
Allow for setting the outputNode to be a uint-type of vector 2, 3, 4, or scalar value, as above. Or a function that returns one of the same types. If outputs can only be of type vec4 in WebGPU then we can require it be
This also implies support for signed & unsigned integer clear colors.
Alternatives
None
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
TSLThree.js Shading LanguageThree.js Shading Language