sm64coopdx/actors/sparkle_animation/model.inc.c
Agent X 19a429dbe5
Add built-in preset screen shader effects configurable through Lua (#1217)
* C++ lighting engine

Runs better using my new system for storing and iterating through lights.

I removed the lighting ctx profiler because after I've realized its very inaccurate and was probably programmed incorrectly from the start. Although I remember it working fine before and not constantly showing 20 ms or higher when I'm in an extremely simple level with extremely simple lights and the FPS is way too high for it to be taking 20 ms.

* Whoops

* Make some optimizations

* Fix small bug with LE inside graphics vertex function

I also brought back the lighting profiler because it's better than nothing.

* Some optimizations

* Cache active lights and 4 lights per vertex limit

Less branching and less iterating with the limit

* Screen shader effects for Lua [OpenGL]

Hue, saturation, brightness, contrast, exposure, dithering, posterization

Global = usually an object in the world
Non global = usually a screen element

Also:
* Changed skyboxes to use environment color instead of vertex color, visually identical
* Changed hud head texture to be non global
* changed power meter to be non global
* changed sparkles to be global
* changed some BBH vertex types to global

OpenGL renderer supported only for now.

* Add default values and better function names

Also fixed sizes in reset function

* Add scanlines effect

* Add global enabled function

* Fix some default values

* Hopefully fix white sparkles

* Whoops

* Address review

* Update function names

* Fix shader crash

* Address reviews
2026-05-11 15:59:48 -04:00

75 lines
3.3 KiB
C

#include "pc/rom_assets.h"
// Sparkles Animation
// 0x04032A48
ROM_ASSET_LOAD_VTX(sparkles_animation_seg4_vertex_04032A48, 0x00114750, 78432, 0x00032a48, 64);
// 0x04032A88
ROM_ASSET_LOAD_TEXTURE(sparkles_animation_seg4_texture_04032A88, "actors/sparkle_animation/sparkle_animation_0.ia16.inc.c", 0x00114750, 78432, 0x00032a88, 2048);
// 0x04033288
ROM_ASSET_LOAD_TEXTURE(sparkles_animation_seg4_texture_04033288, "actors/sparkle_animation/sparkle_animation_1.ia16.inc.c", 0x00114750, 78432, 0x00033288, 2048);
// 0x04033A88
ROM_ASSET_LOAD_TEXTURE(sparkles_animation_seg4_texture_04033A88, "actors/sparkle_animation/sparkle_animation_2.ia16.inc.c", 0x00114750, 78432, 0x00033a88, 2048);
// 0x04034288
ROM_ASSET_LOAD_TEXTURE(sparkles_animation_seg4_texture_04034288, "actors/sparkle_animation/sparkle_animation_3.ia16.inc.c", 0x00114750, 78432, 0x00034288, 2048);
// 0x04034A88
ROM_ASSET_LOAD_TEXTURE(sparkles_animation_seg4_texture_04034A88, "actors/sparkle_animation/sparkle_animation_4.ia16.inc.c", 0x00114750, 78432, 0x00034a88, 2048);
// 0x04035288 - 0x04035300
const Gfx sparkles_animation_seg4_dl_04035288[] = {
gsSPClearGeometryMode(G_LIGHTING),
gsDPSetCombineMode(G_CC_FADEA, G_CC_FADEA),
gsDPSetEnvColor(255, 255, 100, 255),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetTile(G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 5, G_TX_NOLOD),
gsDPLoadSync(),
gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)),
gsDPSetTile(G_IM_FMT_IA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 5, G_TX_NOLOD),
gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC),
gsSPVertex(sparkles_animation_seg4_vertex_04032A48, 4, 0),
gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF),
gsSPSetGeometryMode(G_LIGHTING),
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
gsDPSetEnvColor(255, 255, 255, 255),
gsSPEndDisplayList(),
};
// 0x04035300 - 0x04035318
const Gfx sparkles_animation_seg4_dl_04035300[] = {
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, sparkles_animation_seg4_texture_04032A88),
gsSPBranchList(sparkles_animation_seg4_dl_04035288),
};
// 0x04035318 - 0x04035330
const Gfx sparkles_animation_seg4_dl_04035318[] = {
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, sparkles_animation_seg4_texture_04033288),
gsSPBranchList(sparkles_animation_seg4_dl_04035288),
};
// 0x04035330 - 0x04035348
const Gfx sparkles_animation_seg4_dl_04035330[] = {
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, sparkles_animation_seg4_texture_04033A88),
gsSPBranchList(sparkles_animation_seg4_dl_04035288),
};
// 0x04035348 - 0x04035360
const Gfx sparkles_animation_seg4_dl_04035348[] = {
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, sparkles_animation_seg4_texture_04034288),
gsSPBranchList(sparkles_animation_seg4_dl_04035288),
};
// 0x04035360 - 0x04035378
const Gfx sparkles_animation_seg4_dl_04035360[] = {
gsDPPipeSync(),
gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, sparkles_animation_seg4_texture_04034A88),
gsSPBranchList(sparkles_animation_seg4_dl_04035288),
};