[]修改了Scene下的WebGL参数导致渲染3D对象出现局部透明

因为项目需要对场景的webgl做修改在背景渲染层上加一个摄像头数据,然后我修改后就出现了上述问题一下是截屏,(webgl我也不是很熟悉 ,望大佬帮我指正一下)


S80726-16435167.jpg


S80726-164324.jpg

 
我仔细发现感觉那一块透明的就是这个物体的轮廓 ,但是不知道为什么会有这种情况,下面是代码
 

QQ截图20180726164651.png

 
望大佬帮我指点下 感谢
已邀请:

大饼干

赞同来自:

/**
* Renders the quad
*/
render() {
this.gl.useProgram(this.program);
this.gl.bindBuffer(Laya.WebGLContext.ARRAY_BUFFER, this.vertexPositionBuffer);
this.gl.enableVertexAttribArray(this.vertexPositionAttribute);
this.gl.vertexAttribPointer(
this.vertexPositionAttribute,
this.vertexPositionBuffer.itemSize,
Laya.WebGLContext.FLOAT,
false,
0,
0
);

this.gl.bindBuffer(Laya.WebGLContext.ARRAY_BUFFER, this.textureCoordBuffer);

// Check the current orientation of the device combined with the
// orientation of the VRSeeThroughCamera to determine the correct UV
// coordinates to be used.
const combinedOrientation = combineOrientations(
window.screen.orientation.angle,
this.passThroughCamera.orientation
);
if (combinedOrientation !== this.combinedOrientation) {
this.combinedOrientation = combinedOrientation;
this.gl.bufferData(
Laya.WebGLContext.ARRAY_BUFFER,
this.f32TextureCoords[this.combinedOrientation],
Laya.WebGLContext.STATIC_DRAW
);
}

this.gl.enableVertexAttribArray(this.textureCoordAttribute);
this.gl.vertexAttribPointer(
this.textureCoordAttribute,
this.textureCoordBuffer.itemSize,
Laya.WebGLContext.FLOAT,
false,
0,
0
);

this.gl.activeTexture(this.gl.TEXTURE0);
this.gl.bindTexture(Laya.WebGLContext.TEXTURE_EXTERNAL_OES, this.texture);
// Update the content of the texture in every frame.
this.gl.texImage2D(
Laya.WebGLContext.TEXTURE_EXTERNAL_OES,
0,
Laya.WebGLContext.RGB,
Laya.WebGLContext.RGB,
Laya.WebGLContext.UNSIGNED_BYTE,
this.passThroughCamera
);
this.gl.uniform1i(this.samplerUniform, 0);
this.gl.bindBuffer(Laya.WebGLContext.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
this.gl.drawElements(
Laya.WebGLContext.TRIANGLES,
this.indexBuffer.numItems,
Laya.WebGLContext.UNSIGNED_SHORT,
0
);
}
这是Render部分的代码

要回复问题请先

商务合作
商务合作