Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Alpha mask texture


Rick

Recommended Posts

  • 3 weeks later...

this could easily be achieved by adding 3 lines of code to any diffuse shader you can find in LE.
for shadows you add the same lines of code in any shadow shader.

//In the Fragment stage of the shader add to //Uniforms
//You can use any texture slot you like
//I used 4 since 1 till 3 are diffuse,normal,specular
uniform sampler2D texture4;//Black and White map


//In the void main(void) method add somewhere at the top
vec4 alphamask = texture(texture4,ex_texcoords0);
//Check for pure black color and discard
if (alphamask.r == 0.0 && alphamask.g == 0.0 && alphamask.b == 0.0) discard;


NOTE: make sure the Vertex stage of the shader passes ex_texcoords0 to the Fragment stage but any diffuse+alphamask shader does this.

  • Like 1
Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Facebook Twitter Youtube Github Steam
×
×
  • Create New...