How to cast shadow on camera (Eevee)

Hello,

In real life , when you approach an object (like your hand) too close to your eyes,you can’t see shit, because all lights are blocked and will not reach your eyes.

How do i reproduce this effect in blender eevee? No matter how close a mesh is to the camera,i can see that object as clear as the day.

It’s for animation , turning off all lights manually to find a workaround waste a lot of time :pensive:

The camera doesn’t produce any shadows itself, so even up close, light can still come in from behind. You would have to make up a mesh in the rough shape of the camera and place it just behind the camera’s sensor.

Quick example I set up:

The cube is the mesh acting as the camera, and it is parented to the camera so that wherever the camera moves, the cube will follow.

It seem to works just fine but only with additionnal light, not with hdri ,i get that with HDRI,light come from everywhere ,but shouldn’t it be blocked by the cube the same way?

In Eevee, hdri backgrounds do not cast shadows. You would need to use cycles for that.