Details
Description
Any mesh with a Default/PrincipledMaterial on it with a base or diffuse map set will sample the texture twice.
This is unacceptable from a performance point of view.
void main() { float qt_objectOpacity = _111.qt_material_properties.w; vec4 qt_vertColor = vec4(1.0); vec3 qt_view_vector = normalize(_111.qt_cameraPosition - qt_varWorldPos); vec3 qt_world_normal = normalize(qt_varNormal); vec3 qt_org_normal = qt_world_normal; vec4 qt_diffuseColor = _111.qt_material_base_color * qt_vertColor; float qt_facing = (step(0.0, dot(qt_view_vector, qt_org_normal)) * 2.0) - 1.0; qt_org_normal *= qt_facing; vec3 qt_specularTint = _111.qt_material_specular.xyz; vec4 param = texture(qt_DiffuseMap_sampler, qt_DiffuseMap_uv_coords1); vec4 qt_base_texture_color = qt_sRGBToLinear(param); qt_diffuseColor *= qt_base_texture_color; float qt_metalnessAmount = _111.qt_material_properties.z; vec4 global_diffuse_light = vec4((_111.qt_light_ambient_total * (1.0 - qt_metalnessAmount)) * qt_diffuseColor.xyz, 0.0); vec3 global_specular_light = vec3(0.0); float qt_shadow_map_occl = 1.0; float qt_lightAttenuation = 1.0; float qt_aoFactor = 1.0; float qt_roughnessAmount = _111.qt_material_properties.y; qt_lightAttenuation = 1.0; qt_shadow_map_occl = 1.0; vec3 tmp_light_color = ubLights.lights[0].diffuse.xyz * (1.0 - qt_metalnessAmount); vec3 param_1 = qt_world_normal; vec3 param_2 = -ubLights.lights[0].direction.xyz; vec3 param_3 = tmp_light_color; vec3 _234 = global_diffuse_light.xyz + ((qt_diffuseColor.xyz * qt_shadow_map_occl) * qt_diffuseReflectionBSDF(param_1, param_2, param_3).xyz); global_diffuse_light = vec4(_234.x, _234.y, _234.z, global_diffuse_light.w); global_diffuse_light = vec4(global_diffuse_light.xyz * qt_aoFactor, qt_objectOpacity * qt_diffuseColor.w); vec3 _257 = global_diffuse_light.xyz + (qt_diffuseColor.xyz * _111.qt_material_emissive_color); global_diffuse_light = vec4(_257.x, _257.y, _257.z, global_diffuse_light.w); vec4 qt_texture_color = texture(qt_DiffuseMap_sampler, qt_DiffuseMap_uv_coords1); global_diffuse_light.w *= (_111.qt_material_base_color.w * qt_texture_color.w); vec3 param_4 = global_diffuse_light.xyz + global_specular_light; fragOutput = vec4(qt_tonemap(param_4), global_diffuse_light.w); }