Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
options: [
{ v: 0, t: 'Auto' },
{ v: 1, t: 'Raster (CPU Sort)' },
{ v: 2, t: 'Raster (Hybrid)' },
{ v: 2, t: 'Raster (GPU Sort)' },
{ v: 3, t: 'Compute' }
]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const IDLE_FPS_SAMPLE_MS = 1000;
const RENDERERS = [
{ device: 'webgl2', renderer: pc.GSPLAT_RENDERER_RASTER_CPU_SORT, label: 'WebGL2 CPU Sort', shortLabel: 'GL2 CPU' },
{ device: 'webgpu', renderer: pc.GSPLAT_RENDERER_RASTER_CPU_SORT, label: 'WebGPU CPU Sort', shortLabel: 'GPU CPU' },
{ device: 'webgpu', renderer: pc.GSPLAT_RENDERER_RASTER_HYBRID, label: 'WebGPU Hybrid', shortLabel: 'Hybrid' },
{ device: 'webgpu', renderer: pc.GSPLAT_RENDERER_RASTER_GPU_SORT, label: 'WebGPU GPU Sort', shortLabel: 'GPU Sort' },
{ device: 'webgpu', renderer: pc.GSPLAT_RENDERER_COMPUTE, label: 'WebGPU Compute', shortLabel: 'Compute' }
];

