2
\$\begingroup\$

I'm trying to cast shadows from a small (3cm) sphere onto a table surface.

If I place a large object, I get shadows as expected, but below a certain size, I get nothing.

enter image description here

I appreciate that under normal circumstances, shadow map resolution wouldn't allow this level of detail, however, my entire scene is 2x2x3 metres.

I could scale up everything to work around the issue, but that would cause a lot of knock-on issues when it comes to physics, VR and a whole slew of other things.

How can I take the shadowmap area Unity would usually assign to a whole scene and apply it to a single tabletop?

enter image description here

I've tried tweaking the Lightmapping properties for the table, but haven't seen any visible difference.

Edit: Changing clipping planes didn't have any obvious impact (different angle as from the camera, not editor view)

enter image description here

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Do you find any impact from tightening the near & far planes on your camera? By default it's set to see thousands of meters, which signals to Unity that you need your shadow maps to cover a huge area, leaving few pixels per cm. Shrinking down the size might help it cluster those pixels where you need them. Shadow maps don't use your lightmapping settings. \$\endgroup\$
    – DMGregory
    Commented Feb 17, 2023 at 4:47
  • \$\begingroup\$ @DMGregory, Unfortunately not, no visible difference reducing both by a factor of 10 or 100 (screenshot edited into Q). If shadowmaps don't use lightmap settings, how can I control the shadow map for an object? \$\endgroup\$
    – Basic
    Commented Feb 17, 2023 at 9:05

1 Answer 1

3
\$\begingroup\$

@DMGregory's suggestion was enough to point me in the right direction...

enter image description here

Changing the camera clipping plane didn't help, however, changing the max shadow distance worked.

enter image description here

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .