2 ms·
"One of the many problems with shader code is that HLSL doesn’t support arrays in a meaningful way. Pointer math (and thus array indexing) just isn’t a thing on
by kevingadd 5y ago
"One of the many problems with shader code is that HLSL doesn’t support arrays in a meaningful way. Pointer math (and thus array indexing) just isn’t a thing on the GPU, so writing to a non-constant index of an array is impossible. To work around this, there are several places in the code with patterns like this:"
This is weird, AFAIK pixel shaders have had arrays since DX10 and the OpenGL equivalent through Buffers (and also Unordered Access Views for reading/writing pixel data) https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-to-load https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/...
Are VRChat shaders stuck to Direct3D9/ps_3_0 level functionality?
- pema99 5y agoNo, we can use SM 5.0. It's all DX11. It's not that the framework the game is written in doesn't support such features, we just have no way to bind UAVs for example. What you can do on the CPU is very very limited, while GPU code is completely unrestricted, so we are at the mercy of whatever Unity lets you do on GPU with minimal setup.