Feature request: bake specular map


I am not skillful enough, so I thought I might suggest a useful feature for blender, hoping that some coder who is, might like the idea or the challenge… :slight_smile:

At the moment, you can bake all kinds of maps in blender: AO, normals, textures, displacement and full render.

But there is no possibility to bake specular maps ;(

It would be awesome to have this feature, because if you have a model with several different materials you have already set the specular values… but you can’t transfer them to a single map to be used in an external game engine.

I guess there is no solution to this problem right now, so a script that could be integrated into the blender trunk later would be necessary.

Is there someone interested in this feature? Or am I missing sth?

What do you think?

(Sorry, I really can’t solve this problem. I try to contribute to the blender community in other ways possible; compatible with my skills. So in this matter I can only ask kindly, hoping the best)

PS: I know that one can use the AO map as a starting point for a specular map, but it would still ignore the available spec-settings that are already defined in the material settings. So that wouldn’t be the answer to the problem…

I think the reason for why it’s not possible to bake specular maps is the same as why you cannot bake mirror maps. Both specularity and mirror are dependent on view. Therefore it is not possible to produce a map that would work in all cases (it would work in just that one).

If someone knows a software that can bake either mirror or specular maps, let me know…

Yeah, as BeBraw said… specularity if it’s baked would only look right with the camera in 1 specific position/orientation. And then baking becomes a mute point. It’s the nature of the beast.

Try drawing a map as you’d expect it yourself… then apply it to the model… it probably won’t look as you expect.

no, I disagree… or well, maybe I didn’t make myself clear:

All materials of one object have specular values, right? What you will see in a render is a mixture of these settings and the current light set up and the camera view.

What I want to bake now is not the rendered specularity. If I would, then I would only get the view and light dependent outcome you talked about.

What I would love to bake is the specular-values of all materials of one object put into one texture. This way I could get rid of all materials, apply this new spec-texture and the object would still have the same different specs that it would have if I kept the materials.

Does that make any better sense?

Let’s get some things straight first
All materials of one object have specular value, indeed, but unless told otherwise, e.g with the use of a specular map, any 3D program will apply the same value of specularity along the surface of the model. The only thing then that can further define it is the geometry of the model and the light setup, as you’ve already mentioned. Sculpting for example will add a lot of detail on the geometry, thus affecting the specularity of the model accordingly. Sure, you won’t see any large flat surfaces any more, but still the specular value will be the same for the whole model.
I think you’re trying to start from the end, that is the end 3D result, to get your specular maps, when the best and most common method is 2D manipulation of you textures. You can very easily convert your RGB texture map to a greyscale specular map, using , say, GIMP, or use a bump map (or even a normal map in some cases) instead. Why go into the trouble of render baking when you can edit the source, that has all the information you need? You can take the color values, that hint where a model should be most shiny and where not, and alter them to your heart’s content.
Take a look at this tutorial (there are also a bunch of others)

A specular map out of a bump map, in Photoshop, but the principles apply to GIMP as well.
Hope it helps

I think zapman’s talking about baking a map with (greyscale) hues correlating to the ‘Spec’ sliders under Shading > Material buttons > Shaders.

This way, a mesh object with multiple materials applied could be baked to separate Diffuse and Specular maps, for use in Shading > Material Buttons > MapTo.

I think this would be definitely possible, for use in games at least, as the specular highlights will only show up when a light source is present on the affected area.

Max has this feature and it is shown in the screenie below.
The screenie is taken from Eat3d’s Old Pillar tutorial DVD which is located at http://eat3d.com/training_videos/pillar

AFAIK to enable the specular rendering in MentalRay the model must be assigned to a raytrace material and all the user needs to do is assign a separate material to each part of the model that has a different secularity value.

Maybe if some sort of global illumination was used to light the whole model equally, capturing the specular highlights would be possible.
Im going to have a play around with the nodes and see if i can come up with something with some AO and normal maps.

Thanks so very much for taking your time to create this very useful and informative site. I have learned a lot from your site. Thanks!!0 ------ Bobby Jones (retro jordans).

Yes, that’s exaclty it!

But I want to use this map in a custom game engine outside of blender.

The main goal is to model and texture game objects in blender that are to be used with an external game engine. Since blender materials are rarely supported by any game engines I need to convert the blender materials somehow.

My workflow is as follows:
In Blender I do modeling and texturing. For texturing I make use of different Blender materials and apply procedural as well as image based textures. At the end I do a UV-unwrap for the whole model and bake the diffuse map based on my blender materials.
I would like to do the same with the spec values I set under “Shading > Material buttons > Shaders” to generate a specular map that is based on the materials specular settings.
The diffuse and the spec maps could then be used externally (ogre based for example) to be applied to my model (now only one material for the whole object since I have baked all blender materials into textures that completely cover the object). The result should be visually (roughly) the same as in blender.

In the end I would have:

a 3D mesh of my model that has UV-coordinates

one diffuse texture for this model

one specular texture for this model

one normal map for this model

Of course one can still tweak the generated spec map by hand, but I really think that is is much easier if you can rely on a generated spec map based on your uv-layout and the blender-material settings for specularity. All you would still have to do is doge/burn some details into your generated spec-map

一个男孩问他的妈妈:“你为甚么要哭呢?” 妈妈说:“因为我是女人啊。” 男孩说:“我不懂。” 他妈妈抱起他说:“你永远不会懂得。” 後来小男孩就问他爸爸:“妈妈为甚么毫无理由的哭呢?” “所有女人都这样。”他爸爸回答。 小男孩长成了一个男人,但无缝钢管,不锈钢管,合金管,高压锅炉管,合金管仍就不懂女人为甚么哭泣。 最後,他打电话给上帝;当上帝拿起电话时,他问道:“上帝,女人为什么那么容易哭泣呢?” 上帝回答说:“当我创造女人时,让她很特别。我使她的肩膀能挑起整个世界的重担。并且又柔情似水。 我让她的内心很坚强,能够承受分娩的痛苦和忍受自己孩子多次的拒绝。” 我赋予她耐心使她在别人放弃的时候继续坚持,并且无怨无悔的照顾自己的家人渡过疾病和疲劳。 我赋予她在任何情况下都会爱孩子的感情,即使她的孩子伤害了她。 我赋予她包容她丈夫过错的坚强和用他的勒骨塑成她来保护他的心。 我赋予她智慧让她知道一个好丈夫是绝不会伤害他的妻子的,但有时我也会考验她支持自己丈夫的决心和坚强。 最後,我让她可以流泪。只要她愿意。这是她所独有的。 你看,女人的漂亮不是因为她穿的衣服,她保持的体型或者她梳头的方式。 女人的漂亮必须从她的眼睛中去看,因为那是她心灵的窗户和爱居住的地方。

This would be a pain, but it would work: Disable all your textures except the one that affect spec., change those textures to color, make your mats shadeless and a shade of gray corasponding to the specularity of the mat, and then bake a full render. I just made a simple test of this method: it works both in the game engine and render, but you have to set ‘no rgb’ in the map to settings.

I dont understand this topic. Use your specular values as color and you can bake it.

Yes, this is getting close. The only downside is that it’s really cumbersomely and you ignore the specular settings in Shading > Material buttons > Shaders.

If you have textures already that define the spec values, then you can simply change the settings in “Map to” from spec to color and then bake, that’s right.

But I don’t have any specular textures, I would mainly like to bake the values set in Shading > Material buttons > Shaders for ALL materials into ONE texture.

Wow I am surprised that so many people dont know what a specularity map is !

Anyways spec maps are so simple to make by hand? I dont understand why you would want to bake it with blender that would just be more complicated.

How very presumptive of you.
It is also correct to use a noun when describing a “specular” map…not an adjective which describes its attributes. :stuck_out_tongue:

This is unfortunately a very common misconception.
To create a good specular map takes practice and patience…just as creating a diffuse map does.
The point of this request is so users can define the specularity of individual objects with precision and then bake them onto a texture which would be far more accurate and much quicker as you could create materials in Blender for a number of different surfaces for use later on.
In the end this would increase efficiency and speed up the users workflow.

thank you metalliandy,

at least I am not the only one who could use this feature… :smiley:

the spec values are already available if you have an object with dozens of materials, so why not bake these values into one map? (to be used easily outside blender :wink: )

I also miss a fast way to bake some of the MapTo settings.

I added an idea to blenderstorm some time ago (includes some links to related ideas):