{"id":33023290,"url":"https://github.com/aniketrajnish/Raymarching-Engine-Unity","last_synced_at":"2025-11-25T02:30:14.415Z","repository":{"id":47599814,"uuid":"443095962","full_name":"aniketrajnish/Raymarching-Engine-Unity","owner":"aniketrajnish","description":"A raymarching engine for Unity","archived":false,"fork":false,"pushed_at":"2024-02-07T06:03:51.000Z","size":32838,"stargazers_count":48,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-02T12:45:57.376Z","etag":null,"topics":["raymarcher","raymarching","raymarching-algorithm","signed-distance-functions","unity-plugin","unity-raymarching","unity-tool","unity3d"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aniketrajnish.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-12-30T14:19:53.000Z","updated_at":"2025-02-15T10:39:48.000Z","dependencies_parsed_at":"2024-02-07T07:24:10.504Z","dependency_job_id":"2ca3489a-eab6-4f52-a4f1-1d7c57b7bb23","html_url":"https://github.com/aniketrajnish/Raymarching-Engine-Unity","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/aniketrajnish/Raymarching-Engine-Unity","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aniketrajnish%2FRaymarching-Engine-Unity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aniketrajnish%2FRaymarching-Engine-Unity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aniketrajnish%2FRaymarching-Engine-Unity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aniketrajnish%2FRaymarching-Engine-Unity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aniketrajnish","download_url":"https://codeload.github.com/aniketrajnish/Raymarching-Engine-Unity/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aniketrajnish%2FRaymarching-Engine-Unity/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":["raymarcher","raymarching","raymarching-algorithm","signed-distance-functions","unity-plugin","unity-raymarching","unity-tool","unity3d"],"created_at":"2025-11-13T19:00:34.938Z","updated_at":"2025-11-25T02:30:14.410Z","avatar_url":"https://github.com/aniketrajnish.png","language":"C#","readme":"# Raymarching-Engine-Unity\nA fast GPU-accelerated raymarching engine for Unity with support for over 28 primitives (including fractals, n-dimensional objects, volumetric clouds) and set operations (Union, Subtract, Intersect). Includes a custom interface for manipulating shader parameters through the editor.\u003cbr\u003e\n\nhttps://user-images.githubusercontent.com/58925008/155891674-fdb4e1e8-3e80-447b-9439-aec03d8f34eb.mp4\n\n## Updates\n#### v002\n* The engine now stores the dimensions of the shapes as scriptable objects, to keep multiple instances of same shape persistant across sessions.\n* Added support for Ambient Occlussion, Hard/Soft Shadows and various render setting exposed for the users to play around with.\n* Download the `.unitypackage` [here](https://github.com/aniketrajnish/Raymarching-Engine-Unity/releases/tag/v002).\n\n## Rendering the shapes provided\n* Attach `Raymarcher.cs` to the Main Camera and `RaymarchRenderer.cs` to an empty gameobject.\n* Drag the `ImageEffectRaymarcher.shader` in Shader field of `Raymarcher.cs` in inspector and direction light to the Sun's transform field.\n* Click on `Create New Dimensions` in the `RaymarchRenderer.cs` to create a scriptable object to hold the dimesnion data of the shapes.\n* You can control the following settings for the raymarching using the `Raymarcher` component-\n  | Category             | Variable         | Description                                                                  |\n  |----------------------|------------------|------------------------------------------------------------------------------|\n  | **General Settings** | Shader           | Shader used for raymarching.                                                 |\n  |                      | Sun              | Directional light in the scene.                                              |\n  |                      | Loop             | Repetition of structures in the raymarching shader.                          |  \n  | **Light Settings**   | Is Lit           | Toggle lighting calculations on/off.                                         |\n  |                      | Is Shadow Hard   | Toggle between hard and soft shadows.                                        |\n  |                      | Is AO            | Enable or disable Ambient Occlusion.                                         |\n  |                      | Light Col        | Color of the light.                                                          |\n  |                      | Light Intensity  | Intensity of the light.                                                      |\n  |                      | Shadow Intensity | Intensity of shadows.                                                        |\n  |                      | Shadow Min       | Minimum shadow distance.                                                     |\n  |                      | Shadow Max       | Maximum shadow distance.                                                     |\n  |                      | Shadow Smooth    | Smoothness of shadow edges.                                                  |\n  |                      | AO Step          | Step size for AO calculation.                                                |\n  |                      | AO Intensity     | Intensity of AO.                                                             |\n  |                      | AO Iteration     | Number of iterations for AO calculation.                                     |\n  | **Render Settings**  | Max Steps        | Maximum number of steps for raymarching.                                     |\n  |                      | Max Dist         | Maximum distance to raymarch before considering a hit.                       |\n  |                      | Surf Dist        | Threshold for considering a hit in raymarching.                              |\n* You can control the following properties of the individual shapes using the `RaymarchRenderer` componnent-\n  | Category              | Variable         | Description                                                               |\n  |-----------------------|------------------|---------------------------------------------------------------------------|\n  | **Default Inspector** | Shape            | Shape to be rendered.                                                  |\n  |                       | Operation        | Operation to be performed (union, subtraction, intersection).             |\n  |                       | Color            | Color of the shape.                                                       |\n  |                       | Create New Dimensions | Button to create new dimenion scriptable object for the shape |\n  |                       | Dimensions       | Scriptable Object holding the shape's dimension data.                     |\n  | **Shape Dimensions**  | Dimension Props  | The dimension properties based on the chosen 4D shape.                    |\n\n## Rendering a custom shape\n* Append the distance function of the shape in `DFs.cginc` like\n    ```\n    float sdShape(float3 p, // dimension parameters)\t\n    {\n        // distance function here\n    }\n    ```   \n* Append the distance function created above in `GetDist()` in the `ImageEffectRaymarcher.shader`.\n    ```\n    float GetDist(Shape shape, float3 p) {\n        switch (shape.shapeIndex) {\n        case n:\n            return sdShape(float3 p, // dimension parameters);\n        }\n    }\n    ```\n* Add the shape data in the scriptable object `ShapeDimensions.cs`\n  ```\n  public float shapeDimension = default dimenison\n  ```\n* Add the shape in Shape enum in `RaymarchRenderer.cs` \n    ```\n    public enum Shape {\n        // shape name\n    };  \n    ```\n* Make the dimension array in `Helpers.cs` to be sent as a compute buffer to the Raymarching shader.\n    ```\n    public static vector12 GetDimensionVectors(int i)\n    {\n        //dimension vector12 object\n    }\n    ```\n* Finally make a custom editor for your shape in the `PropertiesEditor.cs`\n    ```\n    public override void OnInspectorGUI()\n    {\n        base.OnInspectorGUI();\n        RaymarchRenderer renderer = (RaymarchRenderer)target;        \n         \n        if (GUILayout.Button(\"Create New Dimensions\"))\n           renderer.dimensions = CreateShapeDimensionsAsset();\n         \n        if (renderer.dimensions == null)\n           return;\n    \n        switch (renderer.shape)\n        {\n            //property editor here\n        }\n    }\n    ```\n","funding_links":[],"categories":["ComputerGraphics \u0026\u0026 Shadingv"],"sub_categories":["Google Analytics"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faniketrajnish%2FRaymarching-Engine-Unity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faniketrajnish%2FRaymarching-Engine-Unity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faniketrajnish%2FRaymarching-Engine-Unity/lists"}