[ADD] - 3D Scenes for pre-render areas (#5804)

* Hard removal 2D ones for now

* override some scene values for prerender tests (#46)

* Adult Link Cloudy

* Fix: Child Link Night ToT Exterior

* Fix for real now

* Tweak: Skybox castle courtyard

* WIP - adjusting for patterns

* Hooked all code, needs testing

* Hookified

* Clean up

* Update Fog Control

* clang

* Fix skybox override to only affect 3D pre-rendered scenes

Prevent the 3D scene renderer from overriding skyboxes on all scenes

Previously, the function was applying skybox changes to every scene, overriding the intended skyboxes throughout the game (Example: Kokiri Forest with a blue sky instead of it's original "greyish" one)
Now it only applies custom skybox settings to scenes in the skyboxControlList, preserving original skyboxes for other scenes

* Remove commentary and forgot to add Zelda's courtyard skybox

* Move code to shipInit.

* Early return for VB_SHOULD.

* clang

* Fix missing !

* Feedback fixes.

* clang

* Fix CVAR

* Modify Skybox for scenes with multiple viewpoints.

* setting position change to blend in the "modder stuff can do"

* Adressed review

* tooltip space missing, oops

* InitFunc

---------

Co-authored-by: Archez <Archez@users.noreply.github.com>
Co-authored-by: Caladius <clatini88@gmail.com>
This commit is contained in:
PurpleHato
2025-10-01 04:03:55 +02:00
committed by GitHub
parent 5ed3db0a7e
commit e10b882c08
11 changed files with 212 additions and 5 deletions

View File

@@ -1390,6 +1390,8 @@ void Play_Draw(PlayState* play) {
Gfx_SetupFrame(gfxCtx, 0, 0, 0);
if ((HREG(80) != 10) || (HREG(82) != 0)) {
GameInteractor_ExecuteOnPlayDrawBegin();
POLY_OPA_DISP = Play_SetFog(play, POLY_OPA_DISP);
POLY_XLU_DISP = Play_SetFog(play, POLY_XLU_DISP);

View File

@@ -5,6 +5,7 @@
#include "global.h"
#include "vt.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include <string.h>
#include <assert.h>
@@ -256,6 +257,9 @@ s32 swapAndConvertJPEG(void* data) {
void Room_DrawBackground2D(Gfx** gfxP, void* tex, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 tlutMode,
u16 tlutCount, f32 offsetX, f32 offsetY) {
if (!GameInteractor_Should(VB_DRAW_2D_BACKGROUND, true)) {
return;
}
Gfx* gfx = *gfxP;
uObjBg* bg;

View File

@@ -71,6 +71,9 @@
#include "assets/textures/skyboxes/vr_holy1_static.h"
#include "assets/textures/skyboxes/vr_holy1_pal_static.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
u32 D_8012AC90[4] = {
0x00000000,
0x00010000,
@@ -449,17 +452,23 @@ void func_800AF178(SkyboxContext* skyboxCtx, s32 arg1) {
void LoadSkyboxTex(SkyboxContext* skyboxCtx, int segmentIndex, int imageIndex, char* tex, int width, int height,
int offsetW, int offsetH) {
skyboxCtx->textures[segmentIndex][imageIndex] = tex;
if (GameInteractor_Should(VB_LOAD_SKYBOX, true)) {
skyboxCtx->textures[segmentIndex][imageIndex] = tex;
}
}
void LoadSkyboxTexAtOffset(SkyboxContext* skyboxCtx, int segmentIndex, int imageIndex, char* tex, int width, int height,
int offset) {
skyboxCtx->textures[segmentIndex][imageIndex] = tex;
if (GameInteractor_Should(VB_LOAD_SKYBOX, true)) {
skyboxCtx->textures[segmentIndex][imageIndex] = tex;
}
}
void LoadSkyboxPalette(SkyboxContext* skyboxCtx, int paletteIndex, char* palTex, int width, int height) {
skyboxCtx->palettes[paletteIndex] = palTex;
skyboxCtx->palette_size = width * height;
if (GameInteractor_Should(VB_LOAD_SKYBOX, true)) {
skyboxCtx->palettes[paletteIndex] = palTex;
skyboxCtx->palette_size = width * height;
}
}
static const char* sSBVRFine0Tex[] = { gSunriseSkybox1Tex, gSunriseSkybox2Tex, gSunriseSkybox3Tex, gSunriseSkybox4Tex,