Shadowplane abruptly stops in AR for very large shadows

I’m using a shadowplane in AR and it clips at a location I don’t understand. Works fine for small and human size models, but as soon as you make a large model that casts a big shadow, can immediately see where the shadowplane plane abruptly ends. I tried to change the camera.far and plane size values but always the same result. Is there a good solution for shadows in AR that works for small, medium, and very large meshes?

		this.directionalLight = new THREE.DirectionalLight();
		this.directionalLight.intensity = this.settings.directional_light_intensity;
		this.directionalLight.castShadow = true; = 2.0; //wtf does this do
		this.directionalLight.shadow.mapSize.width = 1024;
		this.directionalLight.shadow.mapSize.height = 1024; = 0.1; = 500; = 45; 
		var planeGeometry = new THREE.PlaneGeometry(500, 500);
		planeGeometry.rotateX(-Math.PI / 2);
		this.shadowplane = new THREE.Mesh(planeGeometry, new THREE.ShadowMaterial({ color:0x000000, opacity:this.settings.shadowplane_opacity }));
		this.shadowplane.receiveShadow = true;

same lighting and shadow again, but different project, clipping on the shadowplane…

any idea what causes this?

This looks like the edge of the orthographic shadow camera frustum. You can try adjusting, right, top, and bottom to increase the bounds. You’ll need to call updateProjectionMatrix afterward, too.


bingo that’s it. thanks @gkjohnson

1 Like