{"id":23379784,"url":"https://github.com/jiepengtan/unity-raymarching-framework","last_synced_at":"2025-10-24T10:39:50.761Z","repository":{"id":41281008,"uuid":"130640046","full_name":"JiepengTan/Unity-Raymarching-Framework","owner":"JiepengTan","description":"A framework to easy implement raymarching in unity. Include lots of hash,noise,fbm,SDF,rotate functions","archived":false,"fork":false,"pushed_at":"2018-04-27T14:52:31.000Z","size":1750,"stargazers_count":161,"open_issues_count":0,"forks_count":29,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-10T21:04:15.220Z","etag":null,"topics":["framework","library","raymarch","raymarching","shader","shadertoy","unity"],"latest_commit_sha":null,"homepage":"","language":"HLSL","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/JiepengTan.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}},"created_at":"2018-04-23T04:28:36.000Z","updated_at":"2025-03-22T10:51:37.000Z","dependencies_parsed_at":"2022-07-17T04:00:33.247Z","dependency_job_id":null,"html_url":"https://github.com/JiepengTan/Unity-Raymarching-Framework","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/JiepengTan/Unity-Raymarching-Framework","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JiepengTan%2FUnity-Raymarching-Framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JiepengTan%2FUnity-Raymarching-Framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JiepengTan%2FUnity-Raymarching-Framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JiepengTan%2FUnity-Raymarching-Framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JiepengTan","download_url":"https://codeload.github.com/JiepengTan/Unity-Raymarching-Framework/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JiepengTan%2FUnity-Raymarching-Framework/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280783844,"owners_count":26390277,"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-10-24T02:00:06.418Z","response_time":73,"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":["framework","library","raymarch","raymarching","shader","shadertoy","unity"],"created_at":"2024-12-21T19:27:43.608Z","updated_at":"2025-10-24T10:39:50.725Z","avatar_url":"https://github.com/JiepengTan.png","language":"HLSL","readme":"\n\n# Unity-Raymarching-Framework\nA framework to easy implement raymarching in unity. Include lots of hash,noise,fbm,SDF,rotate functions,most of them come from shadertoy,with this library,you can easy write raymarching shader in unity without rewrite the noise function again.    \n\nalso,this framework provide a easy way to merge your raymarching scene with unity scene.    \n\nInclude\nNoise:\n\u003e1.PNoise :Perlin Noise  \n2.VNoise :Value Noise  \n3.SNoise :Simplex Noise   \n4.WNoise :Worley Noise (Voronoi)  \n4.TNoise :TriNoise  \n\nHash\n\u003e//  x out, x in...  \nHashXX  \neg:\nfloat2 Hash22(float2 p)   \nmeans 2 in 2 out  \n\nFBM  \n\u003efloat FBM( float2 p )  \nfloat FBM( float2 p,float iterNum)  \n\nRot:\n\u003eRot2D  \nRot3D  \n\nSDF:\n\u003eSdBox ...  \nOpU OpS ...\n\nFile specification:\n\u003e.Math.cginc :some math functions and macros   \n.Hash.cginc : hash function  \n.Noise.cginc : Noise functions eg:PerlinNoise,ValueNoise,SimplexNoise,VoronoiNoise,TriNoise  \n.FBM.cginc: Fbm functions  \n.Feature.cginc: some special function : Caustic,Stars,Cloud,Fog ...    \n.SDF.cginc :some distance function use for modeling  \n.Framework3D.cginc  :a raymarching framework   \n.Framework3D_DefaultScene.cginc : use for quickly create a Test scene   \n\n\nWith this framework,you can easy merge raymarching scene with Unity ,and easy  to walk around in it ,without rewrite a \"SetCamera\" function to init ro,rd variable.\n\nHere is a example:\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/JiepengTan/JiepengTan.github.io/blob/master/assets/img/blog/Show/MergeRaymarchExample.gif?raw=true\" width=\"660\"\u003e\u003c/p\u003e   \n\n```c\nShader \"FishManShaderTutorial/RaymarchMergeExample\" {\n    Properties{\n        _MainTex(\"Base (RGB)\", 2D) = \"white\" {}\n    }\n    SubShader{\n        Pass {\n            ZTest Always Cull Off ZWrite Off\n            CGPROGRAM\n#pragma vertex vert   \n#pragma fragment frag  \n#include \"ShaderLibs/Framework3D.cginc\"\n            float4 ProcessRayMarch(float2 uv,float3 ro,float3 rd,inout float sceneDep,float4 sceneCol)  {\n                float3 col = float3(0.,0.,0.);\n                float3 n = float3(0.,1.0,0.);\n                float t = sceneDep + 10;\n                float occ = 0.;\n                float3 sc =  float3(0.,0.5,0.);\n                float3 sr = 0.5;\n                float3 ce = sc - ro;\n                float b = dot( rd, ce );\n                float tt = sr*sr - (dot( ce, ce )- b*b );\n                if( tt \u003e 0.0 ){\n                    t = b - sqrt(tt);\n                    float3 p = ro+t*rd;\n                    col = 0.5+0.5*cos(2.*PI*(float3(1.,1.,1.)*p.y*0.2+float3(0.,0.33,0.67)));\n                }\n                MergeRayMarchingIntoUnity(t,col, sceneDep,sceneCol);\n                return float4(col,1.0);\n            } \n            ENDCG\n        }//end pass\n    }//end SubShader\n    FallBack Off\n}\n```\n\n\nA simple scene example:  \n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/JiepengTan/JiepengTan.github.io/blob/master/assets/img/blog/ShaderTutorial3D/BounceBall/head.gif?raw=true\" width=\"512\"\u003e\u003c/p\u003e \n\n\n```c\n// create by JiepengTan 2018-04-14 \n// email: jiepengtan@gmail.com\nShader \"FishManShaderTutorial/SDFBounceBall\" {\n    Properties{\n        _MainTex(\"Base (RGB)\", 2D) = \"white\" {}\n    }\n    SubShader{\n        Pass {\n            ZTest Always Cull Off ZWrite Off\n            CGPROGRAM\n\n#pragma vertex vert   \n#pragma fragment frag  \n\n#define DEFAULT_PROCESS_FRAG\n#define DEFAULT_RENDER\n#include \"ShaderLibs/Framework3D_DefaultRender.cginc\"\n            \n            fixed SdBounceBalls(fixed3 pos){\n                fixed SIZE = 2.;\n                fixed2 gridSize = fixed2(SIZE,SIZE);\n                fixed rv = Hash12( floor((pos.xz) / gridSize));\n                pos.xz = OpRep(pos.xz,gridSize);\n                fixed bollSize = 0.1;\n                fixed bounceH = .5;\n                return SdSphere(pos- fixed3(0.,(bollSize+bounceH+sin(_Time.y*3.14 + rv*6.24)*bounceH),0.),bollSize);\n            }\n            // user define mat shading function \n            fixed3 MatCol(float matID,float3 pos,float3 nor)\n            { \n                // material        \n                fixed3 col = 0.45 + 0.35*sin( fixed3(0.05,0.08,0.10)*(matID-1.0) );\n                if( matID\u003c1.5 )\n                {       \n                    fixed f = CheckersGradBox( 5.0*pos.xz );\n                    col = 0.3 + f*fixed3(0.1,0.1,0.1);\n                }\n                return col;\n            }\n            // user define scene construct function\n            fixed2 Map( in fixed3 pos )\n            {\n                fixed2 res = fixed2( SdPlane(     pos), 1.0 )  ;\n                res = OpU( res, fixed2( SdBounceBalls( pos),1.) );\n                return res;\n            }\n\n            ENDCG\n        }//end pass\n    }//end SubShader\n    FallBack Off\n}\n\n```\n\nMore examples:\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/JiepengTan/JiepengTan.github.io/blob/master/assets/img/blog/ShaderTutorial3D/SDF/head.gif?raw=true\" width=\"512\"\u003e\u003c/p\u003e \n\n \u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/JiepengTan/JiepengTan.github.io/blob/master/assets/img/blog/Show/Fog.gif?raw=true\" width=\"512\"\u003e\u003c/p\u003e \n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/JiepengTan/JiepengTan.github.io/blob/master/assets/img/blog/Show/HpUI.gif?raw=true\" width=\"512\"\u003e\u003c/p\u003e \n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/JiepengTan/JiepengTan.github.io/blob/master/assets/img/blog/Show/LakeInHighland.gif?raw=true\" width=\"512\"\u003e\u003c/p\u003e \n\n\n- [More Examples][1]\n- [My shadertoy link][2]\n- [My blog][3]\n\n  [1]: https://github.com/JiepengTan/FishManShaderTutorial\n  [2]: https://www.shadertoy.com/user/FishMan\n  [3]: https://blog.csdn.net/tjw02241035621611","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiepengtan%2Funity-raymarching-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjiepengtan%2Funity-raymarching-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiepengtan%2Funity-raymarching-framework/lists"}