# Shadow Quality

**URL:** <https://forum.needle.tools/t/shadow-quality/2508>\
**Category:** 🌵 Needle Engine\
**Tags:** question\
**Created:** [May 5, 2025, 7:43am UTC](https://forum.needle.tools/t/shadow-quality/2508 "2025-05-05T07:43:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tomislav\_Stefan](https://forum.needle.tools/user_avatar/forum.needle.tools/tomislav_stefan/32/3808_2.png) [@Tomislav\_Stefan](https://forum.needle.tools/u/Tomislav_Stefan)\
**Post date:** [May 5, 2025, 7:43am UTC](https://forum.needle.tools/t/shadow-quality/2508/1 "2025-05-05T07:43:26Z")

</div>

Hello, is there any way to have more quality shadows on the shadow catcher plane? Now I can see the shadow pixel moving along the animated part of the shadows of the object’s straight edges.

---

<div class="post-metadata">

**Author:** ![needle-assistant](https://forum.needle.tools/user_avatar/forum.needle.tools/needle-assistant/32/3415_2.png) [@needle-assistant](https://forum.needle.tools/u/needle-assistant)\
**Post date:** [May 5, 2025, 7:43am UTC](https://forum.needle.tools/t/shadow-quality/2508/2 "2025-05-05T07:43:28Z")

</div>

Hi Tomislav,

Step-by-step plan in pseudocode:

1. Investigate how shadows and shadow catchers are configured in Needle Engine.
2. Identify which factors/settings influence shadow quality (resolution, filtering, light settings).
3. Suggest improvements, such as increasing shadow map resolution or applying softer shadow filters.
4. Show how to set these properties on relevant Needle/Three.js components.
5. Recommend workflow steps for best shadow quality (e.g., light types, renderer settings).

Implementation in TypeScript for a custom Needle Engine Behaviour:

```typescript
import { Behaviour, serializable } from "@needle-tools/engine";
import { DirectionalLight, PCFSoftShadowMap, WebGLRenderer } from "three";

export class ImproveShadowQuality extends Behaviour {
    @serializable(DirectionalLight)
    light?: DirectionalLight;

    awake() {
        // 1. Set high resolution for shadow maps
        if (this.light) {
            this.light.castShadow = true;
            this.light.shadow.mapSize.width = 4096;
            this.light.shadow.mapSize.height = 4096;

            // Optional: Increase shadow bias to reduce shadow acne
            this.light.shadow.bias = -0.0005;
        }

        // 2. Change renderer to use better shadow filtering
        const renderer = this.context.renderer as WebGLRenderer;
        renderer.shadowMap.enabled = true;
        renderer.shadowMap.type = PCFSoftShadowMap; // softer shadows
    }
}

```

**Tips:**

- For sharp straight shadow edges, increase shadow map size.
- For soft edges, use `PCFSoftShadowMap`.
- Avoid too high resolution for performance reasons.
- Fine-tune plane and receiver material for correct catching/blending.
- Ensure your receiving plane’s material is properly set up for shadow catching.

**Links:**

- [Three.js Shadow Docs](https://threejs.org/docs/#api/en/lights/shadows/LightShadow)
- [Needle Engine Docs - Shadows](https://engine.needle.tools/docs/guide/rendering/shadows.html)

Follow-up questions:

- Which light type are you using (directional, spot, point)?
- What is your current shadow map size and shadow catcher material setup?

This helps tailor the best solution for your scene!

_4 replies left_  
_thread\_KJ6ECFrjyt3pzReXVXdsZ3tG_  
_**Reply to this post directly if you need further help (bottom right button)**_

---

<div class="post-metadata">

**Author:** ![Tomislav\_Stefan](https://forum.needle.tools/user_avatar/forum.needle.tools/tomislav_stefan/32/3808_2.png) [@Tomislav\_Stefan](https://forum.needle.tools/u/Tomislav_Stefan)\
**Post date:** [May 5, 2025, 9:32am UTC](https://forum.needle.tools/t/shadow-quality/2508/3 "2025-05-05T09:32:15Z")

</div>

Hmm, I have tried the script above and didn’t see any change.

---

<div class="post-metadata">

**Author:** ![needle-assistant](https://forum.needle.tools/user_avatar/forum.needle.tools/needle-assistant/32/3415_2.png) [@needle-assistant](https://forum.needle.tools/u/needle-assistant)\
**Post date:** [May 5, 2025, 9:32am UTC](https://forum.needle.tools/t/shadow-quality/2508/4 "2025-05-05T09:32:17Z")

</div>

Thank you, Tomislav. Let’s clarify to help you further:

Could you please answer these:

1. Which light type are you using (directional, spot, or point)?
2. Are you using the standard Needle Engine shadow catcher setup or a custom material?
3. What export workflow are you using (Unity, Blender, direct Three.js/Needle code)?

Possible issues if the script didn’t change anything:

- The `ImproveShadowQuality` component must be attached to a GameObject in your scene.
- The `light` field in the component must reference your actual light object.
- The renderer settings may get overridden elsewhere or after the script runs.

Tips to ask good questions:

- Share error logs if available.
- Specific details about your workflow help zero in on issues faster.
- Copy project info from Unity/Blender if using Needle’s pipeline.

Ready for concrete debugging once you provide those details!

_4 replies left_  
_thread\_KJ6ECFrjyt3pzReXVXdsZ3tG_  
_**Reply to this post directly if you need further help (bottom right button)**_

---

<div class="post-metadata">

**Author:** ![Tomislav\_Stefan](https://forum.needle.tools/user_avatar/forum.needle.tools/tomislav_stefan/32/3808_2.png) [@Tomislav\_Stefan](https://forum.needle.tools/u/Tomislav_Stefan)\
**Post date:** [May 5, 2025, 9:45am UTC](https://forum.needle.tools/t/shadow-quality/2508/5 "2025-05-05T09:45:16Z")

</div>

I am using Directional light  
Using standard shadow catcher setup  
I am Using Unity

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [May 5, 2025, 10:28am UTC](https://forum.needle.tools/t/shadow-quality/2508/6 "2025-05-05T10:28:11Z")

</div>

Hi, without writing code I think all you need to do is to add the AdditionalShadowData component in Unity (see button at the bottom of the Light component)

Then modify/increase the ShadowResolution.

 ![Screenshot 2025-05-05 at 17.27.14](https://europe1.discourse-cdn.com/flex006/uploads/needle1/original/2X/b/bbb9f9930e979fb3f5359d275f9bce45b05ad562.png)

 ![Screenshot 2025-05-05 at 17.27.46](https://europe1.discourse-cdn.com/flex006/uploads/needle1/original/2X/5/5d3751d132c81ac686b8f828961e9aab6d4da78e.png)

---

<div class="post-metadata">

**Author:** ![Tomislav\_Stefan](https://forum.needle.tools/user_avatar/forum.needle.tools/tomislav_stefan/32/3808_2.png) [@Tomislav\_Stefan](https://forum.needle.tools/u/Tomislav_Stefan)\
**Post date:** [May 5, 2025, 11:30am UTC](https://forum.needle.tools/t/shadow-quality/2508/7 "2025-05-05T11:30:58Z")

</div>

Can I modify shadow strength? Not only dropping on the Shadowcatcher but also on the object itself.  
I would also like to know how I reference my DirectionalLight so I can change its properties.

---

<div class="post-metadata">

**Author:** ![system](https://forum.needle.tools/user_avatar/forum.needle.tools/system/32/20_2.png) [@system](https://forum.needle.tools/u/system)\
**Post date:** [May 18, 2025, 11:31am UTC](https://forum.needle.tools/t/shadow-quality/2508/8 "2025-05-18T11:31:41Z")

</div>

Closed on May 18, 2025, 11:31am UTC

This topic was automatically closed 13 days after the last reply. New replies are no longer allowed.
