Hi, i’ve just started playing around with threeJS and stumbled upon something i can’t seem to resolve on my own.
I made a pong game and was trying to make it look a little better so i gave a go to meshPhysicalMaterial and tried to give my paddles a glass look.
But here’s the problem. Sometime the glass seems to reflect / or show by transparency a sort of black object that is not present in my scene. (If it can help I’ll try to upload a gif)
I tried changing the way i implemented the skybox, i tried another way of giving the paddles a glass effect and changing the rendering order but nothing worked so far.
Here is the paddle code (The movement is irrelevant i just update the y position received from the server)
var g_paddle1 = new THREE.BoxGeometry(0.2, 2., 2.);
var g_paddle2 = new THREE.BoxGeometry(0.2, 2., 2.);
var m_paddle1 = new THREE.MeshPhysicalMaterial({
reflectivity : 0.3,
transmission : 1.0,
roughness : 0.8,
clearcoat : 0.3,
clearcoatRoughness : 0.25,
ior : 1.2,
thickness : 10.0,
side : THREE.BackSide,
color : new THREE.Color(0xff0000),
});
paddle1 = new THREE.Mesh(g_paddle1, m_paddle1);
paddle1.position.x -= 5;
paddle1.rotation.x = Math.PI / 180 * 90;
paddle1.renderOrder = 2;