@cesium/engine 7.0.0 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Build/ThirdParty/Workers/z-worker-pako.js +1 -5
- package/Build/Workers/{chunk-7XEAYGZK.js → chunk-24YTYWNB.js} +10 -10
- package/Build/Workers/{chunk-IQBYFRVW.js → chunk-2632RVPI.js} +7 -7
- package/Build/Workers/chunk-2KACWKS4.js +501 -0
- package/Build/Workers/{chunk-QZAD5O7I.js → chunk-2XPLH3JY.js} +7 -7
- package/Build/Workers/{chunk-JY5YEZFA.js → chunk-2ZBL3MVO.js} +8 -8
- package/Build/Workers/{chunk-ZK5JOS3D.js → chunk-3NCVAGDA.js} +14 -14
- package/Build/Workers/{chunk-AR5DNBJ4.js → chunk-5R6VWLMH.js} +6 -6
- package/Build/Workers/{chunk-PTQQUQC3.js → chunk-5TIV3L26.js} +13 -13
- package/Build/Workers/{chunk-BZP4T2JJ.js → chunk-6WF3KIF5.js} +10 -10
- package/Build/Workers/{chunk-5WQ523AW.js → chunk-73FKKY52.js} +5 -5
- package/Build/Workers/{chunk-F6SE42BK.js → chunk-7COR472O.js} +15 -472
- package/Build/Workers/{chunk-72SANQJV.js → chunk-ADOVHYWO.js} +9 -5
- package/Build/Workers/{chunk-5YLJ77FF.js → chunk-BCU2LH5T.js} +12 -11
- package/Build/Workers/{chunk-4EBHOMFX.js → chunk-C3XBUYBO.js} +17 -17
- package/Build/Workers/{chunk-IX2JCCNM.js → chunk-C6OI26DR.js} +1 -1
- package/Build/Workers/{chunk-2HJWSU7B.js → chunk-CO35JNNE.js} +4 -4
- package/Build/Workers/{chunk-OVLG3FRS.js → chunk-DGDUKCJJ.js} +6 -6
- package/Build/Workers/{chunk-DTAIXKTO.js → chunk-DPUSFA7S.js} +6 -6
- package/Build/Workers/{chunk-R5X4OQT4.js → chunk-E6WXPSJS.js} +7 -7
- package/Build/Workers/{chunk-VK3EJHWI.js → chunk-EOXYZ34O.js} +2 -2
- package/Build/Workers/{chunk-RAEV7K66.js → chunk-EPKE7GE3.js} +5 -5
- package/Build/Workers/{chunk-GV56Q4LU.js → chunk-GFA4SMXV.js} +11 -11
- package/Build/Workers/{chunk-NKPBIX7F.js → chunk-GXUXEOE2.js} +1 -1
- package/Build/Workers/{chunk-NY3K4IM3.js → chunk-HBQPB6IH.js} +12 -12
- package/Build/Workers/{chunk-6HZQPRUS.js → chunk-I37B3MZ2.js} +1 -1
- package/Build/Workers/{chunk-VRGFV2UO.js → chunk-L4BW3RUA.js} +10 -10
- package/Build/Workers/{chunk-6VJVYK2V.js → chunk-LAQP3SCC.js} +2 -2
- package/Build/Workers/{chunk-PNBGBETF.js → chunk-LQJ5FFFR.js} +10 -10
- package/Build/Workers/{chunk-UAEW6HKG.js → chunk-M2AYBTNH.js} +13 -13
- package/Build/Workers/{chunk-YUCVWAY6.js → chunk-MWV7IZK4.js} +7 -7
- package/Build/Workers/{chunk-JXDC723O.js → chunk-N4KXMWQU.js} +2 -2
- package/Build/Workers/{chunk-XWXM2O2R.js → chunk-NP2GYYE5.js} +6 -6
- package/Build/Workers/{chunk-GEJTYLCO.js → chunk-NZWNZA6S.js} +5 -5
- package/Build/Workers/{chunk-LZGHD6NY.js → chunk-P2YAAMT2.js} +15 -15
- package/Build/Workers/{chunk-S6SKF6DT.js → chunk-P4XKB3QZ.js} +5 -5
- package/Build/Workers/{chunk-U2VCRRQW.js → chunk-PXB7T27O.js} +6 -6
- package/Build/Workers/{chunk-RV7ZYPFT.js → chunk-QCQUZGXI.js} +4 -4
- package/Build/Workers/{chunk-JJ4VBOQ3.js → chunk-QKBGRKKG.js} +4 -4
- package/Build/Workers/{chunk-ODW7WYM4.js → chunk-RMOEYCZW.js} +2 -2
- package/Build/Workers/{chunk-ZUA2UUNV.js → chunk-RSJXEO2A.js} +2 -2
- package/Build/Workers/{chunk-UDO6BFSF.js → chunk-RV7ZOSS6.js} +13 -13
- package/Build/Workers/{chunk-LZ7JIV3K.js → chunk-SE4PXOEA.js} +17 -17
- package/Build/Workers/{chunk-S4MAZ3SS.js → chunk-SS4ESNE3.js} +2 -2
- package/Build/Workers/{chunk-AIPU2VSX.js → chunk-TJBU6GML.js} +6 -6
- package/Build/Workers/{chunk-5M3U6ZMA.js → chunk-TZORKRNK.js} +1 -1
- package/Build/Workers/{chunk-MY3VNFGQ.js → chunk-VR5RBW52.js} +7 -7
- package/Build/Workers/{chunk-FP6GYBFX.js → chunk-WHUSTDIB.js} +10 -10
- package/Build/Workers/{chunk-5HDYHG3F.js → chunk-X2F6BEPY.js} +13 -13
- package/Build/Workers/{chunk-WZU2YLWG.js → chunk-X6XOMPWL.js} +3 -3
- package/Build/Workers/{chunk-UGK3FCDY.js → chunk-YDVSBWEO.js} +1 -1
- package/Build/Workers/{chunk-46UD5ABS.js → chunk-YV4H2Y7M.js} +4 -4
- package/Build/Workers/{chunk-WBQCVXR3.js → chunk-Z7FQLK6N.js} +4 -4
- package/Build/Workers/{chunk-L2ZN645J.js → chunk-ZNVSKMQ2.js} +6 -6
- package/Build/Workers/{chunk-JCNXK6EL.js → chunk-ZYPTP7GS.js} +11 -11
- package/Build/Workers/combineGeometry.js +24 -23
- package/Build/Workers/createBoxGeometry.js +18 -17
- package/Build/Workers/createBoxOutlineGeometry.js +16 -15
- package/Build/Workers/createCircleGeometry.js +26 -25
- package/Build/Workers/createCircleOutlineGeometry.js +19 -18
- package/Build/Workers/createCoplanarPolygonGeometry.js +33 -32
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -30
- package/Build/Workers/createCorridorGeometry.js +29 -28
- package/Build/Workers/createCorridorOutlineGeometry.js +28 -27
- package/Build/Workers/createCylinderGeometry.js +20 -19
- package/Build/Workers/createCylinderOutlineGeometry.js +18 -17
- package/Build/Workers/createEllipseGeometry.js +26 -25
- package/Build/Workers/createEllipseOutlineGeometry.js +19 -18
- package/Build/Workers/createEllipsoidGeometry.js +19 -18
- package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -17
- package/Build/Workers/createFrustumGeometry.js +18 -17
- package/Build/Workers/createFrustumOutlineGeometry.js +18 -17
- package/Build/Workers/createGeometry.js +54 -33
- package/Build/Workers/createGroundPolylineGeometry.js +22 -21
- package/Build/Workers/createPlaneGeometry.js +16 -15
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -14
- package/Build/Workers/createPolygonGeometry.js +33 -32
- package/Build/Workers/createPolygonOutlineGeometry.js +30 -29
- package/Build/Workers/createPolylineGeometry.js +25 -24
- package/Build/Workers/createPolylineVolumeGeometry.js +31 -30
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -26
- package/Build/Workers/createRectangleGeometry.js +27 -26
- package/Build/Workers/createRectangleOutlineGeometry.js +20 -19
- package/Build/Workers/createSimplePolylineGeometry.js +23 -22
- package/Build/Workers/createSphereGeometry.js +19 -18
- package/Build/Workers/createSphereOutlineGeometry.js +18 -17
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
- package/Build/Workers/createVectorTileGeometries.js +24 -23
- package/Build/Workers/createVectorTilePoints.js +12 -12
- package/Build/Workers/createVectorTilePolygons.js +22 -21
- package/Build/Workers/createVectorTilePolylines.js +14 -14
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -21
- package/Build/Workers/createVerticesFromHeightmap.js +22 -21
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +19 -18
- package/Build/Workers/createWallGeometry.js +24 -23
- package/Build/Workers/createWallOutlineGeometry.js +23 -22
- package/Build/Workers/decodeDraco.js +11 -11
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +601 -92
- package/Build/Workers/transcodeKTX2.js +7 -7
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -21
- package/Source/Core/Check.d.ts +127 -0
- package/Source/Core/Check.js +0 -1
- package/Source/Core/Ellipsoid.js +6 -0
- package/Source/Core/Geometry.js +1 -1
- package/Source/Core/IntersectionTests.js +6 -3
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/PixelFormat.js +5 -0
- package/Source/Core/PolygonGeometry.js +1 -1
- package/Source/Core/Transforms.js +3 -0
- package/Source/Core/VerticalExaggeration.js +2 -1
- package/Source/Core/srgbToLinear.js +32 -0
- package/Source/DataSources/CzmlDataSource.js +51 -23
- package/Source/DataSources/DataSourceDisplay.js +27 -0
- package/Source/DataSources/Entity.js +20 -2
- package/Source/DataSources/GeometryUpdaterSet.js +114 -0
- package/Source/DataSources/GeometryVisualizer.js +19 -83
- package/Source/Renderer/Context.js +10 -0
- package/Source/Renderer/ContextLimits.js +2 -0
- package/Source/Renderer/demodernizeShader.js +4 -1
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Axis.js +12 -7
- package/Source/Scene/Billboard.js +32 -0
- package/Source/Scene/BillboardCollection.js +1 -1
- package/Source/Scene/BingMapsImageryProvider.js +4 -0
- package/Source/Scene/Camera.js +46 -4
- package/Source/Scene/Cesium3DTilesVoxelProvider.js +2 -9
- package/Source/Scene/Cesium3DTileset.js +10 -7
- package/Source/Scene/Cesium3DTilesetBaseTraversal.js +2 -4
- package/Source/Scene/FrameState.js +5 -0
- package/Source/Scene/Globe.js +0 -67
- package/Source/Scene/GlobeTranslucencyState.js +1 -1
- package/Source/Scene/GltfPipeline/updateVersion.js +69 -68
- package/Source/Scene/I3SDataProvider.js +270 -53
- package/Source/Scene/I3SDecoder.js +8 -1
- package/Source/Scene/I3SFeature.js +2 -5
- package/Source/Scene/I3SField.js +136 -31
- package/Source/Scene/I3SGeometry.js +70 -2
- package/Source/Scene/I3SLayer.js +55 -10
- package/Source/Scene/I3SNode.js +175 -18
- package/Source/Scene/I3SStatistics.js +94 -0
- package/Source/Scene/I3SSublayer.js +176 -0
- package/Source/Scene/I3SSymbology.js +337 -0
- package/Source/Scene/KeyframeNode.js +1 -1
- package/Source/Scene/Label.js +33 -0
- package/Source/Scene/LabelCollection.js +2 -1
- package/Source/Scene/Model/pickModel.js +25 -7
- package/Source/Scene/PickFramebuffer.js +37 -2
- package/Source/Scene/Picking.js +113 -39
- package/Source/Scene/Primitive.js +6 -5
- package/Source/Scene/Scene.js +126 -42
- package/Source/Scene/ScreenSpaceCameraController.js +21 -7
- package/Source/Scene/SensorVolumePortionToDisplay.js +69 -0
- package/Source/Scene/SpatialNode.js +12 -19
- package/Source/Scene/StructuralMetadata.js +1 -1
- package/Source/Scene/VoxelBoxShape.js +67 -6
- package/Source/Scene/VoxelCell.js +273 -0
- package/Source/Scene/VoxelCylinderShape.js +117 -163
- package/Source/Scene/VoxelEllipsoidShape.js +255 -304
- package/Source/Scene/VoxelPrimitive.js +109 -15
- package/Source/Scene/VoxelRenderResources.js +12 -3
- package/Source/Scene/VoxelShape.js +7 -4
- package/Source/Scene/VoxelTraversal.js +76 -54
- package/Source/Scene/buildVoxelDrawCommands.js +23 -0
- package/Source/Scene/createGooglePhotorealistic3DTileset.js +1 -0
- package/Source/Scene/processVoxelProperties.js +3 -0
- package/Source/Shaders/Voxels/IntersectBox.glsl +21 -47
- package/Source/Shaders/Voxels/IntersectBox.js +21 -47
- package/Source/Shaders/Voxels/IntersectClippingPlanes.glsl +1 -1
- package/Source/Shaders/Voxels/IntersectClippingPlanes.js +1 -1
- package/Source/Shaders/Voxels/IntersectCylinder.glsl +76 -203
- package/Source/Shaders/Voxels/IntersectCylinder.js +76 -203
- package/Source/Shaders/Voxels/IntersectEllipsoid.glsl +220 -229
- package/Source/Shaders/Voxels/IntersectEllipsoid.js +220 -229
- package/Source/Shaders/Voxels/IntersectLongitude.glsl +102 -0
- package/Source/Shaders/Voxels/IntersectLongitude.js +104 -0
- package/Source/Shaders/Voxels/IntersectionUtils.glsl +33 -11
- package/Source/Shaders/Voxels/IntersectionUtils.js +33 -11
- package/Source/Shaders/Voxels/Megatexture.glsl +1 -2
- package/Source/Shaders/Voxels/Megatexture.js +1 -2
- package/Source/Shaders/Voxels/Octree.glsl +14 -9
- package/Source/Shaders/Voxels/Octree.js +14 -9
- package/Source/Shaders/Voxels/VoxelFS.glsl +128 -40
- package/Source/Shaders/Voxels/VoxelFS.js +128 -40
- package/Source/Shaders/Voxels/VoxelUtils.glsl +31 -0
- package/Source/Shaders/Voxels/VoxelUtils.js +33 -0
- package/Source/Shaders/Voxels/convertUvToBox.glsl +24 -3
- package/Source/Shaders/Voxels/convertUvToBox.js +24 -4
- package/Source/Shaders/Voxels/convertUvToCylinder.glsl +64 -40
- package/Source/Shaders/Voxels/convertUvToCylinder.js +64 -40
- package/Source/Shaders/Voxels/convertUvToEllipsoid.glsl +100 -91
- package/Source/Shaders/Voxels/convertUvToEllipsoid.js +100 -91
- package/Source/ThirdParty/Workers/z-worker-pako.js +1 -1
- package/Source/Workers/createGeometry.js +40 -11
- package/Source/Workers/decodeI3S.js +720 -94
- package/index.d.ts +542 -40
- package/index.js +75 -66
- package/package.json +2 -2
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
// See IntersectionUtils.glsl for the definitions of Ray, Intersections,
|
|
2
|
-
//
|
|
1
|
+
// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT, Intersections,
|
|
2
|
+
// RayShapeIntersection, setSurfaceIntersection, setShapeIntersection
|
|
3
|
+
// See IntersectLongitude.glsl for the definitions of intersectHalfPlane,
|
|
4
|
+
// intersectFlippedWedge, intersectRegularWedge
|
|
3
5
|
|
|
4
6
|
/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js)
|
|
5
7
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE
|
|
6
8
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO
|
|
7
9
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF
|
|
8
|
-
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF
|
|
9
10
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF
|
|
10
|
-
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE
|
|
11
11
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF
|
|
12
12
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF
|
|
13
13
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF
|
|
14
14
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF
|
|
15
15
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF
|
|
16
16
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF
|
|
17
|
-
#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX
|
|
18
|
-
#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN
|
|
19
|
-
#define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT
|
|
20
17
|
#define ELLIPSOID_INTERSECTION_INDEX_LONGITUDE
|
|
21
18
|
#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX
|
|
22
19
|
#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN
|
|
@@ -27,205 +24,225 @@
|
|
|
27
24
|
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE)
|
|
28
25
|
uniform vec2 u_ellipsoidRenderLongitudeMinMax;
|
|
29
26
|
#endif
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX)
|
|
34
|
-
uniform float u_ellipsoidInverseOuterScaleUv;
|
|
35
|
-
#endif
|
|
36
|
-
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN)
|
|
37
|
-
uniform float u_ellipsoidInverseInnerScaleUv;
|
|
38
|
-
#endif
|
|
39
|
-
|
|
40
|
-
vec2 intersectZPlane(Ray ray)
|
|
41
|
-
{
|
|
42
|
-
float o = ray.pos.z;
|
|
43
|
-
float d = ray.dir.z;
|
|
44
|
-
float t = -o / d;
|
|
45
|
-
float s = sign(o);
|
|
46
|
-
|
|
47
|
-
if (t >= 0.0 != s >= 0.0) return vec2(t, +INF_HIT);
|
|
48
|
-
else return vec2(-INF_HIT, t);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
vec4 intersectHalfPlane(Ray ray, float angle) {
|
|
52
|
-
vec2 o = ray.pos.xy;
|
|
53
|
-
vec2 d = ray.dir.xy;
|
|
54
|
-
vec2 planeDirection = vec2(cos(angle), sin(angle));
|
|
55
|
-
vec2 planeNormal = vec2(planeDirection.y, -planeDirection.x);
|
|
27
|
+
uniform float u_eccentricitySquared;
|
|
28
|
+
uniform vec2 u_ellipsoidRenderLatitudeSinMinMax;
|
|
29
|
+
uniform vec2 u_clipMinMaxHeight;
|
|
56
30
|
|
|
57
|
-
|
|
58
|
-
float
|
|
59
|
-
float t = -a / b;
|
|
31
|
+
RayShapeIntersection intersectZPlane(in Ray ray, in float z) {
|
|
32
|
+
float t = -ray.pos.z / ray.dir.z;
|
|
60
33
|
|
|
61
|
-
|
|
62
|
-
bool
|
|
63
|
-
if (outside) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT);
|
|
34
|
+
bool startsOutside = sign(ray.pos.z) == sign(z);
|
|
35
|
+
bool entry = (t >= 0.0) != startsOutside;
|
|
64
36
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
vec2 intersectHalfSpace(Ray ray, float angle)
|
|
69
|
-
{
|
|
70
|
-
vec2 o = ray.pos.xy;
|
|
71
|
-
vec2 d = ray.dir.xy;
|
|
72
|
-
vec2 n = vec2(sin(angle), -cos(angle));
|
|
73
|
-
|
|
74
|
-
float a = dot(o, n);
|
|
75
|
-
float b = dot(d, n);
|
|
76
|
-
float t = -a / b;
|
|
77
|
-
float s = sign(a);
|
|
37
|
+
vec4 intersect = vec4(0.0, 0.0, z, t);
|
|
38
|
+
vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
|
|
78
39
|
|
|
79
|
-
if (
|
|
80
|
-
|
|
40
|
+
if (entry) {
|
|
41
|
+
return RayShapeIntersection(intersect, farSide);
|
|
42
|
+
} else {
|
|
43
|
+
return RayShapeIntersection(-1.0 * farSide, intersect);
|
|
44
|
+
}
|
|
81
45
|
}
|
|
82
46
|
|
|
83
|
-
|
|
47
|
+
RayShapeIntersection intersectHeight(in Ray ray, in float relativeHeight, in bool convex)
|
|
84
48
|
{
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
float
|
|
92
|
-
float
|
|
93
|
-
float
|
|
49
|
+
// Scale the ray by the ellipsoid axes to make it a unit sphere
|
|
50
|
+
// Note: approximating ellipsoid + height as an ellipsoid
|
|
51
|
+
vec3 radiiCorrection = u_ellipsoidRadiiUv / (u_ellipsoidRadiiUv + relativeHeight);
|
|
52
|
+
vec3 position = ray.pos * radiiCorrection;
|
|
53
|
+
vec3 direction = ray.dir * radiiCorrection;
|
|
54
|
+
|
|
55
|
+
float a = dot(direction, direction); // ~ 1.0 (or maybe 4.0 if ray is scaled)
|
|
56
|
+
float b = dot(direction, position); // roughly inside [-1.0, 1.0] when zoomed in
|
|
57
|
+
float c = dot(position, position) - 1.0; // ~ 0.0 when zoomed in.
|
|
58
|
+
float determinant = b * b - a * c; // ~ b * b when zoomed in
|
|
59
|
+
|
|
60
|
+
if (determinant < 0.0) {
|
|
61
|
+
vec4 miss = vec4(normalize(direction), NO_HIT);
|
|
62
|
+
return RayShapeIntersection(miss, miss);
|
|
63
|
+
}
|
|
94
64
|
|
|
95
|
-
|
|
96
|
-
float t2 = -a2 / b2;
|
|
97
|
-
float s1 = sign(a1);
|
|
98
|
-
float s2 = sign(a2);
|
|
65
|
+
determinant = sqrt(determinant);
|
|
99
66
|
|
|
67
|
+
// Compute larger root using standard formula
|
|
68
|
+
float signB = b < 0.0 ? -1.0 : 1.0;
|
|
69
|
+
// The other root may suffer from subtractive cancellation in the standard formula.
|
|
70
|
+
// Compute it from the first root instead.
|
|
71
|
+
float t1 = (-b - signB * determinant) / a;
|
|
72
|
+
float t2 = c / (a * t1);
|
|
100
73
|
float tmin = min(t1, t2);
|
|
101
74
|
float tmax = max(t1, t2);
|
|
102
|
-
float smin = tmin == t1 ? s1 : s2;
|
|
103
|
-
float smax = tmin == t1 ? s2 : s1;
|
|
104
|
-
|
|
105
|
-
bool e = tmin >= 0.0;
|
|
106
|
-
bool f = tmax >= 0.0;
|
|
107
|
-
bool g = smin >= 0.0;
|
|
108
|
-
bool h = smax >= 0.0;
|
|
109
|
-
|
|
110
|
-
if (e != g && f == h) return vec2(tmin, tmax);
|
|
111
|
-
else if (e == g && f == h) return vec2(-INF_HIT, tmin);
|
|
112
|
-
else if (e != g && f != h) return vec2(tmax, +INF_HIT);
|
|
113
|
-
else return vec2(NO_HIT);
|
|
114
|
-
}
|
|
115
75
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
return vec4(
|
|
76
|
+
float directionScale = convex ? 1.0 : -1.0;
|
|
77
|
+
vec3 d1 = directionScale * normalize(position + tmin * direction);
|
|
78
|
+
vec3 d2 = directionScale * normalize(position + tmax * direction);
|
|
79
|
+
|
|
80
|
+
return RayShapeIntersection(vec4(d1, tmin), vec4(d2, tmax));
|
|
121
81
|
}
|
|
122
82
|
|
|
123
|
-
|
|
83
|
+
/**
|
|
84
|
+
* Given a circular cone around the z-axis, with apex at the origin,
|
|
85
|
+
* find the parametric distance(s) along a ray where that ray intersects
|
|
86
|
+
* the cone.
|
|
87
|
+
* The cone opening angle is described by the squared cosine of
|
|
88
|
+
* its half-angle (the angle between the Z-axis and the surface)
|
|
89
|
+
*/
|
|
90
|
+
vec2 intersectDoubleEndedCone(in Ray ray, in float cosSqrHalfAngle)
|
|
124
91
|
{
|
|
125
92
|
vec3 o = ray.pos;
|
|
126
93
|
vec3 d = ray.dir;
|
|
94
|
+
float sinSqrHalfAngle = 1.0 - cosSqrHalfAngle;
|
|
127
95
|
|
|
128
|
-
float
|
|
129
|
-
float
|
|
130
|
-
float
|
|
131
|
-
|
|
132
|
-
if (det < 0.0) {
|
|
133
|
-
return vec2(NO_HIT);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
det = sqrt(det);
|
|
137
|
-
float t1 = -b - det;
|
|
138
|
-
float t2 = -b + det;
|
|
139
|
-
float tmin = min(t1, t2);
|
|
140
|
-
float tmax = max(t1, t2);
|
|
141
|
-
|
|
142
|
-
return vec2(tmin, tmax);
|
|
143
|
-
}
|
|
96
|
+
float aSin = d.z * d.z * sinSqrHalfAngle;
|
|
97
|
+
float aCos = -dot(d.xy, d.xy) * cosSqrHalfAngle;
|
|
98
|
+
float a = aSin + aCos;
|
|
144
99
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
vec3 d = ray.dir;
|
|
100
|
+
float bSin = d.z * o.z * sinSqrHalfAngle;
|
|
101
|
+
float bCos = -dot(o.xy, d.xy) * cosSqrHalfAngle;
|
|
102
|
+
float b = bSin + bCos;
|
|
149
103
|
|
|
150
|
-
float
|
|
151
|
-
float
|
|
152
|
-
float c =
|
|
153
|
-
|
|
104
|
+
float cSin = o.z * o.z * sinSqrHalfAngle;
|
|
105
|
+
float cCos = -dot(o.xy, o.xy) * cosSqrHalfAngle;
|
|
106
|
+
float c = cSin + cCos;
|
|
107
|
+
// determinant = b * b - a * c. But bSin * bSin = aSin * cSin.
|
|
108
|
+
// Avoid subtractive cancellation by expanding to eliminate these terms
|
|
109
|
+
float determinant = 2.0 * bSin * bCos + bCos * bCos - aSin * cCos - aCos * cSin - aCos * cCos;
|
|
154
110
|
|
|
155
|
-
if (
|
|
111
|
+
if (determinant < 0.0) {
|
|
156
112
|
return vec2(NO_HIT);
|
|
113
|
+
} else if (a == 0.0) {
|
|
114
|
+
// Ray is parallel to cone surface
|
|
115
|
+
return (b == 0.0)
|
|
116
|
+
? vec2(NO_HIT) // Ray is on cone surface
|
|
117
|
+
: vec2(-0.5 * c / b, NO_HIT);
|
|
157
118
|
}
|
|
158
119
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
120
|
+
determinant = sqrt(determinant);
|
|
121
|
+
|
|
122
|
+
// Compute larger root using standard formula
|
|
123
|
+
float signB = b < 0.0 ? -1.0 : 1.0;
|
|
124
|
+
float t1 = (-b - signB * determinant) / a;
|
|
125
|
+
// The other root may suffer from subtractive cancellation in the standard formula.
|
|
126
|
+
// Compute it from the first root instead.
|
|
127
|
+
float t2 = c / (a * t1);
|
|
162
128
|
float tmin = min(t1, t2);
|
|
163
129
|
float tmax = max(t1, t2);
|
|
164
|
-
|
|
165
130
|
return vec2(tmin, tmax);
|
|
166
131
|
}
|
|
167
132
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
float
|
|
176
|
-
|
|
177
|
-
if
|
|
178
|
-
|
|
179
|
-
|
|
133
|
+
/**
|
|
134
|
+
* Given a point on a conical surface, find the surface normal at that point.
|
|
135
|
+
*/
|
|
136
|
+
vec3 getConeNormal(in vec3 p, in bool convex) {
|
|
137
|
+
// Start with radial component pointing toward z-axis
|
|
138
|
+
vec2 radial = -abs(p.z) * normalize(p.xy);
|
|
139
|
+
// Z component points toward opening of cone
|
|
140
|
+
float zSign = (p.z < 0.0) ? -1.0 : 1.0;
|
|
141
|
+
float z = length(p.xy) * zSign;
|
|
142
|
+
// Flip normal if shape is convex
|
|
143
|
+
float flip = (convex) ? -1.0 : 1.0;
|
|
144
|
+
return normalize(vec3(radial, z) * flip);
|
|
145
|
+
}
|
|
180
146
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
147
|
+
/**
|
|
148
|
+
* Compute the shift between the ellipsoid origin and the apex of a cone of latitude
|
|
149
|
+
*/
|
|
150
|
+
float getLatitudeConeShift(in float sinLatitude) {
|
|
151
|
+
// Find prime vertical radius of curvature:
|
|
152
|
+
// the distance along the ellipsoid normal to the intersection with the z-axis
|
|
153
|
+
float x2 = u_eccentricitySquared * sinLatitude * sinLatitude;
|
|
154
|
+
float primeVerticalRadius = inversesqrt(1.0 - x2);
|
|
155
|
+
|
|
156
|
+
// Compute a shift from the origin to the intersection of the cone with the z-axis
|
|
157
|
+
return primeVerticalRadius * u_eccentricitySquared * sinLatitude;
|
|
187
158
|
}
|
|
188
159
|
|
|
189
|
-
|
|
160
|
+
void intersectFlippedCone(in Ray ray, in float cosHalfAngle, out RayShapeIntersection intersections[2]) {
|
|
161
|
+
// Undo the scaling from ellipsoid to sphere
|
|
162
|
+
ray.pos = ray.pos * u_ellipsoidRadiiUv;
|
|
163
|
+
ray.dir = ray.dir * u_ellipsoidRadiiUv;
|
|
164
|
+
// Shift the ray to account for the latitude cone not being centered at the Earth center
|
|
165
|
+
ray.pos.z += getLatitudeConeShift(cosHalfAngle);
|
|
166
|
+
|
|
167
|
+
float cosSqrHalfAngle = cosHalfAngle * cosHalfAngle;
|
|
190
168
|
vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle);
|
|
191
169
|
|
|
170
|
+
vec4 miss = vec4(normalize(ray.dir), NO_HIT);
|
|
171
|
+
vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
|
|
172
|
+
|
|
173
|
+
// Initialize output with no intersections
|
|
174
|
+
intersections[0].entry = -1.0 * farSide;
|
|
175
|
+
intersections[0].exit = farSide;
|
|
176
|
+
intersections[1].entry = miss;
|
|
177
|
+
intersections[1].exit = miss;
|
|
178
|
+
|
|
192
179
|
if (intersect.x == NO_HIT) {
|
|
193
|
-
return
|
|
180
|
+
return;
|
|
194
181
|
}
|
|
195
182
|
|
|
196
|
-
|
|
197
|
-
vec3 d = ray.dir;
|
|
183
|
+
// Find the points of intersection
|
|
198
184
|
float tmin = intersect.x;
|
|
199
185
|
float tmax = intersect.y;
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
186
|
+
vec3 p0 = ray.pos + tmin * ray.dir;
|
|
187
|
+
vec3 p1 = ray.pos + tmax * ray.dir;
|
|
188
|
+
|
|
189
|
+
vec4 intersect0 = vec4(getConeNormal(p0, true), tmin);
|
|
190
|
+
vec4 intersect1 = vec4(getConeNormal(p1, true), tmax);
|
|
191
|
+
|
|
192
|
+
bool p0InShadowCone = sign(p0.z) != sign(cosHalfAngle);
|
|
193
|
+
bool p1InShadowCone = sign(p1.z) != sign(cosHalfAngle);
|
|
194
|
+
|
|
195
|
+
if (p0InShadowCone && p1InShadowCone) {
|
|
196
|
+
// no valid intersections
|
|
197
|
+
} else if (p0InShadowCone) {
|
|
198
|
+
intersections[0].exit = intersect1;
|
|
199
|
+
} else if (p1InShadowCone) {
|
|
200
|
+
intersections[0].entry = intersect0;
|
|
201
|
+
} else {
|
|
202
|
+
intersections[0].exit = intersect0;
|
|
203
|
+
intersections[1].entry = intersect1;
|
|
204
|
+
intersections[1].exit = farSide;
|
|
205
|
+
}
|
|
209
206
|
}
|
|
210
207
|
|
|
211
|
-
|
|
208
|
+
RayShapeIntersection intersectRegularCone(in Ray ray, in float cosHalfAngle, in bool convex) {
|
|
209
|
+
// Undo the scaling from ellipsoid to sphere
|
|
210
|
+
ray.pos = ray.pos * u_ellipsoidRadiiUv;
|
|
211
|
+
ray.dir = ray.dir * u_ellipsoidRadiiUv;
|
|
212
|
+
// Shift the ray to account for the latitude cone not being centered at the Earth center
|
|
213
|
+
ray.pos.z += getLatitudeConeShift(cosHalfAngle);
|
|
214
|
+
|
|
215
|
+
float cosSqrHalfAngle = cosHalfAngle * cosHalfAngle;
|
|
212
216
|
vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle);
|
|
213
217
|
|
|
218
|
+
vec4 miss = vec4(normalize(ray.dir), NO_HIT);
|
|
219
|
+
vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
|
|
220
|
+
|
|
214
221
|
if (intersect.x == NO_HIT) {
|
|
215
|
-
return
|
|
222
|
+
return RayShapeIntersection(miss, miss);
|
|
216
223
|
}
|
|
217
224
|
|
|
218
|
-
|
|
219
|
-
vec3 d = ray.dir;
|
|
225
|
+
// Find the points of intersection
|
|
220
226
|
float tmin = intersect.x;
|
|
221
227
|
float tmax = intersect.y;
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
228
|
+
vec3 p0 = ray.pos + tmin * ray.dir;
|
|
229
|
+
vec3 p1 = ray.pos + tmax * ray.dir;
|
|
230
|
+
|
|
231
|
+
vec4 intersect0 = vec4(getConeNormal(p0, convex), tmin);
|
|
232
|
+
vec4 intersect1 = vec4(getConeNormal(p1, convex), tmax);
|
|
233
|
+
|
|
234
|
+
bool p0InShadowCone = sign(p0.z) != sign(cosHalfAngle);
|
|
235
|
+
bool p1InShadowCone = sign(p1.z) != sign(cosHalfAngle);
|
|
236
|
+
|
|
237
|
+
if (p0InShadowCone && p1InShadowCone) {
|
|
238
|
+
return RayShapeIntersection(miss, miss);
|
|
239
|
+
} else if (p0InShadowCone) {
|
|
240
|
+
return RayShapeIntersection(intersect1, farSide);
|
|
241
|
+
} else if (p1InShadowCone) {
|
|
242
|
+
return RayShapeIntersection(-1.0 * farSide, intersect0);
|
|
243
|
+
} else {
|
|
244
|
+
return RayShapeIntersection(intersect0, intersect1);
|
|
245
|
+
}
|
|
229
246
|
}
|
|
230
247
|
|
|
231
248
|
void intersectShape(in Ray ray, inout Intersections ix) {
|
|
@@ -234,25 +251,25 @@ void intersectShape(in Ray ray, inout Intersections ix) {
|
|
|
234
251
|
ray.pos = ray.pos * 2.0 - 1.0;
|
|
235
252
|
ray.dir *= 2.0;
|
|
236
253
|
|
|
237
|
-
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX)
|
|
238
|
-
Ray outerRay = Ray(ray.pos * u_ellipsoidInverseOuterScaleUv, ray.dir * u_ellipsoidInverseOuterScaleUv);
|
|
239
|
-
#else
|
|
240
|
-
Ray outerRay = ray;
|
|
241
|
-
#endif
|
|
242
|
-
|
|
243
254
|
// Outer ellipsoid
|
|
244
|
-
|
|
245
|
-
|
|
255
|
+
RayShapeIntersection outerIntersect = intersectHeight(ray, u_clipMinMaxHeight.y, true);
|
|
256
|
+
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect);
|
|
246
257
|
|
|
247
258
|
// Exit early if the outer ellipsoid was missed.
|
|
248
|
-
if (outerIntersect.
|
|
259
|
+
if (outerIntersect.entry.w == NO_HIT) {
|
|
249
260
|
return;
|
|
250
261
|
}
|
|
251
262
|
|
|
252
263
|
// Inner ellipsoid
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
264
|
+
RayShapeIntersection innerIntersect = intersectHeight(ray, u_clipMinMaxHeight.x, false);
|
|
265
|
+
|
|
266
|
+
if (innerIntersect.entry.w == NO_HIT) {
|
|
267
|
+
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect);
|
|
268
|
+
} else {
|
|
269
|
+
// When the ellipsoid is large and thin it's possible for floating point math
|
|
270
|
+
// to cause the ray to intersect the inner ellipsoid before the outer ellipsoid.
|
|
271
|
+
// To prevent this from happening, clamp innerIntersect to outerIntersect and
|
|
272
|
+
// sandwich the inner ellipsoid intersection inside the outer ellipsoid intersection.
|
|
256
273
|
|
|
257
274
|
// Without this special case,
|
|
258
275
|
// [outerMin, outerMax, innerMin, innerMax] will bubble sort to
|
|
@@ -267,81 +284,55 @@ void intersectShape(in Ray ray, inout Intersections ix) {
|
|
|
267
284
|
|
|
268
285
|
// Note: If initializeIntersections() changes its sorting function
|
|
269
286
|
// from bubble sort to something else, this code may need to change.
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
if (innerIntersect == vec2(NO_HIT)) {
|
|
279
|
-
setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect);
|
|
280
|
-
} else {
|
|
281
|
-
// When the ellipsoid is very large and thin it's possible for floating
|
|
282
|
-
// point math to cause the ray to intersect the inner ellipsoid before
|
|
283
|
-
// the outer ellipsoid. To prevent this from happening, clamp innerIntersect
|
|
284
|
-
// to outerIntersect and sandwhich the intersections like described above.
|
|
285
|
-
//
|
|
286
|
-
// In theory a similar fix is needed for cylinders, however it's more
|
|
287
|
-
// complicated to implement because the inner shape is allowed to be
|
|
288
|
-
// intersected first.
|
|
289
|
-
innerIntersect.x = max(innerIntersect.x, outerIntersect.x);
|
|
290
|
-
innerIntersect.y = min(innerIntersect.y, outerIntersect.y);
|
|
291
|
-
setIntersection(ix, 0, outerIntersect.x, true, true); // positive, enter
|
|
292
|
-
setIntersection(ix, 1, innerIntersect.x, false, true); // negative, enter
|
|
293
|
-
setIntersection(ix, 2, innerIntersect.y, false, false); // negative, exit
|
|
294
|
-
setIntersection(ix, 3, outerIntersect.y, true, false); // positive, exit
|
|
295
|
-
}
|
|
296
|
-
#endif
|
|
297
|
-
|
|
298
|
-
// Flip the ray because the intersection function expects a cone growing towards +Z.
|
|
299
|
-
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF)
|
|
300
|
-
Ray flippedRay = outerRay;
|
|
301
|
-
flippedRay.dir.z *= -1.0;
|
|
302
|
-
flippedRay.pos.z *= -1.0;
|
|
303
|
-
#endif
|
|
287
|
+
innerIntersect.entry.w = max(innerIntersect.entry.w, outerIntersect.entry.w);
|
|
288
|
+
innerIntersect.exit.w = min(innerIntersect.exit.w, outerIntersect.exit.w);
|
|
289
|
+
setSurfaceIntersection(ix, 0, outerIntersect.entry, true, true); // positive, enter
|
|
290
|
+
setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); // negative, enter
|
|
291
|
+
setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); // negative, exit
|
|
292
|
+
setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false); // positive, exit
|
|
293
|
+
}
|
|
304
294
|
|
|
305
295
|
// Bottom cone
|
|
306
296
|
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF)
|
|
307
|
-
|
|
308
|
-
|
|
297
|
+
RayShapeIntersection bottomConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeSinMinMax.x, false);
|
|
298
|
+
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection);
|
|
309
299
|
#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF)
|
|
310
|
-
|
|
311
|
-
|
|
300
|
+
RayShapeIntersection bottomConeIntersection = intersectZPlane(ray, -1.0);
|
|
301
|
+
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection);
|
|
312
302
|
#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF)
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
303
|
+
RayShapeIntersection bottomConeIntersections[2];
|
|
304
|
+
intersectFlippedCone(ray, u_ellipsoidRenderLatitudeSinMinMax.x, bottomConeIntersections);
|
|
305
|
+
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 0, bottomConeIntersections[0]);
|
|
306
|
+
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 1, bottomConeIntersections[1]);
|
|
316
307
|
#endif
|
|
317
308
|
|
|
318
309
|
// Top cone
|
|
319
310
|
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF)
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
311
|
+
RayShapeIntersection topConeIntersections[2];
|
|
312
|
+
intersectFlippedCone(ray, u_ellipsoidRenderLatitudeSinMinMax.y, topConeIntersections);
|
|
313
|
+
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 0, topConeIntersections[0]);
|
|
314
|
+
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 1, topConeIntersections[1]);
|
|
323
315
|
#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF)
|
|
324
|
-
|
|
325
|
-
|
|
316
|
+
RayShapeIntersection topConeIntersection = intersectZPlane(ray, 1.0);
|
|
317
|
+
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection);
|
|
326
318
|
#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF)
|
|
327
|
-
|
|
328
|
-
|
|
319
|
+
RayShapeIntersection topConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeSinMinMax.y, false);
|
|
320
|
+
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection);
|
|
329
321
|
#endif
|
|
330
322
|
|
|
331
323
|
// Wedge
|
|
332
324
|
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO)
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
325
|
+
RayShapeIntersection wedgeIntersects[2];
|
|
326
|
+
intersectHalfPlane(ray, u_ellipsoidRenderLongitudeMinMax.x, wedgeIntersects);
|
|
327
|
+
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersects[0]);
|
|
328
|
+
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersects[1]);
|
|
336
329
|
#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF)
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF)
|
|
340
|
-
vec2 wedgeIntersect = intersectHalfSpace(ray, u_ellipsoidRenderLongitudeMinMax.x);
|
|
341
|
-
setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect);
|
|
330
|
+
RayShapeIntersection wedgeIntersect = intersectRegularWedge(ray, u_ellipsoidRenderLongitudeMinMax);
|
|
331
|
+
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect);
|
|
342
332
|
#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF)
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
333
|
+
RayShapeIntersection wedgeIntersects[2];
|
|
334
|
+
intersectFlippedWedge(ray, u_ellipsoidRenderLongitudeMinMax, wedgeIntersects);
|
|
335
|
+
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersects[0]);
|
|
336
|
+
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersects[1]);
|
|
346
337
|
#endif
|
|
347
338
|
}
|