6 for (i = 0; i < 128; i ++)
8 float in =
data[i], diff =
data[i+128];
14 val = (in < 0x800) ? (u32)in : 0x7FF;
21 if (diff < -0x1000) diff = -0x1000;
22 else if (diff > 0xFFF) diff = 0xFFF;
23 val2 = (s32)diff & 0x1FFF;
26 lut->data[i] = val2 | (val << 13);
30void FogLut_Exp(C3D_FogLut* lut,
float density,
float gradient,
float near,
float far)
34 for (i = 0; i <= 128; i ++)
36 float x = FogLut_CalcZ(i/128.0f, near, far);
37 float val = expf(-powf(density*x, gradient));
55 ctx->
texEnvBuf |= (fogMode&7) | ((gasMode&1)<<3) | (zFlip ? BIT(16) : 0);
81 ctx->
flags &= ~C3DiF_FogLut;
void FogLut_FromArray(C3D_FogLut *lut, const float data[256])
void C3D_FogColor(u32 color)
void FogLut_Exp(C3D_FogLut *lut, float density, float gradient, float near, float far)
void C3D_FogLutBind(C3D_FogLut *lut)
void C3D_FogGasMode(GPU_FOGMODE fogMode, GPU_GASMODE gasMode, bool zFlip)