Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
86bb000
Minor cleanup in VoxelPrimitive
Jul 29, 2025
0a57ba4
Compute camera position in tile coordinates for BOX voxels
Jul 31, 2025
4933dbb
Use multiline template literals in getClippingFunction
Aug 4, 2025
a8fcb07
Fix intersection logic for BOX voxels
Aug 4, 2025
35bb1c9
Honor readonly tags in VoxelShape interface
Aug 9, 2025
3d284dc
Fix specs related to voxel shape changes
Aug 9, 2025
0df1c0a
Clean up clipping plane handling for voxels
Aug 18, 2025
27908b7
Use clipping planes for BOX voxel render bounds
Aug 20, 2025
3a2388b
Intersect BOX voxel bounds and scene depth in eye coordinates
Aug 26, 2025
4767a62
Perform voxel raymarching in eye coordinates (WIP)
Aug 30, 2025
d2cbf3d
Clean up voxel step and normal calculations
Sep 2, 2025
1492423
Use tile coordinates in voxel traversal
Sep 2, 2025
b69bf8f
Merge branch 'main' into voxel-rte
Sep 3, 2025
4984fdf
Fix TS error in VoxelPrimitive
Sep 3, 2025
dc091db
Clean up voxel traversal shader code
Sep 3, 2025
9156d9a
Keep voxel normals in eye coordinates
Sep 4, 2025
ee9a3da
Simplify defines and uniforms for VoxelCylinderShape
Sep 8, 2025
74a100a
Remove unused voxel uniforms and method
Sep 9, 2025
644dcbd
Use VoxelBoundCollection for cylinder height bounds in eye coordinates
Sep 10, 2025
59f757b
Implement tile coordinate traversal for cylindrical voxels
Sep 12, 2025
414e98f
Merge branch 'main' into voxel-rte
Sep 12, 2025
952baae
Fix undeclared uniform in BOX voxels
Sep 12, 2025
e9f112f
Use transform for cylinder voxel RTU coordinates
Sep 17, 2025
4a72394
Implement RTE rendering for ellipsoid voxels (WIP)
Sep 24, 2025
6317f2e
Fix TS error
Sep 24, 2025
e437bd5
Raymarch ellipsoid voxels in unscaled coordinates
Sep 26, 2025
afb90a9
Use local coordinates instead of UV for voxel transforms
Sep 26, 2025
87ebfbe
Rename glsl files for voxel coordinate conversions
Sep 26, 2025
382512f
Return eye coordinate normals from voxel shape intersections
Sep 27, 2025
6cd1367
Re-run prettier
Sep 29, 2025
f868e33
Fix VoxelEllipsoidShapeSpec
Sep 29, 2025
45ac5e5
Fix normal handling for voxel longitude bounds
Sep 29, 2025
0c5f1a7
Fix longitude bounds bugs in VoxelCylinderShape
Sep 30, 2025
8511913
Cleanup VoxelCylinderShape uniforms
Sep 30, 2025
bc967f5
Fix longitude bound bug in VoxelCylinderShape
Sep 30, 2025
7fb5717
Fix longitude bound bug in VoxelEllipsoidShape
Sep 30, 2025
7852cb7
Re-run prettier, clean up voxel sandcastles
Sep 30, 2025
784405f
Clarify shape-specific voxel uniforms
Sep 30, 2025
8a7050a
Remove unused voxel coordinate conversions from shaders
Sep 30, 2025
293d719
Clean up comments and dead code
Sep 30, 2025
ff471a4
PR feedback round 1
Oct 1, 2025
05935a1
Fix transforms for cylindrical voxels
Oct 1, 2025
634fdea
Merge branch 'main' into voxel-rte
Oct 1, 2025
1bcf62a
Fix transforms for box voxels
Oct 1, 2025
052855d
Update CHANGES.md, re-run prettier
Oct 1, 2025
c0a730b
Update CHANGES.md to highlight WebGL2 requirement for voxels
Oct 1, 2025
25a085d
Merge branch 'main' into voxel-rte
ggetz Oct 1, 2025
64e17d3
Fix latitude intersection for ellipsoid voxels
Oct 1, 2025
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
9 changes: 6 additions & 3 deletions Apps/Sandcastle/gallery/Voxel Picking.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,17 @@
this.names = ["color"];
this.types = [Cesium.MetadataType.VEC4];
this.componentTypes = [Cesium.MetadataComponentType.FLOAT32];
this._levelCount = 3;
this.availableLevels = 3;
this.globalTransform = globalTransform;
}

