Jump to content

Recommended Posts

Posted

Is there a shader that allows you to have a mask texture? Not a diffuse that has alpha but a separate texture from the diffuse that is b&w that shows where the alpha should be?

Posted

Look at the campfire texture in urWorld Project. It uses a b/w mask texture to define the ember glow areas. It's not exactly what your after but it's close and you may be able to rework it.

  • Like 1
trindieprod.png?dl=0spacer.png?dl=0steam-icon.png?dl=0twitter-icon.png?dl=0spacer.png?dl=0
Posted

There have been several shaders that use masks (in various capacities) - found within 5 minutes of searching for the keyword "mask".

I also remember shadmar having several posts in the past where he was using masks for 2D effects as well.

  • Haha 1

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

  • 3 weeks later...
Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.

×
×
  • Create New...