You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: CHANGES.md
+1
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ Change Log
9
9
* Fixed an issue causing entities to disappear when updating multiple entities simultaneously. [#4096](https://github.com/AnalyticalGraphicsInc/cesium/issues/4096)
10
10
* Added support in CZML for expressing `BillboardGraphics.alignedAxis` as the velocity vector of an entity, using `velocityReference` syntax.
11
11
* Normalizing the velocity vector produced by `VelocityVectorProperty` is now optional.
12
+
* Added `AttributeCompression.octEncodeInRange`, `AttributeCompression.octDecodeInRange` and an optional `rangeMax` parameter to `Math.toSNorm` and `Math.fromSNorm`, to support oct-encoding with variable precision. [#4121](https://github.com/AnalyticalGraphicsInc/cesium/pull/4121)
Copy file name to clipboardexpand all lines: Source/Core/AttributeCompression.js
+52-16
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,14 @@
2
2
define([
3
3
'./Cartesian2',
4
4
'./Cartesian3',
5
+
'./defaultValue',
5
6
'./defined',
6
7
'./DeveloperError',
7
8
'./Math'
8
9
],function(
9
10
Cartesian2,
10
11
Cartesian3,
12
+
defaultValue,
11
13
defined,
12
14
DeveloperError,
13
15
CesiumMath){
@@ -23,21 +25,22 @@ define([
23
25
varAttributeCompression={};
24
26
25
27
/**
26
-
* Encodes a normalized vector into 2 SNORM values in the range of [0-255] following the 'oct' encoding.
28
+
* Encodes a normalized vector into 2 SNORM values in the range of [0-rangeMax] following the 'oct' encoding.
27
29
*
28
-
* Oct encoding is a compact representation of unit length vectors. The encoding and decoding functions are low cost, and represent the normalized vector within 1 degree of error.
30
+
* Oct encoding is a compact representation of unit length vectors.
29
31
* The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
30
32
* Cigolle et al 2014: {@link http://jcgt.org/published/0003/02/01/}
31
33
*
32
-
* @param {Cartesian3} vector The normalized vector to be compressed into 2 byte 'oct' encoding.
33
-
* @param {Cartesian2} result The 2 byte oct-encoded unit length vector.
34
-
* @returns {Cartesian2} The 2 byte oct-encoded unit length vector.
34
+
* @param {Cartesian3} vector The normalized vector to be compressed into 2 component 'oct' encoding.
35
+
* @param {Cartesian2} result The 2 component oct-encoded unit length vector.
36
+
* @param {Number} rangeMax The maximum value of the SNORM range. The encoded vector is stored in log2(rangeMax+1) bits.
37
+
* @returns {Cartesian2} The 2 component oct-encoded unit length vector.
35
38
*
36
39
* @exception {DeveloperError} vector must be normalized.
0 commit comments