Expand Down
2 changes: 1 addition & 1 deletion examples/src/examples/gaussian-splatting/crop.controls.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
options: [
{ v: 0, t: 'Auto' },
{ v: 1, t: 'Raster (CPU Sort)' },
{ v: 2, t: 'Raster (Hybrid)' },
{ v: 2, t: 'Raster (GPU Sort)' },
{ v: 3, t: 'Compute' }
]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
options: [
{ v: 0, t: 'Auto' },
{ v: 1, t: 'Raster (CPU Sort)' },
{ v: 2, t: 'Raster (Hybrid)' },
{ v: 2, t: 'Raster (GPU Sort)' },
{ v: 3, t: 'Compute' }
]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
options: [
{ v: 0, t: 'Auto' },
{ v: 1, t: 'Raster (CPU Sort)' },
{ v: 2, t: 'Raster (Hybrid)' },
{ v: 2, t: 'Raster (GPU Sort)' },
{ v: 3, t: 'Compute' }
]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
options: [
{ v: 0, t: 'Auto' },
{ v: 1, t: 'Raster (CPU Sort)' },
{ v: 2, t: 'Raster (Hybrid)' },
{ v: 2, t: 'Raster (GPU Sort)' },
{ v: 3, t: 'Compute' }
]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
options: [
{ v: 0, t: 'Auto' },
{ v: 1, t: 'Raster (CPU Sort)' },
{ v: 2, t: 'Raster (Hybrid)' },
{ v: 2, t: 'Raster (GPU Sort)' },
{ v: 3, t: 'Compute' }
]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
options: [
{ v: 0, t: 'Auto' },
{ v: 1, t: 'Raster (CPU Sort)' },
{ v: 2, t: 'Raster (Hybrid)' },
{ v: 2, t: 'Raster (GPU Sort)' },
{ v: 3, t: 'Compute' }
]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
options: [
{ v: 0, t: 'Auto' },
{ v: 1, t: 'Raster (CPU Sort)' },
{ v: 2, t: 'Raster (Hybrid)' },
{ v: 2, t: 'Raster (GPU Sort)' },
{ v: 3, t: 'Compute' }
]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
options: [
{ v: 0, t: 'Auto' },
{ v: 1, t: 'Raster (CPU Sort)' },
{ v: 2, t: 'Raster (Hybrid)' },
{ v: 2, t: 'Raster (GPU Sort)' },
{ v: 3, t: 'Compute' }
]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
options: [
{ v: 0, t: 'Auto' },
{ v: 1, t: 'Raster (CPU Sort)' },
{ v: 2, t: 'Raster (Hybrid)' },
{ v: 2, t: 'Raster (GPU Sort)' },
{ v: 3, t: 'Compute' }
]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
options: [
{ v: 0, t: 'Auto' },
{ v: 1, t: 'Raster (CPU Sort)' },
{ v: 2, t: 'Raster (Hybrid)' },
{ v: 2, t: 'Raster (GPU Sort)' },
{ v: 3, t: 'Compute' }
]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
options: [
{ v: 0, t: 'Auto' },
{ v: 1, t: 'Raster (CPU Sort)' },
{ v: 2, t: 'Raster (Hybrid)' },
{ v: 2, t: 'Raster (GPU Sort)' },
{ v: 3, t: 'Compute' }
]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
options: [
{ v: 0, t: 'Auto' },
{ v: 1, t: 'Raster (CPU Sort)' },
{ v: 2, t: 'Raster (Hybrid)' },
{ v: 2, t: 'Raster (GPU Sort)' },
{ v: 3, t: 'Compute' }
]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
options: [
{ v: 0, t: 'Auto' },
{ v: 1, t: 'Raster (CPU Sort)' },
{ v: 2, t: 'Raster (Hybrid)' },
{ v: 2, t: 'Raster (GPU Sort)' },
{ v: 3, t: 'Compute' }
]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
options: [
{ v: 0, t: 'Auto' },
{ v: 1, t: 'Raster (CPU Sort)' },
{ v: 2, t: 'Raster (Hybrid)' },
{ v: 2, t: 'Raster (GPU Sort)' },
{ v: 3, t: 'Compute' }
]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
options: [
{ v: 0, t: 'Auto' },
{ v: 1, t: 'Raster (CPU Sort)' },
{ v: 2, t: 'Raster (Hybrid)' },
{ v: 2, t: 'Raster (GPU Sort)' },
{ v: 3, t: 'Compute' }
]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
options: [
{ v: 0, t: 'Auto' },
{ v: 1, t: 'Raster (CPU Sort)' },
{ v: 2, t: 'Raster (Hybrid)' },
{ v: 2, t: 'Raster (GPU Sort)' },
{ v: 3, t: 'Compute' }
]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
options: [
{ v: 0, t: 'Auto' },
{ v: 1, t: 'Raster (CPU Sort)' },
{ v: 2, t: 'Raster (Hybrid)' },
{ v: 2, t: 'Raster (GPU Sort)' },
{ v: 3, t: 'Compute' }
]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const controls = ({ observer, ReactPCUI, jsx, fragment }) => {
options: [
{ v: 0, t: 'Auto' },
{ v: 1, t: 'Raster (CPU Sort)' },
{ v: 2, t: 'Raster (Hybrid)' },
{ v: 2, t: 'Raster (GPU Sort)' },
{ v: 3, t: 'Compute' }
]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const controls = ({ observer, ReactPCUI, jsx, fragment }) => {
options: [
{ v: 0, t: 'Auto' },
{ v: 1, t: 'Raster (CPU Sort)' },
{ v: 2, t: 'Raster (Hybrid)' },
{ v: 2, t: 'Raster (GPU Sort)' },
{ v: 3, t: 'Compute' }
]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
options: [
{ v: 0, t: 'Auto' },
{ v: 1, t: 'Raster (CPU Sort)' },
{ v: 2, t: 'Raster (Hybrid)' },
{ v: 2, t: 'Raster (GPU Sort)' },
{ v: 3, t: 'Compute' }
]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
options: [
{ v: 0, t: 'Auto' },
{ v: 1, t: 'Raster (CPU Sort)' },
{ v: 2, t: 'Raster (Hybrid)' },
{ v: 2, t: 'Raster (GPU Sort)' },
{ v: 3, t: 'Compute' }
]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
options: [
{ v: 0, t: 'Auto' },
{ v: 1, t: 'Raster (CPU Sort)' },
{ v: 2, t: 'Raster (Hybrid)' },
{ v: 2, t: 'Raster (GPU Sort)' },
{ v: 3, t: 'Compute' }
]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
options: [
{ v: 0, t: 'Auto' },
{ v: 1, t: 'Raster (CPU Sort)' },
{ v: 2, t: 'Raster (Hybrid)' },
{ v: 2, t: 'Raster (GPU Sort)' },
{ v: 3, t: 'Compute' }
]
})
Expand Down
9 changes: 4 additions & 5 deletions src/scene/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -1225,15 +1225,14 @@ export const GSPLAT_RENDERER_AUTO = 0;
export const GSPLAT_RENDERER_RASTER_CPU_SORT = 1;

