I don't have any lights in my scene only an HDRI. The light of it goes through my object who has a whole in it and I can see everything inside as I would have a light in there. Obviously it's weird because there is not light inside. There are some tutorials explaining how to play with the shadows of lights, but how do I play with the shadow of an HDRI? Thank you for your time.
I'm sorry I was wrong about it. Only in Eevee is happening not in Cycles. I attached a link with a simple cube to show you what I'm talking about. Just an HDRI in the scene, no other lights. enter link description hereAny suggestions how I can make it in Eevee not to show the light inside... besides changing the material color :-). Thank you.
Short answer: using Irradiance Volumes might help...
Cycles is using ray tracing so shadows of HDRI are a given, i.e. when the ray calculation is bouncing inside the box, there is little chance of it getting to any of the light source of the HDRI through the hole inside your box, or no chance at all if the box is completely sealed (rays are calculated backward from the camera).
Eevee is not a ray tracer and the global illumination (GI) and shadows from an HRDI background texture can only be approximated using irradiance volumes and baking the results on top of existing materials. Eevee cannot do realtime calculation of shadows and indirect lighting of the lightsource emitted by every pixel of your HDRI texture. For realtime, Eevee only calculates the direct illumination of the HDRI on all faces of the scene and adds the indirect lighting stuff only if it has been baked (or until Eevee supports AMD ProRender or NVidia RTX for GI :) ).
In the basic example below, you can see that after setting an Irradiance Volume and
Baking Indirect Lighting (under
Render Properties), low res shadows start to appear inside the cube. Playing around with multipls Irrandiance Volumes and their resolution and other aspects might help but in general, stick to Cycles for true GI.
Credit: Beautiful sunset HDRI from Greg Zaal (https://hdrihaven.com/hdri/?c=outdoor&h=cape_hill)