我正在用框架蒙版图像遮罩照片。蒙版是为核心图形创建的,核心图形是反转的。
黑色意味着“可见”,白色意味着“完全透明”。与Photoshop蒙版相反。
有没有可能反转滤镜的蒙版,从而使效果反转?
发布于 2014-02-22 13:45:18
将rgb颜色更改为反色非常容易。在片段着色器中,您可以执行此表达式
uniform sampler2D tex0 ;
uniform sampler2D tex1; // mask
void main()
{
vec4 nowcolor = texture2D(texture1, uv);
vec4 newmask = vec4(1.0,1.0,1.0,1.0) - nowcolor;
// and use the new mask here instead the old mask texture
}https://stackoverflow.com/questions/21944418
复制相似问题