{"id":13784554,"url":"https://github.com/azixMcAze/Unity-OptimalUnlitShader","last_synced_at":"2025-05-11T20:30:48.946Z","repository":{"id":147177083,"uuid":"118120294","full_name":"azixMcAze/Unity-OptimalUnlitShader","owner":"azixMcAze","description":"An unlit über-shader covering all the common use cases","archived":false,"fork":false,"pushed_at":"2018-05-04T13:32:09.000Z","size":1273,"stargazers_count":37,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-10T11:22:05.060Z","etag":null,"topics":["shaders","unity"],"latest_commit_sha":null,"homepage":null,"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/azixMcAze.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}},"created_at":"2018-01-19T12:02:12.000Z","updated_at":"2024-04-07T02:17:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"d0ac3ace-c2ff-4c0e-9c1e-b3bd0b2b68d9","html_url":"https://github.com/azixMcAze/Unity-OptimalUnlitShader","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azixMcAze%2FUnity-OptimalUnlitShader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azixMcAze%2FUnity-OptimalUnlitShader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azixMcAze%2FUnity-OptimalUnlitShader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azixMcAze%2FUnity-OptimalUnlitShader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/azixMcAze","download_url":"https://codeload.github.com/azixMcAze/Unity-OptimalUnlitShader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225094286,"owners_count":17419970,"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":["shaders","unity"],"created_at":"2024-08-03T19:00:47.939Z","updated_at":"2024-11-17T21:30:18.913Z","avatar_url":"https://github.com/azixMcAze.png","language":"C#","funding_links":[],"categories":["Shader Optimization"],"sub_categories":[],"readme":"# Unity - Optimal Unlit Shader\nAn unlit shader for unity covering all the common use cases without any overhead for the features you don't use.\n\nAll the unused features are automatically disabled by the inspector so that the shader stays optimal. There is no longer a need to write multiple unlit shader variants for all you use cases (e.g. unlit with only a color, transparent unlit with color and a mask, unlit with texture and color, etc.)\n\n![Screenshot 1](docs/optimalunlitshader-screenshot1.png)\u003cbr/\u003e\n*A simple material with only the main texture used. The shader code will not use the mask texture nor use the color.*\n\n## Features\n* Optional texture \n* Optional color\n* Optional mask texture\n* Optional separate mask texture tiling and offset\n* Opaque / Cutout / Transparent rendering modes\n* Unused features automatically disabled\n\n## How it works\n\nThis shader has a custom inspector that will automatically enable keywords in order to disable unused features:\n* `_TEXTURE_OFF`, when the main texture (`_MainTex`) is `null`, will disable the texture sampling\n* `_MASK_OFF`, when the mask texture (`_Mask`) is `null`, will disable the mask texture sampling and the primary UV channel when used with `_TEXTURE_OFF`\n* `_MASK_SCALE_OFFSET_OFF`, when the mask texture's tiling and offset are the same as the main texture's ones, will disable the mask secondary UV channel\n* `_COLOR_OFF`, when the color (`_Color`) is white (1, 1, 1, 1), will disable the color multiplication\n\nThe \"Rendering mode\" dropdown allows to select between opaque, cutout and transparent rendering.\n\nIn cutout mode, the following keyword is also used:\n* `_ALPHATEST_ON`, when the alpha cutoff parameter (`_Cutoff`) is more than zero, will enable alpha testing\n\n\n\n![Screenshot 2](docs/optimalunlitshader-screenshot2.png)\u003cbr/\u003e\n*With only a main texture in this material, the mask and the color are disabled by the `_MASK_OFF` and `_COLOR_OFF` keywords*\n\n## Use in animation or scripting\n\nThe shader features are only enabled or disabled by the inspector. If you modify the properties of a material using this shader by code or from an animation, the set of enabled features will not change.\n\nIf some features should be enabled (e.g. the color has changed and is no longer white), the material will not behave correctly (e.g. the material will stays white instead of being tinted).\n\nTo prevent this problem, you can use the toggles in the \"Advanced Options\" foldout. The selected features will not be disabled the material will behave correctly even when modified from outside the inspector.\n\n\n![Screenshot 3](docs/optimalunlitshader-screenshot3.png)\u003cbr/\u003e\n*Unlike in the previous exemple, the color is not disabled by keyword*","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FazixMcAze%2FUnity-OptimalUnlitShader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FazixMcAze%2FUnity-OptimalUnlitShader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FazixMcAze%2FUnity-OptimalUnlitShader/lists"}