diff --git a/examples/light.html b/examples/light.html
index 4aa17392..249f7d11 100644
--- a/examples/light.html
+++ b/examples/light.html
@@ -54,12 +54,10 @@
viewer.setDescription("");
- viewer.loadGUI(() => {
+ viewer.loadGUI().then(() => {
viewer.setLanguage('en');
$("#menu_appearance").next().show();
- $("#menu_tools").next().show();
- $("#menu_scene").next().show();
- viewer.toggleSidebar();
+ // viewer.toggleSidebar();
});
let light = new THREE.SpotLight();
diff --git a/examples/vr.html b/examples/vr.html
index 7f4dbdb8..f1caa752 100644
--- a/examples/vr.html
+++ b/examples/vr.html
@@ -50,7 +50,11 @@
viewer.setFOV(60);
viewer.setPointBudget(2 * 1000 * 1000);
viewer.setDescription(`
- If your browser supports WebVR, a VR button will appear on the bottom right. (Tested on HTC Vive + Firefox and Oculus Quest)
+ If your browser supports WebVR, a VR button will appear on the bottom right.
+ (Tested on HTC Vive + Firefox 73 (works),
+ Oculus Quest (works),
+ Chrome 80 ((didn't work) )
+
Controls: Point right controller in desired direction, then push the right joystick forward
to fly in that direction.
Pushing the left youstick in addition to the right one modifies speed by up to 4x.
@@ -122,10 +126,14 @@
return;
}
- const displays = await navigator.getVRDisplays();;
+ const displays = await navigator.getVRDisplays();
console.log(displays);
if(displays.length > 0){
+
+ const controls = new Potree.VRControlls(viewer);
+ viewer.addEventListener("update", (e) => controls.update(e.delta));
+
const elVR = document.createElement("div");
elVR.innerHTML = `
diff --git a/examples/vr_heidentor.html b/examples/vr_heidentor.html
index dbc1f7ed..20812c84 100644
--- a/examples/vr_heidentor.html
+++ b/examples/vr_heidentor.html
@@ -50,6 +50,14 @@
viewer.setFOV(60);
viewer.setPointBudget(0.3 * 1000 * 1000);
viewer.loadSettingsFromURL();
+ viewer.setDescription(`
+ If your browser supports WebVR, a VR button will appear on the bottom right.
+ (Tested on HTC Vive + Firefox 73 (works),
+ Oculus Quest (works),
+ Chrome 80 ((didn't work) )
+
+ Heidentor point cloud courtesy of Ludwig Boltzmann Institute - Archeological Prospection and Virtual Archeology (26M points)
+ `);
viewer.loadGUI(() => {
viewer.setLanguage('en');
diff --git a/src/materials/shaders/pointcloud.vs b/src/materials/shaders/pointcloud.vs
index 545147fc..3fa0e2d1 100644
--- a/src/materials/shaders/pointcloud.vs
+++ b/src/materials/shaders/pointcloud.vs
@@ -916,13 +916,6 @@ void main() {
vColor = vColor * visibility + vColor * uShadowColor * (1.0 - visibility);
}
- { // debug
- vec4 depthMapValue = texture2D(uShadowMap[i], vec2(u, v) + sampleLocations[0]);
-
- float t = depthMapValue.x * 20.0;
- vColor = vec3(t, t, t);
-
- }
}
diff --git a/src/utils/PointCloudSM.js b/src/utils/PointCloudSM.js
index b8c7af8a..2f751e22 100644
--- a/src/utils/PointCloudSM.js
+++ b/src/utils/PointCloudSM.js
@@ -41,7 +41,7 @@ export class PointCloudSM{
this.camera.up.set(0, 0, 1);
this.camera.position.copy(light.position);
- let target = new THREE.Vector3().addVectors(light.position, light.getWorldDirection(new THREE.Vector3()));
+ let target = new THREE.Vector3().subVectors(light.position, light.getWorldDirection(new THREE.Vector3()));
this.camera.lookAt(target);
this.camera.updateProjectionMatrix();
@@ -65,10 +65,10 @@ export class PointCloudSM{
this.threeRenderer.setRenderTarget(this.target);
this.threeRenderer.clear(true, true, true);
- this.threeRenderer.setRenderTarget(oldTarget);
this.potreeRenderer.render(scene, this.camera, this.target, {});
+ this.threeRenderer.setRenderTarget(oldTarget);
}