ScreenSpaceReflection won't work as expected when I use custom geometry from a GLB file

Hello,
I have a problem with ReflectorForSSRPass, here an example with a simple new THREE.PlaneGeometry as groundreflector, it works as expected !


Here’s another example with a custom geometry created in Blender and exported as GLB, it’s a simple Plane too.

Reflection is going wrong. What did i miss ?

Here’s my code for custom GLB geometry :

const loader = new GLTFLoader();
const glb = await loader.loadAsync('models/gltf/eshop/eshop.glb');
const glbground = await loader.loadAsync('models/gltf/eshop/eshop_groundSSR.glb');
const eshop = glb.scene;
const groundSSR = glbground.scene;
var selectSSR = [];
	 
groundSSR.traverse((child) => {
	if (child.isMesh) {
		if (child.userData.reflectorSSR ) {
			console.log('Adding geometry to selectSSR !', child.geometry);
			selectSSR.push(child.geometry);
		}
	} 
});
	
scene.add(eshop);

if (selectSSR.length === 0) {
	console.log('Aucune geometrie SSR trouvee.');
}
	
const mergedGeometry =  BufferGeometryUtils.mergeGeometries(selectSSR);
    
groundReflector = new ReflectorForSSRPass( mergedGeometry, {
	clipBias: 0.0005,
	textureWidth: window.innerWidth,
	textureHeight: window.innerHeight,
	color: 0x000000,
	useDepthTexture: true,
} );
groundReflector.position.set( 0, 0.001, 0 );
groundReflector.material.depthWrite = false;
groundReflector.visible = paramSsr.visible;
groundReflector.fresnel = paramSsr.fresnel;
groundReflector.distanceAttenuation = paramSsr.distanceAttenuation;
groundReflector.maxDistance = paramSsr.maxDistance;
groundReflector.opacity = paramSsr.opacity;

scene.add( groundReflector );

Any suggestions would be appreciated.

1 Like

+1 we’ve got the same issue. That oblige us to make everything in code.

This is likely a uv map (and or normals) issue, what do your uvs currently look like in the exported model? You can cross reference your uv set with the THREE.PlaneGeometry uv set here

If the uvs look correct I’d look into exporting the plane in the model with different normals types, starting with setting to vertex normals with hard edges and then to face normals etc…

Uvs are okay, it’s a simple Plane created in Blender with standard Mesh > Plane, here a shot of the plane in Blender, normals vextex and face looks okay, it’s shade flat like every new geometry in Blender.


I added the GLB to the scene, so you can see the UVs are okay too. however, you can see that the reflection is not working correctly.

I’m not sure I understand what you mean by different normals types…