Cycles specular highlight

Hello there, i have a question: it is possible to create highlight specular witouth roughness reflection using Cycles? Just like Specular in Blender Internal.

Highlights, by definition, come from roughness. If you mean just a colored highlight from light sources, you may have to wait for a Phong-like BSDF. OSL may already have one, but don’t quote me on that.

I’ve been asking about this for years, it would be nice to have, and someone mentioned it on Kent Trammel’s recent car paint tutorial. It’s not “just like BI” either, Vray has 5 specular parameters, as well as C4D, etc. :slight_smile:

Moved from “General Forums > Blender and CG Discussions” to “Support > Lighting and Rendering”

Specularity is in fact reflection. It’s reflection of light source. If you enable glossy direct pass - you’ll have specularity (kind of).

Of course, but this is pretty typical of the responses I have gotten(and I certainly mean no offense). I don’t want “kind of”, or a complicated workaround for something as simple as specularity. :slight_smile:

In fact, specularity is a workaround itself…
Specularity is more or less a (physically incorrect) hack to fake the reflection of CG light sources in 3D, as in the early days of rendering CG lights (point, spot, etc.) were invisible and therefore did not show up in reflections at all. And it is a very limited hack indeed, as the specular highlight is e. g. always circular regardless of the light source’s actual shape.

Cylces can calculate “real” reflection of light sources on surfaces so that hack is not needed any more.
And one could argue that adding a physically incorrect effect like specularity would somewhat foil the benefits of having a pathtracing engine…:wink:

specular only happens on shiny surfaces… shiny surfaces in cycles use the glossy shader…
It’s not a complicated workaround it’s just more physical…
there’s a phong shader in OSL… but by default cycles osl doesn’t have a phong shader… it’s about the simplest shader script out there though so you could use this;

though it’s slightly more complicated than using in a built n node but i wouldn’t call it a workaround… :wink:


#include <stdosl.h>

