Elephant in the room: how to handle Specular while baking textures?

I don’t understand how there apparently isn’t any tutorial or question online regarding the issue of Specular while baking textures.

I understand that baking Specular in an animation isn’t a good idea, but what do I have to do with my Specular instead? Take a Glossy BSDF node and connect it to the Emission node via a Mix Shader, with a Fresnel node in its Fac channel? How do you people handle the issue of Specular? :slight_smile:

What exactly is the issue here?

The effect of Gloss and Specular changes in relation to the light sources.

Glossy/Specular textures are simple overriding/adding on top of the diffuse texture where the light reflects off the surface.

There is no such thing as physically real Specular texture. Hence why PBR pipeline does not really use it. In PBR, Specular channel in a material simply control how much light/reflection is visible on the surface. If the specular channel is at high value, the object will have the potential to shine very bright. If the specular channel is at low value, the object will have the potential to have a very weak shine.

You’re right about that, TeaCrab, but that’s exactly the information I keep finding online as well. It’s not what I meant, so I am sorry for my poor explanation.

It’s about texture baking. If I bake textures, I don’t bake Specular because I am making an animation with a camera move. But this doesn’t mean I don’t want Specular in my Material - I just don’t BAKE it.

But then this problem arises: how do I add Specular to my baked texture afterwards? By adding a Glossy BSDF node and connecting it to the Emission node via a Mix Shader node? What’s the common way of adding Specular back to a baked texture?

And there we are: I can’t find anything online regarding this issue! :slight_smile:

In PBR, you don’t. In PBR the roughness map automatically adjusts the reflectivity. If you don’t care about correct PBR, you could connect the texture to the glossy color socket, possibly causing it to go all white at glancing angles.

Okay, so could you tell me what your node setup would be if you wanted Specular? I can’t get my head around it :smile:

Oh, and I DO care about PBR, but apparently I just don’t know how to achieve that :smiley:

Specular texture is just how reflective/shiny each part of your model is, which can be baked from another model, so light reflections can look different on different areas. Glinting highlights are just reflections from lights in your scene.
It is possible to bake your scene lighting to your colour/diffuse texture which is completely different to having a specular map.

That’s right, AndySC, but actually not quite the issue.
I don’t want to bake Specular. I want Specular to be rendered.

The ONLY things I want to bake are

  1. Diffuse
  2. Direct Lighting
  3. Indirect Lighting

since these things are the only visual parts I can bake without having problems when moving my camera, right?

After baking these things, I want Specular to be rendered (not baked) on top of it. How? :smiley:

I would have to experiment, but my initial thought is fresnel to mix between prebaked emission textures and glossy. Fresnel might have to be multiplied with texture map at f0 while keeping full fresnel at f90. But, I would have to experiment as I’ve never done it, and I can’t right now (rendering in progress).

Thanks CarlG, for your help. I really appreciate it!

But while reading more and more online I’m starting to think I might be doing the whole baking process wrong altogether.

So please let me reverse my question: if I have a Material with Diffuse and Specular, what’s the best way of baking this for a camera move animation?

I think it’s not possible to get your specular without baking also your spec/glossy/roughness map : as your baked maps will be used in an full unlit material, you have no other choice than using your spec map as mask for your glossy.
'should probably looks like this:

Why does the Specular/Glossy/Roughness need to be baked as well, you think? :thinking:
Can’t it be rendered instead?

I don’t usually bake, but I would consider it if the surface area is major and it uses tons of generators and/or very complex node setups to achieve the effect. If you’re using textures already, I don’t see the point.

However, my node setups usually gets complex in order to avoid texture repeats, and to bake/texture gen those would more likely produce texture sizes I can’t handle.

You say that you don’t see the point when you’d already be using textures.
Good point, but it seems to me that baking light / shadow information on lots of objects saves me much render time eventually, don’t you think? I’m just starting to learn about baking… :wink:

Hi Rezzy777,

you are on the right track with your baking approach, here is an example where we used the same technique as you described in your first posts:


We baked down the diffuse light into 32bit-exrs maps as a foundation for final shading. Light baking was done on a clay model, here you loose colour-bleeding but you are most flexible with texturing afterwards…

The denoised lightmaps were then put into an emission shader and multiplied with the texture/albedo maps, on top we mixed in the glossy part with fresnel as a factor. Here I took the most simple solution with a Layer-Weight Node and and RGB Curve to control the fresnel effect (old Chocofur-Approach), but there are better nodegroups floating around for correct fresnel behaviour (google cynicat pro…)

Bake down to 32-bit to keep the scene refered Lightvalues and to avoid flat light and banding issues in postproduction, hope that helps a bit…

1 Like

Wooooow polygonsoul, thank you so much! That’s exactly what I meant! Finally! :star_struck:

So, to be clear: you didn’t bake textures or albedo but the lights instead.
That’s a great idea, you can apply that to every existing object in a scene, regardless whether it’s textured or not, right?

The last part of your comment was a bit difficult for me. Where did you find this trick? Do you have a tutorial for me? Or perhaps a model? :smiley:

And does this way of baking really decrease render times by a lot?

Many thanks again, I felt like being the only person on earth trying to achieve this :sweat_smile:

Good point. Colour bleed can be kinda difficult to tame in some cases. I’ve just desaturated a bit the couple of times I’ve tried it.

I’m getting confused, lol. You want to bake textures or lighting? You can bake all textures you want - say you have a noise node and want to use the result but as a texture map instead of a noise node. But baking already existing texture maps, especially if nothing fancy is done, doesn’t make too much sense.

For baking light, you can still only bake the diffuse/translucency response as that is camera/view angle independent. Cycles doesn’t allow baking of glossy/refractive responses as they are view dependent - they change on the surface with from where you look. And I don’t think there is a way to access prebaked cubemaps from Eevee - which in theory you could be able to add back as emission shader using reflected coords instead of proper shader reacting to light.

1 Like

Hahahaha I am finally starting to get this!

Apparently there’s a difference between texture- and light-baking. Thought those were two names for the same thing. Online everyone uses texture baking (lots of tutorials about it), but in the end I guess it’s light baking I’m after :laughing:
I just want to bake as much as possible in Blender to make my animation rendering smoother.
Than it’s probably light baking I need, right?

Since light baking really seems to make a difference in render times, why should anyone prefer to bake textures? You can’t bake specular, you cannot mix specular with it, so what’s the advantage? Maybe just for people who create Materials without specular… :thinking:

Yes, you are on track. To gather more insight read about light baking for game development, the described workflow is very similar to what is happening inside Unreal Engine, static light baking for high(er) quality lighting used in eg. architectural visualisation. All your objects will need minimum two UV Sets like in UE4, one for the lightmap and one or more for texturing…

Regarding correct fresnel behaviour and math behind it you could check this video:

Rendertimes will be decreased a lot, because Cycles or path tracers in general are quite fast rendering glossy bounces, we rendered interior animations with a way better quality than the example I posted in 20-30sek on 1080 gtx noise free.

Texture baking make sense too, think about heavy procedural shaders baked down to small bitmap images, as Carl G pointed out, again a technique often used in game developement. Even specular baking make sense too, think here about 3D Browsergames/Apps on low end machines or phones/tablets…

Woooow man, thank you so much!!! :ok_hand:t2::ok_hand:t2::ok_hand:t2:
After having searched online for days you put me in the right direction here! Thanks again!
I thought I was going mad here since nobody understood what I meant :laughing:

So… what about color bleeding? Is this something I’lll have to dismiss to use lightmapping? Or do you have some hacks for this as well?