{"id":13340838,"url":"https://github.com/vr-voyage/direct-model-importer-vrchat","last_synced_at":"2025-04-13T18:41:35.753Z","repository":{"id":167163318,"uuid":"639073981","full_name":"vr-voyage/direct-model-importer-vrchat","owner":"vr-voyage","description":"A prefab to recreate image-encoded 3D models inside VRChat","archived":false,"fork":false,"pushed_at":"2023-09-28T07:23:19.000Z","size":466,"stargazers_count":22,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-27T09:22:44.773Z","etag":null,"topics":["prefab","udon","udonsharp","unity","vrchat"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vr-voyage.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","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},"funding":{"patreon":"vrgames_voyage"}},"created_at":"2023-05-10T17:49:22.000Z","updated_at":"2025-03-19T22:14:56.000Z","dependencies_parsed_at":"2024-10-24T01:17:39.571Z","dependency_job_id":"5a0cdb8a-2655-4108-a1b7-a5be6b92fe0e","html_url":"https://github.com/vr-voyage/direct-model-importer-vrchat","commit_stats":null,"previous_names":["vr-voyage/direct-model-importer-vrchat"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vr-voyage%2Fdirect-model-importer-vrchat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vr-voyage%2Fdirect-model-importer-vrchat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vr-voyage%2Fdirect-model-importer-vrchat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vr-voyage%2Fdirect-model-importer-vrchat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vr-voyage","download_url":"https://codeload.github.com/vr-voyage/direct-model-importer-vrchat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248764376,"owners_count":21158074,"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":["prefab","udon","udonsharp","unity","vrchat"],"created_at":"2024-07-29T19:24:02.660Z","updated_at":"2025-04-13T18:41:35.735Z","avatar_url":"https://github.com/vr-voyage.png","language":"C#","funding_links":["https://patreon.com/vrgames_voyage"],"categories":[],"sub_categories":[],"readme":"# /!\\ ALPHA SOFTWARE. CAN BREAK AND CHANGE COMPLETELY OVER TIME /!\\\n\n[blender-demo-en.webm](https://github.com/vr-voyage/direct-model-importer-vrchat/assets/84687350/421c49b2-435d-43da-9817-4e3d2e05ad1a)\n\n# Direct Model Importer\n\nThis is currently a Proof of Concept of how to regenerate meshes encoded in EXR\ninside VRChat.\n\nThis package actually provide an encoder within Unity, to encode any Mesh as\na file.\n\nYou'll still have to upload the generated EXR file somewhere (Discord being\nthe easiest solution) and then enter the URL inside the panel within the game.\n\n\u003e You can actually test it in the Editor, during 'Play' mode too.\n\nAn exporter for Blender is also available here :\n\nhttps://github.com/vr-voyage/direct-model-exporter-blender\n\n# Encoding documentation\n\nThe data are supposed to be encoded in RGBA, using 32-bits floating point\nfor each channel.\n\nI have no idea how to only use one channel at the moment, so four channels\n(RGBA) are used. This actually hinders the decoder implementation, but I\nhave no clear idea how to avoid that, beside using shader tricks that would\nmake the whole thing even more complex.\n\n## Version 2\n\n### Metadata\n\nThe first 64 bytes provide the file metadata\n\n* Float  0 == `(float) 0x00564f59` (**VOY**)\n* Float  1 == `(float) 0x00454741` (**AGE**)\n* Float  2 == Float.INFINITY (*Currently unchecked*)\n* Float  3 == Float.NAN (*Currently unchecked*)\n* Float  4 == **Version number**\n* Float  8 == **Number of vertices stored**\n* Float  9 == **Number of normals stored**\n* Float 10 == **Number of UVs stored** (Only one UV map is stored at the moment)\n* Float 11 == **Number of indices stored**\n\nThe rest is unused at the moment.\n\n### Vertices (from index 64)\n\nVertices are stored in the RGB channels.\nAlpha is ignored.\n\n```csharp\n        int metadataSize = 64;\n        int nfloatsInColor = 4;\n        int cursor = metadataSize / nfloatsInColor;\n        for (int v = 0; v \u003c nVertices; v++, cursor++)\n        {\n            Color currentCol = colors[cursor];\n            Vector3 vertex = new Vector3(\n                currentCol.r,\n                currentCol.g,\n                currentCol.b);\n            vertices[v] = vertex;\n        }\n```\n\n### Normals (after the vertices)\n\nNormals are stored in the RGB channels.\nAlpha is ignored.\n\n```csharp\n        for (int n = 0; n \u003c nNormals; n++, cursor++)\n        {\n            Color currentCol = colors[cursor];\n            Vector3 normal = new Vector3(\n                currentCol.r,\n                currentCol.g,\n                currentCol.b);\n            normals[n] = normal;\n        }\n```\n\n### UVS (after the normals)\n\nUV coordinates are stored in the RG channels.\nBlue and Alpha are ignored.\n\n```csharp\n        for (int u = 0; u \u003c nUVS; u++)\n        {\n            Color currentCol = colors[cursor];\n            Vector2 uv = new Vector2(\n                currentCol.r,\n                currentCol.g);\n            uvs[u] = uv;\n            cursor++;\n        }\n```\n\n### Indices (after the UV)\n\nIndices are packed.\nThe easiest way is to read 'nIndices / (float values in Color)' values.  \nThen, at the end, read the remaining parts depending on how much data\nis left.\n\n```csharp\n    /* This rounds the value to a multiple of 4.\n     * There are way smarter ways to do it, I'm just lazy\n     */\n    int alignedIndices = nIndices / nfloatsInColor * nfloatsInColor;\n    int currentIndex = 0;\n    for (; currentIndex \u003c alignedIndices; currentIndex += 4, cursor++)\n    {\n\n        Color currentCol = colors[cursor];\n        /*Debug.Log($\"Index : {currentIndex} ({cursor*4}) - Indices : {(int)currentCol.r},{(int)currentCol.g},{(int)currentCol.b},{(int)currentCol.a}\");*/\n        indices[currentIndex + 0] = (int)currentCol.r;\n        indices[currentIndex + 1] = (int)currentCol.g;\n        indices[currentIndex + 2] = (int)currentCol.b;\n        indices[currentIndex + 3] = (int)currentCol.a;\n    }\n    /*Debug.Log($\"cursor after indices : {cursor - start} ({(cursor - start) * 4})\");*/\n    int remainingIndices = nIndices - alignedIndices;\n    if (remainingIndices \u003e 0)\n    {\n        Color currentCol = colors[cursor];\n        if (remainingIndices \u003e= 1)\n        {\n            indices[currentIndex] = (int)currentCol.r;\n            currentIndex++;\n        }\n        if (remainingIndices \u003e= 2)\n        {\n            indices[currentIndex] = (int)currentCol.g;\n            currentIndex++;\n        }\n        if (remainingIndices == 3)\n        {\n            indices[currentIndex] = (int)currentCol.b;\n            currentIndex++;\n        }\n    }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvr-voyage%2Fdirect-model-importer-vrchat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvr-voyage%2Fdirect-model-importer-vrchat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvr-voyage%2Fdirect-model-importer-vrchat/lists"}