{"id":25944952,"url":"https://github.com/yinb1426/directional-flow-shader","last_synced_at":"2026-06-05T03:31:37.618Z","repository":{"id":279979320,"uuid":"870121929","full_name":"yinb1426/Directional-Flow-Shader","owner":"yinb1426","description":"Directional Flow Shader using URP","archived":false,"fork":false,"pushed_at":"2025-02-28T14:36:20.000Z","size":87,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T20:13:33.866Z","etag":null,"topics":["hlsl","shaderlab","unity","unity3d","urp"],"latest_commit_sha":null,"homepage":"","language":"ShaderLab","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/yinb1426.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,"publiccode":null,"codemeta":null}},"created_at":"2024-10-09T13:34:26.000Z","updated_at":"2025-02-28T14:36:23.000Z","dependencies_parsed_at":"2025-02-28T20:13:36.585Z","dependency_job_id":"cda18ef3-bbe7-4a37-919b-43a1735fbc6c","html_url":"https://github.com/yinb1426/Directional-Flow-Shader","commit_stats":null,"previous_names":["yinb1426/directional-flow-shader"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinb1426%2FDirectional-Flow-Shader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinb1426%2FDirectional-Flow-Shader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinb1426%2FDirectional-Flow-Shader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yinb1426%2FDirectional-Flow-Shader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yinb1426","download_url":"https://codeload.github.com/yinb1426/Directional-Flow-Shader/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241810032,"owners_count":20023884,"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":["hlsl","shaderlab","unity","unity3d","urp"],"created_at":"2025-03-04T08:20:17.906Z","updated_at":"2025-12-04T09:02:36.463Z","avatar_url":"https://github.com/yinb1426.png","language":"ShaderLab","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 动态流动水体Shader\n## 概述\n动态流动水体Shader基于FlowMap，将水体以**动态流动**方式呈现，并根据流动方向添加**泡沫**以加强流动呈现效果，用以呈现大范围水体流动效果。\n## 特性\n* 基于用户提供的FlowMap以及水深纹理WaterHeightTexture，实现流动效果。\n* 使用Blinn-Phong模型中的半兰伯特漫反射部分，实现光照效果。考虑到应用场景，没有加入高光部分\n* 设置4种波浪参数，实现无缝流动效果\n* 根据水深阈值混合泡沫纹理，以加强流动效果\n## Shader情况说明\n本工程提供2份Shader文件：Directional Flow Dynamic Shader、Directional Flow Shader。\n二者的差异在于：\n* 前者需要两份前后FlowMap和水深纹理，且需要提供插值参数以获取Lerp后的水流速度和水深值。\n* 后者仅需要一份FlowMap和水深纹理\n二者的使用场景如下：\n* 当有多个时间节点的FlowMap和水深纹理，需要连续显示水流运动过程时，请使用Directional Flow Dynamic Shader\n* 当仅有一个时间节点的FlowMap和水深纹理，需要观察某一时刻的水流运动时，请使用Directional Flow Shader\n\u003e 之后的参数说明将以Directional Flow Shader为例\n## 参数\n**常规及贴图**：\n| 参数 | 类型 | \u003ccenter\u003e说明\u003c/center\u003e | 建议参考值 |\n| :------: | :------: | ------ | :------: |\n| DisplacementMap | 2D | 平面波浪高度的位移贴图 | |\n| NormalMap | 2D | 平面波浪高度位移贴图对应的法线贴图 | |\n| NormalStrength | Float | 法线强度 | 0.7 |\n| FlowMap | 2D | 流向贴图 | |\n| WaterHeightTexture | 2D | 水深贴图 (也可以使用CG方法获取水深) | |\n| HeightNoiseMap | 2D | 水面高度噪声贴图 | |\n| HeightNoiseNormalMap | 2D | 水面高度噪声法线贴图 | |\n\n**水体颜色与水深**：\n| 参数 | 类型 | \u003ccenter\u003e说明\u003c/center\u003e | 建议参考值 |\n| :------: | :------: | ------ | :------: |\n| WaterShallowColor | Color | 浅水颜色 | (4, 93, 111, 170) |\n| WaterDeepColor | Color | 深水颜色 |  (78, 110, 133, 240) |\n| DepthDensity | Float | 调节水深的系数，用于更好地显示水体颜色 | 1 |\n\n**波浪参数**：\n| 参数 | 类型 | \u003ccenter\u003e说明\u003c/center\u003e |\n| :------: | :------: | ------ |\n| GridResolution | Float | 水面细分网格大小 |\n| WavePeriod | Float | 控制位移贴图(三角函数)的周期 |\n| FlowVelocityStrength | Float | 流速控制 |\n* 波浪参数共4组，建议参考值为：\n    * (40, 1.578, 0.2)\n    * (60, 1.36, 0.285)\n    * (70, 1.6, 0.454)\n    * (50, 2.54, 0.238)\n**浪尖泡沫**：\n| 参数 | 类型 | \u003ccenter\u003e说明\u003c/center\u003e | 建议参考值 |\n| :------: | :------: | ------ | :------: |\n| FoamTexture | 2D | 泡沫纹理 | Tiling = 300X300 | \n| FoamMinEdge | Range(0, 1) | 显示泡沫的最低高度 | 0.3 |\n| FoamMaxEdge | Range(0, 1) | 显示泡沫的最高高度 | 0.5 |\n| FoamBlend | Range(0, 1) | 和水体颜色的混合程度 | 0.7 |\n## 实现效果\n![Lighthouse](https://github.com/yinb1426/Directional-Flow-Shader/blob/main/Pictures/Flow.png)\n## 参考\n* https://www.youtube.com/watch?v=XCvaH7nRDmg\n* https://onlinelibrary.wiley.com/doi/full/10.1111/cgf.13669\n* https://catlikecoding.com/unity/tutorials/flow/directional-flow/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyinb1426%2Fdirectional-flow-shader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyinb1426%2Fdirectional-flow-shader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyinb1426%2Fdirectional-flow-shader/lists"}