{"id":19685744,"url":"https://github.com/mob-sakai/staticbluredscreen","last_synced_at":"2025-04-29T06:30:48.151Z","repository":{"id":37733105,"uuid":"113805148","full_name":"mob-sakai/StaticBluredScreen","owner":"mob-sakai","description":"Non-realtime (=static) screen blur for Unity. Easy to use background for dialogs.","archived":false,"fork":false,"pushed_at":"2019-01-03T11:17:11.000Z","size":246,"stargazers_count":191,"open_issues_count":1,"forks_count":30,"subscribers_count":14,"default_branch":"develop","last_synced_at":"2024-11-11T17:45:39.709Z","etag":null,"topics":["background","blur","effects","shader","ugui","ui","unity","unity3d"],"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/mob-sakai.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-11T02:57:53.000Z","updated_at":"2024-10-26T12:33:55.000Z","dependencies_parsed_at":"2022-09-16T06:10:16.588Z","dependency_job_id":null,"html_url":"https://github.com/mob-sakai/StaticBluredScreen","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mob-sakai%2FStaticBluredScreen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mob-sakai%2FStaticBluredScreen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mob-sakai%2FStaticBluredScreen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mob-sakai%2FStaticBluredScreen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mob-sakai","download_url":"https://codeload.github.com/mob-sakai/StaticBluredScreen/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224152858,"owners_count":17264777,"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":["background","blur","effects","shader","ugui","ui","unity","unity3d"],"created_at":"2024-11-11T18:23:48.936Z","updated_at":"2024-11-11T18:23:49.498Z","avatar_url":"https://github.com/mob-sakai.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"StaticBluredScreen\n===\n\n### NOTE: This project has been integrated into [UIEffect](https://github.com/mob-sakai/UIEffect), so we are NOT continuing development in this repository.\n\n[![](https://img.shields.io/github/release/mob-sakai/StaticBluredScreen.svg?label=latest%20version)](https://github.com/mob-sakai/StaticBluredScreen/releases)\n[![](https://img.shields.io/github/release-date/mob-sakai/StaticBluredScreen.svg)](https://github.com/mob-sakai/StaticBluredScreen/releases)  \n![](https://img.shields.io/badge/requirement-Unity%205.5%2B-green.svg)\n[![](https://img.shields.io/github/license/mob-sakai/StaticBluredScreen.svg)](https://github.com/mob-sakai/StaticBluredScreen/blob/master/LICENSE.txt)  \n[![](https://img.shields.io/github/last-commit/mob-sakai/StaticBluredScreen/develop.svg?label=last%20commit%20to%20develop)](https://github.com/mob-sakai/StaticBluredScreen/commits/develop)\n[![](https://img.shields.io/github/issues/mob-sakai/StaticBluredScreen.svg)](https://github.com/mob-sakai/StaticBluredScreen/issues)\n\n\n\u003c\u003c [Description](#Description) | [WebGL Demo](#demo) | [Download](https://github.com/mob-sakai/StaticBluredScreen/releases) | [Usage](#usage) | [Change log](https://github.com/mob-sakai/StaticBluredScreen/blob/develop/CHANGELOG.md) \u003e\u003e\n\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n## Overview\n\n![image](https://user-images.githubusercontent.com/12690315/33933482-3238bd34-e039-11e7-864c-bb22f8be9e5e.png)\n\n静的なブラースクリーンを表示します.\nポストエフェクト等によるリアルタイムブラーとは異なり、ある時点でのレンダリング結果に対するブラーのみを提供します.\n\n1. ブラー処理用のCameraが不要です.\n2. ブラーは常時実行されません. テクスチャ更新を実行したあと1度だけ実行されます.\n3. 縮小バッファを利用することで、メモリサイズを小さく抑えます.\n4. スクリーン | ブラー | ダイアログ1 | ブラー | ダイアログ2 ... のように、重ねて表示できます.\n5. 激しい動きのあるオブジェクトがスクリーン上にある場合、ブラーテクスチャにズレが発生し得ます.\n\n![](https://user-images.githubusercontent.com/12690315/33972462-5c8d1d04-e0c1-11e7-8e04-a8089a208f0d.gif)\n\n\n\n\n## How To Work?\n\nカメラに対し以下のコマンドバッファを１フレームだけ割り当てています.  \n縮小バッファを利用してブラーを適用し、出力先RTにコピーしているだけです.  \nその後、出力先RTをRawImage等で表示させると、ブラーが画面に適用されているように見えます.  \nブラーが適用されるのはあくまで縮小バッファであり、レンダリング負荷がほとんどかからないことに注意してください.\n\n```cs\n// テンポラリRTに対するIDを生成.\nint copyId = Shader.PropertyToID(\"_ScreenCopy\");\nint blurId = Shader.PropertyToID(\"_StaticBlur\");\n\n// ブラーシェーダを割り当てたマテリアルを生成.\nMaterial materialBlur = new Material(shaderBlur);\n\n// 出力先RTを生成.\nRenderTexture rt = new RenderTexture(w, h);\n\n// カメラのレンダリング結果をRTにコピー.\nbuffer = new CommandBuffer();\nbuffer.GetTemporaryRT(copyId, -1, -1, 0, FilterMode.Bilinear);\nbuffer.Blit(BuiltinRenderTextureType.CurrentActive, copyId);\n\n// 縮小バッファを利用して、ブラーシェーダを適用.\nbuffer.GetTemporaryRT(blurId, w/4, h/4, 0, FilterMode.Bilinear);\nbuffer.Blit(copyId, blurId, materialBlur);\n\n// 縮小バッファから出力先RTにコピー.\nbuffer.Blit(blurId, rtId);\n\n// テンポラリRTを解放.\nbuffer.ReleaseTemporaryRT(blurId);\nbuffer.ReleaseTemporaryRT(copyId);\n\n// コマンドバッファをカメラに追加.\n_camera.AddCommandBuffer(CameraEvent.AfterImageEffects, buffer);\n```\n\n\n\n\n## Requirement\n\n* Unity5.5+ *(included Unity 2017.x)*\n* No other SDK\n\n\n\n\n## Usage\n\n1. Download [StaticBluredScreen.unitypackage](https://github.com/mob-sakai/StaticBluredScreen/raw/master/StaticBluredScreen.unitypackage) and install to your project.\n1. Attach `StaticBluredScreen` component to GameObject.\n1. In playmode, call `StaticBluredScreen.UpdateTexture`.\n1. Enjoy!\n\n![image](https://user-images.githubusercontent.com/12690315/40522542-6fc60e1a-600c-11e8-8b22-9a41f21e8657.png)\n\n\n\n\n## Demo\n\n[demo](https://developer.cloud.unity3d.com/share/-kw9dNzDxX/webgl/)\n\nダイアログを開くタイミングで静的なスクリーンブラーを生成し、アニメーションでフェードイン/アウトするデモです.  \nシーン内にカメラは1つしかありません.  \nダイアログが2つ重なったとき、更にブラーを生成しています.\n\n\n\n\n## License\n\nMIT  \n© UTJ/UCL\n\n\n## Author\n\n[mob-sakai](https://github.com/mob-sakai)\n\n\n\n\n## See Also\n\n* GitHub Page : https://github.com/mob-sakai/StaticBluredScreen\n* Issue tracker : https://github.com/mob-sakai/StaticBluredScreen/issues\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmob-sakai%2Fstaticbluredscreen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmob-sakai%2Fstaticbluredscreen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmob-sakai%2Fstaticbluredscreen/lists"}