Big hole in new method for passing arrays to shaders in U5.4

Passing uniform arrays to shader now use new method (and previous one is obsolete !). It works only for materialPropertyBlock which is usable for renderer. Why it doesn’t apply to materials ? Having arrays in materials is quite important as well. And this is the only way to feed terrain shader with array.

Terrains don’t have renderer exposed thus we’re screwed and can’t pass arrays to terrain shaders anymore.

Using DX11 buffers is an option, but I don’t like to have terrain shader DX11 only. Using tex1D would ridiculous as well. For 1 array - I’d say - OK. I can live with it, but using textures to pass certain amount of constant data to shader is evil :slight_smile: (and yes - typically I need a lot of parameters to control terrain rendering).

Tom

Hmm yeah that sounds a valid problem. I think the right approach is to add SetPropertyBlock to Terrain as well as other renderers. Will do, but whether it lands to 5.4 will depend on many other things.

Very curious if there has been any developments on this topic in the last month?

Coding work is done, implementing tests and bringing it to 5.4 beta…

Nice!

As a few next betas passed , when could we expect it to be available ?

Tom

1 Like

What’s the answer on this?

Hey,

Unfortunately the new APIs (that allow MaterialPropertyBlock to be working with terrain) doesn’t catch the 5.4 train. But the good news is that we have recently added Material.SetFloatArray, Material.SetVectorArray and Material.SetMatrixArray for your needs :slight_smile:

Will they be added to a 5.4 patch later or do we need to wait for 5.5?

Material.*Array gives you access to the global material so you don’t need terrain to expose the renderer to pass arrays to it.