0

I'm trying to create an effect where only objects and geometry within a sphere are rendered with a specific texture (or rendered at all if it's easier) and everything outside the sphere is not visible to the player. This effect is acting as the player's light. This is what I have so far. enter image description here

I did this by creating a renderer that changes the material from a standard material to an unlit one when it is obscured by another object, following the steps in this tutorial: https://youtu.be/eLIe95csKWE

This is really close to what I want, but the problem is inherent to the method. As you can see in this next picture, you cannot see objects within the sphere if the player is also within the sphere, less than ideal considering it is supposed to be a light source. The second issue is that you can see objects beyond the sphere as they are also obscured by it Current Light Failures

I would much rather create a boolean intersection that will only show geometry within the sphere, as that way nothing behind it wil be shown and you will still be able to see it when you enter the radius of the sphere. Howevver I have not been able to find a solution to this issue (The only one I could find was from 2016 so its outdated and all the documentation was in japanese anyway. https://github.com/hecomi/UnityScreenSpaceBoolean)

TearsOfLA
  • 11
  • 3
  • Are you willing to use custom shaders for this effect? To me it sounds like you might want to use a regular light source with a custom lighting model. – Kit MacAllister Apr 18 '23 at 05:49
  • You could have a look and see how MRTK solved it https://learn.microsoft.com/en-us/windows/mixed-reality/mrtk-unity/mrtk2/features/rendering/clipping-primitive?view=mrtkunity-2022-05 – derHugo Apr 18 '23 at 14:05
  • Ya as long as the effect works, I'm fine with whatever solution, that was just the one I found closest to what I wanted, but it isn't working out how I need it. MRTK2 is interesting and would work, but im not sure how it would interact with XR Toolkit or if it will have conflicts. – TearsOfLA Apr 18 '23 at 20:05

0 Answers0