Skip to content
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

WebGPURenderer: New AfterImageNode for the PostProcessing renderer. #27451

Merged
merged 4 commits into from Dec 27, 2023

Conversation

RenaudRohlinger
Copy link
Collaborator

Implemented a temporal node that can be use in the postprocessing pipeline. I took the opportunity to create a new gpu postprocessing demo. It's called AfterImageNode to be aligned with the legacy name AfterimagePass.

Example on how to use it with the afterImage method:

postProcessing = new PostProcessing( renderer );

const scenePass = pass( scene, camera );
const scenePassColor = scenePass.getTextureNode();

combinedPass = scenePassColor;
combinedPass = combinedPass.afterImage( params.damp );

postProcessing.outputNode = combinedPass;

Demo:
https://raw.githack.com/renaudrohlinger/three.js/node-temporal/examples/webgpu_postprocessing_afterimage.html
image

@Mugen87
Copy link
Collaborator

Mugen87 commented Dec 27, 2023

It's called AfterImageNode to be aligned with the legacy name AfterimagePass.

This is a good policy since it allows to offer replacement nodes for existing pass classes.

@sunag sunag merged commit e852478 into mrdoob:dev Dec 27, 2023
8 of 10 checks passed
@Methuselah96 Methuselah96 mentioned this pull request Jan 15, 2024
45 tasks
AdaRoseCannon pushed a commit to AdaRoseCannon/three.js that referenced this pull request Jan 15, 2024
…mrdoob#27451)

* init afterimage node

* init value

* cleanup

---------
@@ -111,6 +111,8 @@ export { default as ViewportSharedTextureNode, viewportSharedTexture } from './d
export { default as ViewportDepthTextureNode, viewportDepthTexture } from './display/ViewportDepthTextureNode.js';
export { default as ViewportDepthNode, viewZToOrthographicDepth, orthographicDepthToViewZ, viewZToPerspectiveDepth, perspectiveDepthToViewZ, depth, depthTexture, depthPixel } from './display/ViewportDepthNode.js';
export { default as GaussianBlurNode, gaussianBlur } from './display/GaussianBlurNode.js';
export { default as AfterImageNode, afterImage } from './display/AfterImageNode.js';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sunag Maybe we can create a new directory for postprocessing nodes (GaussianBlur, AfterImage), like postprocessing/?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, filters seem to sound better to me, I don't think they should be for exclusive use in post-processing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants