{"id":33022547,"url":"https://github.com/Cyanilux/BakeShader","last_synced_at":"2025-11-23T07:01:21.377Z","repository":{"id":59219521,"uuid":"531090264","full_name":"Cyanilux/BakeShader","owner":"Cyanilux","description":"Unity editor tool for baking shaders to textures. Texture2D, Texture3D, Flipbook, or MeshRenderer (uses model UV)","archived":false,"fork":false,"pushed_at":"2024-03-04T22:36:50.000Z","size":30,"stargazers_count":158,"open_issues_count":0,"forks_count":14,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-06-06T09:34:43.911Z","etag":null,"topics":["baking","blit","shaders","texture-baking","unity","uv"],"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/Cyanilux.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2022-08-31T13:11:05.000Z","updated_at":"2024-06-01T08:12:43.000Z","dependencies_parsed_at":"2024-03-04T23:50:45.475Z","dependency_job_id":null,"html_url":"https://github.com/Cyanilux/BakeShader","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Cyanilux/BakeShader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cyanilux%2FBakeShader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cyanilux%2FBakeShader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cyanilux%2FBakeShader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cyanilux%2FBakeShader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cyanilux","download_url":"https://codeload.github.com/Cyanilux/BakeShader/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cyanilux%2FBakeShader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285914727,"owners_count":27252968,"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","status":"online","status_checked_at":"2025-11-23T02:00:06.149Z","response_time":135,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["baking","blit","shaders","texture-baking","unity","uv"],"created_at":"2025-11-13T19:00:34.926Z","updated_at":"2025-11-23T07:01:21.372Z","avatar_url":"https://github.com/Cyanilux.png","language":"C#","funding_links":[],"categories":["Texture"],"sub_categories":[],"readme":"## BakeShader\n\n![Bake](https://user-images.githubusercontent.com/69320946/187734767-1b574014-9d53-4f83-86e3-7f06f7ad2188.gif)\n\n- Adds \"Bake Shader\" window (under Window/Cyanilux/BakeShader)\n\t- Includes modes : Texture2D (png), Texture3D asset, Flipbook, MeshRenderer\n- Also adds \"Bake\" options to the \"...\" context menus on Material asset and MeshRenderer component\n\t- (If BakeShader window is open, this will use resolution \u0026 path settings set there, otherwise uses defaults mentioned below)\n- Should work in any render pipeline!\n- By default, results are saved under Assets/BakedTextures\n\n### Setup:\n- Install via Package Manager → Add package via git URL : \n  - `https://github.com/Cyanilux/BakeShader.git`\n- Alternatively, download and put the folder in your Assets\n\n### Bake Modes : \n- **Texture2D (png)**\n    - Shader is blit (basically draws a quad)\n    - Result saved as .png\n    - Defaults to 2048x2048 size\n- **Texture3D**\n    - Shader is blit in slices. Use `_Slice` Float property in shader calculations. This ranges from 0 to 1 through the depth of the Texture3D\n    - Result saved as Texture3D asset\n    - Defaults to 128x128x128 size\n- **Flipbook**\n    - Same as Texture3D, but slices are combined vertically into a long Texture2D\n    - Result saved as .png, this could then be imported as a regular texture (for usage with Flipbook node later) or as a 2D Array, or 3D Texture.\n    - Defaults to 256x256 size (per slice), 32 slices, (so final image size of 256x8192)\n- **MeshRenderer : Renderer is drawn to Texture2D**\n    - Will bake using first Material only. Scene View must be open for Renderer baking to occur\n    - Defaults to 2048x2048 size\n    - For the intended result, shader should be **unlit** and **output using UV coordinates instead of vertices** :\n        - For Shader Graphs, use the provided `Bake Shader Vertex Pos` subgraph in the **Position** port on the **Vertex** stack. Also use `Render Face : Both` in graph settings.\n        - Note that using the `Position` node in **Fragment** stage will now produce different results, as this changes the vertex positions. In v12+ we can avoid this by using a **Custom Interpolator** to pass the unmodified vertex pos through, if required. See : https://www.cyanilux.com/tutorials/intro-to-shader-graph/#custom-interpolators\n        - For Shader Code (CG/HLSL), the following should work (though some variables may need renaming). The pass should also specify `Cull Off`\n\n```\n#pragma multi_compile _ _BAKESHADER\n\n// in vertex function :\n#ifdef _BAKESHADER\n    float2 remappedUV = IN.uv.xy * 2 - 1;\n    float4 outputPos = float4(remappedUV.x, remappedUV.y, 0, 1);\n    OUT.vertex = outputPos; // Built-in RP\n    OUT.positionCS = outputPos; // URP\n#else\n    OUT.vertex = UnityObjectToClipPos(IN.vertex); // Built-in RP\n    OUT.positionCS = TransformObjectToHClip(IN.vertex); // URP\n#endif\n// (where \"vertex\" / \"positionCS\" is the common naming convention for the parameter using SV_POSITION semantic)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCyanilux%2FBakeShader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCyanilux%2FBakeShader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCyanilux%2FBakeShader/lists"}