Cycles Specular Maps

Hi again everybody!
just another newbie question, is there a way to apply Spec Maps with Cycles render engine? I´ve tried to apply a Glossy material together with a texture image (mixed) and then regulate the roughness of the Glossy through another texture image (black and white for spec) and texture coordinate (UV mapped). Didn´t seem to have any (desired) effect so, maybe I´m doing something wrong. Anybody knows?

     Thanks in advance.....

I want to know this too, does anyone have an answer?

There are at least three methods to control specularity with a texture (and maybe more I haven’t thought of):

  1. mix diffuse and glossy shader and use bw specmap as fac input of the mix node
  2. use bw specmap as input to roughness of glossy shader
  3. use bw or color specmap as input to color of glossy shader

Those should work. If they don’t, you can post a screenshot of your nodes and/or the blend, maybe something else is wrong.

Edit: as cdog points out below, keep in mind that roughness is a different effect than specularity or shinyness. So to clarify a bit better:

1 controls the strength of the influence of the whole glossy node,
2 controls the blurryness of the reflection,
3 controls the intensity of the reflection (and also the color if not set to b/w)

Thankyou very much for the reply, the 1st method will fit in real nicely with my current node setup :smiley:

I’d imagine you could mix up 1. and 2. to create stuff like dirty mirror with part of it reflecting more sharp image.

That’s the thing I love about the workflow with nodes

i would like to know a little about this too.

How would u actually use a spec map which u made urself and use it in cycles.

Thanks for you help, Sanne! Works perfect.
Although this thread is older, I have attached a screenshot of my node setup for checking.


Heh, I had to scroll up to see what I said. “Help? What help?” :slight_smile:

Nodes look sensible, except for using diffuse texture as color input to the glossy node. Maybe that’s what you want actually, but glossy color is always white unless it’s metal. Just a thing to keep in mind.

The two glossy effects (via mix node and via roughness) can be further controlled with some math nodes in between, if needed, for example to control the strength seperately.

Edit: hmmm, thinking about your nodes a bit more. Spec map outputs [0 … 1]. Where 0, diffuse texture is shown via mix node, at the same time it’s where roughness is also 0, meaning max shiny. Where spec map is 1, full glossy node is shown, but roughness is 1 in this case also, meaning glossy effect is max rough -> nearly diffuse. I think you might have to reverse one of them.

No time to test right now, though.

Thanks. Just updated this one.

The two glossy effects (via mix node and via roughness) can be further controlled with some math nodes in between, if needed, for example to control the strength separately.

Thanks. I just added a multiply math node in between.

Edit: hmmm, thinking about your nodes a bit more. Spec map outputs [0 … 1]. Where 0, diffuse texture is shown via mix node, at the same time it’s where roughness is also 0, meaning max shiny. Where spec map is 1, full glossy node is shown, but roughness is 1 in this case also, meaning glossy effect is max rough -> nearly diffuse. I think you might have to reverse one of them.

I tried to implement what you suggested. But then it looks more reflective than specular. What you suggested was to set either the orange or the green math node to negative?

Thanks
Martin


No, not to negative, then it would convert the range of [0 … 1] that the texture puts out to [0 … -1], which makes no sense for the inputs they want to feed. What you’d want to do is converting [0 … 1] to [1 … 0]. You can achieve that with an additional math node right after the texture, set it to subtract, set first (upper) value to 1 and put the texture output into the second (lower) input.

So then you get:
[0 … 1] -> [1 - 0 … 1 - 1] -> [1 … 0]. Voila :slight_smile:

Thanks Sanne! I will give it a try. I updated my nodes as shown in the picture.

Best regards
Martin

PS: Funny, I just saw your logo. I am also using Archlinux!


Yup, that’s what I meant. I still didn’t test, so play with it and see if it works, but in theory it should. :slight_smile:

And hey, fellow Archer, how nice! I tested Archlinux in a vm for some months and switched for good at end of August, so I’m still very new. Lovin it!

My tests showed something different. I have a BW specular map. The colors refer to the specular map.
It is the factor input for the Mix Shader: black = complete diffuse color, white = complete glossy color
And it is the input for the Roughness of the Glossy Shader: black = shiny, white = more diffuse.
So I think I need to put the “1 - 0” conversion before the roughness of the glossy shader and not before the mix shader.
What do you think?

Best regards
Martin

Arch is the best. I had Linux From Scratch, Gentoo, and Ubuntu Studio before. Arch was the best distro.


Hi guys. Just one note. Roughness isn’t the same as the specular(which in the contex of cycles shouldn’t be used, I think, because usually specular means fake reflections of invisible light sources which is an old concept(still used, though). Cycles uses only real reflections of visible light sources (this is why you don’t see anything when using current area lamp - there’s no specular reflection, because the light source is invisible).
So "specular"should be reflectivity - maximal level of reflection; and roughness means how blurry the reflection is. If you know vray or mental ray terminology those two parameters are there as well. Basically its usage is - reflectivity should be used only on combined materials (for example puddles on a floor), because each component is in fact a material in itself with its properties. So using a map in the fac of the mix basically tells the shader where there should be more reflection. And roughness is usually used within one material to simulate slight deviations in glossiness (for example a wooden floor - the overal reflectivity is the same but the roughness/glossiness changes).

Martin, yes, looks even better, at least it’s clearer what the intention is.

My Linux history: Debian Woody, Debian Sid, Ubuntu Breezy, -Dapper, -Karmic, Archlinux. :slight_smile:
Did you use Ubuntu Studio for music? If so, what applications? I’m playing a bit with Renoise, one of the very few proprietary programs on my computer.

cdog, according to Wikipedia specular refers to non-glossy reflection, in our case it would be glossy with roughness 0, while reflection with roughness > 0 is called glossy. Specular map should maybe better be called gloss map, although spec map is very common.

In general specular doesn’t necessarily mean fake reflection, but it’s called that way in BI, where it is indeed fake.

Yeah I know what you mean. I just meant to point out that those three methods you mentioned in the begining 1 and 3 are roughly the same but 2 is a different thing. The result can be similar, but in general it’s better to know what each component means and set the materials accordingly. This way it gives the most predictable result under different lighting conditions and is also quite simple to set up.

cdog,

aaah, now I see, I misunderstood you. You’re right, of course, roughness is a different effect, I should have made it more clear in that post. I’ll edit it, thanks for pointing it out.

Ok, so that node setup controls specularity. Is there any repository/collection where nodes are collected. It was very hard to find any information on cycles nodes.

Martin

PS: No, unfortunately not :eyebrowlift2: Actually I used Ubuntu Studio to have maximal responsiveness for Steam/Counter Strike running in Wine. And I thought that a maximal responsiveness also is very resource efficient and provides the maximum resources for 3D renderings.

I have used this node setup to render diffuse/specular/height_or_bump/ao maps from the stone pack of cgcookie.com.


I think this setup produce the best results. I would like to try here the multiply node.