I am trying to create a material where I can place in 2 images (one with white space, and one with just an outline) where the outline gets laid over(with alpha cut out) a material/shader, that would be defined by the white space image.

enter image description here

I have both halves working separately correctly, but when I use a mix shader, they mix correctly but become transparent (when I want it solid).

Node Map

Both Together

enter image description here

(First image is the node map used. Top image texture is outline and bottom is white space)
(second image is the output using the monkey head. There is aweful transparency over everything)

  • $\begingroup$ It seems to me you have one mix shader too many. Please post the images you are using as texture. Better still if you share your file (with the images packed into it). You can use blend-exchange.giantcowfilms.com and edit the resulting link into your original post. $\endgroup$ – user1853 May 22 '16 at 7:13
  • $\begingroup$ Think I got this right: <img src="http://blend-exchange.giantcowfilms.com/embedImage.png?bid=1326" /> I would have posted the 2 images in the same post, but I am limited to only 2 images(says StackExchange) $\endgroup$ – Tim Leitzke May 22 '16 at 7:24
  • $\begingroup$ Images are not saved into the blend file, they have to be packed. So please pack the images (File>External Data>Pack All into .blend). Re-save the file. Re-Upload to blendexchange and edit the resulting link into the question. $\endgroup$ – user1853 May 22 '16 at 7:30
  • $\begingroup$ Else upload the images in other site and edit the link into the original post. $\endgroup$ – user1853 May 22 '16 at 7:32
  • $\begingroup$ Whoops. The forum post I read for packing images did not state it required to be saved too, I figure that was built in on that or something. Re-uploaded and edited into original post above. $\endgroup$ – Tim Leitzke May 22 '16 at 7:39

The last mix shader on your node tree is just making your shader a 50% mix of two other shaders, but not using any transparency to control the mix.

Get rid of the extra mix shader and mix the two shapes together directly:

enter image description here (click on the image to enlarge)

I'll break it in pieces so that is clearer:

When you are using an alpha channel you are using a black and white image to control how two things mix. White is used as opacity, black as transparency. Anything in between will be semitransparent.

If you use the Alpha channel to mix shaders, the white portion of the image will be using whatever shader is connected to the bottom socket. The black portions will use the other shader connected to the top socket. In this case Black will become transparent and white a Diffuse shader.

enter image description here (click on the image to enlarge)

To mix the other image you use the same approach: Using the alpha channel you just select to use a diffuse shader over a material that has areas that are already transparent.

enter image description here (click on the image to enlarge)

  • $\begingroup$ Wow, that makes a lot more sense. Though is there any explanation to why it blurs the 2 together instead of doing what it is supposed to? I can only think that maybe because it is directly 2 alpha channels bring mixed instead of one being applied over or something. $\endgroup$ – Tim Leitzke May 22 '16 at 7:56
  • $\begingroup$ What is supposed to do... what do you mean by that? $\endgroup$ – user1853 May 22 '16 at 7:57
  • $\begingroup$ By "supposed to do", I meant to outcome I wanted in comparison to what was happening. $\endgroup$ – Tim Leitzke May 22 '16 at 7:59
  • $\begingroup$ @TimLeitzke see edited answer $\endgroup$ – user1853 May 22 '16 at 8:45

As an alternative, instead of combining shaders, just add the alpha channels to control the transparency using a single mix shader.

enter image description here (click on the image to enlarge)

Or, keeping your current setup just plug the Alpha of the solid white space into the final mix shader:

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.