Accessing Transparency Like Depth Values, Do Calculations On GPU

Hello everybody,

I’m very nooby at this but I’m usually able to find the answers I need. Unfortunately not this time and I really hope some can help me out.
First of all let me apologize, because I probably mix words and meanings up due to my lack of knowledge and there are a lot of things confusing me… I’m sorry, it could be hard to follow
And thank you in advance.
Ok, let’ts start at the beginning.

Roughly said, I want to make use of the GPU (on Android, dealing with OpenGL ES3.2):

  1. get the depth values after the rasterization (is that right?) in like a transparency mode where each pixel (grey value) represents the thickness of the object. Get min and max and store the difference (in a buffer?)
  2. Then rotate the object around a global axis (maybe in the vertex shader?, to keep everything on the gpu if possible) at a custom angle, repeat 1. and do a min max check on the result (difference) from before and store min and max
  3. repeat 2. until a specific rotation is reached
  4. calculate difference of min max and store in result2(difference2), then rotate around another global axis
  5. repeat steps before until specific rotation reached and check result2 for min, if min store rotations
  6. render one final transparent image (i mean create) at the rotations of result2 to a file
  7. read values result2 and rotations from outside

I’ve found this tutorial which seems fairly easy to create a xray shader X-Ray Shader Tutorial in Unity – Linden Reid
thats pretty much what i want at the end but with some calculations, stored results inbetween and accessing the depth values if that is correct so far.
But I don’t know how to approach it or if it is even possible.
If so, could it be done with the shader graph as well?

Furthermore I have even gone through Unity’s “writing your first shader”, which has transparency elements which changes a given texture on an object. But well here I am, probably didn’t get the obvious helpful parts ^^’

My solution with linecasts so far (happening on the cpu) is not very satisfying, neither in performance nor in results

ps. I’m on Unity 2020.3.29f

Hm ok, I try to elaborate it a little or simplify my question.
So you probably know XRay-Shaders or at least the effect rendered out.
I would like to get something like this:

As you can see it gets darker the more it has to pass the object.
But before rendered out, I want to store the cumulated depth (which is based on the thickness) in a buffer or texture or wherever needed to do a calculation on those values and rotate the object (mesh) or the camera, do calculation and rotation a couple of times and then finally create an image.
Does anyone know the approach to achiev that?

to whomever wants to achieve the above result, it does not entirely resolve my goal but a big one at least getting the thickness as a texture:
check out the last comment here: Rendering Object Thickness/Volume with Two-Pass Shader - #23 by Piflik
so hard to find and yet so simple to do. works on android as well