Can we have stencil support in PolySpatial?
I’m adding stencil on top of the supported shader (for example, the basic lit URP shader graph)
Stencil{
ref 1
comp always
pass replace
}
and couldn’t able to get the shader rendered.
Is stencil in general not supported or is there any way around to get stencil effect?
Thanks for the support, Dan! I’m relieved and excited that there is a way to get this effect done. I’m unfamiliar with occlusion shaders. Is there anyway you can explain / show me how you did this with this geometry example?
It’s a built-in material type that ships with Unity, if you change the shader of any material and then apply it to the geometry it will occlude all virtual content hidden by the occlusion geometry.
If you mean support for stencil operations in MR, then no, it is still not available. This is a limitation of Apple’s RealityKit, which does not provide any support for stencil operations. If you are interested in such support, I suggest you request it from Apple via their Feedback Assistant.
I created a sphere with a hole and applied the occlusion shader to that. That will occlude all the content that is behind the sphere geometery except the hole.
Can you share a little bit about what you are trying to achieve?
Thank you so much for your example @DanMillerU3D - This is pretty close to what I’m trying to achieve
I’ve been exploring different ways to create a 3D screen where objects won’t be visible if their position happens to be “outside the screen” (between the player and the screen or in your example, outside the “hole”).
I’ve been able to successfully create this effect on full VR using stencil buffers and custom passes but having passthrough is a must for my use case so looking for possible approaches to achieve the same effect in MR.
@DanMillerU3D do you think this is achievable in MR?