My game runs extremely slow on older mobile devices like the Samsung Galaxy S4 and iPhone 5 when shadows are enabled. However, when shadows are turned off, performance improves significantly.
Is there a way to detect a slow GPU in order to disable shadows completely on slower devices? Or is there a way to enhance shadow performance?
I have tried adjusting the shadow.mapSize
on lights and the shadowMap.type
on the renderer, but it did not boost performance.
Some additional details:
I am using a PerspectiveCamera
and WebGLRenderer
with a render size of 1700x667.
Lights used:
new THREE.AmbientLight(0xffffff, 0.7)
and new THREE.SpotLight(0xffffff, 0.4, 4000, 100)
Materials used:
MeshPhongMaterial