Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

小程序ar环境下加载纹理会在渲染一瞬间后消失 #38

Open
632366134 opened this issue Nov 2, 2022 · 3 comments
Open

小程序ar环境下加载纹理会在渲染一瞬间后消失 #38

632366134 opened this issue Nov 2, 2022 · 3 comments

Comments

@632366134
Copy link

let geometry = new THREE.PlaneGeometry(2, 2);
let loader = new THREE.TextureLoader();
const texture = await loader.loadAsync(data);
const material = new THREE.MeshBasicMaterial({
side: THREE.DoubleSide,
map: texture,
});

        texture.minFilter = THREE.LinearFilter;
        texture.flipY = false;
        texture.wrapS = texture.wrapT = THREE.ClampToEdgeWrapping;
        let model = (this.model = new THREE.Mesh(geometry, material));
     
       model.rotation.set(-Math.PI / 2, 0, 0);

this.scene.add(model)

@HJ-Hao
Copy link

HJ-Hao commented Dec 25, 2022

您好,我也遇到这个问题了,请问您解决了吗? @632366134

@Natuka
Copy link

Natuka commented Apr 27, 2023

小程序官方有对应的回复,我也遇到这个问题,今天找到了
把原来范例里面的
this.renderer.state.setCullFace(THREE.CullFaceNone)
替换成
this.renderer.state.reset()
https://developers.weixin.qq.com/community/develop/doc/00048c138946f869c13f0df4c5b400?highLine=VKSession%25E4%25B8%25AD%25E6%25A8%25A1%25E5%259E%258B%25E9%2583%25A8%25E5%2588%2586%25E7%25BA%25B9%25E7%2590%2586%25E4%25B8%25A2%25E5%25A4%25B1%25EF%25BC%258C%25E6%2598%25BE%25E7%25A4%25BA%25E9%25BB%2591%25E8%2589%25B2

@JinhuaSu
Copy link

this.renderer.state.setCullFace(THREE.CullFaceNone)
我这边测试成功的是this.renderer.state.setCullFace(THREE.CullFaceNone) 不能去掉
在renderGL函数里加this.renderer.state.reset()
https://developers.weixin.qq.com/community/develop/doc/00048c138946f869c13f0df4c5b400?highLine=gltf%25E8%25B4%25B4%25E5%259B%25BE%25E9%25BB%2591%25E8%2589%25B2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants