{"id":15387014,"url":"https://github.com/gkjohnson/unity-vector-extensions","last_synced_at":"2025-11-13T22:53:11.188Z","repository":{"id":66338476,"uuid":"131036101","full_name":"gkjohnson/unity-vector-extensions","owner":"gkjohnson","description":"Vector extensions to add hlsl-like functionality","archived":false,"fork":false,"pushed_at":"2018-05-20T19:02:38.000Z","size":42,"stargazers_count":8,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-11T05:33:57.729Z","etag":null,"topics":["csharp","graphics","hlsl","shaders","unity","utilty","vector"],"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/gkjohnson.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,"publiccode":null,"codemeta":null}},"created_at":"2018-04-25T16:40:55.000Z","updated_at":"2025-01-31T20:57:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"dd17c79b-d590-419a-ad3f-4bd122f06b34","html_url":"https://github.com/gkjohnson/unity-vector-extensions","commit_stats":{"total_commits":15,"total_committers":1,"mean_commits":15.0,"dds":0.0,"last_synced_commit":"40c68c1834ff79d5a345335b61a82ee42bf45aca"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gkjohnson/unity-vector-extensions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkjohnson%2Funity-vector-extensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkjohnson%2Funity-vector-extensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkjohnson%2Funity-vector-extensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkjohnson%2Funity-vector-extensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gkjohnson","download_url":"https://codeload.github.com/gkjohnson/unity-vector-extensions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkjohnson%2Funity-vector-extensions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284304462,"owners_count":26982161,"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-13T02:00:06.582Z","response_time":61,"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":["csharp","graphics","hlsl","shaders","unity","utilty","vector"],"created_at":"2024-10-01T14:51:22.957Z","updated_at":"2025-11-13T22:53:11.164Z","avatar_url":"https://github.com/gkjohnson.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# unity-vector-extensions\nA set of Vector structs to support some HLSL-like vector functionality.\n\n## Use\n```cs\nusing ShaderTypes;\n// ...\n\nVector3 a;\nVector4 b = new Vector4(a, 5);\na.xy = b.wz + a.yx;\nb.xy /= b.zw;\n\n// ...\n```\n\n## Features\n### Subvector Getters and Setters\n\nConvenience getters and setters are provided for getting and setting subvectors of a vector type, like HLSL vectors.\n\n```cs\nVector4 v;\nv.xxx;  v.rrr; // Vector3\nv.yx;   v.gr;  // Vector2\nv.wxyx; v.argr // Vector4\n```\n\n### Per-element Vector Operators\n\nMultiplication, divison, additon, and division operators are defined for each vector type and perform the operation on each element of the target vector. Basic float multiplication and division operators are also provided.\n\n```cs\nnew Vector2(1, 2) * new Vector2(3, 4) == new Vector2(3, 8)\n\nVector3 a, b;\na.zx += b.yz;\nb.yz *= b.xw;\nb.yyz /= a.yyz;\na /= b;\nb /= 2;\n```\n\n### Implicit UnityEngine.Vector* Conversion\n\nImplicit vector conversion to and from Unity vectors.\n\n```cs\nUnityEngine.Vector3 a = new ShaderTypes.Vector3(2, 2);\nShaderTypes.Vector3 b = new UnityEngine.Vector3(1, 1);\n```\n\n## Shader Type Definition Statements\n```cs\n// define common shader types in csharp\nusing float4 = ShaderTypes.Vector4;\nusing float3 = ShaderTypes.Vector3;\nusing float2 = ShaderTypes.Vector2;\n\nusing half4 = ShaderTypes.Vector4;\nusing half3 = ShaderTypes.Vector3;\nusing half2 = ShaderTypes.Vector2;\n\nusing fixed4 = ShaderTypes.Vector4;\nusing fixed3 = ShaderTypes.Vector3;\nusing fixed2 = ShaderTypes.Vector2;\n```\n\n## Regenerating ShaderVectorTypes.cs\n\nRun `node generate-ShaderVectorTypes` in the repository root.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgkjohnson%2Funity-vector-extensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgkjohnson%2Funity-vector-extensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgkjohnson%2Funity-vector-extensions/lists"}