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?
↧