PBR color difference in example



I noticed something in the PBR example. Compared to the original Cerberus asset, the pistol’s colors in the bs example seem to be much brighter.

This is how the original looks:

And this is the PBR example:

I only changed the environment map to a more similar one to make it more obvious. Now I don’t think this is a bug, so maybe you know the reason for the difference? It looks the same as the original in every PBR example I could find on github, so it shouldn’t be some completely different kind of PBR implementation, right? Messing around with HDR and tonemapping didn’t make any difference either.

I just don’t want to mess up the asset creation. Love bs::f so far, good job.



I don’t think you need to worry about messing up your asset creation - it’s either a bug or something that can be adjusted using settings.

My best guess that it’s due to exposure. Try turning off auto exposure (enableAutoExposure on RenderSettings in CCamera component) and try tweaking the exposure manually. See if you can get a similar result as with other examples.

My other guess is indirect lighting - depending which example you have compared it with, it might not have indirect lighting applied, which would make everything appear darker. Since you are using a different environment map, it could also be much brighter than in other examples.

Let me know how it goes. If you still can’t find settings that compares with other examples, give me a link to a particular one and I’ll test it myself in case something is going wrong internally.


Thank you very much for your suggestions. Tweaking the exposure didn’t help unfortunately, however you were right about indirect lighting.

In the example image in my original post, the wooden part looks correct and the metallic part is too bright. If I disable indirect lighting, it looks like this:

The metallic part looks correct (darker) and the wooden part doesn’t, which makes sense. Now maybe I’m completely wrong… But if I remember correctly, a fully metallic material shouldn’t reflect diffuse(?) light the way it currently does with indirect lighting enabled, right?

At least this seems to be what’s happening here. Metallic materials currently reflect indirect diffuse light when they should only reflect specular light, making the material appear too bright. Sorry if the terms are wrong, it’s been a few years.

So could it actually be a bug in the standard PBR shader?


Yep, you’ve hit the nail right on the head. I’ve taken a quick look at the indirect diffuse calculations and they appear to be ignoring the metalness of the surface.

I should have a fix for this early next week. I’ll let you know.


Awesome, thank you! This framework is exactly what I was looking for.


I’ve submitted a fix for the incorrect indirect diffuse, hopefully that resolves your issue. 287ae88d