{"id":15292722,"url":"https://github.com/andersystems/unity-grass-interaction","last_synced_at":"2026-05-01T06:33:13.758Z","repository":{"id":256583089,"uuid":"855838135","full_name":"AnderSystems/Unity-Grass-Interaction","owner":"AnderSystems","description":"This repository contains a custom solution for grass collision in Unity URP. Unlike traditional methods that create a single collision point, this approach uses an orthographic camera to render a top-down view and applies the rendered image as a collision mask on the grass.","archived":false,"fork":false,"pushed_at":"2024-09-11T14:42:44.000Z","size":91,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T11:16:11.669Z","etag":null,"topics":["shader","shadergraph","unity","unity-3d","urp"],"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/AnderSystems.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":"2024-09-11T14:38:26.000Z","updated_at":"2024-10-15T09:02:09.000Z","dependencies_parsed_at":"2024-09-11T22:43:10.019Z","dependency_job_id":null,"html_url":"https://github.com/AnderSystems/Unity-Grass-Interaction","commit_stats":null,"previous_names":["andersystems/unitygrassinteraction","andersystems/unity-grass-interaction"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnderSystems%2FUnity-Grass-Interaction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnderSystems%2FUnity-Grass-Interaction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnderSystems%2FUnity-Grass-Interaction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnderSystems%2FUnity-Grass-Interaction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AnderSystems","download_url":"https://codeload.github.com/AnderSystems/Unity-Grass-Interaction/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245258213,"owners_count":20585977,"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":["shader","shadergraph","unity","unity-3d","urp"],"created_at":"2024-09-30T16:26:12.049Z","updated_at":"2026-05-01T06:33:13.731Z","avatar_url":"https://github.com/AnderSystems.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003eGrass Collision Solution in Unity URP\u003c/h1\u003e\n\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003eThis repository contains a custom solution for grass collision in Unity URP. Unlike traditional methods that create a single collision point, this approach uses an orthographic camera to render a top-down view and applies the rendered image as a collision mask on the grass. The solution includes a custom shader that lowers the grass based on the alpha channel of the texture.\u003c/p\u003e\n\n\u003ch2\u003eFeatures\u003c/h2\u003e\n\u003cul\u003e\n  \u003cli\u003e\u003cb\u003eOrthographic Camera\u003c/b\u003e: Captures a top-down view of the scene, synchronized with the main camera.\u003c/li\u003e\n  \u003cli\u003e\u003cb\u003eRender Mask\u003c/b\u003e: Renders only the objects that interact with the grass.\u003c/li\u003e\n  \u003cli\u003e\u003cb\u003eCustom Shader\u003c/b\u003e: Uses the alpha channel to lower the grass in the collision areas.\u003c/li\u003e\n  \u003cli\u003e\u003cb\u003ePixel Perfect Update\u003c/b\u003e: Ensures stable rendering by updating camera coordinates with integer values.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ch2\u003eLimitations\u003c/h2\u003e\n\u003cul\u003e\n  \u003cli\u003e\u003cb\u003eDistance\u003c/b\u003e: The effectiveness depends on the rendering distance of the collision camera.\u003c/li\u003e\n  \u003cli\u003e\u003cb\u003eQuality\u003c/b\u003e: Higher texture resolution improves collision precision but increases computational load.\u003c/li\u003e\n  \u003cli\u003e\u003cb\u003eObject Height\u003c/b\u003e: The system only captures a top-down map, which may cause grass to move even if the object is not directly colliding with it.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003ch2\u003eHow to Use\u003c/h2\u003e\n\u003col\u003e\n  \u003cli\u003eClone the repository.\u003c/li\u003e\n  \u003cli\u003eOpen the project in Unity.\u003c/li\u003e\n  \u003cli\u003eAssign the orthographic camera and configure the render mask.\u003c/li\u003e\n  \u003cli\u003eApply the custom shader to your grass material.\u003c/li\u003e\n  \u003cli\u003eAdjust the settings as needed to fit your scene.\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003ch2\u003eContributing\u003c/h2\u003e\n\u003cp\u003eFeel free to fork this repository and submit pull requests. Any contributions to improve the solution are welcome!\u003c/p\u003e\n\n\u003ch2\u003eLicense\u003c/h2\u003e\n\u003cp\u003eThis project is licensed under the MIT License.\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandersystems%2Funity-grass-interaction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandersystems%2Funity-grass-interaction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandersystems%2Funity-grass-interaction/lists"}