Making a surface transparent from blackness of texture
Posted
by
Dan the Man
on Game Development
See other posts from Game Development
or by Dan the Man
Published on 2012-06-09T16:28:56Z
Indexed on
2012/06/09
16:49 UTC
Read the original article
Hit count: 350
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));
© Game Development or respective owner