{"id":20508867,"url":"https://github.com/smkplus/cyberpunkeffect","last_synced_at":"2025-06-11T13:02:35.538Z","repository":{"id":101453377,"uuid":"245365313","full_name":"smkplus/CyberPunkEffect","owner":"smkplus","description":null,"archived":false,"fork":false,"pushed_at":"2020-03-09T08:40:02.000Z","size":2690,"stargazers_count":46,"open_issues_count":1,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T12:23:52.820Z","etag":null,"topics":["shader","unity"],"latest_commit_sha":null,"homepage":null,"language":"ShaderLab","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/smkplus.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":"2020-03-06T08:20:46.000Z","updated_at":"2024-09-27T13:50:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"90b4393e-e8e5-4391-bd8f-bae3c6ca4668","html_url":"https://github.com/smkplus/CyberPunkEffect","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smkplus%2FCyberPunkEffect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smkplus%2FCyberPunkEffect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smkplus%2FCyberPunkEffect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smkplus%2FCyberPunkEffect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smkplus","download_url":"https://codeload.github.com/smkplus/CyberPunkEffect/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248788927,"owners_count":21161727,"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","unity"],"created_at":"2024-11-15T20:20:52.103Z","updated_at":"2025-04-13T22:10:30.084Z","avatar_url":"https://github.com/smkplus.png","language":"ShaderLab","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Cyberpunk 2077 Scanning Effect\n\nThis effect Recreated By:\n\nSeyed Morteza Kamali\n\nMohammad Zamanian\n\n\n![image](https://user-images.githubusercontent.com/16706911/76066136-3c589380-5fa2-11ea-917e-ec85529c580c.png)\n\n\n\n\n![Record_2020_03_06_12_07_50_569](https://user-images.githubusercontent.com/16706911/76066724-6199d180-5fa3-11ea-904e-0ac2b623ba2f.gif)\n![Record_2020_03_06_12_08_48_299](https://user-images.githubusercontent.com/16706911/76066664-48912080-5fa3-11ea-9b0d-6bac6137143d.gif)\n\n\n# 1. Introduction\nThis tutorial will describe step-by-step how to write a cyber punk like scanning effect in unity. The effect is made from different parts such as outline, pixelation and fill effect. You can see the effect in the following images:\n\n\n![image](https://user-images.githubusercontent.com/16706911/76066897-b2a9c580-5fa3-11ea-9113-032b6d1b73a1.png)\n\n![Record_2020_03_06_12_24_27_337](https://user-images.githubusercontent.com/16706911/76078657-57ce9900-5fb8-11ea-921f-b84640550de5.gif)\n\n\n## Our Implementation\n## https://twitter.com/ShaderGuy/status/1217308220034899969?s=20\n\n## Full Video:\n## https://twitter.com/ShaderGuy/status/1217315711401582594?s=20\n\n# 2. Objects mask\nAs you may know, we can implement outline effect and fill effect easily in regular object shaders using vertex distortion and screen space overlay effects, but the third effect which cannot be implemented using regular shaders is pixelation effect, this effect can only be created using image effects because it goes outside the object with this effect applied. The problem with this implementation is that we cannot apply the image effect on specific objects and it will be applied to the whole screen. So we need a way to mask our objects in our image effect shader.\nThere are two ways to implement object mask to use it in our effect:\n1.Using unity’s pre-rendered stencil buffer\n2.Using stencil buffer along with command buffers\n3.Using command buffers\n\n\n# 2.1 Using stencil buffer\nA stencil buffer is an extra data buffer, in addition to color buffer and depth buffer. The buffer is per pixel and works on 8bit integer values.\nIn the simplest case, the stencil buffer is used to mask area of rendering. For example, you want to render a character everywhere but in a sphere.\nAs shown in the image below, before anything is drawn in stencil buffer, the buffer is filled with zeros for each pixel and is black and we can make it white by replacing the buffer values in the area of the object we want to mask with.\n\n![image](https://user-images.githubusercontent.com/16706911/76067160-2fd53a80-5fa4-11ea-88ce-78208de39a22.png)\n```\n// Make my area of rendering’s stencil buffer white.\nStencil\n{\n    Ref 1\n    Comp Always\n    Pass Replace\n}\n```\nThen create another default shader called “MaskedShader” and add the following lines as you did before, create a material of it and add it to the human.\n```\n// Draw me where stencil buffer is black\nStencil\n{\n    Ref 0\n    Comp Equal\n}\n```\n![image](https://user-images.githubusercontent.com/16706911/76067377-7e82d480-5fa4-11ea-95a4-7ff936d83289.png)\n\n\n\n// old image effect technique and description\n## Using stencil buffer along with command buffer\n\n## Using only command buffers\n// describing command buffers\n## Image effect\n\n## Outline effect\n## Fill effect\n\n![image](https://user-images.githubusercontent.com/16706911/76071779-07513e80-5fac-11ea-8b38-b1d49b4000a9.png)\n\n## Pixelate effect\n## Applying to multiple objects\n\n\n# Useful links:\n\n## [Image effect on specific part of objects](https://www.linkedin.com/pulse/image-effect-specific-part-objects-seyed-morteza-kamali/)\n\n![0](https://user-images.githubusercontent.com/16706911/76190501-60aaaf00-61f2-11ea-8844-73f1af39d574.jpg)\n\n\n# ToDo\nComplete the Tutorial\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmkplus%2Fcyberpunkeffect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmkplus%2Fcyberpunkeffect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmkplus%2Fcyberpunkeffect/lists"}