Rick Posted February 25, 2018 Share Posted February 25, 2018 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? Quote Link to comment Share on other sites More sharing options...
tjheldna Posted February 25, 2018 Share Posted February 25, 2018 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. 1 Quote Link to comment Share on other sites More sharing options...
macklebee Posted February 25, 2018 Share Posted February 25, 2018 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. 1 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
GorzenDev Posted March 15, 2018 Share Posted March 15, 2018 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. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.