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

Commit

Permalink
HARP-14502: Fixes blue-ish webtiles on sphere (#2133)
Browse files Browse the repository at this point in the history
* HARP-14502: Fixes blue-ish webtiles on sphere

Signed-off-by: Frauke Fritz <frauke.fritz@here.com>
  • Loading branch information
FraukeF committed Mar 4, 2021
1 parent eae990a commit fe19681
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
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

0 comments on commit fe19681

Please sign in to comment.