You can definitely do the raymarching part, but you’re right about there not being a way to output a custom depth value in a surface shader. If this is on a non-visionOS platform, you could try drawing your SDF in a full-screen post-processing pass with ARView’s PostProcessContext, which would give you access to the depth buffer produced by the rest of your scene to blend with as needed.
Topic:
Graphics & Games
SubTopic:
RealityKit
Tags: