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

GeometryBufferRenderer: Fix wrong index being returned for the depth and normal textures #14430

Merged
merged 2 commits into from Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/dev/core/src/PostProcesses/motionBlurPostProcess.ts
Expand Up @@ -156,7 +156,7 @@ export class MotionBlurPostProcess extends PostProcess {
scene.enableGeometryBufferRenderer();

if (this._geometryBufferRenderer) {
this._geometryBufferRenderer.enableVelocity = true;
this._geometryBufferRenderer.enableVelocity = this._isObjectBased;
}
} else {
scene.enablePrePassRenderer();
Expand Down Expand Up @@ -237,6 +237,10 @@ export class MotionBlurPostProcess extends PostProcess {
return this.updateEffect();
}

if (this._geometryBufferRenderer) {
this._geometryBufferRenderer.enableVelocity = this._isObjectBased;
}

this._updateEffect();

this._invViewProjection = null;
Expand Down
4 changes: 4 additions & 0 deletions packages/dev/core/src/Rendering/geometryBufferRenderer.ts
Expand Up @@ -248,6 +248,10 @@ export class GeometryBufferRenderer {
return this._velocityIndex;
case GeometryBufferRenderer.REFLECTIVITY_TEXTURE_TYPE:
return this._reflectivityIndex;
case GeometryBufferRenderer.DEPTH_TEXTURE_TYPE:
return this._linkedWithPrePass ? this._depthIndex : 0;
case GeometryBufferRenderer.NORMAL_TEXTURE_TYPE:
return this._linkedWithPrePass ? this._normalIndex : 1;
default:
return -1;
}
Expand Down