Skip to content

Consolidate textures#1234

Open
Lwmte wants to merge 8 commits into
developfrom
consolidate_textures
Open

Consolidate textures#1234
Lwmte wants to merge 8 commits into
developfrom
consolidate_textures

Conversation

@Lwmte

@Lwmte Lwmte commented May 29, 2026

Copy link
Copy Markdown
Collaborator

This PR allows to consolidate disjointed texture pieces for a given object into a single set of texture pages.

@Lwmte Lwmte added enhancement A task which adds something new or improves on existing features. new feature This is a new feature task. labels May 29, 2026
@Lwmte Lwmte requested a review from Copilot May 29, 2026 07:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a WadTool command to consolidate per-object texture fragments into packed texture page(s), reusing and generalizing the existing export texture-packing logic in TombLib.

Changes:

  • Added a new WadTool action + menu item to “Consolidate textures” for selected destination objects.
  • Refactored/extended TombLib texture packing to support packing into configurable page sizes and applying the packing back onto Wad meshes.
  • Updated the installer changelog to mention the new feature.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
WadTool/WadActions.cs Adds ConsolidateSelectedObjectTextures action and wires it to destination selections.
WadTool/Forms/FormMain.Designer.cs Adds the “Consolidate textures” menu item under Textures.
WadTool/Forms/FormMain.cs Enables the new menu item and adds the click handler.
TombLib/TombLib/Wad/WadMesh.cs Introduces shared texture packing helpers and ConsolidateTextures applying packing to meshes.
TombLib/TombLib/Wad/Wad2.cs Updates PackTexturesForExport to support packing into variable page sizes and multiple pages.
Installer/Changes.txt Documents the new option in release notes.
Files not reviewed (1)
  • WadTool/Forms/FormMain.Designer.cs: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread TombLib/TombLib/Wad/WadMesh.cs Outdated
Comment thread Installer/Changes.txt Outdated
@Lwmte Lwmte added this to the Version 2.0 milestone May 29, 2026
@TrainWrack

Copy link
Copy Markdown
Collaborator

Did a quick test on Consolidate texture branch. Its good but not quite what wadmerger had achieved. It consolidates textures only on one object. Which is already an improvement but for Lara which spans multiple objects, it would be good, if we can select multiple objects and then consolidate into one.

Also, maybe we can auto consolidate, when copying objects out of TR files. Once again, if I consolidate the textures and there are multiple objects which use the same textures, they each get their own copy of the said texture.

Aggregate the meshes of every selected object into a single ConsolidateTextures
pass instead of consolidating per object, so multi-object sets (e.g. Lara) share
one set of texture pages and textures used by more than one object are packed
only once instead of being duplicated per object.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement A task which adds something new or improves on existing features. new feature This is a new feature task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants