Closed kring closed 4 months ago
I added a tiny unrelated commit to this PR that improves a comment in RasterOverlayUtilities.cpp
, for lack of a better place to put it.
This is ready for another look. In addition to your suggestions, I moved upsampleGltfForRasterOverlays
into RasterOverlayUtilities
. I think it makes a lot more sense that way than as a global function in Cesium3DTilesContent
.
Previously,
upsampleGltfForRasterOverlays
assumed that raster overlay texture coordinates were found in attributes named_CESIUMOVERLAY_n
, and that the origin of the V coordinate was at the Southern end of the tile. Both of these assumptions are fine in our game engine integrations where a custom shader does the overlay rendering. But they're problematic if we want to produce a standard glTF.So this PR makes the base name of the texture coordinates a parameter, and defaults it to the standard glTF texture coordinate name (
TEXCOORD_n
). It also adds ahasInvertedVCoordinate
parameter indicating that the model's V texture coordinate starts is 0.0 at the Northern end of the tile rather than the Southern end, consistent with a right-side-up map image.Some other improvements in this PR:
target
property of the created bufferviews for indices. It was incorrectly set toARRAY_BUFFER
instead ofELEMENT_ARRAY_BUFFER
.byteLength
property of the created vertex and index buffers.