Blender model no longer reflective in three.js

Here is a demo of an aircraft in WebGL2 r165. This model was updated to Blender 3.02. Everything is nice and shiny, no error messages.

When I displayed the model in WebGPU r169, it was also nice and shiny. But WebGPU noted there were some UV errors. The right wing which was no longer textured and the glass was missing UVs. I loaded the model into Blender v4.2 (the latest), fixed the errors and exported the result to a glb file. However, as can be seen here, all the reflections are now gone. (I get the same result if I load the v4.2 model into the WebGL2 r165, so this is not a WebGPU problem.)

As far as I can tell my program conforms with WebGPU requirements, as illustrated in webgpu_materials_envmaps.html.

Here is the code for the Skybox:

envMap = cubeLoader
    .setPath(SBxSrc)
    .load(["px.jpg", "nx.jpg", "py.jpg", "ny.jpg", "pz.jpg", "nz.jpg"]);
envMap.format = THREE.RGBAFormat; // required?
envMap.colorSpace = THREE.SRGBColorSpace; // r152 change
scene.background = envMap;
scene.environment = envMap; // ??? required?

Here is the code for the gltf loader:

gltfLoader.load(mxr_.Src, function (gltf) {
    gltf.scene.traverse(function (child) {
        if (child.isMesh) {
            child.material.envMap = envMap;
            ...
            child.material.needsUpdate = true; // probably not required
        }
    });

My model displays reflective materials using a Blender shader setup which includes a glTF Metallic shader:

As I test, I have modified the shader setup for the first section of the fuselage to use a Principled BSDF shader, like this:

This appears to agree with the setup shown in the Blender 4.2 here

I suspect that this is a Blender problem (that may date back to Blender v3.3, the oldest version I have). But I am hoping that someone on this message board might have run into and solved this problem.

THANKS!
You got me pointed in the right direction. I needed to change the ORM map. The front section of the fuselage is now reflective - perhaps too much - but I can fix that over time.

I don’t know if you want the roughnessFactor connected to the same map? I think that’s just a multiplier for the roughness read from the metallicroughness map?

edit: nvm ignore this. i wasn’t looking at your current setup…

1 Like

maybe the time you saw it super reflective in r169, the roughness map was bugged/disconnected, and then it was later fixed?

here’s how it looks in gltf report… its not super shiny due to the roughness map i think…

1 Like

I wondered about that too.

The map I am using is what I call an ORM map and is a combination of three maps, the red channel has an occlusion map, the green channel a roughness map and the blue channel is a metallic map. As far as I can tell, that is still used in gltf models.

The Blender handbook indicates that this kind of map is still used:

“When using an image, glTF expects the metallic values to be encoded in the blue (B) channel, and roughness to be encoded in the green (G) channel of the same image.”

In the discussion of Baked Ambient Occlusion, the handbook notes that there is now a glTF Material Output which you can use to display the red (Occlusion) channel. The last example in that section shows a setup which appears to use an ORM map in the same kind of setup that I tried - but which had no effect.

The Normal map setup appears just below that and appears to match what I have tried…

There is an off-chance that my version of Blender is not working correctly. I can no longer use the middle mouse button to orbit the model… I have tried reloading and resetting it to factory specs, but that hasn’t fixed that particular problem. Everything else seems to work.

As far as I can tell, my export settings haven’t changed. But I haven’t used Blender for a couple of years (just after they made the exporter part of the program), so I could have missed some important changes.

I do get full reflections if I disconnect the RM maps and set the metallic to 1 and roughness to 0. So that indicates that the problems may be in the maps. Perhaps I need to invert the colors.

The material I am changing is txt_fuse1.

yeah perhaps… though a realistic brushed aluminum plane skin would have some roughness prolly… unless it was painted… like… it looks kinda “correct” to me in the gltf-report screenshot. whatever looks good tho i guess. :smiley:

Yes, I don’t want to overdo the reflections. They might have been nice and shiny when they arrived (like Doc) but that would fade over time due to salt air and corrosion. I was going to add a picture of a real B-29, but some look completely non-reflective, while others look slightly reflective.

The reflective map did appear the opposite of what I expected, the painted areas were supposed to be less reflective, but had higher values. The occlusion maps were not a factor since they were entirely white.

1 Like