Search code examples
javascriptthree.js3drenderingshadow

How to use PCF (SOFT) shadows in three.js?


How do you apply the PCF (SOFT) shadow type as seen in the Three.js online editor to your renderer in the form of javascript code?

Image of three.js editor panel showing "PCF (SOFT)" option


Solution

  • To use that type of shadows you need to use the respective type of shadow map:

    renderer.shadowMap.type = THREE.PCFSoftShadowMap;
    

    Related links:

    r115