/**
* Hybrid rasterization renderer that performs projection, screen-space culling and sort key
* generation in a single compute pass, sorts globally via a compute radix sort, and rasterizes
* quads from a pre-projected cache. WebGPU only. Experimental with limited functionality.
* Rasterization-based rendering with GPU-side culling and sorting. WebGPU only. Experimental with
* limited functionality.
*
* @type {number}
* @category Graphics
* @ignore
* @alpha
*/
export const GSPLAT_RENDERER_RASTER_HYBRID = 2;
export const GSPLAT_RENDERER_RASTER_GPU_SORT = 2;

/**
* Full compute pipeline for rendering. WebGPU only. Experimental with limited functionality.
Expand Down
22 changes: 11 additions & 11 deletions src/scene/gsplat-unified/gsplat-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { ComputeRadixSort } from '../graphics/radix-sort/compute-radix-sort.js';
import { Debug } from '../../core/debug.js';
import { BoundingBox } from '../../core/shape/bounding-box.js';
import {
GSPLAT_RENDERER_RASTER_CPU_SORT, GSPLAT_RENDERER_RASTER_HYBRID,
GSPLAT_RENDERER_RASTER_CPU_SORT, GSPLAT_RENDERER_RASTER_GPU_SORT,
GSPLAT_RENDERER_COMPUTE,
GSPLAT_DEBUG_LOD, GSPLAT_DEBUG_SH_UPDATE, GSPLAT_DEBUG_AABBS
} from '../constants.js';
Expand Down Expand Up @@ -90,7 +90,7 @@ let _randomColorRaw = null;
* GSplatManager manages the rendering of splats using a work buffer, where all active splats are
* stored and rendered from.
*
* Shared culling + compaction (hybrid raster and compute renderer, WebGPU only):
* Shared culling + compaction (raster GPU-sort path and compute renderer, WebGPU only):
* Interval compaction operates on contiguous intervals of splats (one per octree node).
* 1. Cull + count (compute): each interval's bounding sphere is tested against frustum
* planes (or a fisheye cone). The pass writes the interval's splat count (or 0 if
Expand Down Expand Up @@ -154,21 +154,21 @@ class GSplatManager {
cpuSorter = null;

/**
* GPU-based radix sorter (hybrid raster path).
* GPU-based radix sorter (raster GPU sort path).
*
* @type {ComputeRadixSort|null}
*/
gpuSorter = null;

/**
* Interval-based GPU compaction (hybrid / compute paths).
* Interval-based GPU compaction (raster GPU sort / compute paths).
*
* @type {GSplatIntervalCompaction|null}
*/
intervalCompaction = null;

