Update viewer_ar.js
Browse files- viewer_ar.js +3 -3
viewer_ar.js
CHANGED
|
@@ -100,7 +100,7 @@
|
|
| 100 |
app.scene.gammaCorrection = pc.GAMMA_SRGB;
|
| 101 |
app.scene.toneMapping = pc.TONEMAP_ACES;
|
| 102 |
app.scene.exposure = 1.25; // ajuste 0.9–1.8 si besoin
|
| 103 |
-
app.scene.ambientLight = new pc.Color(
|
| 104 |
|
| 105 |
// Camera + lumière (directionnelle par défaut)
|
| 106 |
const camera = new pc.Entity("Camera");
|
|
@@ -108,7 +108,7 @@
|
|
| 108 |
app.root.addChild(camera);
|
| 109 |
|
| 110 |
const light = new pc.Entity("Light");
|
| 111 |
-
light.addComponent("light", { type: "directional", intensity: 2.0, castShadows:
|
| 112 |
light.setLocalEulerAngles(45, 30, 0); // direction lisible par défaut
|
| 113 |
app.root.addChild(light);
|
| 114 |
|
|
@@ -143,7 +143,7 @@
|
|
| 143 |
// Chargement GLB + "fix matériaux"
|
| 144 |
app.assets.loadFromUrl(GLB_URL, "container", (err, asset) => {
|
| 145 |
if (err){ console.error(err); message("Échec du chargement du modèle GLB."); return; }
|
| 146 |
-
const instance = asset.resource.instantiateRenderEntity({ castShadows:
|
| 147 |
modelRoot.addChild(instance);
|
| 148 |
modelRoot.setLocalScale(1,1,1);
|
| 149 |
|
|
|
|
| 100 |
app.scene.gammaCorrection = pc.GAMMA_SRGB;
|
| 101 |
app.scene.toneMapping = pc.TONEMAP_ACES;
|
| 102 |
app.scene.exposure = 1.25; // ajuste 0.9–1.8 si besoin
|
| 103 |
+
app.scene.ambientLight = new pc.Color(1, 1, 1);
|
| 104 |
|
| 105 |
// Camera + lumière (directionnelle par défaut)
|
| 106 |
const camera = new pc.Entity("Camera");
|
|
|
|
| 108 |
app.root.addChild(camera);
|
| 109 |
|
| 110 |
const light = new pc.Entity("Light");
|
| 111 |
+
light.addComponent("light", { type: "directional", intensity: 2.0, castShadows: true, color: new pc.Color(1,1,1) });
|
| 112 |
light.setLocalEulerAngles(45, 30, 0); // direction lisible par défaut
|
| 113 |
app.root.addChild(light);
|
| 114 |
|
|
|
|
| 143 |
// Chargement GLB + "fix matériaux"
|
| 144 |
app.assets.loadFromUrl(GLB_URL, "container", (err, asset) => {
|
| 145 |
if (err){ console.error(err); message("Échec du chargement du modèle GLB."); return; }
|
| 146 |
+
const instance = asset.resource.instantiateRenderEntity({ castShadows:true, receiveShadows:false });
|
| 147 |
modelRoot.addChild(instance);
|
| 148 |
modelRoot.setLocalScale(1,1,1);
|
| 149 |
|