Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 3D Tiles depth picking #5770

Merged
merged 12 commits into from
Aug 29, 2017
15 changes: 10 additions & 5 deletions Apps/Sandcastle/gallery/Classification.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 0.0, 0.0, 0.5))
},
id : 'volume'
})
}),
classificationType : Cesium.ClassificationType.CESIUM_3D_TILES
}));

camera.setView({
Expand Down Expand Up @@ -106,7 +107,8 @@
color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString('#F26419').withAlpha(0.5))
},
id : 'volume 1'
})
}),
classificationType : Cesium.ClassificationType.CESIUM_3D_TILES
}));

center = new Cesium.Cartesian3(1216394.3346955755, -4736207.431365568, 4081336.7768881875);
Expand All @@ -125,7 +127,8 @@
color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString('#F03A47').withAlpha(0.5))
},
id : 'volume 2'
})
}),
classificationType : Cesium.ClassificationType.CESIUM_3D_TILES
}));

center = new Cesium.Cartesian3(1216388.1664430483, -4736210.034324032, 4081332.9324705894);
Expand All @@ -143,7 +146,8 @@
color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString('#004FFF').withAlpha(0.5))
},
id : 'volume 3'
})
}),
classificationType : Cesium.ClassificationType.CESIUM_3D_TILES
}));

center = new Cesium.Cartesian3(1216383.1478702603, -4736211.716097012, 4081329.551077661);
Expand All @@ -161,7 +165,8 @@
color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.fromCssColorString('#55DDE0').withAlpha(0.5))
},
id : 'volume 4'
})
}),
classificationType : Cesium.ClassificationType.CESIUM_3D_TILES
}));

camera.setView({
Expand Down
30 changes: 20 additions & 10 deletions Apps/Sandcastle/gallery/development/Ground Primitive.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
color: Cesium.ColorGeometryInstanceAttribute.fromColor(color)
},
id : 'polygon 1'
})
}),
classificationType : Cesium.ClassificationType.TERRAIN
}));

// Same polygon slightly offset and overlapping.
Expand All @@ -89,7 +90,8 @@
color: Cesium.ColorGeometryInstanceAttribute.fromColor(color)
},
id : 'polygon 2'
})
}),
classificationType : Cesium.ClassificationType.TERRAIN
}));

// Same polygon slightly offset and overlapping.
Expand All @@ -110,7 +112,8 @@
color: Cesium.ColorGeometryInstanceAttribute.fromColor(color)
},
id : 'polygon 3'
})
}),
classificationType : Cesium.ClassificationType.TERRAIN
}));
}

Expand Down Expand Up @@ -204,7 +207,8 @@
var show = new Cesium.ShowGeometryInstanceAttribute(true);
var instances = createBatchedInstances(color, show);
scene.groundPrimitives.add(new Cesium.GroundPrimitive({
geometryInstances : instances
geometryInstances : instances,
classificationType : Cesium.ClassificationType.TERRAIN
}));

viewOverlappingPolygons();
Expand All @@ -216,7 +220,8 @@
var instances = createBatchedInstances(color, show);

var primitive = scene.groundPrimitives.add(new Cesium.GroundPrimitive({
geometryInstances : instances
geometryInstances : instances,
classificationType : Cesium.ClassificationType.TERRAIN
}));

color = new Cesium.ColorGeometryInstanceAttribute(1.0, 0.0, 1.0, 0.5);
Expand All @@ -230,7 +235,8 @@
}

var pickPrimitive = scene.groundPrimitives.add(new Cesium.GroundPrimitive({
geometryInstances : instances
geometryInstances : instances,
classificationType : Cesium.ClassificationType.TERRAIN
}));

viewOverlappingPolygons();
Expand Down Expand Up @@ -270,7 +276,8 @@
color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(1.0, 0.0, 0.0, 0.5))
},
id : 'circle'
})
}),
classificationType : Cesium.ClassificationType.TERRAIN
}));

// Ellipse Geometry
Expand All @@ -285,7 +292,8 @@
color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(0.0, 1.0, 1.0, 0.5))
},
id : 'ellipse'
})
}),
classificationType : Cesium.ClassificationType.TERRAIN
}));

// Corridor Geometry
Expand All @@ -303,7 +311,8 @@
color : Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(0.0, 0.0, 1.0, 0.5))
},
id : 'corridor'
})
}),
classificationType : Cesium.ClassificationType.TERRAIN
}));

// Rectangle geometry
Expand All @@ -317,7 +326,8 @@
color: Cesium.ColorGeometryInstanceAttribute.fromColor(new Cesium.Color(0.0, 1.0, 0.0, 0.5))
},
id : 'rectangle'
})
}),
classificationType : Cesium.ClassificationType.TERRAIN
}));
});

Expand Down
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ Change Log
* Fixed a bug that caused imagery splitting to work incorrectly when CSS pixels were not equivalent to WebGL drawing buffer pixels, such as on high DPI displays in Microsoft Edge and Internet Explorer.
* Added `Cesium3DTileset.loadJson` to support overriding the default tileset loading behavior. [#5685](https://github.com/AnalyticalGraphicsInc/cesium/pull/5685)
* Fixed loading of binary glTFs containing CRN or KTX textures. [#5753](https://github.com/AnalyticalGraphicsInc/cesium/pull/5753)
* Fixed depth picking on 3D Tiles. [#5676](https://github.com/AnalyticalGraphicsInc/cesium/issues/5676)
* Fixed glTF model translucency bug. [#5731](https://github.com/AnalyticalGraphicsInc/cesium/issues/5731)
* Added `classificationType` to `ClassificationPrimitive` and `GroundPrimitive` to choose whether terrain, 3D Tiles, or both are classified. [#5683](https://github.com/AnalyticalGraphicsInc/cesium/issues/5676)

### 1.36 - 2017-08-01

Expand Down
11 changes: 6 additions & 5 deletions Source/Renderer/Pass.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ define([
COMPUTE : 1,
GLOBE : 2,
CESIUM_3D_TILE : 3,
GROUND : 4,
OPAQUE : 5,
TRANSLUCENT : 6,
OVERLAY : 7,
NUMBER_OF_PASSES : 8
TERRAIN_CLASSIFICATION : 4,
CESIUM_3D_TILE_CLASSIFICATION : 5,
OPAQUE : 6,
TRANSLUCENT : 7,
OVERLAY : 8,
NUMBER_OF_PASSES : 9
};

return freezeObject(Pass);
Expand Down
Loading