{"id":33023316,"url":"https://github.com/stalomeow/ShaderUtilsForSRP","last_synced_at":"2025-11-25T02:30:19.031Z","repository":{"id":178066603,"uuid":"661317418","full_name":"stalomeow/ShaderUtilsForSRP","owner":"stalomeow","description":"Utilities for SRP shaders.","archived":false,"fork":false,"pushed_at":"2023-10-10T14:16:01.000Z","size":465,"stargazers_count":57,"open_issues_count":0,"forks_count":15,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-23T00:36:09.764Z","etag":null,"topics":["shader","srp","unity"],"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/stalomeow.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":"2023-07-02T13:22:14.000Z","updated_at":"2025-02-24T07:38:30.000Z","dependencies_parsed_at":"2023-10-10T16:35:38.905Z","dependency_job_id":"f30cdee7-967c-4d05-95c9-625a618e1c0c","html_url":"https://github.com/stalomeow/ShaderUtilsForSRP","commit_stats":null,"previous_names":["stalomeow/com.stalomeow.srp-shader-utils"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/stalomeow/ShaderUtilsForSRP","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stalomeow%2FShaderUtilsForSRP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stalomeow%2FShaderUtilsForSRP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stalomeow%2FShaderUtilsForSRP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stalomeow%2FShaderUtilsForSRP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stalomeow","download_url":"https://codeload.github.com/stalomeow/ShaderUtilsForSRP/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stalomeow%2FShaderUtilsForSRP/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286079811,"owners_count":27282121,"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-25T02:00:05.816Z","response_time":54,"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":["shader","srp","unity"],"created_at":"2025-11-13T19:00:34.939Z","updated_at":"2025-11-25T02:30:19.025Z","avatar_url":"https://github.com/stalomeow.png","language":"C#","funding_links":[],"categories":["ComputerGraphics \u0026\u0026 Shadingv"],"sub_categories":["Google Analytics"],"readme":"# Shader Utils for SRP v2\n\n[![openupm](https://img.shields.io/npm/v/com.stalomeow.srp-shader-utils?label=openupm\u0026registry_uri=https://package.openupm.com)](https://openupm.cn/packages/com.stalomeow.srp-shader-utils/)\n\nUtilities for **SRP** shaders.\n\n## Requirements\n\n- Unity \u003e= 2021.3.\n- Core RP Library \u003e= 12.0.0.\n\n## File Extensions\n\nCreate HLSL and SRP Shader files easily using menu item.\n\n![menu item](Screenshots~/menu_item.png)\n\n## Preference Settings\n\nSettings can be found in `Preferences/Shader Utils for SRP`.\n\n![pref settings](Screenshots~/pref_settings.png)\n\n## Advanced Shader GUI\n\nUse `StaloSRPShaderGUI` as CustomEditor.\n\n``` shaderlab\nCustomEditor \"StaloSRPShaderGUI\"\n```\n\n![shader gui](Screenshots~/shader_gui.png)\n\n### Advanced Shader Property Attributes\n\n- `HeaderFoldout(label[, ...tooltips])`\n\n    Begin an animated foldout header.\n\n- `Indent([count])`\n\n    Add indents before the property. The default count is 1.\n\n- `HelpBox(None|Info|Warning|Error, ...messages)`\n\n    Display a HelpBox above the property.\n\n- `PostHelpBox(None|Info|Warning|Error, ...messages)`\n\n    Display a HelpBox under the property.\n\n- `MinMaxRange(min-limit, max-limit)`\n\n    Display a vector property with a MinMaxSlider.\n\n    - `property.x`: Min value.\n    - `property.y`: Max value.\n\n- `RampTexture`\n\n    Display a texture as a ramp texture (similar to a color gradient).\n\n- `SingleLineTextureNoScaleOffset([color-property])`\n\n    Display a texture property in single line without `Tiling` and `Offset`. If `color-property` is specified, an additional color field will be displayed next to the texture.\n\n- `TextureScaleOffset`\n\n    Display a vector property as the `Tiling` and `Offset` of a texture.\n\n    - `property.xy`: Tiling (Scale).\n    - `property.zw`: Offset.\n\n\n- `If(expr)`\n\n    Display the property if `expr` evaluates to `true`. You can write complex expression like `((not _KEYWORD_A and true) or (_KEYWORD_B and not not not false)) and not _KEYWORD_C`.\n\n    Operator precedence: `not` \u003e `and` \u003e `or`.\n\n### Material Property Wrapper\n\nThis is similar to Unity's `MaterialPropertyDrawer`.\n\nYou can write a custom class inherited from `MaterialPropertyWrapper` (in namespace `Stalo.ShaderUtils.Editor`) to control the GUI of a material property.\n\nHere's an example:\n\n``` c#\ninternal class PostHelpBoxWrapper : MaterialPropertyWrapper\n{\n    private readonly MessageType m_MsgType;\n    private readonly string m_Message;\n\n    public PostHelpBoxWrapper(string rawArgs) : base(rawArgs)\n    {\n        string[] args = rawArgs.Split(',', StringSplitOptions.RemoveEmptyEntries);\n\n        for (int i = 0; i \u003c args.Length; i++)\n        {\n            args[i] = args[i].Trim();\n        }\n\n        m_MsgType = Enum.Parse\u003cMessageType\u003e(args[0]);\n        m_Message = string.Join(\", \", args[1..]);\n    }\n\n    public override void OnDidDrawProperty(MaterialProperty prop, string label, MaterialEditor editor)\n    {\n        EditorGUILayout.HelpBox(m_Message, m_MsgType);\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstalomeow%2FShaderUtilsForSRP","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstalomeow%2FShaderUtilsForSRP","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstalomeow%2FShaderUtilsForSRP/lists"}