MaNGusT wrote:cuz of texture of the bottom. I mean that brightness calculation is water1+water2+bottom texture=darkened result.
Erm.. Nope.
Code: Select all
pie_SetTexturePage(iV_GetTexture("page-80-water-1.png")); glErrors();
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGenfv(GL_S, GL_OBJECT_PLANE, paramsX);
glTexGenfv(GL_T, GL_OBJECT_PLANE, paramsY);
glMatrixMode(GL_TEXTURE);
Set texture and filtering. (pretty much the same for both of them)
this texture moves +x axis, and the other texture moves along the -x axis.
Code: Select all
pie_SetRendMode(REND_MULTIPLICATIVE);
This makes each texture multiply blending values with each one.
So, texture A * texture B = final result for this operation.
We don't use REND_ADDITIVE.
For what it is worth, this is what they actually do:
Code: Select all
case REND_OPAQUE:
glDisable(GL_BLEND);
break;
case REND_ALPHA:
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
break;
case REND_ADDITIVE:
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
break;
case REND_MULTIPLICATIVE:
glEnable(GL_BLEND);
glBlendFunc(GL_ZERO, GL_SRC_COLOR);
break;
case REND_PREMULTIPLIED:
glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
break;
so, think about it as color = src * A + dst * B or...one of the above.
Why is this topic here, shouldn't it be in the dev area, since, mods can't do anything to the blending modes we use?