shader node_phong_ramp_bsdf(
    float Exponent = 10.0,
    color Color1 = color(0.8, 0.0, 0.0),
    color Color2 = color(0.0, 0.8, 0.0),
    color Color3 = color(0.0, 0.0, 0.8),
    color Color4 = 0.1,
    color Color5 = 0.2,
    color Color6 = 0.3,
    color Color7 = 0.4,
    color Color8 = 0.5,
    normal Normal = N,
    output closure color BSDF = 0)
{
    color Color[8] = {Color1, Color2, Color3, Color4, Color5, Color6, Color7, Color8};

    BSDF = phong_ramp(Normal, Exponent, Color);


Yep this. Specular highlights as used in the likes of BI are simply a hack to get around the fact that you are likely using physically inaccurate invisible point lights sources (which don’t really exist in real life).

In cycles there is no need to implement such a hack as we have environment lights, mesh lights etc - all of which will reflect correctly from a glossy shader. There is no physical analogue of the specular highlights as used in BI.

Of course - there may be an argument to have such specular highlights purely for aesthetic reasons - to give an intentional CG, cartoon or vintage render look - but then again - you have BI for that anyway.

I’m not talking about physical correctness necessarily, more using it as an effect, as moony said in his last sentence.

Left to right we have Hardness set at 300, 50, and 5, all Intensity at 1, no Ramp




@MichaelW: I would certainly call that both a workaround, AND “slightly more complicated” :smiley:

I might be wrong but It seems to me the question was could you create a small circular highlight as if the sun was glinting off of a highly reflective object. And, Phong in BI has been mentioned. And, yes in the case of that type of highlight it is of course smoke and mirrors. If I’m not mistaken that highlight will direct the source, Sun, right back in our eye.

So artist have never done anything but represent it. Oil paint might come closer then anything. But, over there they mix radioactive waste with a zinc white. :slight_smile: Illustrators used the base white of the surface many times. The Phong Shader in BI can create a slight bleed on the edge which to my eye keeps it from looking like a white hole in the object. And, there is a glare node to further fake it. And, using the Phong Shader you can also get a fair looking conductive material where the specular is the same color as the diffuse. The Blinn Shader over there also works for this.

@stock if that was indeed your question the closest I’ve come in Cycles is using the Gloss Shader set to Beckman with the roughness set from 0.005 to say 0.050 and have your Sun Lamp at 0.005 to say 0.05 for the shadows to match the effect. Then like BI and artist down through the ages you will be representing that type of specular highlight. I’m not much on noodling nodes but I suppose this could then be improved with nodes. Since you mentioned Blender Internal I thought this might be the specular highlight you were speaking of.

@stock, if you really want to get tacky and go to hacking have at the filter node with streaks.


Vicky, the first couple of monkeys look like delicious candy. beautiful.

I have no instant, easy workaround to offer but now people can use Cycles baking to capture the indirect lighting, sky, etc… and then switch over to BI for specular highlights and whatever else.

@OP: No. Cycles can’t do “specular shading” using nodes, because it doesn’t have a node that does it, and I believe that due to being a path tracer it doesn’t have external access to light data at all (I’ve been out of rendering business since area lights were hot news :D). In the old days specular shading approximated reflection of light sources in a rough material, because true reflections were sharp (only one ray) and any point light sources wouldn’t show up at all. So specular shading faked two things; light sources having an area (still being defined as only a single point in space), and the blurry reflection of that light source in a glossy material. Yet normal reflections would still be sharp because multiple rays simply cost too much.

So specular shading is a fake approach that isn’t, and I believe can’t, be done in Cycles. At least with current nodes and lack of access to other objects data (like light source positions). Instead we have to resort to true glossy shading (which deals with only true reflections).

The big problem is that light sources doesn’t have to have a specified point in space like they used to, so the following would never work with “emission shader” based light sources (I could have a single mesh defining 5 light bulbs, with object origin set way off). Specular shading requires a known position for light sources (it deals with half angle directions), how would you obtain that in the provided example?

All that wot said, it would still be very useful to have access to other data within the node tree. It would even be very useful to have access to a specular shader, even if it could only handle point lights properly. Give me the most fantastic physically accurate renderer in the world - some times I just want to fake stuff regardless. For me at least, changing to BI (sorry, but I think BI looks awful, so I didn’t join Blender until Cycles arrived :p) isn’t an option. I just need better and more flexible Cycles tools. Without a performance hit of course :slight_smile:

If due to my age, having forgotten something, or not up to speed with current techs, please correct any mistaken assumptions made above.

The easiest way to allow for something akin to fake specularity would be to have a new lightpath flag that tags the last bounce of the ray before it hits the light.

You could then use it as a mask when mixing in the glossy shader, which will mean the only thing visible as reflections being the light sources.

@CarlG: Sounds legit to me! :slight_smile: As I have said before, Vray and other engines have many specular parameters(Vray has 5), so it must be useful for something. I’m not one to compare engines much, and I certainly don’t want to start THAT debate, but it is truly down to the artist to make the engine work for them. I have some better examples where I have used specularity to my advantage, photo-realism wasn’t even in the cards, although in my opinion, it works and looks cool :slight_smile: Both are BI renders
/uploads/default/original/3X/1/4/14d49efb28caafd0225f24a8bbccf4c3e41dde9c.JPGd=1370795435
/uploads/default/original/3X/b/b/bb7a3247609863bade40e398adce954f9e6f5a67.jpgd=1373986832
Trying not to spam this thread with my own stuff, but these are perfect examples of what I would like to do in Cycles.

@marc dion: Thanks! I would buy some candy Suzannes for sure :slight_smile:
You and Ace are kind of saying the same thing, and it would still just be easier to use a Spec node, if it existed. I’m actually shocked this hasn’t come up more, lots of people have mentioned it. :slight_smile: Photo-realism and physically correct be damned, I want to make art :smiley:

EDIT: The color shift on the first pic is all about specularity, I made it really flat on that one(low spec, I think 8 or so). That object has almost totally black Diffuse
Second pic, same idea

Or just have a simple tic. for the glossy node that tells it to only consider reflections of the light sources (do note it wouldn’t be in the shape of a circle for mesh lights because that would require an ugly hack).

Regardless, I still think the ‘light ray’ flag would have a bit of use since it wouldn’t be the only case where it could be useful (like omitting light sources from reflections for instance, but still getting caustics).

I thought I had misread the original question. Meaning my post was a exercise in futility. So I’ve spent about three hours attempting to tone down the highlight to match the lighting and to also get a little bleed at the edges. Since then I have reread the original post and it seems he was indeed talking about a full blown specular highlight on a ball bearing.

So it seems we have two discussions going on. Without attempting to make it three I have a question that maybe someone would answer. And, I don’t have so much as a Christmas ornament or steely to check this out on. Ok Cycles has got the position of the light and I have the resulting shadows. What is driving me nuts is the position of the highlight on the sphere. I keep looking at it and trying to move it over to the edge where it would seem to line up with the shadows. And, it will land in the same spot whether a sun light or a spot is used. My question, is Cycles putting that highlight right where it would actually fall? Or, would it be at about the green arrow.


Probably not. A spot light have a position and a direction. A sun light only have a direction, and position is most likely obtained by projecting in the opposite direction for a long enough distance (infinite). I would test anything only using point lights though, just to be on the safe side.

I appreciate it CarlG. A Point Ltg. drops the highlight in exactly the same spot. For all I know that might be physically correct but I have my doubts given where the shadows are falling. No big deal but I will check it out in a real world situation sometime just out of curiosity.

EDIT: CarlG this might not be real world testing but Blender Internal also places the highlight right there using the exact same setup. So I guess the highlight does belong there.