citro3d  1.2.0
fog.h
Go to the documentation of this file.
1 #pragma once
2 #include "types.h"
3 #include <math.h>
4 
5 typedef struct
6 {
7  u32 data[128];
8 } C3D_FogLut;
9 
10 typedef struct
11 {
12  u32 diff[8];
13  u32 color[8];
14 } C3D_GasLut;
15 
16 static inline float FogLut_CalcZ(float depth, float near, float far)
17 {
18  return far*near/(depth*(far-near)+near);
19 }
20 
21 void FogLut_FromArray(C3D_FogLut* lut, const float data[256]);
22 void FogLut_Exp(C3D_FogLut* lut, float density, float gradient, float near, float far);
23 
24 void C3D_FogGasMode(GPU_FOGMODE fogMode, GPU_GASMODE gasMode, bool zFlip);
25 void C3D_FogColor(u32 color);
26 void C3D_FogLutBind(C3D_FogLut* lut);
27 
28 void GasLut_FromArray(C3D_GasLut* lut, const u32 data[9]);
29 
30 void C3D_GasBeginAcc(void);
31 void C3D_GasDeltaZ(float value);
32 
33 void C3D_GasAccMax(float value);
34 void C3D_GasAttn(float value);
35 void C3D_GasLightPlanar(float min, float max, float attn);
36 void C3D_GasLightView(float min, float max, float attn);
37 void C3D_GasLightDirection(float dotp);
38 void C3D_GasLutInput(GPU_GASLUTINPUT input);
39 void C3D_GasLutBind(C3D_GasLut* lut);
void C3D_GasLutInput(GPU_GASLUTINPUT input)
Definition: gas.c:125
void FogLut_FromArray(C3D_FogLut *lut, const float data[256])
Definition: fog.c:3
void C3D_FogColor(u32 color)
Definition: fog.c:58
void C3D_GasLightPlanar(float min, float max, float attn)
Definition: gas.c:88
void C3D_GasDeltaZ(float value)
Definition: gas.c:52
static float FogLut_CalcZ(float depth, float near, float far)
Definition: fog.h:16
void C3D_GasLightView(float min, float max, float attn)
Definition: gas.c:100
void FogLut_Exp(C3D_FogLut *lut, float density, float gradient, float near, float far)
Definition: fog.c:30
void C3D_GasAccMax(float value)
Definition: gas.c:64
void C3D_FogLutBind(C3D_FogLut *lut)
Definition: fog.c:69
void C3D_GasAttn(float value)
Definition: gas.c:76
void C3D_GasBeginAcc(void)
Definition: gas.c:42
void C3D_FogGasMode(GPU_FOGMODE fogMode, GPU_GASMODE gasMode, bool zFlip)
Definition: fog.c:46
void GasLut_FromArray(C3D_GasLut *lut, const u32 data[9])
Definition: gas.c:30
void C3D_GasLutBind(C3D_GasLut *lut)
Definition: gas.c:138
void C3D_GasLightDirection(float dotp)
Definition: gas.c:112
Definition: fog.h:6
Definition: fog.h:11
float24Uniform_s * data
Definition: uniforms.c:16