Hey, not sure if anyone else has run into this. But we are using a custom shader in BabylonJS, and on the new M1 chip macs only, it is VERY reflective. On every other machine, materials look fine, but on the M1, everything looks like its made of shiny metal. We are trying to fake mip levels using the following function to choose a mip level between 0 and 3.
roughness = roughness * (1.7 - 0.7 * roughness);
float mip = clamp(roughness * 3.0, 0.0, 3.0);
float mipFloor = floor(mip);
float mipCeil = ceil(mip);
mat4 lods = mat4(textureCube(_EnvironmentMapLOD0, reflUVW, 0.0),
textureCube(_EnvironmentMapLOD1, reflUVW, 0.0),
textureCube(_EnvironmentMapLOD2, reflUVW, 0.0),
textureCube(_EnvironmentMapLOD3, reflUVW, 0.0));
vec4 floors = clamp(vec4(1.0, mipFloor, mipFloor - 1.0, mipFloor - 2.0), vec4(0.0, 0.0, 0.0, 0.0), vec4(1.0, 1.0, 1.0, 1.0));
floors.x -= floors.y;
floors.y -= floors.z;
floors.z -= floors.w;
vec4 rgbFloor = lods * floors;
vec4 ceils = clamp(vec4(1.0, mipCeil, mipCeil - 1.0, mipCeil - 2.0), vec4(0.0, 0.0, 0.0, 0.0), vec4(1.0, 1.0, 1.0, 1.0));
ceils.x -= ceils.y;
ceils.y -= ceils.z;
ceils.z -= ceils.w;
vec4 rgbCeil = lods * ceils;
vec4 rgbm = mix(rgbFloor, rgbCeil, mip - mipFloor);
return GammaToLinearSpace(rgbm).rgb;
Unfortunately, on the M1, that final rgbm value seems like it should be cut in half to look correct. Has anyone else run into something similar?