3

The first thing that comes in mind is masking using RGBA values. With this you can obtain this kind of textures and this kind of results.

enter image description here enter image description here

But with this, you can only store up to 4 masks inside a texture and blend between maximum 4 textures.

I am wondering if there's a way to store more than 4 masks inside a texture and being able to blend more than 4 textures using this mask texture. The aim would be to store as much as possible masking data inside a texture.

Is it possible ? How ?

MaT
  • 1,556
  • 3
  • 28
  • 64
  • 2
    The limit is your imagination, the available techniques are: split 64bits rgba pixels over more than 4 8bits groups, use texture array, use texture atlas, adding some attributes to your vertices,...and some experts have surely more to propose... – j-p Jan 13 '15 at 11:47
  • 1
    easiest is to use multiple masking textures, if that is not an option you can encode more values in that mask texture (bit hacks). Another method that is to use vertex color, mask texture, alpha from used textures to allow much more complex blending. – Raxvan Jan 13 '15 at 12:08
  • @j-p Thanks for all your solutions. I am not interested in texture array and texture atlas. Could you develop your 64bits RGBA pixels splitting and vertex attributes ? Does all of this allow blending ? – MaT Jan 13 '15 at 13:54
  • @Raxvan As I said, I am interested in bit hacks. Do you have some white paper or tutorials about this ? Thank a lot. – MaT Jan 13 '15 at 13:56
  • i don't know something for this specifically, but you can take a look at http://stackoverflow.com/questions/17638800/storing-two-float-values-in-a-single-float-variable . you can encode 2 floats into one , so you can apply this to texture channels to get 8 float values (from rgba texture) – Raxvan Jan 13 '15 at 14:01
  • I think except during fbo blitting, blending is always possible. Search for vertex attribute (vao,vbo) You may pass custom data to each vertex (for addressing textures in atlas or array). RGBA is 4 bytes, (right?) you may group bits differently (16x4bits for example) for each splatting texture coef... – j-p Jan 13 '15 at 14:12

0 Answers0