Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

HARP-14502: Fixes blue-ish webtiles on sphere #2133

Merged
merged 3 commits into from
Mar 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion @here/harp-webtile-datasource/lib/WebTileLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class WebTileLoader extends BaseTileLoader {
const planeMesh = addGroundPlane(
this.tile,
this.dataSource.renderOrder,
undefined,
0xffffff,
this.dataSource.opacity,
true
);
Expand Down
37 changes: 36 additions & 1 deletion test/rendering/WebTileDataRendering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ describe("MapView + WebTileData rendering test", function () {
lookAt?: Partial<LookAtParams>;
webTileOptions?: Partial<WebTileDataSourceOptions>;
runBeforeFinish?: () => void;
clearColor?: string;
}

async function webTileTest(options: WebTileTestOptions) {
Expand All @@ -44,7 +45,7 @@ describe("MapView + WebTileData rendering test", function () {

mapView = new MapView({
canvas,
theme: {},
theme: { clearColor: options.clearColor },
preserveDrawingBuffer: true,
pixelRatio: 1,
projection: options.projection
Expand Down Expand Up @@ -103,6 +104,23 @@ describe("MapView + WebTileData rendering test", function () {
});
});

it("renders webtile from loaded texture png on sphere", async function () {
this.timeout(5000);

await webTileTest({
mochaTest: this,
testImageName: "webtile-clover-sphere",
projection: sphereProjection,
clearColor: "#ff0000",
getTexture: (tile: Tile) => {
return Promise.all([
new TextureLoader().load("../dist/resources/wests_textures/clover.png"),
[]
]);
}
});
});

it("renders webtile from loaded texture with opacity", async function () {
this.timeout(5000);

Expand All @@ -119,6 +137,23 @@ describe("MapView + WebTileData rendering test", function () {
});
});

it("renders webtile from loaded texture with opacity on sphere", async function () {
this.timeout(5000);

await webTileTest({
mochaTest: this,
testImageName: "webtile-opacity-sphere",
projection: sphereProjection,
getTexture: (tile: Tile) => {
return Promise.all([
new TextureLoader().load("../dist/resources/wests_textures/clover.png"),
[]
]);
},
webTileOptions: { renderingOptions: { opacity: 0.5 } }
});
});

it("renders webtile from loaded texture png with alpha", async function () {
this.timeout(5000);

Expand Down