From 348c9c9ff32a493a005da72dba1832da118e4b0b Mon Sep 17 00:00:00 2001 From: bunnei Date: Wed, 25 Nov 2015 20:25:02 -0500 Subject: gl_shader_gen: Implement lighting red, green, and blue reflection. --- src/video_core/pica.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/video_core/pica.h') diff --git a/src/video_core/pica.h b/src/video_core/pica.h index 76db51038..267070e45 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h @@ -650,9 +650,9 @@ struct Regs { Distribution0 = 0, Distribution1 = 1, Fresnel = 3, - Blue = 4, - Green = 5, - Red = 6, + ReflectBlue = 4, + ReflectGreen = 5, + ReflectRed = 6, SpotlightAttenuation = 8, DistanceAttenuation = 16, }; @@ -718,10 +718,19 @@ struct Regs { switch (sampler) { case LightingSampler::Distribution0: return (config != LightingConfig::Config1); + case LightingSampler::Distribution1: return (config != LightingConfig::Config0) && (config != LightingConfig::Config1) && (config != LightingConfig::Config5); + case LightingSampler::Fresnel: return (config != LightingConfig::Config0) && (config != LightingConfig::Config2) && (config != LightingConfig::Config4); + + case LightingSampler::ReflectRed: + return (config != LightingConfig::Config3); + + case LightingSampler::ReflectGreen: + case LightingSampler::ReflectBlue: + return (config == LightingConfig::Config4) || (config == LightingConfig::Config5) || (config == LightingConfig::Config7); } return false; } @@ -773,6 +782,9 @@ struct Regs { BitField<16, 1, u32> lut_enable_d0; // 0: GL_TRUE, 1: GL_FALSE BitField<17, 1, u32> lut_enable_d1; // 0: GL_TRUE, 1: GL_FALSE BitField<19, 1, u32> lut_enable_fr; // 0: GL_TRUE, 1: GL_FALSE + BitField<20, 1, u32> lut_enable_rr; // 0: GL_TRUE, 1: GL_FALSE + BitField<21, 1, u32> lut_enable_rg; // 0: GL_TRUE, 1: GL_FALSE + BitField<22, 1, u32> lut_enable_rb; // 0: GL_TRUE, 1: GL_FALSE // Each bit specifies whether distance attenuation should be applied for the // corresponding light -- cgit v1.2.3