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: Improve AO approach #28863

Draft
wants to merge 19 commits into
base: dev
Choose a base branch
from
Prev Previous commit
revert
  • Loading branch information
sunag committed Jul 20, 2024
commit ecd527e85d590f53f909ba4302eb67cd0b7a6bfd
5 changes: 2 additions & 3 deletions src/nodes/display/AfterImageNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { nodeObject, addNodeElement, tslFn, float, vec4 } from '../shadernode/Sh
import { NodeUpdateType } from '../core/constants.js';
import { uv } from '../accessors/UVNode.js';
import { texture } from '../accessors/TextureNode.js';
import { passTexture } from './PassNode.js';
import { uniform } from '../core/UniformNode.js';
import { sign, max } from '../math/MathNode.js';
import QuadMesh from '../../renderers/common/QuadMesh.js';

import { Vector2 } from '../../math/Vector2.js';
import { RenderTarget } from '../../core/RenderTarget.js';
import { viewportTopLeft } from './ViewportNode.js';

const _size = /*@__PURE__*/ new Vector2();

Expand All @@ -31,7 +31,7 @@ class AfterImageNode extends TempNode {
this._oldRT = new RenderTarget();
this._oldRT.texture.name = 'AfterImageNode.old';

this._textureNode = texture( this._compRT.texture, viewportTopLeft ).before( this );
this._textureNode = passTexture( this, this._compRT.texture );

this.updateBeforeType = NodeUpdateType.RENDER;

Expand Down Expand Up @@ -149,4 +149,3 @@ export const afterImage = ( node, damp ) => nodeObject( new AfterImageNode( node
addNodeElement( 'afterImage', afterImage );

export default AfterImageNode;

Loading