The pbr shader nor working for metallic

Hi all,

I am in chapeter 7, the part which is using pbr render function from Apple’s LODwithFunctionSpecialization. It renders fine with the chest example, however, when I tried to load a model with actual metallic texture, it appears all white for the metal part, no matter what viewing angle. Is there a bug in the shader?

@david402 - I’ve been working on this recently. This is the new PBR shader I came up with:

Let me know what you think.

Metallics are always a bit unsatisfactory without reflection.

@caroline Unfortunately I think it does look more like metal now. I tried to write my own pbr shader based on https://learnopengl.com/PBR/Lighting, and I think it works as well. The Fresnel setting is very important for metallic material it seems.
This is the rendering result from your new shader.


This is my rendering with the implementation from the link above.

I think I messed up something in my renderer, it could not load the metallic texture properly, therefore I hardcoded metallic value to 1 in my shader.
Here is my pbr shader file.

Thank you for replying.