Making a surface transparent from blackness of texture
- by Dan the Man
I am making a "halo" shader in unity using GLSL. And I've come to a roadblock.
What I need to do is take a texture, like the following, and make it transparent according to the darkness of it. And I don't want a cutout, because that cuts it off at a hard edge.
This line of code doesn't seem to work.
gl_FragColor = texture2D( vec4( _MainTex.r, _MainTex.g, _MainTex.b, _MainTex.a), vec2(textureCoordinates));