Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/core2/ba/model.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include "core2/ba/physics.h"
#include "bk_math.h"

#include "port/Enhancements/Cosmetics/PlayerColors.h"

void assetcache_release(void *); //assetcache_free
void modelRender_func_8033A280(f32);

Expand Down Expand Up @@ -101,6 +103,8 @@ void baModel_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){
modelRender_setPreDrawCallback((model_render_pre_draw_callback_f)_baModel_preDraw, 0);
modelRender_setRefPoints(D_80363780);
modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL);
// [port] Swap in this player's recoloured palettes/vertex colours for this draw.
PlayerColors_applyLocalForDraw(baModel_getModelId(), baModelBin);
if(D_8037C150.unk0){
D_8037C150.unk0 = 0;
modelRender_draw(gfx, mtx, D_8037C150.unk4, rotation, baModelScale, sp38, baModelBin);
Expand Down
7 changes: 6 additions & 1 deletion src/port/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "Extractor/GameExtractor.h"
#include "ship/window/gui/FileBrowserWindow.h"
#include "Interpolation/FrameInterpolation.h"
#include "Nametag/Nametag.h"
#include "OS/OS.h"
#include "Network/Anchor/Anchor.h"
#include "port/Enhancements/Events/PortEnhancements.h"
Expand Down Expand Up @@ -1269,9 +1270,13 @@ void GameEngine::RunCommands(Gfx* Commands, const std::vector<std::unordered_map
// Vertex-animated models blend into one buffer per draw, so unlike the
// matrix maps this can't be precomputed per sub-frame. It has to land
// right before the pass that reads it.
const float subframeBlend = (frameCount > 1) ? (float)(frameIdx + 1) / (float)frameCount : 1.0f;
if (frameCount > 1) {
FrameInterpolation_ApplyAnimVertices((float)(frameIdx + 1) / (float)frameCount);
FrameInterpolation_ApplyAnimVertices(subframeBlend);
}
// Overlays drawn by the Gui pass below place themselves per tick, so they need the
// same blend the geometry is being posed with or they step while the world glides.
Nametag::SetSubframeBlend(subframeBlend);
bool isFinalFrame = (frameIdx == frameCount - 1);
if (frameCount > 1 || wndBase->IsFrameReady()) {
// Sample the full CPU cost of producing this sub-frame.
Expand Down
Loading
Loading