File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,11 +69,10 @@ class Camera {
6969 framePasses = [ ] ;
7070
7171 /**
72- * Frame passes that execute before this camera's main scene rendering. Each entry contains
73- * a pass and metadata controlling scheduling. Entries are picked up by the RenderPassForward
74- * that renders this camera's layers.
72+ * Frame passes that execute before this camera's main scene rendering. Entries are picked up
73+ * by the RenderPassForward that renders this camera's layers.
7574 *
76- * @type {{ pass: FramePass, requiresDepth: boolean } [] }
75+ * @type {FramePass[] }
7776 */
7877 beforePasses = [ ] ;
7978
Original file line number Diff line number Diff line change @@ -275,12 +275,9 @@ class GSplatComputeLocalRenderer extends GSplatRenderer {
275275 _registerFramePass ( ) {
276276 const camera = this . cameraNode . camera ?. camera ;
277277 if ( camera ) {
278- const exists = camera . beforePasses . some ( e => e . pass === this . framePass ) ;
279- if ( ! exists ) {
280- // Schedule the compute splat pass before this camera's scene rendering.
281- // requiresDepth hints that a depth prepass should run first, so the
282- // rasterize shader can skip splats behind opaque geometry.
283- camera . beforePasses . push ( { pass : this . framePass , requiresDepth : true } ) ;
278+ // Schedule the compute splat pass before this camera's scene rendering.
279+ if ( ! camera . beforePasses . includes ( this . framePass ) ) {
280+ camera . beforePasses . push ( this . framePass ) ;
284281 }
285282 this . _needsFramePassRegister = false ;
286283 } else {
@@ -293,7 +290,7 @@ class GSplatComputeLocalRenderer extends GSplatRenderer {
293290 this . _needsFramePassRegister = false ;
294291 const camera = this . cameraNode . camera ?. camera ;
295292 if ( camera ) {
296- const idx = camera . beforePasses . findIndex ( e => e . pass === this . framePass ) ;
293+ const idx = camera . beforePasses . indexOf ( this . framePass ) ;
297294 if ( idx !== - 1 ) {
298295 camera . beforePasses . splice ( idx , 1 ) ;
299296 }
Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ class RenderPassForward extends RenderPass {
183183 if ( camera ) {
184184 const { beforePasses } = camera ;
185185 for ( let j = 0 ; j < beforePasses . length ; j ++ ) {
186- this . beforePasses . push ( beforePasses [ j ] . pass ) ;
186+ this . beforePasses . push ( beforePasses [ j ] ) ;
187187 }
188188 }
189189 }
You can’t perform that action at this time.
0 commit comments