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

Merge custom pipeline transparent and opaque queues #17620

Open
wants to merge 1 commit into
base: v3.8.4
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Merge custom pipeline transparent and opaque queues
  • Loading branch information
GengineJS committed Sep 10, 2024
commit d75fd42c27d1111f2ff00d2414d081df16fe2138
26 changes: 6 additions & 20 deletions editor/assets/default_renderpipeline/builtin-pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -688,12 +688,8 @@ if (rendering) {

pass.setViewport(this._viewport);

// The opaque queue is used for Reflection probe preview
pass.addQueue(QueueHint.OPAQUE)
.addScene(camera, SceneFlags.OPAQUE);

// The blend queue is used for UI and Gizmos
let flags = SceneFlags.BLEND | SceneFlags.UI;
let flags = SceneFlags.BLEND | SceneFlags.UI | SceneFlags.OPAQUE;
if (this._cameraConfigs.enableProfiler) {
flags |= SceneFlags.PROFILER;
pass.showStatistics = true;
Expand Down Expand Up @@ -1006,12 +1002,16 @@ if (rendering) {
pass.addTexture(`ShadowMap${id}`, 'cc_shadowMap');
}

const sceneFlags = SceneFlags.BLEND | SceneFlags.OPAQUE | SceneFlags.MASK |
(camera.geometryRenderer
? SceneFlags.GEOMETRY
: SceneFlags.NONE);
// TODO(zhouzhenglong): Separate OPAQUE and MASK queue

// add opaque and mask queue
pass.addQueue(QueueHint.NONE) // Currently we put OPAQUE and MASK into one queue, so QueueHint is NONE
.addScene(camera,
SceneFlags.OPAQUE | SceneFlags.MASK,
sceneFlags,
mainLight || undefined,
scene ? scene : undefined);
}
Expand Down Expand Up @@ -1322,20 +1322,6 @@ if (rendering) {
this.addPlanarShadowQueue(camera, mainLight, pass);
}

// ----------------------------------------------------------------
// Forward Lighting (Blend)
// ----------------------------------------------------------------
// Add transparent queue

const sceneFlags = SceneFlags.BLEND |
(camera.geometryRenderer
? SceneFlags.GEOMETRY
: SceneFlags.NONE);

pass
.addQueue(QueueHint.BLEND)
.addScene(camera, sceneFlags, mainLight || undefined);

return pass;
}

Expand Down
Loading