0
$\begingroup$

I am placing a decal (round red light) and trying to apply a material everywhere else.

The Color1 input of my MixRGB node is sending through the manual color as if it had no connection.

enter image description here

When I move the connection to Color1 instead to the Output I see the expected material.

enter image description here

What I would like is for the red light to appear over the blue material. The pink I do not want.

Also, why do I need the Diffuse Shader node after the MixRGB node?

Here is my blend file in case it is needed ....

https://drive.google.com/open?id=0B8ZnFrE6fxi_VVVwdnhaS2VwZ1k

Thanks for any insight.

$\endgroup$
6
  • 1
    $\begingroup$ At a glance I can't figure out what is supposed to be happening with that color ramp. But the first problem I see is that you have BSDF shader data (from your Mix Shader) going back into RGB (the Mix RGB node). All color processing should happen before shading. That's all I can say for now since I am on mobile (can't download your .blend to my iPhone). $\endgroup$
    – Mentalist
    Oct 24, 2017 at 5:59
  • $\begingroup$ I think you can tell I have no idea what I'm doing lol. I don't know the difference between a Mix Shader and a MixRGB node except they combine stuff. $\endgroup$
    – deanresin
    Oct 24, 2017 at 6:08
  • 1
    $\begingroup$ You should typically connect like-for-like - the node socket colors indicate the ‘type’ and you generally shouldn’t connect different colors unless there’s a really good reason and you know how they’ll be converted. In particular, green should never connect to anything but green. $\endgroup$ Oct 24, 2017 at 6:47
  • $\begingroup$ Everything is so buggy I can't stand it. I don't know if I'm messing up or the program is messing up. Sometimes my changes are reflected in the "render" but not the "preview" and vice versa. My UVmap decal sometimes disappears. I'm trying to make changes with the comments you made but no luck so far. $\endgroup$
    – deanresin
    Oct 24, 2017 at 6:57
  • $\begingroup$ Try to use Mix shader instead of MixRGB, but do it after Diffuse shader (which is right before Output). And plug Texture's color straight in this last Diffuse shader $\endgroup$
    – Serge L
    Oct 24, 2017 at 7:32

2 Answers 2

2
$\begingroup$

Okay, I'm looking at your .blend now.

There isn't one easy "here's the problem!" sort of thing. It's more like a series of problems. So I will try to, while attempting to keep this as brief as possible, point out each of the problems I see with your material and try to help you get the effect I think you're aiming for.

(Nice zamboni, btw!)

The first thing is, this makes no sense:

A baffling ColorRamp setup

Neither does this:

BSDF shader data should not come before Color data

Do this instead:

Color data should come before BSDF data

Another no-no...

Oh no! Color before shading again!

Do this to see your material:

Connect Shader to Material Output

Here is how you can combine two images using the alpha of a PNG:

One important thing to understand about both RGB and shader mix nodes is that when something is plugged into the Fac input any white image data is considered positive (or 1 if you like binary) and any black image data is considered negative (0). All shades of gray fall somewhere in between. If you know what a PNG's alpha channel looks like you can probably imagine how this is all working now. We have taken that grayscale channel and told Cycles we want that to factor a mix of colors or shaders instead of transparency. Another important thing to understand is that whatever is plugged into the upper socket is what will mask through as 0 and whatever is plugged into the lower socket will mask through as 1.

This would work if only we had images

But wait, something's wrong...

There are no images in this .blend. Looks like you forgot to pack them before sharing. For the future, this can be done from File > External Data > Pack All Into .blend.

Can't load images because they haven't been packed

Let's look on Pixabay to see what image we might be able to substitute for a taillight...

Bright red Agaric on Pixabay

A bright red magic mushroom! Perfect.

Pixabay image credit shout-out to "adege"

Make a transparent PNG, and we're up and running again.

(Providing transparent PNG below. Use responsibly.)

Mushroom transparent PNG

Texture alpha factoring between two materials

At this point you have all you need to show the decal on your material.

But since it is a light after all, let's take it a bit further.

Connect an Emission Shader like this so light will be emitted from only the non-transparent parts of the PNG:

Light-emitting decal - node setup

And I saw you were trying to add some displacement with your original node setup, so let's add that back in the correct way.

Bump node setup

I think you'll need to change the lighting in your scene before the bumps will be visible on your model, but you can see them in the material preview. Adjust the Noise Texture parameters to your liking. The Math Node (set to Multiply) tames the bump values.

Now everything is awesome!

Oh wait... the decal is upside-down.

We had better fix your UV map too.

Wow! That is one hell of a UV map.

Crazy UV map

Since you've already got the 2D Cursor in the right place and you have it set as your pivot point, we can just rotate this bad boy 180° and we'll be good to go.

Rotating the UV map 180-degrees

Okay! And that concludes this answer. Phew! I think I broke a sweat writing this. Also experiencing some pupil dilation and my computer's display looks amazing; how odd. Anyway, good luck and happy blending!

$\endgroup$
2
  • $\begingroup$ Thanks... I had fixed some of the problems you mentioned but some I hadn't known about. I look forward to going over it in detail and applying it to my project. $\endgroup$
    – deanresin
    Oct 26, 2017 at 0:11
  • $\begingroup$ Cool, glad I could help. Good luck with your project! $\endgroup$
    – Mentalist
    Oct 26, 2017 at 0:55
0
$\begingroup$

The comment section solved it. The main problem was I was using shaders before the MixRGB node. I replaced the MixRGB node with a Mix Shader node and moved all the Diffuse Shaders in front ot the Mix Shader nodes.

enter image description here

enter image description here

Edit: I also removed the diffuse shader in front of the glossy shader.

enter image description here

$\endgroup$
7
  • 1
    $\begingroup$ Please read:What is the meaning of the color of the node sockets in the node editor? $\endgroup$
    – user1853
    Oct 24, 2017 at 20:30
  • $\begingroup$ I read your suggestion and have realized that my blue Diffuse Shader node in front of the Glossy Shader was in error. $\endgroup$
    – deanresin
    Oct 24, 2017 at 22:19
  • $\begingroup$ Nodes expect a specific kind of information going in. $\endgroup$
    – user1853
    Oct 24, 2017 at 23:09
  • $\begingroup$ Glad you got it working! I started composing an answer for you, but it ended up being pretty involved. If you can pack your .blend and upload it to Blend Exchange I will at least post my .blend, and possibly an answer. $\endgroup$
    – Mentalist
    Oct 25, 2017 at 0:55
  • $\begingroup$ no post your answer. mine will be less informative. $\endgroup$
    – deanresin
    Oct 25, 2017 at 1:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .