-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TSL: Introduce renderOutput()
#28781
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
#28780 It seems to work :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! This change solves both issues discussed in #28779. Devs can now controls via RenderOutputNode
when output tone mapping and color space conversion should happen in the pass chain. And second, the additional output pass in Renderer
is now disabled when post processing is used (so there is on separate output pass anymore).
I've noticed an issue when experimenting with Unlike https://jsfiddle.net/3vgz4sxw/ If you remove the |
FWIW, maybe postProcessing.outputColorTransform = true; |
I'm afraid that is not right. The idea is to set The texture node returned by |
I don't think I quite understand this code: // post processing
postProcessing = new THREE.PostProcessing( renderer );
postProcessing.outputColorTransform = false;
// scene pass
const scenePass = pass( scene, camera );
const outputPass = renderOutput( scenePass );
postProcessing.outputNode = outputPass.toTexture(); Correct me if I get this wrong, but it looks like |
It is the last node in the stack that produces the final values for display. It's like when you assign node compositions to With postProcessing = new THREE.PostProcessing( renderer );
postProcessing.outputColorTransform = false;
// scene pass (ideally produced via MRT)
const scenePass = pass( scene, camera );
const scenePassColor = scenePass.getTextureNode();
const scenePassViewZ = scenePass.getViewZNode();
const scenePassNormal = scenePass.getNormalNode();
// Bloom -> Output (tone-mapping+sRGB) -> FXAA
const bloomPass = scenePassColor.bloom( scenePassViewZ, scenePassNormal );
const outputPass = bloomPass.renderOutput();
const fxaaPass = outputPass.fxaa();
postProcessing.outputNode = fxaaPass; FXAA requires sRGB input and since it is not a per-pixel operation, the result of previous pass as a texture. The |
You can actually chain all commands or write them more explicitly: const bloomPass = bloom( scenePassColor, scenePassViewZ, scenePassNormal );
const outputPass = renderOutput( bloomPass );
const fxaaPass = fxaa( outputPass );
postProcessing.outputNode = fxaaPass; Or everything in one row: postProcessing.outputNode = scenePassColor.bloom( scenePassViewZ, scenePassNormal ).renderOutput().fxaa(); |
@Mugen87 Try add this for now: const outputPass = renderOutput( scenePass, renderer.toneMapping, renderer.outputColorSpace )
|
Related issue: #28779 (comment)
Description
Color Space Conversion and Tone Mapping are applied in Post Processing pass, it is possible to manipulate the sequence too using
renderOutput()
as updated in the3dlut
example..toneMappingNode
has been removed and the examples updated, I think it can be replaced by post-processing now.