Skip to content

Commit e92069b

Browse files
mvaligurskyMartin Valigursky
andauthored
LodStreaming example has Radial sorting toggle (#8515)
Co-authored-by: Martin Valigursky <mvaligursky@snapchat.com>
1 parent 5b76bd5 commit e92069b

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

examples/src/examples/gaussian-splatting/lod-streaming.controls.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ export const controls = ({ observer, ReactPCUI, React, jsx, fragment }) => {
3434
jsx(
3535
Panel,
3636
{ headerText: 'Settings' },
37+
jsx(
38+
LabelGroup,
39+
{ text: 'Radial' },
40+
jsx(BooleanInput, {
41+
type: 'toggle',
42+
binding: new BindingTwoWay(),
43+
link: { observer, path: 'radialSorting' },
44+
value: observer.get('radialSorting') ?? true
45+
})
46+
),
3747
isWebGPU && jsx(
3848
LabelGroup,
3949
{ text: 'GPU Sorting' },

examples/src/examples/gaussian-splatting/lod-streaming.example.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ assetListLoader.load(() => {
129129
app.scene.gsplat.lodUpdateAngle = 90;
130130
app.scene.gsplat.lodBehindPenalty = 3;
131131
app.scene.gsplat.radialSorting = true;
132+
133+
data.on('radialSorting:set', () => {
134+
app.scene.gsplat.radialSorting = !!data.get('radialSorting');
135+
});
136+
132137
app.scene.gsplat.lodUpdateDistance = config.lodUpdateDistance;
133138
app.scene.gsplat.lodUnderfillLimit = config.lodUnderfillLimit;
134139

@@ -150,6 +155,7 @@ assetListLoader.load(() => {
150155

151156
// initialize UI settings (must be after observer registration)
152157
data.set('cameraFov', 75);
158+
data.set('radialSorting', true);
153159
data.set('gpuSorting', false);
154160
data.set('culling', device.isWebGPU);
155161
data.set('compact', true);

0 commit comments

Comments
 (0)