- Home /
Problem is not reproducible or outdated
Passing arrays of variable length to shader.
Hello there.
I am currently in the process of making my own tile based lighting system inside Unity. Everything is working quite well, but performance is somewhat poor since everything is done on the CPU. So i thought the next logical step would be to transfer some of the workload on the GPU. How can i pass an array of all my custom light positions (Vector2 variables) to my custom shader dynamically, and how can i iterate through them?
Hey Professor, did you find out how to have a variable length array in a shader?
Not directly. I managed to partially solve the issue by creating 1D textures and then passing those to the shader.
Follow this Question
Related Questions
SSAO showing through objects with custom shader 2 Answers
Shader light - Problem 0 Answers
Recieving Shadow on Custom Shader 1 Answer
Texture2D to Texture3D 2 Answers
Is it possible to fake Global Illumination within textures? 1 Answer