瀏覽代碼

#591 remove obsolete computeFaceNormals in scene.js; support transparent textures

Falko Schindler 2 年之前
父節點
當前提交
47a48ca5b7
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      nicegui/elements/scene.js

+ 1 - 1
nicegui/elements/scene.js

@@ -28,7 +28,6 @@ function texture_geometry(coords) {
   geometry.setAttribute("position", new THREE.Float32BufferAttribute(vertices, 3));
   geometry.setAttribute("uv", new THREE.Float32BufferAttribute(uvs, 2));
   geometry.computeVertexNormals();
-  geometry.computeFaceNormals();
   return geometry;
 }
 
@@ -38,6 +37,7 @@ function texture_material(texture) {
   return new THREE.MeshLambertMaterial({
     map: texture,
     side: THREE.DoubleSide,
+    transparent: true,
   });
 }