diff options
Diffstat (limited to 'src/video_core/swrasterizer/lighting.cpp')
| -rw-r--r-- | src/video_core/swrasterizer/lighting.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/video_core/swrasterizer/lighting.cpp b/src/video_core/swrasterizer/lighting.cpp index b38964530..5fa748611 100644 --- a/src/video_core/swrasterizer/lighting.cpp +++ b/src/video_core/swrasterizer/lighting.cpp | |||
| @@ -230,7 +230,8 @@ std::tuple<Math::Vec4<u8>, Math::Vec4<u8>> ComputeFragmentsColors( | |||
| 230 | d1_lut_value * refl_value * light_config.specular_1.ToVec3f(); | 230 | d1_lut_value * refl_value * light_config.specular_1.ToVec3f(); |
| 231 | 231 | ||
| 232 | // Fresnel | 232 | // Fresnel |
| 233 | if (lighting.config1.disable_lut_fr == 0 && | 233 | // Note: only the last entry in the light slots applies the Fresnel factor |
| 234 | if (light_index == lighting.max_light_index && lighting.config1.disable_lut_fr == 0 && | ||
| 234 | LightingRegs::IsLightingSamplerSupported(lighting.config0.config, | 235 | LightingRegs::IsLightingSamplerSupported(lighting.config0.config, |
| 235 | LightingRegs::LightingSampler::Fresnel)) { | 236 | LightingRegs::LightingSampler::Fresnel)) { |
| 236 | 237 | ||
| @@ -242,14 +243,14 @@ std::tuple<Math::Vec4<u8>, Math::Vec4<u8>> ComputeFragmentsColors( | |||
| 242 | if (lighting.config0.fresnel_selector == | 243 | if (lighting.config0.fresnel_selector == |
| 243 | LightingRegs::LightingFresnelSelector::PrimaryAlpha || | 244 | LightingRegs::LightingFresnelSelector::PrimaryAlpha || |
| 244 | lighting.config0.fresnel_selector == LightingRegs::LightingFresnelSelector::Both) { | 245 | lighting.config0.fresnel_selector == LightingRegs::LightingFresnelSelector::Both) { |
| 245 | diffuse_sum.a() *= lut_value; | 246 | diffuse_sum.a() = lut_value; |
| 246 | } | 247 | } |
| 247 | 248 | ||
| 248 | // Enabled for the specular lighting alpha component | 249 | // Enabled for the specular lighting alpha component |
| 249 | if (lighting.config0.fresnel_selector == | 250 | if (lighting.config0.fresnel_selector == |
| 250 | LightingRegs::LightingFresnelSelector::SecondaryAlpha || | 251 | LightingRegs::LightingFresnelSelector::SecondaryAlpha || |
| 251 | lighting.config0.fresnel_selector == LightingRegs::LightingFresnelSelector::Both) { | 252 | lighting.config0.fresnel_selector == LightingRegs::LightingFresnelSelector::Both) { |
| 252 | specular_sum.a() *= lut_value; | 253 | specular_sum.a() = lut_value; |
| 253 | } | 254 | } |
| 254 | } | 255 | } |
| 255 | 256 | ||