How to get the Cascaded Shadows' split spheres positions?
Hello!
In order to compute the directional cascaded shadows in a shader (as in Internal-PrePassCollectShadows.shader or UnityCG.cginc) we need several informations easily findable through the QualitySettings class. Except that I cannot figue out how to get the split sphere positions or how to compute them.
I need them to create an VFX in compute shader and declaring "float4 unity_ShadowSplitSpheres[4];" does not work.
Thank you very much in advance!
Cheerz!
Answer by Avol · Jul 30, 2016 at 04:06 PM
Apparently it is impossible at the current state as unity does not give you access to most of the uniform properties it passes to cginc in C#. Current state of unity is very bad when it comes to compute shaders, there is a need to write all the CPU intensive calculations twice if you want to have practically any modern compute shader based graphics effects.
Your answer
![](https://koobas.hobune.stream/wayback/20220612075355im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Creating a native UAV into a meshes native vertex buffer (DX11) 1 Answer
Inconsistent Shadows in DrawMeshInstancedIndirect 0 Answers
[URP] Transp Shadergraph has shadows? 2 Answers
Trouble with shadows and water 0 Answers
Very bad graphics quality and terrible looking shadows in WebGL build 1 Answer