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):
- 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?)
- 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
- repeat 2. until a specific rotation is reached
- calculate difference of min max and store in result2(difference2), then rotate around another global axis
- repeat steps before until specific rotation reached and check result2 for min, if min store rotations
- render one final transparent image (i mean create) at the rotations of result2 to a file
- 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
