See through sphere that blocks the light

Hi!

I would like to create some kind of see through spherical wall.

  • The wall has to be see through (we don’t see it at all)
  • The wall has to block the light. So the lights in the sphere don’t light up things that are out of the sphere and the lights out of the sphere don’t light up things that are in the sphere.

Thank you for your help

Hello moutinoir,

To achieve this effect, you can change the pass that the object is being rendered in. If your object is in a blueprint, you can navigate to the Rendering section of the mesh’s detail, expand the field to show additional settings, and then check the box labled “Render CustomDepth Pass” while also unchecking “Render in Main Pass”. This should make the object appear to be invisible but still be able to block light.

Hello,

Thank you for your answer, I tried it out and it kind of does the job.
What I did :

  • In my object Rendering section of the mesh’s detail, in additional settings, I checked the box labled “Render CustomDepth Pass”
  • I unchecked “Render in Main Pass”
  • In the Lighting section, I checked “Use Two Sided Lighting”
  • I opened the sphere static mesh detail window (double clicking on the static mesh on my object), in Static Mesh Settings, I checked “Double Sided Geometry”

Here is the result ( light position is out of the sphere, green light position is in the sphere)

The sphere was here

I have a problem though. When, with the player, I get close the the lights that are inside the sphere, it lights it up, even if the player is out of the sphere

the sphere was here

Can you help me with this please?

Unfortunately I don’t believe that this can be done without dynamic lighting and setting it up through code/blueprints to have the light only be active and/or rendered while the player is inside of the sphere.

I don’t mind using blueprints or code.
If I do do this :

setting it up through code/blueprints to have the light only be active and/or rendered while the player is inside of the sphere

Then my light will not be rendered at all when the player is not around, I would like the light to be here all the time.

I don’t understand why it lights up the player though. Can you explain what’s happening please?

When it comes to the light not being rendered, thats something that happens anyway. When your camera cannot see an object, it is automatically being culled when it comes to rendering for performance reasons.

As for the light hitting your player, this may be due to indirect lighting, which could be bouncing from the floor to the character model. To test this, you can bring the indirect lighting value in the light’s details. If the character is still lit up at this point, try adding a manner of thickness to the sphere (even though it is already set to Two Sided Geometry) to see if that may help.

Hello moutinoir,

Was my latest comment of any help to you or are you still having problems getting the desired effect? Please let me know if you have any further questions. In the meantime, I’ll be marking this as resolved for tracking purposes.

Have a nice day!