Any neat way to sample camera depth at cursor location from script? (Not by raycasting colliders.)
can you give a little context? what are you trying to achieve, what camera setup (ortho/perspective/whatever) etc.
You can definitely get this information in a shader. The question is if it’s exposed on the scripting side.
I can imagine a horrible hack using a shader to write to some invisible renderer and reading that information - you probably shouldn’t do that.
I’m trying to achieve a depth pick with better accuracy than what colliders provide. Not sure how else to put it. (Dynamic meshes.)
Is it possible to get the depth in an image effect? In that case I suppose one could just create an image effect that doesn’t do anything more but check 1 pixel where the cursor is and write it to a variable.