
The arguments for the mode functions in MultiTexture
Hi,
I'm trying to understand the whole MultiTexturing stuff at the moment. I'm quite impressed about what can be done using this x3d-only node. Nevertheless I'm a bit confused when I try to understand the different blending modes. As I'm no 3D expert I'm learning the concepts while learning to use the x3d-specification.
I think the single textures are processed in different stages of the calculation. in each stage we have the cumulated result from all the previous stages and the current texture, which should be processed. The texel value named Arg1 in the spec is taken from my current texture, Arg2 is chosen by evaluating the source field of my multitexture node. By default it's always the value taken from the calculations done so far. But I can also say, I want the diffuse or the specular color from the material field, or, alternatively, the values written down in the color & alpha fields of the MultiTexture node.
So far I hope I understood the whole thing. The fact, that nearly every single browser renders my samples differently confuses me a little bit, but I think, thats the usual browser compatibility topic. But what confuses me the most is, that the specification says, that replace mode returns the value Arg2, which is the source value. But for me "replace" would be to take the value from the currently processed texture rather than from the previous texture. So following the spec, the replace mode would be the same as selectarg2. Now I'm unsure, if I have a false imagination of how replace should work, or if the specification is wrong here, and it should say "Arg1", or, third option, I mixed Arg1 and Arg2, and Arg2 is the current texture. There are indicators for each of those possibilities.
In the example for the second blending mode for the alpha channel, the spec says:
So here replace uses the alpha value of Arg1, not Arg2. On the other hand, BS Contact does the same things when using SELECTARG2 and REPLACE. Octaga therefore doesn't. It gives the same result, when I use SELECTARG1 and REPLACE. On the other hand, Octaga does it's own stuff in another point, it takes the current texture as Arg2 and the already computed part as Arg1. That would match the definition of REPLACE in the spec, and my understanding of a replace function, but not the spec definition of Arg1 and Arg2.
To cut a long story short: I'm confused about Arg1 and Arg2 and the definition of REPLACE mode in the spec. Any help would be greatly appreciated as I don't want to write something wrong in my thesis. Despite of that I'm thinking about all this MultiTexture stuff a few days already and found no answer.
TIA,
Oli