Glossiness by texture

Hi there,
i’m currently investigating the capabilities of blender. I was wondering if it is possible to control the glossiness of raytraced reflections and refractions (mirror and transparency) through a texture. I only found a way to control the specular hardness, but specular is not an option when making realistic surfaces.
I tried to blend two materials with different glossiness factors, but this yields a different result then directly controlling the glossiness. Did i miss the solution somewhere?

+1 to this question. I ran into this issue Just the other day in one of my projects and was about to ask it here myself.

BTW welcome to the fourm qb13.

I have seen folks use the specular pass in the compositor as a multiplier for a reflectance image texture. Is that what you mean?

I spent more time trying to figure this out.

walshlg, not exactly, specular is basicly a faster version of glossy reflections, as in real life there is no such thing as a specular that isn’t just light being reflected in the same way as a reflection. hope that kinda makes sense, the reason for useing a glossy reflection would be to add more realism to a render if you look into the blender art mag on multi layer SSS skin it has some stuff about using gloss for the specular, but it doesn’t go into anything like an actual gloss map as I remember it.

Anyways, I tried this out some more qb13, and in 2.53 the ray-tracing texture support is still spotty, I couldn’t even get mirror value to work with a texture, which is something that does work pre 2.5. As for effecting the actual gloss value, I have no idea, and my experiments, even with nodes, have thus far been useless.

Well, that’s a little bit disappointing. I thought it shouldn’t be so difficult to implement while all the other values are already controllable by texture.
Does anybody know if one of the alternative renderer plugins are capable of that? I tried V-Ray/Blender, but there only the internal blender material settings are translated to vray, so… also only a single value for glossiness. Maybe yafaray or luxrender? I only had a quick look on them and didn’t find something like that. Or are there any other renderers worth trying?

Not sure why you are trying to treat a reflection as a texture? It is the nature of a reflection that it is dependent on viewpoint, so if you have a static image, you just render your reflections, and if you have a movie, you cannot really apply a texture of your reflections, cos as you or the object moves, they will all be wrong, and it will look awful. This is why you cannot bake a specular, either.

If you mean can you make a reflection look like a gloss, rather than a pure reflection, then the node editor is the route to take. I would perhaps fake the emit factor as a glossiness factor, by taking two renderlayers, and removing emit from one, and then using the emit factor in another renderlayer pass to control the blur on the reflection in the first pass. Hope that makes sense. Might not work if you have two areas of differing glossiness immediately adjacent, unless you also mask them somehow to different passes, so the blur on one doesn’t affect the other.


Hey travellingmatt,
maybe i was a little bit unclear. I am not trying to fake a reflection with a texture. I want to control the strength of the glossiness of the reflection (and also refraction) with a texture. Then I can make parts of an object glossier than other with a smooth transition between.
This can be useful when you are trying to make an object look partly wet or something like that.

Right, I did wonder if that was the sort of thing.

I would use the compositor for that. As I suggested before, use something like the emit factor, which is applicable as a texture, and then render the reflection as a separate pass, and use the emit pass to control either the blurriness or the amount of reflection, as needed. Obviously, you would need to separate the ‘glossy’ objects onto a separate layer from anything truly reflective, but it could work easily enough.

If you have no ‘specular’ in the image at all, then you could use specular in the texture for amount of reflection, and emit for blurriness, so you would have control of both within the texture.


ok, call me stupid, but how would you go about doing that travellingmatt? I’m having no success with ether mat nodes or scene nodes. (scene is what I tried after your post) I’m also starting to wonder if I found a bug with the reflection pass, because the results that is giving me are really weird and make no sense to me, but I’m not yet ready to say that isn’t just my own incompetence and lack of understanding.

little update on before, I did figure out what was wrong for the mirror value controlled by a texture, so that works fine in 2.53.

hm, I don’t understand travellingmatts attempts either, but I’m not a blender specialist :spin:. However, I previously wanted to add some imagefiles, hope they can help to make the point clear:

wanted result, done with max/vray:

unwanted result by mixing two materials in blender (maybe it can be done better):

just a little addition for how I did the material-mix in blender:

ok, so I took what you started with and experimented some more, here is what I’m thinking now.

This is about as good of a work around as you can get in blender right now, but it’s defiantly just a work around, not a real solution. more on this in a bit.

qb13, the first problem yours has is you need to turn the gloss value way down, or up as it may be. when the value is at 0 it seems to bounce the rays in any direction off the face of the normal randomly. the max render you have is most certainly not coning them out that much. I was getting fairly similar results to the max at about .8, and in practice I don’t think you should ever venture much past that, farther just seems to be unrealistic to any real world materials.

Next is the real problem I’m finding. Because doing it with the nodes like this, you are not actually creating a gradient for the gloss value, but rather mixing two different gloss values together. That may sound similar, but it yields very different results. Because the later will not be accurate, anywhere in the mixing gradient the cleaner mirror value will show through the glossier one, giving an ugly halo effect.

The workaround within the workaround :spin: that I’ve found is just to make more materials of in-between levels of glossiness, thus minimizing the size of the halos till they aren’t as visible. I’ve attached a simple three mat screen cap I did. but when things get more complected this could take a very long time to set up.

Anyways, that is how I understand the situation for now…


I agree with that. I thought it could be possible without a workaround or at least with a identical looking workaround, but apparently not.
Is there a reliable possibility to make a “feature request” to the developers? I still think it shouldn’t be so hard to implement. I even found other material properties that should be texturable in my opinion, for instance the fresnel and anisotrop settings and all sss and strand settings (correct me if they already are). But maybe I’m not the right person to request something from the developers, cause I’m currently only testing Blender for the first time :smiley:

Anyway, does anybody know the situation with the other renderers for blender?

I would suggest using a variation of the DOF blur effect on the reflection. The DOF allows you to control the blur radius, rather than amount, as the controlling factor. Thus, if you feed the specular pass into blur node where you would normally feed your z-buffer input, you should get a variable blur, rather than a variable ‘amount’ of blur.

There might be a considerable amount of tweaking needed to get the values right, though.

I’ll try to throw a test file together tonight when I get home, - I’m working on a scene that does a lot of reflections, blurred and otherwise, so it will be helpful to my own project too.



Hm, that sounds interesting, like a post-reflection-blur. I think this could work in many cases, while some incorrect reflections at the borders of the surface may appear.
But a direct solution would be preferable and less complex to realise.

I agree that this is one of the many things that Blender could, and ideally should, do. However, I’m sure the wish list for the Blender team is a mile long already!

For technical accuracy, you should really be able to put a DOF setting on your raytraced reflections, so that objects further from the object are more blurred than those close to it, but perhaps that’s getting too picky :slight_smile:

(Thinks… must try and see if that is possible!)


btw, i did some tests with luxrender, there it is possible:

but so far luxrender seems rather slow to me.