Skip to content

Commit 26d660d

Browse files
Fixed voxel projectile and animation lighting issues (#2228)
In vanilla, they are darker than voxel technos. --------- Co-authored-by: Noble_Fish <1065703286@qq.com>
1 parent 6fab06f commit 26d660d

8 files changed

Lines changed: 42 additions & 1 deletion

File tree

CREDITS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,7 @@ This page lists all the individual contributions to the project by their author.
760760
- Allow replacing vanilla repairing with togglable auto repairing
761761
- Fix an issue that the time for units in the area guard mission to reacquire targets after eliminating the target is significantly longer than that in other missions
762762
- Framework for dynamic sight
763+
- Fixed voxel projectile and animation lighting issues
763764
- **solar-III (凤九歌)**
764765
- Target scanning delay customization (documentation)
765766
- Skip target scanning function calling for unarmed technos (documentation)

docs/Fixed-or-Improved-Logics.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho
326326
- Purely visual animations and particles are no longer included in frame CRC generation and are thus exempt from any sync checks between players in multiplayer games.
327327
- Fixed the bug that low-air taking off / landing objects will receive twice damage.
328328
- Allowed `AuxBuilding` to count building upgrades.
329+
- Fixed voxel projectile and animation lighting issues.
329330

330331
## Fixes / interactions with other extensions
331332

docs/Whats-New.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,7 @@ HideShakeEffects=false ; boolean
659659
- Fixed AI team recruitment inconsistency causing underfilled teams (by handama)
660660
- Fixed the issue where tint color RGB mode conversion was incorrect (by Shatyuka)
661661
- Fixed the bug that low-air taking off / landing objects will receive twice damage (by NetsuNegi)
662+
- Fixed voxel projectile and animation lighting issues (by TaranDahl)
662663
663664
#### Phobos fixes:
664665
- Fixed the bug that `AllowAirstrike=no` cannot completely prevent air strikes from being launched against it (by NetsuNegi)

docs/locale/zh_CN/LC_MESSAGES/CREDITS.po

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2547,6 +2547,10 @@ msgstr "修复了处于 `Area Guard` 任务中的单位消灭目标后重新获
25472547
msgid "Framework for dynamic sight"
25482548
msgstr "动态视野框架"
25492549

2550+
msgid ""
2551+
"Fixed voxel projectile and animation lighting issues"
2552+
msgstr "修复了 Voxel 抛射体和动画的光照问题"
2553+
25502554
msgid "**solar-III (凤九歌)**"
25512555
msgstr "**solar-III(凤九歌)**"
25522556

docs/locale/zh_CN/LC_MESSAGES/Fixed-or-Improved-Logics.po

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,6 +1686,10 @@ msgstr "修复了低空起飞/降落的物体会受到两次伤害的 Bug。"
16861686
msgid "Allowed `AuxBuilding` to count building upgrades."
16871687
msgstr "允许了 `AuxBuilding` 计入建筑加载物。"
16881688

1689+
msgid ""
1690+
"Fixed voxel projectile and animation lighting issues."
1691+
msgstr "修复了 Voxel 抛射体和动画的光照问题。"
1692+
16891693
msgid "Fixes / interactions with other extensions"
16901694
msgstr "修复或与其他扩展的交互"
16911695

docs/locale/zh_CN/LC_MESSAGES/Whats-New.po

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2366,6 +2366,10 @@ msgid ""
23662366
"twice damage (by NetsuNegi)"
23672367
msgstr "修复了低空起飞/降落的物体会受到两次伤害的 Bug(by NetsuNegi)"
23682368

2369+
msgid ""
2370+
"Fixed voxel projectile and animation lighting issues (by TaranDahl)"
2371+
msgstr "修复了 Voxel 抛射体和动画的光照问题(by TaranDahl)"
2372+
23692373
msgid "Phobos fixes:"
23702374
msgstr "Phobos 过往版本问题修复:"
23712375

src/Misc/Hooks.BugFixes.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3552,3 +3552,29 @@ DEFINE_HOOK(0x71A9CD, Remove_UnInitFix, 0x6) // TemporalClass::Update
35523552
pPassenger->UnInit();
35533553
return R->Origin() + 0x9;
35543554
}
3555+
3556+
#pragma region VoxelLightingFix
3557+
3558+
// Fixes VoxelAnimClass::DrawIt and BulletClass::DrawAVXL VXL rendering
3559+
// lacking proper double-light source (ambient + directional + specular)
3560+
// that TechnoClass uses via sub_753D00, making them appear darker.
3561+
3562+
DEFINE_HOOK(0x749D97, VoxelAnimClass_DrawIt_LightingFix, 0x5)
3563+
{
3564+
GET(VoxLib*, pVXL, EBP);
3565+
GET(Matrix3D*, pMatrix, EAX);
3566+
Drawing::SetupVoxelDoubleLighting(pVXL, 0, 0, pMatrix, &Drawing::VoxelTransformMatrix, &Game::VoxelLightSource, 3.0);
3567+
return 0x749DA8;
3568+
}
3569+
3570+
DEFINE_HOOK(0x46B0E1, BulletClass_DrawAVXL_LightingFix, 0x5)
3571+
{
3572+
GET(VoxLib*, pVXL, ESI);
3573+
GET(Matrix3D*, pMatrix, EAX);
3574+
3575+
Drawing::SetupVoxelDoubleLighting(pVXL, 0, 0, pMatrix, &Drawing::VoxelTransformMatrix, &Game::VoxelLightSource, 3.0);
3576+
R->Stack(STACK_OFFSET(0xF4, -0xDC), pVXL);
3577+
return 0x46B0F6;
3578+
}
3579+
3580+
#pragma endregion

0 commit comments

Comments
 (0)