2014-02-21 56 views

回答

0

將rgb顏色更改爲反色是很容易的。 在片段着色器中,你可以做到這一點exprestion

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 

}