/**
* Compute projector + sort keys for {@link GSPLAT_RENDERER_RASTER_HYBRID}.
* Compute projector + sort keys for {@link GSPLAT_RENDERER_RASTER_GPU_SORT}.
*
* @type {GSplatProjector|null}
*/
Expand All @@ -180,7 +180,7 @@ class GSplatManager {
indirectDrawSlot = -1;

/**
* Indirect dispatch slot for hybrid raster (projector + radix) and compute paths.
* Indirect dispatch slot for raster GPU sort (projector + radix) and compute paths.
* The compute local renderer builds its own indirect args in private buffers
* and does not use these slots.
*/
Expand Down Expand Up @@ -507,7 +507,7 @@ class GSplatManager {
* @returns {import('../mesh-instance.js').MeshInstance|null} The pick mesh instance, or null.
*/
prepareForPicking(camera, width, height) {
if (this.activeRenderer === GSPLAT_RENDERER_RASTER_HYBRID) {
if (this.activeRenderer === GSPLAT_RENDERER_RASTER_GPU_SORT) {
const sortedState = this.worldStates.get(this.sortedVersion);
if (!sortedState?.sortedBefore || !camera.node) return null;

Expand Down Expand Up @@ -585,7 +585,7 @@ class GSplatManager {
_createRenderer(mode) {
if (mode === GSPLAT_RENDERER_COMPUTE) {
this.renderer = new GSplatComputeLocalRenderer(this.device, this.node, this.cameraNode, this.layer, this.workBuffer);
} else if (mode === GSPLAT_RENDERER_RASTER_HYBRID) {
} else if (mode === GSPLAT_RENDERER_RASTER_GPU_SORT) {
this.renderer = new GSplatHybridRenderer(this.device, this.node, this.cameraNode, this.layer, this.workBuffer);
this.initHybridSorting();
} else {
Expand Down Expand Up @@ -1518,7 +1518,7 @@ class GSplatManager {
// Compute renderer: run compaction only (no key generation or radix sort)
this.compactGpu(lastState);
gpuSortedThisFrame = true;
} else if (this.activeRenderer === GSPLAT_RENDERER_RASTER_HYBRID) {
} else if (this.activeRenderer === GSPLAT_RENDERER_RASTER_GPU_SORT) {
this.sortGpuHybrid(lastState);
gpuSortedThisFrame = true;
} else {
Expand All @@ -1536,9 +1536,9 @@ class GSplatManager {
this.lastCullingProjMat.copy(this.cameraNode.camera.projectionMatrix);
}

// Hybrid raster needs projector + radix + fresh indirect args every frame (indirect
// Raster GPU sort needs projector + radix + fresh indirect args every frame (indirect
// slots are per-frame; post-projector visible count differs from interval prefix sum).
if (this.activeRenderer === GSPLAT_RENDERER_RASTER_HYBRID && lastState && !gpuSortedThisFrame) {
if (this.activeRenderer === GSPLAT_RENDERER_RASTER_GPU_SORT && lastState && !gpuSortedThisFrame) {
this.sortGpuHybrid(lastState);
gpuSortedThisFrame = true;
}
Expand Down
8 changes: 4 additions & 4 deletions src/scene/gsplat-unified/gsplat-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { GSplatFormat } from '../gsplat/gsplat-format.js';
import {
GSPLATDATA_COMPACT,
GSPLAT_RENDERER_AUTO, GSPLAT_RENDERER_RASTER_CPU_SORT,
GSPLAT_RENDERER_COMPUTE, GSPLAT_RENDERER_RASTER_HYBRID,
GSPLAT_RENDERER_COMPUTE, GSPLAT_RENDERER_RASTER_GPU_SORT,
GSPLAT_DEBUG_NONE, GSPLAT_DEBUG_LOD, GSPLAT_DEBUG_SH_UPDATE, GSPLAT_DEBUG_HEATMAP,
GSPLAT_DEBUG_AABBS, GSPLAT_DEBUG_NODE_AABBS
} from '../constants.js';
Expand Down Expand Up @@ -146,8 +146,8 @@ class GSplatParams {
* - {@link GSPLAT_RENDERER_AUTO}: Automatically selects the best pipeline for the platform.
* - {@link GSPLAT_RENDERER_RASTER_CPU_SORT}: Rasterization with CPU-side sorting.
* - {@link GSPLAT_RENDERER_COMPUTE}: Full compute pipeline (WebGPU only, experimental).
* - {@link GSPLAT_RENDERER_RASTER_HYBRID}: Hybrid rasterization with a compute projection
* cache and global radix sort (WebGPU only, experimental, internal).
* - {@link GSPLAT_RENDERER_RASTER_GPU_SORT}: Rasterization with GPU-side sorting (WebGPU only,
* experimental).
*
* Defaults to {@link GSPLAT_RENDERER_AUTO}. Modes requiring WebGPU fall back to
* {@link GSPLAT_RENDERER_RASTER_CPU_SORT} on WebGL devices. The resolved mode actually used
Expand All @@ -162,7 +162,7 @@ class GSplatParams {
if (value === GSPLAT_RENDERER_AUTO) {
this._currentRenderer = GSPLAT_RENDERER_RASTER_CPU_SORT;
} else if ((value === GSPLAT_RENDERER_COMPUTE ||
value === GSPLAT_RENDERER_RASTER_HYBRID) &&
value === GSPLAT_RENDERER_RASTER_GPU_SORT) &&
!this._device.isWebGPU) {
this._currentRenderer = GSPLAT_RENDERER_RASTER_CPU_SORT;
} else {
Expand Down