Disable/revert recent refection changes.

PiperOrigin-RevId: 963586393
Change-Id: I65449cfcae4d50664f87296fa69d1660adf60c91
This commit is contained in:
Haroon Qureshi
2026-08-12 12:07:16 -07:00
committed by Copybara-Service
parent fca913b4f5
commit 4929f2cd99
5 changed files with 8 additions and 38 deletions
@@ -15,7 +15,6 @@
material {
name : phong_2d_reflect,
shadingModel : specularGlossiness,
postLightingBlending : add,
flipUV : false,
parameters : [
{ type : float4, name : BaseColorFactor },
@@ -52,12 +51,8 @@ fragment {
material.emissive = vec4(
materialParams.BaseColorFactor.rgb * materialParams.EmissiveFactor, 0.0);
// The reflection is radiance arriving from the mirror direction, so it is
// weighted by the Fresnel term and added after lighting. Reflectance is
// the reflectivity at normal incidence; grazing angles approach a mirror.
// Apply reflection.
vec4 reflection = texture(materialParams_Reflection, screen_uv);
float f0 = materialParams.Reflectance;
float fresnel = f0 + (1.0 - f0) * pow(1.0 - getNdotV(), 5.0);
material.postLightingColor = vec4(reflection.rgb * fresnel, 0.0);
material.baseColor.rgb = mix(material.baseColor.rgb, reflection.rgb, materialParams.Reflectance);
}
}
@@ -15,7 +15,6 @@
material {
name : phong_2d_uv_reflect,
shadingModel : specularGlossiness,
postLightingBlending : add,
flipUV : false,
parameters : [
{ type : float4, name : BaseColorFactor },
@@ -44,12 +43,8 @@ fragment {
material.emissive = vec4(
materialParams.BaseColorFactor.rgb * materialParams.EmissiveFactor, 0.0);
// The reflection is radiance arriving from the mirror direction, so it is
// weighted by the Fresnel term and added after lighting. Reflectance is
// the reflectivity at normal incidence; grazing angles approach a mirror.
// Apply reflection.
vec4 reflection = texture(materialParams_Reflection, screen_uv);
float f0 = materialParams.Reflectance;
float fresnel = f0 + (1.0 - f0) * pow(1.0 - getNdotV(), 5.0);
material.postLightingColor = vec4(reflection.rgb * fresnel, 0.0);
material.baseColor.rgb = mix(material.baseColor.rgb, reflection.rgb, materialParams.Reflectance);
}
}
@@ -15,7 +15,6 @@
material {
name : phong_color_reflect,
shadingModel : specularGlossiness,
postLightingBlending : add,
parameters : [
{ type : float4, name : BaseColorFactor },
{ type : float, name : SpecularFactor },
@@ -37,12 +36,8 @@ fragment {
material.emissive = vec4(
materialParams.BaseColorFactor.rgb * materialParams.EmissiveFactor, 0.0);
// The reflection is radiance arriving from the mirror direction, so it is
// weighted by the Fresnel term and added after lighting. Reflectance is
// the reflectivity at normal incidence; grazing angles approach a mirror.
// Apply reflection.
vec4 reflection = texture(materialParams_Reflection, screen_uv);
float f0 = materialParams.Reflectance;
float fresnel = f0 + (1.0 - f0) * pow(1.0 - getNdotV(), 5.0);
material.postLightingColor = vec4(reflection.rgb * fresnel, 0.0);
material.baseColor.rgb = mix(material.baseColor.rgb, reflection.rgb, materialParams.Reflectance);
}
}
@@ -15,7 +15,6 @@
material {
name : phong_cube_reflect,
shadingModel : specularGlossiness,
postLightingBlending : add,
flipUV : false,
parameters : [
{ type : float4, name : BaseColorFactor },
@@ -51,12 +50,8 @@ fragment {
material.emissive = vec4(
materialParams.BaseColorFactor.rgb * materialParams.EmissiveFactor, 0.0);
// The reflection is radiance arriving from the mirror direction, so it is
// weighted by the Fresnel term and added after lighting. Reflectance is
// the reflectivity at normal incidence; grazing angles approach a mirror.
// Apply reflection.
vec4 reflection = texture(materialParams_Reflection, screen_uv);
float f0 = materialParams.Reflectance;
float fresnel = f0 + (1.0 - f0) * pow(1.0 - getNdotV(), 5.0);
material.postLightingColor = vec4(reflection.rgb * fresnel, 0.0);
material.baseColor.rgb = mix(material.baseColor.rgb, reflection.rgb, materialParams.Reflectance);
}
}
@@ -133,40 +133,30 @@ MaterialManager::MaterialType MaterialManager::GetMaterialType(
} else if (material.orm_texture) {
if (material.opacity_texture) {
return ObjectManager::kPbrPackedTransparent;
} else if (material.reflectance > 0) {
return ObjectManager::kPbrPackedReflect;
} else {
return ObjectManager::kPbrPacked;
}
} else if (material.metallic_texture) {
if (material.opacity_texture) {
return ObjectManager::kPbrPackedTransparent;
} else if (material.reflectance > 0) {
return ObjectManager::kPbrReflect;
} else {
return ObjectManager::kPbr;
}
} else if (material.roughness_texture) {
if (material.color[3] < 1.0f) {
return ObjectManager::kPbrTransparent;
} else if (material.reflectance > 0) {
return ObjectManager::kPbrReflect;
} else {
return ObjectManager::kPbr;
}
} else if (material.metallic >= 0) {
if (material.color[3] < 1.0f) {
return ObjectManager::kPbrTransparent;
} else if (material.reflectance > 0) {
return ObjectManager::kPbrReflect;
} else {
return ObjectManager::kPbr;
}
} else if (material.roughness >= 0) {
if (material.color[3] < 1.0f) {
return ObjectManager::kPbrTransparent;
} else if (material.reflectance > 0) {
return ObjectManager::kPbrReflect;
} else {
return ObjectManager::kPbr;
}