PBR: Shadeless lighting disables some material channels


(Klaasnienhuis) #1

I've noticed that setting the lighting mode to shadeless in PBR disables some material channels. In my case I wanted to use my baked lightmaps as occlusion maps but I was unable to do so.

Separating diffuse colors or textures from the lightmaps has some benefits. It makes it possible to tweak the diffuse in the sketchfab editor without having to redo the lightbake. But most of all it makes it possible to do this through the API in a configurator. You could have a nicely baked model while being able to change the color at the same time without the need of having to bake a texture for each color variation.

Is there a way to have the lit lighting mode and have access to the full PBR shader?


(Stephomi) #2

In shadeless PBR, we only keep the albedo/baseColor and the EmitColor.
Maybe, to be consistent with classic mode, we could probably multiply with the cavity and the AO indeed.

Hmm, I'm not sure I get it, with PBR lit mode it should work ?
Note that AO can't be colored though.

Here's basically the pbr shader :

Alpha * ( Cavity * ( EnvironmentSpec{roughness/specular} * AOspec + EnvironmentDiffuse{diffuse} * AO + EmitColor + LightPonctual{diffuse/roughness/specular}) )

#3

Did you mean "...have the shadeless lighting mode..." ?


(Klaasnienhuis) #4

@stephomi @james, yes, I'm totally confusing myself. Indeed I'd like to have the shadeless mode with access to the basecolor and the AO. I understand AO is a bw map which is multiplied. That's exactly what I'm aiming at.

The issue I have with the lit mode is that the sketchfab lighting adds a lot of, well light. I can set up my base color and baked AO in lit mode but the lighting makes everything a lot brighter than I intend. If there's a way to have some shaders ignore the lighting in lit mode (my baked shaders) while others use the lighting (glass for instance) then I'd like to hear about it!


(Stephomi) #5

Hmm, I'm confused, you can't control the lights?
As you can see in the equation above the AO only darken the environment contribution, so maybe you are relying too much on the ponctual lighting (that is only darkened with the cavity).

We'll probably update the shadeless PBR mode to include emit and AO (so basically Cavity * ( Diffuse * AO + EmitColor)), but for now we don't think it's a good idea to have "shadeless materials".


(Klaasnienhuis) #6

Well, I'm having a hard time controlling the lights in this instance, yes. Since I have baked textures I'd like the lights not affect those materials. Shadeless mode lets me do this. When I'm in pbr lit mode I need some lighting to be able to see my materials, either the point/directional lights or the environment lighting. But I don't want these lights to affect the color or shading of my materials.

Since I want to separate my diffuse color from the baked AO map I have to use the lit mode. But there's no omnidirectional, smooth lighting option. The hemi light would be good, but that doesn't work in pbr.

You say you'll update the shadeless pbr mode but you actually advise against it. How would you suggest I set up my material?


(Stephomi) #7

By "shadeless materials" I meant "shadeless materials in the PBR lit mode".

I think that might be the real issue here since the shading of the materials in PBR is driven by the lights.
In a near future, you might upload a custom environment (not sure what a flat color would look like though)

We'll ping you back when the shadeless PBR will be live (probably on the next-next release).
Until then, if you want to use the shadeless mode you can probably just use the classic mode, as it's basically the same operation Diffuse * Lightmap + EmitColor


(Klaasnienhuis) #8

Thanks @stephomi, I'll go with the classic mode for now.