ProceduralMultiTileVoxelProvider.prototype.requestData = function (options) {
const { tileLevel, tileX, tileY, tileZ } = options;

if (tileLevel >= this._levelCount) {
return Promise.reject(`No tiles available beyond level ${this._levelCount}`);
if (tileLevel >= this.availableLevels) {
return Promise.reject(
`No tiles available beyond level ${this.availableLevels - 1}`,
);
}

const dimensions = this.dimensions;
Expand Down Expand Up @@ -174,6 +176,7 @@
customShader: customShader,
});
voxelPrimitive.nearestSampling = true;
voxelPrimitive.stepSize = 0.7;

viewer.scene.primitives.add(voxelPrimitive);
camera.flyToBoundingSphere(voxelPrimitive.boundingSphere, {
Expand Down
10 changes: 5 additions & 5 deletions Apps/Sandcastle/gallery/Voxels.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@
this.componentTypes = [Cesium.MetadataComponentType.FLOAT32];
this.globalTransform = globalTransform;

this._levelCount = 2;
this._allVoxelData = new Array(this._levelCount);
this.availableLevels = 2;
this._allVoxelData = new Array(this.availableLevels);

const allVoxelData = this._allVoxelData;
const channelCount = Cesium.MetadataType.getComponentCount(this.types[0]);
const { dimensions } = this;

for (let level = 0; level < this._levelCount; level++) {
for (let level = 0; level < this.availableLevels; level++) {
const dimAtLevel = Math.pow(2, level);
const voxelCountX = dimensions.x * dimAtLevel;
const voxelCountY = dimensions.y * dimAtLevel;
Expand Down Expand Up @@ -158,9 +158,9 @@
ProceduralMultiTileVoxelProvider.prototype.requestData = function (options) {
const { tileLevel, tileX, tileY, tileZ } = options;

if (tileLevel >= this._levelCount) {
if (tileLevel >= this.availableLevels) {
return Promise.reject(
`No tiles available beyond level ${this._levelCount - 1}`,
`No tiles available beyond level ${this.availableLevels - 1}`,
);
}

Expand Down
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

### @cesium/engine

#### Breaking Changes :mega:

- Voxel rendering now requires a WebGL2 context, which is [enabled by default since 1.101](https://github.com/CesiumGS/cesium/pull/10894). For voxel rendering, make sure the `requestWebGl1` flag in `contextOptions` is NOT set to true.

#### Fixes :wrench:

- Materials loaded from type now respect submaterials present in the referenced material type. [#10566](https://github.com/CesiumGS/cesium/issues/10566)
Expand All @@ -17,6 +21,7 @@
- Prevent runtime errors for certain forms of invalid PNTS files [#12872](https://github.com/CesiumGS/cesium/issues/12872)
- Improved performance of clamped labels. [#12905](https://github.com/CesiumGS/cesium/pull/12905)
- Fixes issue where multiple instances of a Gaussian splat tileset would transform tile positions incorrectly and render out of position. [#12795](https://github.com/CesiumGS/cesium/issues/12795)
- Converted voxel raymarching to eye coordinates to fix precision issues in large datasets. [#12061](https://github.com/CesiumGS/cesium/issues/12061)

#### Additions :tada:

Expand Down
6 changes: 3 additions & 3 deletions packages/engine/Source/Scene/ClippingPlaneCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ function ClippingPlaneCollection(options) {
* An event triggered when a new clipping plane is added to the collection. Event handlers
* are passed the new plane and the index at which it was added.
* @type {Event}
* @default Event()
* @readonly
*/
this.planeAdded = new Event();

/**
* An event triggered when a new clipping plane is removed from the collection. Event handlers
* are passed the new plane and the index from which it was removed.
* @type {Event}
* @default Event()
* @readonly
*/
this.planeRemoved = new Event();

Expand Down Expand Up @@ -472,7 +472,7 @@ ClippingPlaneCollection.prototype.update = function (frameState) {
// Compute texture requirements for current planes
// In RGBA FLOAT, A plane is 4 floats packed to a RGBA.
// In RGBA UNSIGNED_BYTE, A plane is a float in [0, 1) packed to RGBA and an Oct32 quantized normal,
// so 8 bits or 2 pixels in RGBA.
// so 8 bytes or 2 pixels in RGBA.
const pixelsNeeded = useFloatTexture ? this.length : this.length * 2;

if (defined(clippingPlanesTexture)) {
Expand Down
Loading