mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-21 15:45:46 +00:00
gl_shader_gen: Implement fragment lighting fresnel effect.
This commit is contained in:
parent
b07c7c26c6
commit
d376a783ea
3 changed files with 38 additions and 9 deletions
|
@ -713,12 +713,15 @@ struct Regs {
|
|||
}
|
||||
};
|
||||
|
||||
/// Returns true if the specified lighting sampler is supported by the current Pica lighting configuration
|
||||
static bool IsLightingSamplerSupported(LightingConfig config, LightingSampler sampler) {
|
||||
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);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -761,6 +764,7 @@ struct Regs {
|
|||
BitField<0, 3, u32> src_num; // number of enabled lights - 1
|
||||
|
||||
union {
|
||||
BitField< 2, 2, LightingFresnelSelector> fresnel_selector;
|
||||
BitField< 4, 4, LightingConfig> config;
|
||||
BitField<27, 1, u32> clamp_highlights; // 1: GL_TRUE, 0: GL_FALSE
|
||||
};
|
||||
|
@ -768,6 +772,7 @@ struct Regs {
|
|||
union {
|
||||
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
|
||||
|
||||
// Each bit specifies whether distance attenuation should be applied for the
|
||||
// corresponding light
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue