Reputation: 961
Here's my issue:
.
The shadows on the text should not be there and despite my changes to the shadowMap resolution, nothing changes. This is the code used to generate the mesh:
var materialArray_Flying = [
new THREE.MeshPhongMaterial( { color: 0xff00ff, ambient: 0xff00ff } ), //face
new THREE.MeshPhongMaterial( { color: 0x008888, ambient: 0x008888 } )]; //sides
var textGeom_Flying = new THREE.TextGeometry( "{Flying}",
{
size: 4, height: .25, curveSegments: 3,
font: "helvetiker", weight: "bold", style: "normal",
bevelThickness: 0.025, bevelSize: 0.05, bevelEnabled: true,
material: 0, extrudeMaterial: 1
});
var textMesh_Flying = new THREE.Mesh(textGeom_Flying, new THREE.MeshFaceMaterial(materialArray_Flying));
scene.add(textMesh_Flying);
textMesh_Flying.castShadow = true;
textMesh_Flying.receiveShadow = true;
My renderer is set up like this:
var renderer = new THREE.WebGLRenderer({antialias: true});
renderer.shadowMapEnabled = true;
renderer.shadowMapSoft = true;
renderer.shadowMapType = THREE.PCFSoftShadowMap;
renderer.shadowCameraNear = 3;
renderer.shadowCameraFar = camera.far;
renderer.shadowCameraFov = 50;
renderer.setClearColor(0x000000, 1);
renderer.shadowMapWidth = 4096;
renderer.shadowMapHeight = 4096;
Any assistance is welcome.
Upvotes: 1
Views: 452
Reputation: 2198
I believe what you are seeing is due to the fact that the objects are so very small in unit space, and the shadow mapping technique is struggling to translate such small floats into a usable texture. Plus with very "thin" geometry sometimes even the smallest shadowCameraNear value is still large enough to "see" right through the mesh.
I can see two solutions.
1) stop accepting shadows on the main mesh(es)
textMesh_Flying.receiveShadow = false;
OR 2) increase the size of your entire scene/thickness of your letters, giving the shadow algorithms some "meat" to play with.
Note: You could try a shadowCameraNear = 0.001;
and see if that helps too.
Hope that helps,
Upvotes: 1