I’m getting to a point where there’s quite a few things where having access to 3D textures in a material would be very useful - mainly for lookup tables of precomputed data. I understand UE4 doesn’t yet have 3D textures, so in general people are creating grids of 2D texture ‘slices’ of a 3D volume - as in the incredible work of Ryan Brucks, for example.
What I’m wondering (and I’m pretty new to all this and not coming from a CS background so this might be a stupid question) is what would be the problem with instead having a three dimensional array fully laid out inside a custom node?
var = 427.52117;
var = 213.73671;
var = 37363.26;
Then you could simply look up the appropriate value with the three indices, without having to calculate the correct UV position in a texture.
Obviously, for large arrays this could end up with some pretty big custom hlsl nodes, but what kind of effect would that have on performance compared to a texture? Is the problem that the array wouldn’t be initialised into memory and stay there, but have to be re-initialised every time the code is called (on each pixel I guess)? If so, then I suppose the benefit of using a texture is that it’s loaded into memory once and values can be read out from it any time without reloading it? I don’t know how shaders work under the hood or get compiled, so not sure if this even makes total sense.