Changes in gloss 2.16.2 vs 1.64.4

Hi everyone, I’ve just updated project to 2.16.2, can clearly see there were changes how gloss and metalness act, can’t really find the issue

function changeReflectivity() {
    const reflectivitySlider = document.getElementById('reflectivitySlider');
    entity = pc.app.root.findByName('Camera').script.pickerFramebuffer.lastSelectedEntity;
    if (entity && entity.render) {


    if (reflectivitySlider.value == 0) {
       entity.render.material.gloss = 0;
       entity.render.material.metalness = 0;
       entity.render.material.useMetalness = false;
    } else {
       entity.render.material.gloss = reflectivitySlider.value;
       entity.render.material.metalness = 0;
       entity.render.material.useMetalness = true;
    }

    entity.render.material.gloss = reflectivitySlider.value;
    entity.render.material.update();

    }   
}

In old version, “reflectivity” changed visibly from 0 to 0.1 to 1, now in the new version I can only see “minor” change from 0 to 0.1, anything more ~> identical outcome as 0.1

Hi, there have been several changes to specular/reflection handling in recent engine versions that could be affecting what you’re seeing, including:

  • #8287 — Changed Fresnel F90 calculation

  • #8299 — New isotropic GGX specular implementation

  • #8293 — Fix to KHR_materials_specular for metals and diffuse

  • #6755 — Removal of deprecated Phong specular model

Some workarounds you can try to get a more visible gloss range:

  1. Enable GGX specular on the material:

entity.render.material.enableGGXSpecular = true;

  1. Increase the IOR to boost the base reflectivity:

entity.render.material.refractiveIndex = 2.5; // default is 1.5

  1. Use a small metalness value instead of 0 to get stronger specular response:

entity.render.material.metalness = 0.15;

Also a small bug in your code — you’re setting gloss after the if/else block, which overwrites whatever was set inside it:

entity.render.material.gloss = reflectivitySlider.value;

And if the material was loaded from a glTF file, glossInvert may be true, meaning 0 = shiny and 1 = rough (opposite of what you might expect).