{"id":17721826,"url":"https://github.com/sinbad/fbxudimunpack","last_synced_at":"2025-03-14T05:31:48.732Z","repository":{"id":139583690,"uuid":"311397875","full_name":"sinbad/FbxUdimUnpack","owner":"sinbad","description":"Tool for unpacking a model that uses UDIMs into a form more suitable for real-time use (separate materials per texture tile)","archived":false,"fork":false,"pushed_at":"2020-11-13T16:14:12.000Z","size":64,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-11T15:38:33.412Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sinbad.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-09T16:25:46.000Z","updated_at":"2023-02-08T18:27:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"a12a8db6-58a7-462a-b225-e59120783d15","html_url":"https://github.com/sinbad/FbxUdimUnpack","commit_stats":null,"previous_names":[],"tags_count":1,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinbad%2FFbxUdimUnpack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinbad%2FFbxUdimUnpack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinbad%2FFbxUdimUnpack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinbad%2FFbxUdimUnpack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sinbad","download_url":"https://codeload.github.com/sinbad/FbxUdimUnpack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243532517,"owners_count":20306151,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-25T15:36:23.079Z","updated_at":"2025-03-14T05:31:48.721Z","avatar_url":"https://github.com/sinbad.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FBX UDIM Unpacker\n\n## TL;DR:\n\nThis tool takes a UDIM-enabled model in FBX format makes it cheap and easy to\nuse in real-time engines. \n\n```\nUdimUnpack \u003cinputfile.fbx\u003e \u003coutputfile.fbx\u003e\n```\n\nAny polygon UVs which reference UDIM tiles trigger the splitting of the material\n\"Foo\" into \"Foo_U1001\", \"Foo_U1002\", \"Foo_U1010\" and so on based on the UDIM tile.\nThat poly is then changed to reference that split material and the UVs adjusted\nback to the 0-1 range.\n\nThis means that a real-time engine just needs to have a separate material for\neach UDIM tile and can render the model normally, without any complex UDIM \ntile selector shaders, and in the case of Unreal, without enabling virtual texturing.\n\nIf that makes no sense, read on. 🙂\n\n## Introduction to UDIMs\n\nImagine the situation:\n\n1. You need a more texture resolution on a model than a single 4K texture gives you\n1. You decide to solve this by using more than one texture, assigned to different parts of the model\n1. However really it's still one material conceptually, you just need the texture space\n\n[UDIMs](https://www.fxguide.com/fxfeatured/udim-uv-mapping/) are one answer to this problem, \noriginally designed for the VFX industry. They let you use a single material\nwith texture \"tiles\" of whatever resolution you want for different areas of the model.\nUVs simply extend beyond the 0-1 range to denote the tile (instead of repeating the same texture as normal)\n\n\n## So Why UDIMs?\n\nThe alternative to UDIMs for using multiple textures is splitting your materials \nwhile modelling, one for each section where you want another texture. But UDIMs \nare more convenient for artists because:\n\n1. Conceptually it's all just one material really, the texture tiles are an implementation detail\n1. It's easier to move UV islands around between texture tiles when you don't have to worry about material assignment\n1. Tools like [Substance Painter](https://www.substance3d.com/products/substance-painter/) are designed to work better with UDIMs\n   * This includes being able to [generate and paint across tiles](https://magazine.substance3d.com/paint-across-uv-tiles-udims-in-substance-painter/), which you **can't** do when they're pre-split into separate materials\n\n\nBasically it's all about convenience for artists. In real-time systems we don't\nneed anywhere near as many texture tiles as in VFX work, but as we all know models\nand textures are getting more detailed, so it's becoming common on main models\nto need more than one 4K texture. To me it made sense to try to support this\nworkflow if possible. I certainly found a number of forum threads asking about\nit in Unreal Engine and Unity.\n\n## Using UDIMs in game engines\n\nThe trouble is, game engines, unlike offline renderers, don't really deal with UDIMs. \nThe default behaviour is to just repeat the base texture when the UVs go outside the 0-1 range.\nThere are some ways to deal with them natively (all of which I'd seen suggested\nin threads):\n\n1. Write a shader which samples different textures based on UV range\n    * This is unnecessarily expensive both in terms of the branching and having to \n      have all the textures bound at once (can be a lot once you add PBR maps)\n1. Use Unreal Engine's beta Virtual Texturing UDIM support\n    * Again more expensive and beta, and really designed for large areas where you're\n      only seeing parts of the tiles at a time (like in VFX, which is designed for closeups)\n\nIf like us, you just want to use UDIMs at a low tile count for the pipeline convenience,\nneither of these options are attractive. All we really want is the ability to \nuse UDIMs to make content authoring easier, then at game time just use a separate\nmaterial for each texture tile (2-3 at most probably).\n\n## What this tool does\n\nThis tool takes an input FBX file that uses UDIMs by having UVs that are\noutside the 0-1 range. For example, if a polygon's UVs are in the range (1-2, 0-1),\nit's the UDIM tile 1002 (conceptually one to the right of the main UV space),\nwheras UVs in the range (0-1, 0-1) are UDIM tile 1001.\n\nAny polygon UVs which reference UDIM tiles outside 1001 trigger the splitting of \nthe material \"Foo\" into \"Foo_U1001\", \"Foo_U1002\", \"Foo_U1010\" and so on based on \nthe UDIM tile. Polys are then changed to reference the material corresponding\nto their UDIM tile, and the UVs are adjusted back to the 0-1 range.\n\nThe tool then writes the result to another FBX file. If you import that FBX\ninto a 3D engine, it will have extra materials from the original, depending on\nhow many UDIM tiles were used. You can then hook up materials to the correct\nUDIM texture tiles, one per texture, and use the model like normal.\n\n## Limitations\n\nI've only tested this tool with FBXs from Blender, importing into Unreal Engine 4.\nIn theory though, it should work with any FBX from any modeller, and the result\nshould work with any engine. I can't commit to supporting it for all \nvariations but if you have any problems, PRs are welcome.\n\n## Building\n\n### Dependencies\n\nThe only dependency is the [Autodesk FBX SDK](https://www.autodesk.com/developer-network/platform-technologies/fbx-sdk-2020-1-1) which you'll need to download and install first.\n\n### CMake\n\nYou'll need [CMake](https://cmake.org/) to configure \u0026 generate project files.\nIf you installed the FBX SDK in the standard place it should be found automatically.\n\nI've only tested this on Windows so far with VS 2019, it may not work yet on other platforms\nbut should be able to be tweaked to do so fairly easily. \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinbad%2Ffbxudimunpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsinbad%2Ffbxudimunpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinbad%2Ffbxudimunpack/lists"}