|
SSBM Decomp
|
Refraction visual effects using GX indirect textures. More...
#include "lbrefract.h"#include "lb/types.h"#include <math.h>#include <dolphin/gx/GXTexture.h>#include <baselib/cobj.h>#include <baselib/debug.h>#include <baselib/dobj.h>#include <baselib/state.h>#include <MetroTRK/intrinsics.h>Macros | |
| #define | SIGN_BIT (1 << 31) |
| #define | BITWISE(f) (*(u32*) &f) |
| #define | SIGNED_BITWISE(f) ((s32) BITWISE(f)) |
| #define | GET_SIGN_BIT(f) (SIGNED_BITWISE(f) & SIGN_BIT) |
| #define | BITWISE_PI_2 0x3FC90FDB |
| #define | NAN MSL_TrigF_80400770[0] |
| #define | INF MSL_TrigF_80400774[0] |
| #define | SILVER_RATIO_1_CONJUGATE lbRefract3_804D7DD4 |
| #define | BITWISE_INF 0x7F800000 /* = +Infinity */ |
| #define | BITWISE_0_5 0x3F000000 /* = 0.5f */ |
| #define | BITWISE_1_0 0x3F800000 /* = 1.0f */ |
| #define | BITWISE_2_0 0x40000000 /* = 2.0f */ |
| #define | BITWISE_THRESHOLD_0 0x3F08D5B9 /* = 0.534511148929596f */ |
| #define | BITWISE_THRESHOLD_1 0x3F521801 /* = 0.8206787705421448f */ |
| #define | BITWISE_THRESHOLD_2 0x3F9BF7EC /* = 1.218503475189209f */ |
| #define | BITWISE_THRESHOLD_3 0x3FEF789E /* = 1.870868444442749f */ |
Functions | |
| static void | lbRefract_WriteTexCoordIA4 (lbRefract_CallbackData *data, s32 row, u32 col, u32 arg3, u8 arg4, u8 intensity, u8 alpha) |
| Write IA4 texture coordinate to refraction buffer. | |
| static UNK_RET | fn_80021F70 (UNK_PARAMS) |
| static UNK_RET | fn_80021FB4 (UNK_PARAMS) |
| static UNK_RET | fn_80021FF8 (UNK_PARAMS) |
| static UNK_RET | fn_8002206C (UNK_PARAMS) |
| static void | lbRefract_DObjDispReset (HSD_DObj *dobj, Mtx vmtx, Mtx pmtx, u32 rendermode) |
| Display DObj then reset TEV/indirect stages for refraction cleanup. | |
| static void | lbRefract_ReadTexCoordRGBA8 (lbRefract_CallbackData *data, s32 row, u32 col, u32 *out_r, u32 *out_g, u8 *out_b, u8 *out_a) |
| Read RGBA8 texture coordinate addresses from refraction buffer. | |
| static float | lbRefract_80022DF8 (float x) |
| s32 | lbRefract_8002219C (lbRefract_CallbackData *data, s32 buffer, s32 format, u16 width, u16 height) |
| Initialize refraction callback data for a texture buffer. | |
| void | lbRefract_8002247C (HSD_CObj *cobj) |
| Copy framebuffer to refraction source texture. | |
| void | lbRefract_80022560 (void) |
| Copy framebuffer to refraction source texture. | |
| void | lbRefract_800225D4 (void) |
| Reset TEV and indirect texture stages. | |
| void | lbRefract_80022BB8 (void) |
| Increment refraction effect user count. | |
| void | lbRefract_80022BD0 (void) |
| Decrement refraction effect user count. | |
| float | atan2f (float y, float x) |
| float | acosf (float x) |
| float | asinf (float x) |
| float | atanf (float x) |
Variables | |
| HSD_DObjInfo | hsdDObj |
| static int | lbl_804336D0 [0x10] |
| float | MSL_TrigF_80400770 [] |
| float | MSL_TrigF_80400774 [] |
| static const float | atanf_lookup [] |
Refraction visual effects using GX indirect textures.
Uses reference counting to track active effect users. Supports IA4, IA8, and RGBA8 texture formats.
| #define SIGN_BIT (1 << 31) |
| #define BITWISE | ( | f | ) | (*(u32*) &f) |
| #define GET_SIGN_BIT | ( | f | ) | (SIGNED_BITWISE(f) & SIGN_BIT) |
| #define BITWISE_PI_2 0x3FC90FDB |
| #define NAN MSL_TrigF_80400770[0] |
| #define INF MSL_TrigF_80400774[0] |
| #define SILVER_RATIO_1_CONJUGATE lbRefract3_804D7DD4 |
| #define BITWISE_INF 0x7F800000 /* = +Infinity */ |
| #define BITWISE_0_5 0x3F000000 /* = 0.5f */ |
| #define BITWISE_1_0 0x3F800000 /* = 1.0f */ |
| #define BITWISE_2_0 0x40000000 /* = 2.0f */ |
| #define BITWISE_THRESHOLD_0 0x3F08D5B9 /* = 0.534511148929596f */ |
| #define BITWISE_THRESHOLD_1 0x3F521801 /* = 0.8206787705421448f */ |
| #define BITWISE_THRESHOLD_2 0x3F9BF7EC /* = 1.218503475189209f */ |
| #define BITWISE_THRESHOLD_3 0x3FEF789E /* = 1.870868444442749f */ |
|
static |
Write IA4 texture coordinate to refraction buffer.
|
static |
|
static |
|
static |
|
static |
|
static |
Display DObj then reset TEV/indirect stages for refraction cleanup.
|
static |
Read RGBA8 texture coordinate addresses from refraction buffer.
|
inlinestatic |
| s32 lbRefract_8002219C | ( | lbRefract_CallbackData * | data, |
| s32 | buffer, | ||
| s32 | format, | ||
| u16 | width, | ||
| u16 | height | ||
| ) |
Initialize refraction callback data for a texture buffer.
| data | Callback data to initialize. |
| buffer | Base address of texture buffer. |
| format | Texture format (3=IA4, 4=IA8, 6=RGBA8). |
| width | Texture width in pixels. |
| height | Texture height in pixels. |
| void lbRefract_8002247C | ( | HSD_CObj * | cobj | ) |
Copy framebuffer to refraction source texture.
| void lbRefract_80022560 | ( | void | ) |
Copy framebuffer to refraction source texture.
| void lbRefract_800225D4 | ( | void | ) |
Reset TEV and indirect texture stages.
| void lbRefract_80022BB8 | ( | void | ) |
Increment refraction effect user count.
| void lbRefract_80022BD0 | ( | void | ) |
Decrement refraction effect user count.
| float atan2f | ( | float | y, |
| float | x | ||
| ) |
| float acosf | ( | float | x | ) |
| float asinf | ( | float | x | ) |
| float atanf | ( | float | x | ) |
|
extern |
|
static |
|
extern |
| float MSL_TrigF_80400774[] |
|
static |