mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-12 09:09:47 +12:00
Nyom part 2
This commit is contained in:
parent
75f839509e
commit
a903e1b2a4
2 changed files with 4 additions and 5 deletions
|
@ -73,7 +73,7 @@ namespace PICA {
|
|||
BitField<22, 2, u32> shadowSelector;
|
||||
};
|
||||
|
||||
LightingLUTConfig luts[7]{};
|
||||
std::array<LightingLUTConfig, 7> luts{};
|
||||
|
||||
std::array<Light, 8> lights{};
|
||||
|
||||
|
|
|
@ -595,14 +595,13 @@ bool FragmentGenerator::isSamplerEnabled(u32 environmentID, u32 lutID) {
|
|||
|
||||
void FragmentGenerator::compileLUTLookup(std::string& shader, const PICA::FragmentConfig& config, u32 lightIndex, u32 lutID) {
|
||||
uint lutIndex = 0;
|
||||
int bitInConfig1 = 0;
|
||||
bool spotAttenuationEnable = true;
|
||||
|
||||
if (lutID == spotlightLutIndex) {
|
||||
// These are the spotlight attenuation LUTs
|
||||
bitInConfig1 = 8 + (lightIndex & 0x7);
|
||||
lutIndex = 8u + lightIndex;
|
||||
spotAttenuationEnable = config.lighting.lights[lightIndex].spotAttenuationEnable;
|
||||
} else if (lutID <= 6) {
|
||||
bitInConfig1 = 16 + lutID;
|
||||
lutIndex = lutID;
|
||||
} else {
|
||||
Helpers::warn("Shadergen: Unimplemented LUT value");
|
||||
|
@ -611,7 +610,7 @@ void FragmentGenerator::compileLUTLookup(std::string& shader, const PICA::Fragme
|
|||
const bool samplerEnabled = isSamplerEnabled(config.lighting.config, lutID);
|
||||
const LightingLUTConfig& lut = config.lighting.luts[lutID];
|
||||
|
||||
if (!samplerEnabled || !lut.enable) {
|
||||
if (!samplerEnabled || !lut.enable || !spotAttenuationEnable) {
|
||||
shader += "lut_lookup_result = 1.0;\n";
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue