Skip to content

Commit

Permalink
Fix height shader
Browse files Browse the repository at this point in the history
  • Loading branch information
tentone committed Nov 17, 2022
1 parent f01603b commit 8e61fdc
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion build/geo-three.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,6 @@ class MapHeightNodeShader extends MapHeightNode {
texture.minFilter = three.NearestFilter;
texture.needsUpdate = true;
this.material.userData.heightMap.value = texture;
this.material.map = texture;
this.material.needsUpdate = true;
this.heightLoaded = true;
this.nodeReady();
Expand Down
1 change: 0 additions & 1 deletion build/geo-three.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/geo-three.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion build/geo-three.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,6 @@ class MapHeightNodeShader extends MapHeightNode {
texture.minFilter = NearestFilter;
texture.needsUpdate = true;
this.material.userData.heightMap.value = texture;
this.material.map = texture;
this.material.needsUpdate = true;
this.heightLoaded = true;
this.nodeReady();
Expand Down
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@
scene.add(map);
map.updateMatrixWorld(true);



var camera = new THREE.PerspectiveCamera(80, 1, 1e2, 1e12);

// var test = new THREE.Mesh(new Geo.MapNodeGeometry(1e6, 1e6, 8.0, 8.0, true, 2e5), new THREE.MeshPhongMaterial({wireframe: false, color: 0xFFFFFF}));
Expand Down
3 changes: 1 addition & 2 deletions source/nodes/MapHeightNodeShader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export class MapHeightNodeShader extends MapHeightNode
throw new Error('GeoThree: MapView.heightProvider provider is null.');
}


const texture = new Texture();
texture.image = await this.mapView.heightProvider.fetchTile(this.level, this.x, this.y);
texture.generateMipmaps = false;
Expand All @@ -128,8 +129,6 @@ export class MapHeightNodeShader extends MapHeightNode
// @ts-ignore
this.material.userData.heightMap.value = texture;
// @ts-ignore
this.material.map = texture;
// @ts-ignore
this.material.needsUpdate = true;

this.heightLoaded = true;
Expand Down

0 comments on commit 8e61fdc

Please sign in to comment.