Wednesday, August 30, 2017

shaders - Is multitexturing really just "using more than one texture"?


This might seem stupid, but it bugs me. From what I understand, multitexturing is just using more than 1 texture per shader (usually to blend them somehow). So instead of creating 1 texture, I create 2 or more which is... pretty obvious!


Why is there a special term for that? Is there more to it than just "using more than 1 texture"? Am I missing something?



Answer




The special term has to do with the evolution of graphics cards and real time graphics APIs rather than being so special. For instance image processing and offline graphics rendering had this feature long before it was available in real time graphics APIs and consumer level hardware.


Since OpenGL 1.1 (fixed functionality) multitexturing was introduced as a new state to the API. Instead of only binding one texture, it gave you the ability to bind multiple textures; one for each texture units and then blend between them using one of the texture environment parameters, blend, modulate..etc1


Then texture combiners were introduced, it gave the ability combine a set of textures using more flexible operations, by giving you a way to pass parameters to a fixed set of operations (think of it as shaders but with fixed set of params), this was more flexible than the original "combiners".


With the introduction of shaders, the previous combiners became redundant until officially deprecated. Finally It became trivial (as hardware and accordingly APIs evolved) to pass a texture sampler to the shader and let the GPU execute arbitrary operations (your shader) on your textures as much more flexiblel to what was before.


The point here; even if it became trivial, the term survived as a generic term for any operation that describes sampling and convolution of multiple textures.


1 I am using my memory to recall OpenGL fixed functionality correct me if I missed sth.


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...