three.js - Transparency texture display incorrectly
问题描述
I create a mesh with transparency texture over the ground. but when I move the mesh, the transparent part of the texture changed to the background color of the scene somewhere. how to solve this problem? am I missing some configuration here?
mainCode:
this.renderer = new THREE.WebGLRenderer({antialias: true,alpha: true,logarithmicDepthBuffer:true});
let material = new THREE.MeshBasicMaterial({side: THREE.DoubleSide,color: 0xFFFFFF,map: new THREE.TextureLoader().load(_background),transparent: true,opacity: 1,});
解决方案
设置depthTest:false
在材料中
方法 :
this.renderer = new THREE.WebGLRenderer({antialias: true,alpha: true,logarithmicDepthBuffer:true});
let material = new THREE.MeshBasicMaterial({side: THREE.DoubleSide,color: 0xFFFFFF,map: new THREE.TextureLoader().load(_background),transparent: true,opacity: 1,depthTest:false});
推荐阅读
- python-3.x - 使用 itertools.permutation 时内核死机
- php - 如何将第一个值转换为数组名称php的键
- java - 使用 URL 将图片加载到圆圈 JavaFX 会在 Windows 上出现错误
- php - 如何使用 $request 或任何其他方法从资源路由中获取参数?
- google-apps-script - 为什么这个 Utilities.sleep 在它之前和之后的方法之前执行?
- php - 我如何使这个页面工作它只是重定向到主页
- codeigniter - 如何在 CodeIgniter 中转义 form_dropdown 值
- git - gitignore 不适用于 Visual Studio
- android - 自定义文本中的android recyclerview分隔符
- python - 对传递给函数的列表进行多处理