- Home /
uniform arrays, error during compiling the shader
I'm working on Unity 5.4.0p2 for Windows 10 x64.
I'm trying to pass 512 float uniforms using MaterialPropertyBlock.SetFloatArray()
My uniform array on the shader side is:
float _Heights[512];
and here is how I set this array on the c# side:
private MaterialPropertyBlock m_materialPropertyBlock;
private MeshRenderer m_meshRenderer;
private float[] m_heights;
...
...
void Update()
{
m_materialPropertyBlock.SetFloatArray(m_heightsUniformId, m_heights);
m_meshRenderer.SetPropertyBlock(m_materialPropertyBlock);
}
The problem is, that everything works fine on Samsung Galaxy SIII, but not on Samsung Galaxy S5. On S5 i have the following error (that appears in logcat, right after start)
From Fragment Shader:
Error: uniform variables in fragment shader do not fit in 224 vectors.
I know, that max size of uniform array in Unity is 1024 (and this is internal restriction, not gles). So what is the problem? What am I doing wrong?
Answer by Hylus · Nov 28, 2019 at 09:34 PM
Have the same error in the same device. Did you solved it?:D
Your answer
Follow this Question
Related Questions
Standard cutout shader. Pixely outline. 1 Answer
(FIXED) Shader Error due to dynamic conditional 'if' blocks 1 Answer
Please help me resolve these errors related to shaders. 0 Answers
Shader Replacement Error 0 Answers
Shader Error at line 13 and 14 2 Answers