├── .gitattributes ├── .github ├── templates │ └── header.hbs └── workflows │ └── main.yml ├── .gitignore ├── CHANGELOG.md ├── CHANGELOG.md.meta ├── Documentation~ ├── Images │ ├── culling_mask.png │ ├── displacement_mask.png │ ├── displacement_texture.png │ ├── layer_mask.png │ ├── outline_mesh_normal.png │ ├── outline_mesh_pixelart.png │ ├── outline_normal.png │ ├── outline_pixelart.png │ ├── render_feature.png │ ├── render_feature_ui.png │ ├── renderer_rendering_layer_mask.png │ ├── rendering_layer_mask.png │ ├── secondary_texture.png │ ├── shader_properties.png │ ├── shader_types.png │ ├── shader_variant_default.png │ ├── shader_variant_normal.png │ ├── shader_variant_pixelart.png │ ├── velocity_camera.png │ ├── velocity_camera_ui.png │ ├── velocity_emitter_component.png │ ├── velocity_emitter_object.png │ ├── velocity_texture_blur.png │ ├── velocity_texture_no_blur.png │ └── velocity_texture_preview.png ├── emitters.md ├── index.md ├── properties.md ├── shaders.md └── velocity.md ├── Editor.meta ├── Editor ├── Common.meta ├── Common │ ├── RenderingLayerMaskPropertyDrawer.cs │ ├── RenderingLayerMaskPropertyDrawer.cs.meta │ ├── VelocityEmitterEditor.cs │ └── VelocityEmitterEditor.cs.meta ├── Unity.PixelGraphics.Editor.asmdef ├── Unity.PixelGraphics.Editor.asmdef.meta ├── Universal.meta └── Universal │ ├── VelocityCameraEditor.cs │ └── VelocityCameraEditor.cs.meta ├── LICENSE.md ├── LICENSE.md.meta ├── README.md ├── README.md.meta ├── Runtime.meta ├── Runtime ├── AssemblyInfo.cs ├── AssemblyInfo.cs.meta ├── Common.meta ├── Common │ ├── RenderingLayerMask.cs │ ├── RenderingLayerMask.cs.meta │ ├── ShaderIds.cs │ ├── ShaderIds.cs.meta │ ├── SimulationSettings.cs │ ├── SimulationSettings.cs.meta │ ├── VelocityEmitter.cs │ ├── VelocityEmitter.cs.meta │ ├── VelocityPassSettings.cs │ └── VelocityPassSettings.cs.meta ├── Forward.meta ├── Forward │ ├── VelocityRenderFeature.cs │ ├── VelocityRenderFeature.cs.meta │ ├── VelocityRenderPass.cs │ └── VelocityRenderPass.cs.meta ├── Materials.meta ├── Materials │ ├── Velocity.meta │ └── Velocity │ │ ├── debug_material.mat │ │ ├── debug_material.mat.meta │ │ ├── emitter_material.mat │ │ └── emitter_material.mat.meta ├── Prefabs.meta ├── Prefabs │ ├── Velocity Emitter.prefab │ └── Velocity Emitter.prefab.meta ├── Shaders.meta ├── Shaders │ ├── Foliage.meta │ ├── Foliage │ │ ├── foliage_pixelart_shader.shadergraph │ │ ├── foliage_pixelart_shader.shadergraph.meta │ │ ├── foliage_shader.shadergraph │ │ ├── foliage_shader.shadergraph.meta │ │ ├── grass_pixelart_shader.shadergraph │ │ ├── grass_pixelart_shader.shadergraph.meta │ │ ├── grass_shader.shadergraph │ │ └── grass_shader.shadergraph.meta │ ├── SimplexNoise3D.hlsl │ ├── SimplexNoise3D.hlsl.meta │ ├── Velocity.meta │ ├── Velocity │ │ ├── Blit.shader │ │ ├── Blit.shader.meta │ │ ├── Emitter.shader │ │ ├── Emitter.shader.meta │ │ ├── debug_shader.shadergraph │ │ └── debug_shader.shadergraph.meta │ ├── VelocitySimulation.hlsl │ └── VelocitySimulation.hlsl.meta ├── Unity.PixelGraphics.asmdef ├── Unity.PixelGraphics.asmdef.meta ├── Universal.meta └── Universal │ ├── VelocityCamera.cs │ └── VelocityCamera.cs.meta ├── Tests.meta ├── Tests ├── Runtime.meta └── Runtime │ ├── Unity.PixelGraphics.Tests.asmdef │ └── Unity.PixelGraphics.Tests.asmdef.meta ├── package.json ├── package.json.meta ├── release.config.js └── release.config.js.meta /.gitattributes: -------------------------------------------------------------------------------- 1 | # 3D models 2 | *.3dm filter=lfs diff=lfs merge=lfs -text 3 | *.3ds filter=lfs diff=lfs merge=lfs -text 4 | *.blend filter=lfs diff=lfs merge=lfs -text 5 | *.c4d filter=lfs diff=lfs merge=lfs -text 6 | *.collada filter=lfs diff=lfs merge=lfs -text 7 | *.dae filter=lfs diff=lfs merge=lfs -text 8 | *.dxf filter=lfs diff=lfs merge=lfs -text 9 | *.fbx filter=lfs diff=lfs merge=lfs -text 10 | *.jas filter=lfs diff=lfs merge=lfs -text 11 | *.lws filter=lfs diff=lfs merge=lfs -text 12 | *.lxo filter=lfs diff=lfs merge=lfs -text 13 | *.ma filter=lfs diff=lfs merge=lfs -text 14 | *.max filter=lfs diff=lfs merge=lfs -text 15 | *.mb filter=lfs diff=lfs merge=lfs -text 16 | *.obj filter=lfs diff=lfs merge=lfs -text 17 | *.ply filter=lfs diff=lfs merge=lfs -text 18 | *.skp filter=lfs diff=lfs merge=lfs -text 19 | *.stl filter=lfs diff=lfs merge=lfs -text 20 | *.ztl filter=lfs diff=lfs merge=lfs -text 21 | # Audio 22 | *.aif filter=lfs diff=lfs merge=lfs -text 23 | *.aiff filter=lfs diff=lfs merge=lfs -text 24 | *.it filter=lfs diff=lfs merge=lfs -text 25 | *.mod filter=lfs diff=lfs merge=lfs -text 26 | *.mp3 filter=lfs diff=lfs merge=lfs -text 27 | *.ogg filter=lfs diff=lfs merge=lfs -text 28 | *.s3m filter=lfs diff=lfs merge=lfs -text 29 | *.wav filter=lfs diff=lfs merge=lfs -text 30 | *.xm filter=lfs diff=lfs merge=lfs -text 31 | # Fonts 32 | *.otf filter=lfs diff=lfs merge=lfs -text 33 | *.ttf filter=lfs diff=lfs merge=lfs -text 34 | # Images 35 | *.bmp filter=lfs diff=lfs merge=lfs -text 36 | *.exr filter=lfs diff=lfs merge=lfs -text 37 | *.gif filter=lfs diff=lfs merge=lfs -text 38 | *.hdr filter=lfs diff=lfs merge=lfs -text 39 | *.iff filter=lfs diff=lfs merge=lfs -text 40 | *.jpeg filter=lfs diff=lfs merge=lfs -text 41 | *.jpg filter=lfs diff=lfs merge=lfs -text 42 | *.pict filter=lfs diff=lfs merge=lfs -text 43 | *.png filter=lfs diff=lfs merge=lfs -text 44 | *.psd filter=lfs diff=lfs merge=lfs -text 45 | *.tga filter=lfs diff=lfs merge=lfs -text 46 | *.tif filter=lfs diff=lfs merge=lfs -text 47 | *.tiff filter=lfs diff=lfs merge=lfs -text 48 | 49 | # Collapse Unity-generated files on GitHub 50 | *.asset linguist-generated 51 | *.mat linguist-generated 52 | *.meta linguist-generated 53 | *.prefab linguist-generated 54 | *.unity linguist-generated -------------------------------------------------------------------------------- /.github/templates/header.hbs: -------------------------------------------------------------------------------- 1 | {{#if isPatch~}} 2 | ## 3 | {{~else~}} 4 | # 5 | {{~/if}} {{#if @root.linkCompare~}} 6 | [{{version}}]( 7 | {{~#if @root.repository~}} 8 | {{~#if @root.host}} 9 | {{~@root.host}}/ 10 | {{~/if}} 11 | {{~#if @root.owner}} 12 | {{~@root.owner}}/ 13 | {{~/if}} 14 | {{~@root.repository}} 15 | {{~else}} 16 | {{~@root.repoUrl}} 17 | {{~/if~}} 18 | /compare/{{previousTag}}...{{currentTag}}) 19 | {{~else}} 20 | {{~version}} 21 | {{~/if}} 22 | {{~#if title}} "{{title}}" 23 | {{~/if}} 24 | {{~#if date}} ({{date}}) 25 | {{/if}} 26 | 27 | ### Installation url 28 | ``` 29 | {{#if @root.repository}} 30 | {{~#if @root.host~}} 31 | {{@root.host}}/ 32 | {{~/if~}} 33 | {{~#if @root.owner~}} 34 | {{@root.owner}}/ 35 | {{~/if~}} 36 | {{@root.repository}} 37 | {{~else~}} 38 | {{@root.repoUrl}} 39 | {{~/if~}} 40 | #{{currentTag}} 41 | ``` 42 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | - preview 8 | 9 | jobs: 10 | release: 11 | name: Release 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout repository 15 | uses: actions/checkout@v2 16 | with: 17 | lfs: true 18 | 19 | - name: Release 20 | uses: cycjimmy/semantic-release-action@v2 21 | with: 22 | extra_plugins: | 23 | @semantic-release/changelog 24 | @semantic-release/git 25 | env: 26 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Uu]ser[Ss]ettings/ 12 | /[Cc]ode[Cc]overage/ 13 | 14 | # MemoryCaptures can get excessive in size. 15 | # They also could contain extremely sensitive data 16 | /[Mm]emoryCaptures/ 17 | 18 | # Asset meta data should only be ignored when the corresponding asset is also ignored 19 | !/[Aa]ssets/**/*.meta 20 | 21 | # Uncomment this line if you wish to ignore the asset store tools plugin 22 | # /[Aa]ssets/AssetStoreTools* 23 | 24 | # Autogenerated Jetbrains Rider plugin 25 | /[Aa]ssets/Plugins/Editor/JetBrains* 26 | 27 | # Visual Studio cache directory 28 | .vs/ 29 | 30 | # Gradle cache directory 31 | .gradle/ 32 | 33 | # Autogenerated VS/MD/Consulo solution and project files 34 | ExportedObj/ 35 | .consulo/ 36 | *.csproj 37 | *.unityproj 38 | *.sln 39 | *.suo 40 | *.tmp 41 | *.user 42 | *.userprefs 43 | *.pidb 44 | *.booproj 45 | *.svd 46 | *.pdb 47 | *.mdb 48 | *.opendb 49 | *.VC.db 50 | 51 | # Unity3D generated meta files 52 | *.pidb.meta 53 | *.pdb.meta 54 | *.mdb.meta 55 | 56 | # Unity3D generated file on crash reports 57 | sysinfo.txt 58 | 59 | # Builds 60 | *.apk 61 | *.aab 62 | *.unitypackage 63 | 64 | # Crashlytics generated file 65 | crashlytics-build.properties 66 | 67 | # Packed Addressables 68 | /[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin* 69 | 70 | # Temporary auto-generated Android Assets 71 | /[Aa]ssets/[Ss]treamingAssets/aa.meta 72 | /[Aa]ssets/[Ss]treamingAssets/aa/* 73 | 74 | # Windows thumbnail cache files 75 | Thumbs.db 76 | Thumbs.db:encryptable 77 | ehthumbs.db 78 | ehthumbs_vista.db 79 | 80 | # Dump file 81 | *.stackdump 82 | 83 | # Folder config file 84 | [Dd]esktop.ini 85 | 86 | # Recycle Bin used on file shares 87 | $RECYCLE.BIN/ 88 | 89 | # Windows Installer files 90 | *.cab 91 | *.msi 92 | *.msix 93 | *.msm 94 | *.msp 95 | 96 | # Windows shortcuts 97 | *.lnk 98 | 99 | # IDE 100 | .idea 101 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [1.0.1](https://github.com/aarthificial/pixelgraphics/compare/v1.0.0...v1.0.1) (2021-06-20) 2 | 3 | ### Installation url 4 | ``` 5 | https://github.com/aarthificial/pixelgraphics#v1.0.1 6 | ``` 7 | 8 | 9 | ### Bug Fixes 10 | 11 | * fix normal shaders ([488c0c7](https://github.com/aarthificial/pixelgraphics/commit/488c0c70b04d203b601d250c1d5d408cdc132737)) 12 | 13 | # 1.0.0 (2021-06-20) 14 | 15 | ### Installation url 16 | ``` 17 | https://github.com/aarthificial/pixelgraphics#v1.0.0 18 | ``` 19 | 20 | 21 | ### Bug Fixes 22 | 23 | * fix emitter layer detection ([9a786b7](https://github.com/aarthificial/pixelgraphics/commit/9a786b7a5bb1e0f11c7b9e1f63709d5a9d3d151e)) 24 | -------------------------------------------------------------------------------- /CHANGELOG.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e6bed991b131b214894f8a9cb9d1b36f 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Documentation~/Images/culling_mask.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c2c33e4d2f5bd714eb973a70e4ec0dca2b514b4e7f7be81b0543b51eadcfb589 3 | size 37866 4 | -------------------------------------------------------------------------------- /Documentation~/Images/displacement_mask.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cf697ad70e03f0f34fc58dda0213138b47d007bf68325c42de8e94b045592147 3 | size 3771 4 | -------------------------------------------------------------------------------- /Documentation~/Images/displacement_texture.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8238601c84836daab44849b45ad0fb6e8d1c366decb9c0dea4e187474e6f895a 3 | size 6433 4 | -------------------------------------------------------------------------------- /Documentation~/Images/layer_mask.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cb5ce172650f9fbce68ccb419b400a0c86cc36d4885390204692f8ecb8fae0d5 3 | size 26384 4 | -------------------------------------------------------------------------------- /Documentation~/Images/outline_mesh_normal.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d31b6c70b7ef3bda876119b8fb146bc5ea086b6c444ba0e5089b4a36d26200d4 3 | size 11235 4 | -------------------------------------------------------------------------------- /Documentation~/Images/outline_mesh_pixelart.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8845a4e8e0aed3539a78a21b3996a69f7d88c755c88a6fcad3d6e8b430e38fef 3 | size 5851 4 | -------------------------------------------------------------------------------- /Documentation~/Images/outline_normal.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4932a5775020861a24c807a0bc8a04deee2604ebe40b536a07a157c4d70bdb3d 3 | size 14273 4 | -------------------------------------------------------------------------------- /Documentation~/Images/outline_pixelart.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:bc2eef586685375ba3343b4b0a01739660fd23ed2bab9a46bc259372b11a0ec4 3 | size 5525 4 | -------------------------------------------------------------------------------- /Documentation~/Images/render_feature.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8bad1c37d99256a6e956c7ff37c02b407d05033316047d58b179461b2fe11146 3 | size 30996 4 | -------------------------------------------------------------------------------- /Documentation~/Images/render_feature_ui.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c56dc54cce6df1e15f5870b10917004a25ebe01d7e1ec1f4cc7034f21387ec8f 3 | size 20274 4 | -------------------------------------------------------------------------------- /Documentation~/Images/renderer_rendering_layer_mask.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:14b4a6d6ee1fb1c7da88bcc9719d1b5600c1792c43f2d7302ecff8d79168fcde 3 | size 33862 4 | -------------------------------------------------------------------------------- /Documentation~/Images/rendering_layer_mask.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:de091d81c8a307e86add8694840d89658e749abd46607dd9c5ca8d6f83937f1b 3 | size 27542 4 | -------------------------------------------------------------------------------- /Documentation~/Images/secondary_texture.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:727ee2d6cf86a286ff3d3159ae12798661c5cdf68d4267ea7a560c212ad5aa3a 3 | size 11137 4 | -------------------------------------------------------------------------------- /Documentation~/Images/shader_properties.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5bbfbea40dabfe04927c2eb9146b6b0728322d06392e52591d64ad9de96b2b84 3 | size 57800 4 | -------------------------------------------------------------------------------- /Documentation~/Images/shader_types.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:56aeb21776608a7c0ed110148f5e06891a6903e4522949ec6d43a669671774fd 3 | size 21904 4 | -------------------------------------------------------------------------------- /Documentation~/Images/shader_variant_default.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7ca13d9ba8b91ca138ee0aef77d27f6889f7389b7bfcb752a34a612da1182521 3 | size 4237 4 | -------------------------------------------------------------------------------- /Documentation~/Images/shader_variant_normal.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4fc1db4de4569d7ef96d7c055037c0accb0d9360e43403b97f44744c96ac81b9 3 | size 13075 4 | -------------------------------------------------------------------------------- /Documentation~/Images/shader_variant_pixelart.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:bc2bbdd62cb30718833fb81ae581948c9552bec19f1b4544e154a31a4c276b4c 3 | size 5574 4 | -------------------------------------------------------------------------------- /Documentation~/Images/velocity_camera.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c5643dcd06a622da08f44de00dc04fc535a5d2e4ee41c90b88214892f8b2ac42 3 | size 29045 4 | -------------------------------------------------------------------------------- /Documentation~/Images/velocity_camera_ui.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:065282540d5d6cf6d79715470fe0978c3a2cbe018c57de2a962f7e188302b3d5 3 | size 14804 4 | -------------------------------------------------------------------------------- /Documentation~/Images/velocity_emitter_component.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d86965c777a0f693b3e229ac8c5d5d40c74e74885ea0a08d5bd53964eba489b3 3 | size 35539 4 | -------------------------------------------------------------------------------- /Documentation~/Images/velocity_emitter_object.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5924b4acccea9307cf08cc1ba163d4b3c0edd1ee41626025f683feb52b59f61c 3 | size 32465 4 | -------------------------------------------------------------------------------- /Documentation~/Images/velocity_texture_blur.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3f6544fddbc6517343195c3616f71e4ef095070babf210b0537f4df54d078c59 3 | size 23131 4 | -------------------------------------------------------------------------------- /Documentation~/Images/velocity_texture_no_blur.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f82e374e9b0f1d208a947d6051931e007eb8f5939e1dbe6e3ce53d52cb652233 3 | size 11745 4 | -------------------------------------------------------------------------------- /Documentation~/Images/velocity_texture_preview.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:815a91fbdda591083f98dc0f7dcfa8911e57bee54043972bb2f4dbd5c285899f 3 | size 39395 4 | -------------------------------------------------------------------------------- /Documentation~/emitters.md: -------------------------------------------------------------------------------- 1 | # Velocity Emitters 2 | Objects that interact with the velocity texture are called velocity emitters.
3 | There are two main ways of setting them up. 4 | 5 | ## Standalone emitter 6 | A standalone emitter is any renderer assigned to a layer dedicated for velocity emitters.
7 | This layer is excluded when rendering the scene making all standalone emitters invisible. 8 | 9 | 1. Create a dedicated layer for velocity emitters (For example - "Velocity") 10 | 11 | 1. Setup the layer mask to contain the created layer
12 | ![Layer Mask property](Images/layer_mask.png) 13 | 14 | 1. If you are using a render feature, exclude the layer in the filtering settings
15 | ![Filtering > Transparent Layer Mask property](Images/culling_mask.png)
16 | (When using a velocity camera, the layer will be excluded autmatically) 17 | 18 | 1. Create an emitter
19 | ![2D Object > Sprites > Velocity Emitter](Images/velocity_emitter_object.png)
20 | See the _Configuration_ section below for more info on how to configure an emitter. 21 | 22 | ## Integrated emitter 23 | _(Render feature only)_
24 | Sometimes we want to use an existing renderer as an emitter while still having it appear on the screen.
25 | In cases like this, we can utilize rendering layers to use the same renderer for both rendering and emitting velocity. 26 | 27 | 1. Choose a rendering layer to use for velocity emitters (For example - "Layer2")
28 | ![Rendering Layer Mask property](Images/rendering_layer_mask.png) 29 | 30 | 1. Find a renderer that you want to use as an emitter and add to it the __Velocity Emitter__ component
31 | ![Add Component > PixelGraphics > Velocity Emitter](Images/velocity_emitter_component.png)
32 | See the _Configuration_ section below for more info on how to configure an emitter. 33 | 34 | 1. Make sure that the rendering layer you have picked is checked in the Rendering Layer Mask of the renderer.
35 | ![Rendering Layer Mask property](Images/renderer_rendering_layer_mask.png) 36 | 37 | ## Configuration 38 | 39 | ### `Mode` 40 | The emitter mode decides what should be the source of velocity for this emitter.
41 | There are four modes available: 42 | 43 | Mode | Description 44 | --- | --- 45 | Translation | Velocity is calculated based on the change of position between frames 46 | Rigidbody | Velocity is read from a Rigidbody component 47 | Rigidbody2D | Velocity is read from a Rigidbody2D component 48 | Custom | Velocity is read from a public `customVelocity` field 49 | 50 | ### `Max Speed` 51 | The maximum speed for this emitter.
52 | The actuall speed of an emitter is remapped so that, upon reaching the maximum speed, the resulting speed will be equal to 1. 53 | Anything above that will also result in 1 as well. 54 | 55 | ### `Remapping` 56 | A curve that allows you to fine-tune how the speed is remapped.
57 | X-axis is the real speed (0 = 0, 1 = maxSpeed).
58 | Y-axis is the speed passed to the velocity texture. 59 | 60 | Pseudocode describing how the final speed is calculated: 61 | ``` 62 | speed = remapping(clamp01(length(velocity) / maxSpeed)) 63 | ``` 64 | 65 | ## Custom emitters 66 | Velocity emitters are not the only way to interact with the buffer. 67 | In fact, any sprite assigned to our velocity layer can do that. 68 | 69 | You can use [the default emitter shader](../Runtime/Shaders/Velocity/Emitter.shader) as a template 70 | and create your own shaders that will interact with the buffer differently. 71 | 72 | --- 73 | 74 | Once you have set up a few emitters, you can use [the available shaders](./shaders.md) to see them in action. -------------------------------------------------------------------------------- /Documentation~/index.md: -------------------------------------------------------------------------------- 1 | # PixelGraphics overview 2 | 3 | PixelGraphics is a collection of interactive foliage shaders for Unity
4 | _Tested on Unity 2020.2 - PC & WebGL_ 5 | 6 | ### Installation 7 | Pixel Graphics can be [installed as a unity package](https://docs.unity3d.com/Manual/upm-ui-giturl.html) 8 | using this url: 9 | ``` 10 | https://github.com/aarthificial/pixelgraphics.git 11 | ``` 12 | 13 | ### Usage 14 | 1. [Set up a velocity texture](./velocity.md) 15 | 1. [Place some emitters in your scene](./emitters.md) 16 | 1. [Create materials using the available shaders](./shaders.md) 17 | 1. [Or create your own shaders](./properties.md) 18 | -------------------------------------------------------------------------------- /Documentation~/properties.md: -------------------------------------------------------------------------------- 1 | # Shader properties 2 | Once you have set up the velocity texture, you will gain access to a few shader properties. 3 | You can utilize them to create your own shaders.
4 | These properties can be accessed as follows, from within a shader graph:
5 | ![Accesing a shader property](Images/shader_properties.png)
6 | (Make sure that `Exposed` is not checked) 7 | 8 | ### Velocity Texture 9 | Reference: `_PG_VelocityTexture`
10 | Type: `Texture2D` 11 | 12 | The velocity texture itself.
13 | You can sample it using the coordinates returned from a `Screen Position` node.
14 | The retrieved value represents the velocity data for a given fragment/vertex. 15 | 16 | Channel | Data 17 | --- | --- 18 | R | Displacement along the X-axis 19 | G | Displacement along the Y-axis 20 | B | Velocity along the X-axis 21 | A | Velocity along the Y-axis 22 | 23 | ### Pixel Screen Params 24 | Reference: `_PG_PixelScreenParams`
25 | Type: `Vector4` 26 | 27 | Component | Data 28 | --- | --- 29 | X | Width of the camera measured in "pixel art" pixels 30 | Y | Height of the camera measured in "pixel art" pixels 31 | Z | Pixels per unit 32 | W | 1 / Pixels per unit 33 | 34 | ### Velocity Simulation Params 35 | Reference: `_PG_VelocitySimulationParams`
36 | Type: `Vector4` 37 | 38 | Component | Data 39 | --- | --- 40 | X | Stiffness 41 | Y | Damping 42 | Z | Blur strength 43 | W | Max delta time 44 | -------------------------------------------------------------------------------- /Documentation~/shaders.md: -------------------------------------------------------------------------------- 1 | # Available Shaders 2 | 3 | ### `foliage_shader` and `foliage_pixelart_shader` 4 | Simple wind simulation and velocity reaction.
5 | Sways in any direction.
6 | Best for bushes/trees and other foliage suspended in the air. 7 | 8 | ### `grass_shader` and `grass_pixelart_shader` 9 | Simple wind simulation and velocity reaction.
10 | Sways back and forth along its right axis.
11 | Best for grass/flowers and other small foliage that grows out of the ground. 12 | 13 | ## Variants 14 | Each shader is available in two variants - normal and pixelart. 15 | 16 | | Default sprite | grass_shader | grass_pixelart_shader | 17 | | --- | --- | --- | 18 | |![Default texture](Images/shader_variant_default.png)|![Normal variant](Images/shader_variant_normal.png)|![Pixelart variant](Images/shader_variant_pixelart.png) 19 | 20 | ### Pixelart shaders 21 | Pros: 22 | - Pixel-perfect distortion at higher resolutions 23 | 24 | Cons: 25 | - Computationally heavy 26 | - Can be used only with normal sprite renderers. 27 | 28 | ### Normal shaders 29 | Pros: 30 | - Lightweight 31 | - Can be used with any renderer 32 | - Can be used for *non* pixel art assets 33 | 34 | Cons: 35 | - Pixel-perfect effect requires upscaling 36 | 37 | ## Preparing mesh 38 | Depending on what shader variant you are using, you will need to prepare your sprites differently. 39 | 40 | Normal shaders displace the vertices of a mesh. 41 | To improve the effect, a mesh needs to be additionally subdivided. 42 | This can be done using the Custom Outline mode of the Sprite Editor (see the table below). 43 | 44 | Pixelart shaders displace only the uv coordinates, the mesh itself stays the same. 45 | To make it work, the mesh needs to be bigger than the actual sprite to account for any possible displacement. 46 | This can be done using the Sprite Editor (see the table below) or the import settings. 47 | 48 | | | Normal shader | Pixelart shader | 49 | | --- | --- | --- | 50 | | Outline | ![Outline for normal shaders](Images/outline_normal.png) | ![Outline for pixelart shaders](Images/outline_pixelart.png) | 51 | | Mesh | ![Mesh for normal shaders](Images/outline_mesh_normal.png) | ![Mesh for pixelart shaders](Images/outline_mesh_pixelart.png) | 52 | 53 | ## Configuration 54 | 55 | ### `Velocity Strength` 56 | How much the material is distorted by the velocity texture. 57 | 58 | ### `Wind Velocity` 59 | 2D Vector defining direction and speed of the wind. 60 | 61 | ### `Wind Strength` 62 | How much the material is distorted by the wind. 63 | 64 | ### `Wind Scale` 65 | Scale of the noise used to generate the wind. 66 | 67 | ## Displacement Mask 68 | The distortion can be further controlled by using a secondary texture called `_DisplacementMask` 69 | 70 | | Channel | Function | 71 | | --- | --- | 72 | | R | Controls how much a given fragment/vertex get displaced by the velocity texture | 73 | | G | Controls how much a given fragment/vertex get displaced by the wind | 74 | 75 | Secondary textures are assigned from within the sprite editor: 76 | 77 | ![Assigning a secondary texture](Images/secondary_texture.png) 78 | 79 | You can use a displacement mask to, for example, keep the branches of a bush in place: 80 | 81 | | Texture | Displacement mask | 82 | | --- | --- | 83 | |![Texture](Images/displacement_texture.png)|![Displacement mask](Images/displacement_mask.png)| 84 | 85 | --- 86 | 87 | These shaders are just an example of what is possible. You can use [the exposed properties](./emitters.md) to create your own interactive shaders. 88 | -------------------------------------------------------------------------------- /Documentation~/velocity.md: -------------------------------------------------------------------------------- 1 | # Velocity Texture 2 | The velocity texture is a screen space buffer that stores current velocity of specific objects (emitters) and performs 3 | a simple, spring based simulation for every pixel on the screen.
4 | It can be used to cheaply fake displacement effects caused by moving objects. 5 | For example, grass swaying when the player passes by. 6 | 7 | The velocity texture consists of four channels: 8 | 9 | Channel | Data 10 | --- | --- 11 | R | Displacement along the X-axis 12 | G | Displacement along the Y-axis 13 | B | Velocity along the X-axis 14 | A | Velocity along the Y-axis 15 | 16 | ## Setup 17 | The velocity texture can be set up using two different methods.
18 | The preferred one is to add a `Velocity Render Feature` to your renderer. 19 | 20 | Unfortuantely, as of writing this, only the Forward Renderer supports render features.
21 | If you are using a different renderer (the 2D Renderer, for example) 22 | add a `Velocity Camera` component to your main camera instead. 23 | 24 | (In the future (2021.2) the 2D Renderer will also support render features) 25 | 26 | Adding a render feature | Adding a camera component 27 | --- | --- 28 | ![Add Render Feature > Velocity Render Feature](Images/render_feature.png) | ![Add Component > PixelGraphics > Velocity Camera](Images/velocity_camera.png) 29 | 30 | ## Configuration 31 | Both the render feature and the camera component use the same configuration.
32 | The only difference being that the component does not support the rendering layer mask. 33 | 34 | Render feature | Camera component 35 | --- | --- 36 | ![Add Render Feature](Images/render_feature_ui.png) | ![Velocity Camera](Images/velocity_camera_ui.png) 37 | 38 | ### `Pixels Per Unit` 39 | The amount of pixels that make up one unit of the scene.
40 | Set this value to match the PPU value of sprites in the scene. 41 | 42 | ### `Rendering Layer Mask` 43 | _(Render feature only)_
44 | Rendering layers used for [integrated emitters](./emitters.md#integrated-emitter) 45 | 46 | ### `Layer Mask` 47 | Normal layers used for [standalone emitters](./emitters.md#standalone-emitter) 48 | 49 | ### `Texture Scale` 50 | The resolution of the velocity texture relative to the screen resolution.
51 | 1.0 means full screen size. 52 | 53 | ### `Preview` 54 | _(Render feature only)_
55 | Displays the velocity texture on the screen. For debugging only. 56 | 57 | ![No blur](Images/velocity_texture_preview.png) 58 | 59 | ### `Stiffness` 60 | The spring constant.
61 | The higher the value the stiffer the spring. 62 | 63 | ### `Damping` 64 | The linear damping coefficient. Causes the spring to slow down and eventually reach equilibrium.
65 | Setting it to 0 will cause the spring to oscillate (almost) indefinitely. 66 | 67 | ### `Blur Strength` 68 | The strength of the blur.
69 | Other factors, like the `Texture Scale`, can also affect blurring. 70 | 71 | Blur = 0 | Blur = 1 72 | --- | --- 73 | ![No blur](Images/velocity_texture_no_blur.png) | ![Blur](Images/velocity_texture_blur.png) 74 | 75 | ### `Max Delta Time` 76 | The maximum delta time in seconds. Used to keep the simulation stable in case of FPS drops.
77 | Should be higher than the average delta time of your targeted frame rate. The default value is 1/30 (30 FPS) 78 | 79 | --- 80 | 81 | Once you have set up a render texture, you can start [placing emitters in your scene](./emitters.md) -------------------------------------------------------------------------------- /Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d030f88a2e679364989b30f32eff1f5e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Editor/Common.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ad8d5c1da4883bc448276a016ad52c89 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Editor/Common/RenderingLayerMaskPropertyDrawer.cs: -------------------------------------------------------------------------------- 1 | using Aarthificial.PixelGraphics.Common; 2 | using UnityEditor; 3 | using UnityEngine; 4 | 5 | namespace Aarthificial.PixelGraphics.Editor.Common 6 | { 7 | [CustomPropertyDrawer(typeof(RenderingLayerMask))] 8 | public class RenderingLayerMaskPropertyDrawer : PropertyDrawer 9 | { 10 | private readonly string[] _options = new string[32]; 11 | private bool _optionsCreated; 12 | 13 | public override void OnGUI( 14 | Rect position, 15 | SerializedProperty property, 16 | GUIContent label 17 | ) 18 | { 19 | CreateOptions(); 20 | var maskProperty = property.FindPropertyRelative("mask"); 21 | 22 | EditorGUI.BeginProperty(position, label, property); 23 | maskProperty.intValue = EditorGUI.MaskField( 24 | position, 25 | label, 26 | maskProperty.intValue, 27 | _options 28 | ); 29 | 30 | EditorGUI.EndProperty(); 31 | } 32 | 33 | private void CreateOptions() 34 | { 35 | if (_optionsCreated) return; 36 | 37 | for (var i = 0; i < _options.Length; i++) 38 | { 39 | _options[i] = $"Layer{i + 1}"; 40 | } 41 | 42 | _optionsCreated = true; 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /Editor/Common/RenderingLayerMaskPropertyDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a36483216636c084cbca067635aab9d2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Editor/Common/VelocityEmitterEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using Aarthificial.PixelGraphics.Common; 3 | using Aarthificial.PixelGraphics.Forward; 4 | using Aarthificial.PixelGraphics.Universal; 5 | using UnityEditor; 6 | using UnityEngine; 7 | using UnityEngine.Rendering; 8 | using UnityEngine.Rendering.Universal; 9 | 10 | namespace Aarthificial.PixelGraphics.Editor.Common 11 | { 12 | [CustomEditor(typeof(VelocityEmitter))] 13 | public class VelocityEmitterEditor : UnityEditor.Editor 14 | { 15 | private static readonly GUIContent RigidbodyLabel = EditorGUIUtility.TrTextContent( 16 | "Rigidbody", 17 | "The rigidbody component used as the source of velocity." 18 | ); 19 | 20 | private SerializedProperty _mode; 21 | private SerializedProperty _rigidbody; 22 | private SerializedProperty _rigidbody2D; 23 | private SerializedProperty _maxSpeed; 24 | private SerializedProperty _remapping; 25 | private SerializedProperty _customVelocity; 26 | 27 | private void OnEnable() 28 | { 29 | _mode = serializedObject.FindProperty("mode"); 30 | _rigidbody = serializedObject.FindProperty("rb"); 31 | _rigidbody2D = serializedObject.FindProperty("rb2D"); 32 | _maxSpeed = serializedObject.FindProperty("maxSpeed"); 33 | _remapping = serializedObject.FindProperty("remapping"); 34 | _customVelocity = serializedObject.FindProperty(nameof(VelocityEmitter.customVelocity)); 35 | } 36 | 37 | public override void OnInspectorGUI() 38 | { 39 | serializedObject.Update(); 40 | 41 | EditorGUILayout.PropertyField(_mode); 42 | switch ((VelocityEmitter.EmitterMode) _mode.intValue) 43 | { 44 | case VelocityEmitter.EmitterMode.Rigidbody: 45 | EditorGUILayout.PropertyField(_rigidbody, RigidbodyLabel); 46 | break; 47 | case VelocityEmitter.EmitterMode.Rigidbody2D: 48 | EditorGUILayout.PropertyField(_rigidbody2D, RigidbodyLabel); 49 | break; 50 | case VelocityEmitter.EmitterMode.Custom: 51 | EditorGUILayout.PropertyField(_customVelocity); 52 | break; 53 | } 54 | 55 | EditorGUILayout.PropertyField(_maxSpeed); 56 | EditorGUILayout.PropertyField(_remapping); 57 | 58 | serializedObject.ApplyModifiedProperties(); 59 | } 60 | 61 | [MenuItem("GameObject/2D Object/Sprites/Velocity Emitter")] 62 | private static void CreateCustomEmitter(MenuCommand menuCommand) 63 | { 64 | var prefab = AssetDatabase.LoadAssetAtPath( 65 | "Packages/com.aarthificial.pixelgraphics/Runtime/Prefabs/Velocity Emitter.prefab" 66 | ); 67 | var instance = PrefabUtility.InstantiatePrefab(prefab) as GameObject; 68 | if (instance == null) return; 69 | 70 | PrefabUtility.UnpackPrefabInstance(instance, PrefabUnpackMode.Completely, InteractionMode.AutomatedAction); 71 | GameObjectUtility.SetParentAndAlign(instance, menuCommand.context as GameObject); 72 | 73 | if (TryGetRendererData(out var data)) 74 | { 75 | foreach (var feature in data.rendererFeatures) 76 | { 77 | if (feature is VelocityRenderFeature velocityRenderFeature) 78 | { 79 | instance.layer = GetFirstLayerFromMask(velocityRenderFeature.settings.layerMask); 80 | break; 81 | } 82 | } 83 | } 84 | 85 | var camera = FindObjectOfType(); 86 | if (camera != null) 87 | { 88 | instance.layer = GetFirstLayerFromMask(camera.settings.layerMask); 89 | } 90 | 91 | Undo.RegisterCreatedObjectUndo(instance, "Create " + instance.name); 92 | Selection.activeObject = instance; 93 | } 94 | 95 | private static int GetFirstLayerFromMask(int mask) 96 | { 97 | var layer = 0; 98 | while (layer < 32) 99 | { 100 | if ((mask & (1 << layer)) != 0) 101 | break; 102 | layer++; 103 | } 104 | 105 | return layer; 106 | } 107 | 108 | private static bool TryGetRendererData(out ForwardRendererData data) 109 | { 110 | if (!(GraphicsSettings.currentRenderPipeline is UniversalRenderPipelineAsset pipeline)) 111 | { 112 | data = null; 113 | return false; 114 | } 115 | 116 | data = typeof(UniversalRenderPipelineAsset).GetProperty( 117 | "scriptableRendererData", 118 | BindingFlags.Instance | BindingFlags.NonPublic 119 | ) 120 | ?.GetValue(pipeline) as ForwardRendererData; 121 | 122 | return data != null; 123 | } 124 | } 125 | } -------------------------------------------------------------------------------- /Editor/Common/VelocityEmitterEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 37f3f7a5bc8c485aa3f3ece389901c33 3 | timeCreated: 1623710397 -------------------------------------------------------------------------------- /Editor/Unity.PixelGraphics.Editor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Unity.PixelGraphics.Editor", 3 | "rootNamespace": "Aarthificial.PixelGraphics.Editor", 4 | "references": [ 5 | "Unity.PixelGraphics", 6 | "Unity.RenderPipelines.Universal.Core", 7 | "Unity.RenderPipelines.Universal.Runtime" 8 | ], 9 | "includePlatforms": [ 10 | "Editor" 11 | ], 12 | "excludePlatforms": [], 13 | "allowUnsafeCode": false, 14 | "overrideReferences": false, 15 | "precompiledReferences": [], 16 | "autoReferenced": true, 17 | "defineConstraints": [], 18 | "versionDefines": [], 19 | "noEngineReferences": false 20 | } -------------------------------------------------------------------------------- /Editor/Unity.PixelGraphics.Editor.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c5f19ed5799fc7a4a8431c64769e0fc5 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Editor/Universal.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f2c3272ffe974935a6a21e78b9a899b9 3 | timeCreated: 1623700274 -------------------------------------------------------------------------------- /Editor/Universal/VelocityCameraEditor.cs: -------------------------------------------------------------------------------- 1 | using Aarthificial.PixelGraphics.Common; 2 | using Aarthificial.PixelGraphics.Universal; 3 | using UnityEditor; 4 | 5 | namespace Aarthificial.PixelGraphics.Editor.Universal 6 | { 7 | [CustomEditor(typeof(VelocityCamera))] 8 | public class VelocityCameraEditor : UnityEditor.Editor 9 | { 10 | private SerializedProperty _passSettings; 11 | private SerializedProperty _ppu; 12 | private SerializedProperty _layerMask; 13 | private SerializedProperty _textureScale; 14 | private SerializedProperty _simulationSettings; 15 | 16 | private void OnEnable() 17 | { 18 | _simulationSettings = serializedObject.FindProperty("simulation"); 19 | _passSettings = serializedObject.FindProperty("settings"); 20 | _ppu = _passSettings.FindPropertyRelative(nameof(VelocityPassSettings.pixelsPerUnit)); 21 | _layerMask = _passSettings.FindPropertyRelative(nameof(VelocityPassSettings.layerMask)); 22 | _textureScale = _passSettings.FindPropertyRelative(nameof(VelocityPassSettings.textureScale)); 23 | } 24 | 25 | public override void OnInspectorGUI() 26 | { 27 | serializedObject.Update(); 28 | 29 | EditorGUILayout.PropertyField(_ppu); 30 | EditorGUILayout.PropertyField(_layerMask); 31 | EditorGUILayout.PropertyField(_textureScale); 32 | EditorGUILayout.PropertyField(_simulationSettings); 33 | 34 | serializedObject.ApplyModifiedProperties(); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /Editor/Universal/VelocityCameraEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3c20774b0d454b5eb94d3ab4cbfaf8f7 3 | timeCreated: 1623700340 -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Jacob 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /LICENSE.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f21e13358323cbb4bbc65722da270d56 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PixelGraphics 2 | 3 | [![Made with Unity](https://img.shields.io/badge/Made%20with-Unity-57b9d3.svg?style=flat&logo=unity)](https://unity3d.com) 4 | [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) 5 | 6 | [![Patreon](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3Daarthificial%26type%3Dpatrons&style=for-the-badge)](https://www.patreon.com/aarthificial) 7 | 8 | PixelGraphics is a collection of interactive foliage shaders for Unity
9 | _Tested on Unity 2020.2 - PC & WebGL_ 10 | 11 | ### Installation 12 | Pixel Graphics can be [installed as a Unity package](https://docs.unity3d.com/Manual/upm-ui-giturl.html) 13 | using this url: 14 | ``` 15 | https://github.com/aarthificial/pixelgraphics.git 16 | ``` 17 | 18 | ### Usage 19 | 1. [Set up a velocity texture](./Documentation~/velocity.md) 20 | 1. [Place some emitters in your scene](./Documentation~/emitters.md) 21 | 1. [Create materials using the available shaders](./Documentation~/shaders.md) 22 | 1. [Or create your own shaders](./Documentation~/properties.md) 23 | 24 | ### Release video: 25 | [![Interactive Foliage Shaders for Unity](https://img.youtube.com/vi/ecYWvfMoRIM/maxresdefault.jpg)](https://youtu.be/ecYWvfMoRIM) 26 | -------------------------------------------------------------------------------- /README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e699dbcac657ced499554fbf2b6b9892 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b5107c24da1a13f42bbd78c4818bf124 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | [assembly:InternalsVisibleTo("Unity.PixelGraphics.Editor")] -------------------------------------------------------------------------------- /Runtime/AssemblyInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f9bf74739e8f4405b3bfe646ef3c0701 3 | timeCreated: 1623791539 -------------------------------------------------------------------------------- /Runtime/Common.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 880facf13e882ec4ca2d7123e04a86a4 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Common/RenderingLayerMask.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace Aarthificial.PixelGraphics.Common 5 | { 6 | [Serializable] 7 | public struct RenderingLayerMask 8 | { 9 | [SerializeField] private int mask; 10 | 11 | public static implicit operator uint(RenderingLayerMask mask) => (uint) mask.mask; 12 | 13 | public static implicit operator RenderingLayerMask(uint mask) => new RenderingLayerMask {mask = (int) mask}; 14 | } 15 | } -------------------------------------------------------------------------------- /Runtime/Common/RenderingLayerMask.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 32aa40bdfceabf44398b5053212b22fa 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Common/ShaderIds.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace Aarthificial.PixelGraphics.Common 4 | { 5 | internal static class ShaderIds 6 | { 7 | internal const string VelocityBlitShader = "Hidden/PixelGraphics/Velocity/Blit"; 8 | internal const string VelocityEmitterShader = "PixelGraphics/Velocity/Emitter"; 9 | 10 | internal static readonly int CameraPositionDelta = Shader.PropertyToID("_PG_CameraPositionDelta"); 11 | internal static readonly int PositionDelta = Shader.PropertyToID("_PG_PositionDelta"); 12 | internal static readonly int VelocityTexture = Shader.PropertyToID("_PG_VelocityTexture"); 13 | internal static readonly int PreviousVelocityTexture = Shader.PropertyToID("_PG_PreviousVelocityTexture"); 14 | internal static readonly int TemporaryVelocityTexture = Shader.PropertyToID("_PG_TemporaryVelocityTexture"); 15 | internal static readonly int PixelScreenParams = Shader.PropertyToID("_PG_PixelScreenParams"); 16 | internal static readonly int VelocitySimulationParams = Shader.PropertyToID("_PG_VelocitySimulationParams"); 17 | } 18 | } -------------------------------------------------------------------------------- /Runtime/Common/ShaderIds.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f441477e0ca847a3b9224062fbdb1f9d 3 | timeCreated: 1623698569 -------------------------------------------------------------------------------- /Runtime/Common/SimulationSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace Aarthificial.PixelGraphics.Common 5 | { 6 | [Serializable] 7 | public class SimulationSettings 8 | { 9 | [SerializeField] 10 | [Tooltip("The spring constant.")] 11 | private float stiffness = 70; 12 | 13 | [SerializeField] 14 | [Tooltip("The linear damping coefficient.")] 15 | private float damping = 3; 16 | 17 | [SerializeField] 18 | [Tooltip( 19 | "The strength of the blur.\nOther factors, like the velocity texture scale, can also affect blurring." 20 | )] 21 | private float blurStrength = 0.5f; 22 | 23 | [SerializeField] 24 | [Tooltip( 25 | "The maximum delta time in seconds.\nUsed to keep the simulation stable in case of FPS drops. The default values is 1/30 (30 FPS)" 26 | )] 27 | private float maxDeltaTime = 0.034f; 28 | 29 | public Vector4 Value => 30 | new Vector4( 31 | stiffness, 32 | damping, 33 | blurStrength, 34 | maxDeltaTime 35 | ); 36 | } 37 | } -------------------------------------------------------------------------------- /Runtime/Common/SimulationSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f69f4eb3646e45a2abf270c1b48dc8e4 3 | timeCreated: 1623190507 -------------------------------------------------------------------------------- /Runtime/Common/VelocityEmitter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace Aarthificial.PixelGraphics.Common 5 | { 6 | [AddComponentMenu("PixelGraphics/Velocity Emitter")] 7 | [RequireComponent(typeof(SpriteRenderer))] 8 | public class VelocityEmitter : MonoBehaviour 9 | { 10 | public enum EmitterMode 11 | { 12 | Translation, 13 | Rigidbody, 14 | Rigidbody2D, 15 | Custom, 16 | } 17 | 18 | public Vector3 customVelocity; 19 | 20 | [SerializeField] 21 | [Tooltip("The emitter mode.")] 22 | private EmitterMode mode = EmitterMode.Translation; 23 | 24 | [SerializeField] 25 | private Rigidbody rb; 26 | 27 | [SerializeField] 28 | private Rigidbody2D rb2D; 29 | 30 | [SerializeField] 31 | [Tooltip("The maximum speed. Anything above that will be clamped.")] 32 | private float maxSpeed = 1; 33 | 34 | [SerializeField] 35 | [Tooltip( 36 | "Speed remapping.\nX-axis is the real speed (0 = 0, 1 = maxSpeed)\nY-axis is the speed passed to the velocity texture." 37 | )] 38 | private AnimationCurve remapping = AnimationCurve.Linear(0, 0, 1, 1); 39 | 40 | private SpriteRenderer _renderer; 41 | private Vector3 _lastPosition; 42 | private MaterialPropertyBlock _propertyBlock; 43 | 44 | private void Awake() 45 | { 46 | _renderer = GetComponent(); 47 | _propertyBlock = new MaterialPropertyBlock(); 48 | } 49 | 50 | private void Update() 51 | { 52 | Vector3 velocity; 53 | switch (mode) 54 | { 55 | case EmitterMode.Translation: 56 | var position = transform.position; 57 | velocity = (position - _lastPosition) / Time.deltaTime; 58 | _lastPosition = position; 59 | break; 60 | case EmitterMode.Rigidbody: 61 | velocity = rb.velocity; 62 | break; 63 | case EmitterMode.Rigidbody2D: 64 | velocity = rb2D.velocity; 65 | break; 66 | case EmitterMode.Custom: 67 | velocity = customVelocity; 68 | break; 69 | default: 70 | throw new ArgumentOutOfRangeException(); 71 | } 72 | 73 | float speed = velocity.magnitude; 74 | if (speed > 0) 75 | { 76 | float scale = remapping.Evaluate( 77 | Mathf.Clamp01(speed / maxSpeed) 78 | ); 79 | 80 | velocity = velocity / speed * scale; 81 | } 82 | else 83 | { 84 | velocity = Vector3.zero; 85 | } 86 | 87 | if (_renderer.HasPropertyBlock()) 88 | _renderer.GetPropertyBlock(_propertyBlock); 89 | _propertyBlock.SetVector(ShaderIds.PositionDelta, velocity); 90 | _renderer.SetPropertyBlock(_propertyBlock); 91 | } 92 | } 93 | } -------------------------------------------------------------------------------- /Runtime/Common/VelocityEmitter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 585273055eeba9149adb806882edfccc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {fileID: 2800000, guid: da7e0bd0358b2b74b81c8756f887e625, type: 3} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Common/VelocityPassSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace Aarthificial.PixelGraphics.Common 5 | { 6 | [Serializable] 7 | public class VelocityPassSettings 8 | { 9 | [Tooltip( 10 | "The amount of pixels that make up one unit of the Scene.\nSet this value to match the PPU value of Sprites in the Scene." 11 | )] 12 | public float pixelsPerUnit = 24; 13 | 14 | [Tooltip( 15 | "Which rendering layers the velocity camera renders.\nAllows you to use sprites as velocity emitters while keeping them visible in the default camera." 16 | )] 17 | public RenderingLayerMask renderingLayerMask; 18 | 19 | [Tooltip( 20 | "Which layers the velocity camera renders.\nThe layers should be excluded from the default camera's culling mask" 21 | )] 22 | public LayerMask layerMask; 23 | 24 | [Range(0.01f, 1f)] 25 | [Tooltip( 26 | "The resolution of the velocity texture relative to the screen resolution. 1.0 means full screen size." 27 | )] 28 | public float textureScale = 0.5f; 29 | 30 | [Tooltip("Displays the velocity texture on the screen. For debugging only.")] 31 | public bool preview; 32 | } 33 | } -------------------------------------------------------------------------------- /Runtime/Common/VelocityPassSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d1dd06b45a484a3fab35d93ee502d256 3 | timeCreated: 1623700132 -------------------------------------------------------------------------------- /Runtime/Forward.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7baf3bd608f34239bde12d51a0a4ffe2 3 | timeCreated: 1623188066 -------------------------------------------------------------------------------- /Runtime/Forward/VelocityRenderFeature.cs: -------------------------------------------------------------------------------- 1 | using Aarthificial.PixelGraphics.Common; 2 | using UnityEngine; 3 | using UnityEngine.Rendering; 4 | using UnityEngine.Rendering.Universal; 5 | 6 | namespace Aarthificial.PixelGraphics.Forward 7 | { 8 | public class VelocityRenderFeature : ScriptableRendererFeature 9 | { 10 | [SerializeField] internal VelocityPassSettings settings; 11 | [SerializeField] internal SimulationSettings simulation; 12 | 13 | [SerializeField, HideInInspector, Reload("Runtime/Shaders/Velocity/Emitter.shader")] 14 | private Shader emitterShader; 15 | 16 | [SerializeField, HideInInspector, Reload("Runtime/Shaders/Velocity/Blit.shader")] 17 | private Shader blitShader; 18 | 19 | private VelocityRenderPass _pass; 20 | private Material _emitterMaterial; 21 | private Material _blitMaterial; 22 | 23 | public override void Create() 24 | { 25 | #if UNITY_EDITOR 26 | if (blitShader == null) 27 | blitShader = Shader.Find(ShaderIds.VelocityBlitShader); 28 | if (emitterShader == null) 29 | emitterShader = Shader.Find(ShaderIds.VelocityEmitterShader); 30 | #endif 31 | _emitterMaterial = CoreUtils.CreateEngineMaterial(emitterShader); 32 | _blitMaterial = CoreUtils.CreateEngineMaterial(blitShader); 33 | _pass = new VelocityRenderPass(_emitterMaterial, _blitMaterial); 34 | } 35 | 36 | public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData) 37 | { 38 | _pass.ConfigureTarget(renderer.cameraColorTarget); 39 | _pass.Setup(settings, simulation); 40 | renderer.EnqueuePass(_pass); 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /Runtime/Forward/VelocityRenderFeature.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8080543c2fbf47859ca48496e2504fed 3 | timeCreated: 1622584788 -------------------------------------------------------------------------------- /Runtime/Forward/VelocityRenderPass.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Aarthificial.PixelGraphics.Common; 3 | using UnityEngine; 4 | using UnityEngine.Experimental.Rendering; 5 | using UnityEngine.Rendering; 6 | using UnityEngine.Rendering.Universal; 7 | 8 | namespace Aarthificial.PixelGraphics.Forward 9 | { 10 | public class VelocityRenderPass : ScriptableRenderPass 11 | { 12 | private readonly List _shaderTagIdList = new List(); 13 | private readonly ProfilingSampler _profilingSampler; 14 | private readonly RenderTargetHandle _temporaryVelocityTarget; 15 | private readonly RenderTargetHandle _velocityTarget; 16 | private readonly Material _emitterMaterial; 17 | private readonly Material _blitMaterial; 18 | 19 | private VelocityPassSettings _passSettings; 20 | private SimulationSettings _simulationSettings; 21 | private FilteringSettings _filteringSettings; 22 | private Vector2 _previousPosition; 23 | 24 | public VelocityRenderPass(Material emitterMaterial, Material blitMaterial) 25 | { 26 | _emitterMaterial = emitterMaterial; 27 | _blitMaterial = blitMaterial; 28 | 29 | _temporaryVelocityTarget.Init("_PG_TemporaryVelocityTextureTarget"); 30 | _velocityTarget.Init("_VelocityTarget"); 31 | 32 | _shaderTagIdList.Add(new ShaderTagId("SRPDefaultUnlit")); 33 | _shaderTagIdList.Add(new ShaderTagId("UniversalForward")); 34 | _shaderTagIdList.Add(new ShaderTagId("Universal2D")); 35 | _shaderTagIdList.Add(new ShaderTagId("UniversalForwardOnly")); 36 | _shaderTagIdList.Add(new ShaderTagId("LightweightForward")); 37 | 38 | _filteringSettings = new FilteringSettings(RenderQueueRange.transparent); 39 | _profilingSampler = new ProfilingSampler(nameof(VelocityRenderPass)); 40 | 41 | renderPassEvent = RenderPassEvent.BeforeRenderingOpaques; 42 | } 43 | 44 | public void Setup( 45 | VelocityPassSettings passSettings, 46 | SimulationSettings simulationSettings 47 | ) 48 | { 49 | _passSettings = passSettings; 50 | _simulationSettings = simulationSettings; 51 | } 52 | 53 | public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData) 54 | { 55 | var cmd = CommandBufferPool.Get(); 56 | cmd.Clear(); 57 | 58 | using (new ProfilingScope(cmd, _profilingSampler)) 59 | { 60 | ref var cameraData = ref renderingData.cameraData; 61 | 62 | int textureWidth = Mathf.FloorToInt(cameraData.camera.pixelWidth * _passSettings.textureScale); 63 | int textureHeight = Mathf.FloorToInt(cameraData.camera.pixelHeight * _passSettings.textureScale); 64 | 65 | float height = 2 * cameraData.camera.orthographicSize * _passSettings.pixelsPerUnit; 66 | float width = height * cameraData.camera.aspect; 67 | 68 | var cameraPosition = (Vector2) cameraData.GetViewMatrix().GetColumn(3); 69 | var delta = cameraPosition - _previousPosition; 70 | var screenDelta = cameraData.GetProjectionMatrix() * cameraData.GetViewMatrix() * delta; 71 | _previousPosition = cameraPosition; 72 | 73 | cmd.GetTemporaryRT( 74 | _temporaryVelocityTarget.id, 75 | textureWidth, 76 | textureHeight, 77 | 0, 78 | FilterMode.Bilinear, 79 | GraphicsFormat.R16G16B16A16_SFloat 80 | ); 81 | cmd.GetTemporaryRT( 82 | _velocityTarget.id, 83 | textureWidth, 84 | textureHeight, 85 | 0, 86 | FilterMode.Bilinear, 87 | GraphicsFormat.R16G16B16A16_SFloat 88 | ); 89 | 90 | cmd.SetGlobalVector(ShaderIds.CameraPositionDelta, screenDelta / 2); 91 | cmd.SetGlobalTexture(ShaderIds.VelocityTexture, _velocityTarget.id); 92 | cmd.SetGlobalTexture(ShaderIds.PreviousVelocityTexture, _temporaryVelocityTarget.id); 93 | cmd.SetGlobalVector(ShaderIds.VelocitySimulationParams, _simulationSettings.Value); 94 | cmd.SetGlobalVector( 95 | ShaderIds.PixelScreenParams, 96 | new Vector4( 97 | width, 98 | height, 99 | _passSettings.pixelsPerUnit, 100 | 1 / _passSettings.pixelsPerUnit 101 | ) 102 | ); 103 | 104 | CoreUtils.SetRenderTarget(cmd, _velocityTarget.id); 105 | cmd.SetViewProjectionMatrices(Matrix4x4.identity, Matrix4x4.identity); 106 | cmd.SetViewport(new Rect(0, 0, textureWidth, textureHeight)); 107 | cmd.DrawMesh(RenderingUtils.fullscreenMesh, Matrix4x4.identity, _blitMaterial, 0, 0); 108 | cmd.SetViewProjectionMatrices(cameraData.GetViewMatrix(), cameraData.GetProjectionMatrix()); 109 | context.ExecuteCommandBuffer(cmd); 110 | cmd.Clear(); 111 | 112 | if (!cameraData.isPreviewCamera && !cameraData.isSceneViewCamera) 113 | { 114 | var drawingSettings = CreateDrawingSettings( 115 | _shaderTagIdList, 116 | ref renderingData, 117 | SortingCriteria.CommonTransparent 118 | ); 119 | 120 | if (_passSettings.layerMask != 0) 121 | { 122 | _filteringSettings.layerMask = _passSettings.layerMask; 123 | _filteringSettings.renderingLayerMask = uint.MaxValue; 124 | drawingSettings.overrideMaterial = null; 125 | context.DrawRenderers(renderingData.cullResults, ref drawingSettings, ref _filteringSettings); 126 | } 127 | 128 | if (_passSettings.renderingLayerMask != 0) 129 | { 130 | _filteringSettings.layerMask = -1; 131 | _filteringSettings.renderingLayerMask = _passSettings.renderingLayerMask; 132 | drawingSettings.overrideMaterial = _emitterMaterial; 133 | context.DrawRenderers(renderingData.cullResults, ref drawingSettings, ref _filteringSettings); 134 | } 135 | } 136 | 137 | // TODO Implement proper double buffering 138 | cmd.Blit(_velocityTarget.id, _temporaryVelocityTarget.id); 139 | #if UNITY_EDITOR 140 | if (_passSettings.preview) 141 | cmd.Blit(_velocityTarget.id, colorAttachment); 142 | #endif 143 | CoreUtils.SetRenderTarget(cmd, colorAttachment); 144 | cmd.ReleaseTemporaryRT(_temporaryVelocityTarget.id); 145 | cmd.ReleaseTemporaryRT(_velocityTarget.id); 146 | } 147 | 148 | context.ExecuteCommandBuffer(cmd); 149 | CommandBufferPool.Release(cmd); 150 | } 151 | } 152 | } -------------------------------------------------------------------------------- /Runtime/Forward/VelocityRenderPass.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c7f6a9b796644d99b0db1cadd2d3e429 3 | timeCreated: 1622584837 -------------------------------------------------------------------------------- /Runtime/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 402a6b050ad44707a5a0ea03194d2fcd 3 | timeCreated: 1623188241 -------------------------------------------------------------------------------- /Runtime/Materials/Velocity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d0b60587a7f420b8677907483525e9b 3 | timeCreated: 1623188275 -------------------------------------------------------------------------------- /Runtime/Materials/Velocity/debug_material.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: debug_material 11 | m_Shader: {fileID: -6465566751694194690, guid: 7e584f6b129c7b5408ae04970c36d089, type: 3} 12 | m_ShaderKeywords: ETC1_EXTERNAL_ALPHA 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _MainTex: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - unity_Lightmaps: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - unity_LightmapsInd: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - unity_ShadowMasks: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | m_Floats: [] 39 | m_Colors: [] 40 | m_BuildTextureStacks: [] 41 | -------------------------------------------------------------------------------- /Runtime/Materials/Velocity/debug_material.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f5b56257ea443d546b922f0a00bbeb52 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Materials/Velocity/emitter_material.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: emitter_material 11 | m_Shader: {fileID: 4800000, guid: e86f705a051c4580a7e5a01073829185, type: 3} 12 | m_ShaderKeywords: ETC1_EXTERNAL_ALPHA 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _MainTex: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | m_Floats: [] 27 | m_Colors: [] 28 | m_BuildTextureStacks: [] 29 | -------------------------------------------------------------------------------- /Runtime/Materials/Velocity/emitter_material.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c9d2daac27f045058b7a2dbcaceedb12 3 | timeCreated: 1623188286 -------------------------------------------------------------------------------- /Runtime/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0671728da0e2b9b4b9909e40bbff6978 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Prefabs/Velocity Emitter.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &8922216723879370029 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 579575002806055687} 12 | - component: {fileID: 1868075938677248846} 13 | - component: {fileID: 7104267140644290893} 14 | m_Layer: 0 15 | m_Name: Velocity Emitter 16 | m_TagString: Untagged 17 | m_Icon: {fileID: 0} 18 | m_NavMeshLayer: 0 19 | m_StaticEditorFlags: 0 20 | m_IsActive: 1 21 | --- !u!4 &579575002806055687 22 | Transform: 23 | m_ObjectHideFlags: 0 24 | m_CorrespondingSourceObject: {fileID: 0} 25 | m_PrefabInstance: {fileID: 0} 26 | m_PrefabAsset: {fileID: 0} 27 | m_GameObject: {fileID: 8922216723879370029} 28 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 29 | m_LocalPosition: {x: 0, y: 0, z: 0} 30 | m_LocalScale: {x: 1, y: 1, z: 1} 31 | m_Children: [] 32 | m_Father: {fileID: 0} 33 | m_RootOrder: 0 34 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 35 | --- !u!212 &1868075938677248846 36 | SpriteRenderer: 37 | m_ObjectHideFlags: 0 38 | m_CorrespondingSourceObject: {fileID: 0} 39 | m_PrefabInstance: {fileID: 0} 40 | m_PrefabAsset: {fileID: 0} 41 | m_GameObject: {fileID: 8922216723879370029} 42 | m_Enabled: 1 43 | m_CastShadows: 0 44 | m_ReceiveShadows: 0 45 | m_DynamicOccludee: 1 46 | m_MotionVectors: 1 47 | m_LightProbeUsage: 1 48 | m_ReflectionProbeUsage: 1 49 | m_RayTracingMode: 0 50 | m_RayTraceProcedural: 0 51 | m_RenderingLayerMask: 1 52 | m_RendererPriority: 0 53 | m_Materials: 54 | - {fileID: 2100000, guid: c9d2daac27f045058b7a2dbcaceedb12, type: 2} 55 | m_StaticBatchInfo: 56 | firstSubMesh: 0 57 | subMeshCount: 0 58 | m_StaticBatchRoot: {fileID: 0} 59 | m_ProbeAnchor: {fileID: 0} 60 | m_LightProbeVolumeOverride: {fileID: 0} 61 | m_ScaleInLightmap: 1 62 | m_ReceiveGI: 1 63 | m_PreserveUVs: 0 64 | m_IgnoreNormalsForChartDetection: 0 65 | m_ImportantGI: 0 66 | m_StitchLightmapSeams: 1 67 | m_SelectedEditorRenderState: 0 68 | m_MinimumChartSize: 4 69 | m_AutoUVMaxDistance: 0.5 70 | m_AutoUVMaxAngle: 89 71 | m_LightmapParameters: {fileID: 0} 72 | m_SortingLayerID: 0 73 | m_SortingLayer: 0 74 | m_SortingOrder: 0 75 | m_Sprite: {fileID: -2413806693520163455, guid: 4adeaf2d2b1c7417e89f026626d8264f, type: 3} 76 | m_Color: {r: 1, g: 1, b: 1, a: 1} 77 | m_FlipX: 0 78 | m_FlipY: 0 79 | m_DrawMode: 0 80 | m_Size: {x: 1, y: 1} 81 | m_AdaptiveModeThreshold: 0.5 82 | m_SpriteTileMode: 0 83 | m_WasSpriteAssigned: 1 84 | m_MaskInteraction: 0 85 | m_SpriteSortPoint: 0 86 | --- !u!114 &7104267140644290893 87 | MonoBehaviour: 88 | m_ObjectHideFlags: 0 89 | m_CorrespondingSourceObject: {fileID: 0} 90 | m_PrefabInstance: {fileID: 0} 91 | m_PrefabAsset: {fileID: 0} 92 | m_GameObject: {fileID: 8922216723879370029} 93 | m_Enabled: 1 94 | m_EditorHideFlags: 0 95 | m_Script: {fileID: 11500000, guid: 585273055eeba9149adb806882edfccc, type: 3} 96 | m_Name: 97 | m_EditorClassIdentifier: 98 | customVelocity: {x: 0, y: 0, z: 0} 99 | mode: 0 100 | rb: {fileID: 0} 101 | rb2D: {fileID: 0} 102 | maxSpeed: 1 103 | remapping: 104 | serializedVersion: 2 105 | m_Curve: 106 | - serializedVersion: 3 107 | time: 0 108 | value: 0 109 | inSlope: 0 110 | outSlope: 1 111 | tangentMode: 0 112 | weightedMode: 0 113 | inWeight: 0 114 | outWeight: 0 115 | - serializedVersion: 3 116 | time: 1 117 | value: 1 118 | inSlope: 1 119 | outSlope: 0 120 | tangentMode: 0 121 | weightedMode: 0 122 | inWeight: 0 123 | outWeight: 0 124 | m_PreInfinity: 2 125 | m_PostInfinity: 2 126 | m_RotationOrder: 4 127 | -------------------------------------------------------------------------------- /Runtime/Prefabs/Velocity Emitter.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5f88a889edcd18847af0875629b5ee29 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Runtime/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6893d80e5fc84a12b3773c0eea23793b 3 | timeCreated: 1623188108 -------------------------------------------------------------------------------- /Runtime/Shaders/Foliage.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c0a5d8e91e94449687d351ac68168358 3 | timeCreated: 1623188208 -------------------------------------------------------------------------------- /Runtime/Shaders/Foliage/foliage_pixelart_shader.shadergraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dab8e900d1e249438553a0a987afee8d 3 | timeCreated: 1623188218 -------------------------------------------------------------------------------- /Runtime/Shaders/Foliage/foliage_shader.shadergraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0238d759a0684af4c90c51a61b5cf022 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} 11 | -------------------------------------------------------------------------------- /Runtime/Shaders/Foliage/grass_pixelart_shader.shadergraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dde43568382e4e8e9c1ee3bccaf44e6e 3 | timeCreated: 1623188218 -------------------------------------------------------------------------------- /Runtime/Shaders/Foliage/grass_shader.shadergraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dce1582f293a1ee41a560f85a0a3d2ff 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} 11 | -------------------------------------------------------------------------------- /Runtime/Shaders/SimplexNoise3D.hlsl: -------------------------------------------------------------------------------- 1 | // 2 | // Simplex noise custom node for Shader Graph 3 | // 4 | // Original work (webgl-noise) Copyright (C) 2011 Ashima Arts. 5 | // Translation and modification was made by Keijiro Takahashi. 6 | // Ported to Shader Graph by Sergio L. Valladares and updated by André Mattos 7 | // 8 | // This shader is based on the webgl-noise GLSL shader. For further details 9 | // of the original shader, please see the following description from the 10 | // original source code. 11 | // 12 | // 13 | // Description : Array and textureless GLSL 2D/3D/4D simplex 14 | // noise functions. 15 | // Author : Ian McEwan, Ashima Arts. 16 | // Maintainer : ijm 17 | // Lastmod : 20110822 (ijm) 18 | // License : Copyright (C) 2011 Ashima Arts. All rights reserved. 19 | // Distributed under the MIT License. See LICENSE file. 20 | // https://github.com/ashima/webgl-noise 21 | // 22 | 23 | 24 | //UNITY_SHADER_NO_UPGRADE 25 | #ifndef SIMPLEXNOISE3D_INCLUDE 26 | #define SIMPLEXNOISE3D_INCLUDE 27 | 28 | float3 mod289_3(float3 x) 29 | { 30 | return x - floor(x / 289.0) * 289.0; 31 | } 32 | 33 | float4 mod289_4(float4 x) 34 | { 35 | return x - floor(x / 289.0) * 289.0; 36 | } 37 | 38 | float4 permute(float4 x) 39 | { 40 | return mod289_4((x * 34.0 + 1.0) * x); 41 | } 42 | 43 | float4 taylorInvSqrt(float4 r) 44 | { 45 | return 1.79284291400159 - r * 0.85373472095314; 46 | } 47 | 48 | float4 snoise_grad(float3 v) 49 | { 50 | const float2 C = float2(1.0 / 6.0, 1.0 / 3.0); 51 | 52 | // First corner 53 | float3 i = floor(v + dot(v, C.yyy)); 54 | float3 x0 = v - i + dot(i, C.xxx); 55 | 56 | // Other corners 57 | float3 g = step(x0.yzx, x0.xyz); 58 | float3 l = 1.0 - g; 59 | float3 i1 = min(g.xyz, l.zxy); 60 | float3 i2 = max(g.xyz, l.zxy); 61 | 62 | // x1 = x0 - i1 + 1.0 * C.xxx; 63 | // x2 = x0 - i2 + 2.0 * C.xxx; 64 | // x3 = x0 - 1.0 + 3.0 * C.xxx; 65 | float3 x1 = x0 - i1 + C.xxx; 66 | float3 x2 = x0 - i2 + C.yyy; 67 | float3 x3 = x0 - 0.5; 68 | 69 | // Permutations 70 | i = mod289_3(i); // Avoid truncation effects in permutation 71 | float4 p = 72 | permute(permute(permute(i.z + float4(0.0, i1.z, i2.z, 1.0)) 73 | + i.y + float4(0.0, i1.y, i2.y, 1.0)) 74 | + i.x + float4(0.0, i1.x, i2.x, 1.0)); 75 | 76 | // Gradients: 7x7 points over a square, mapped onto an octahedron. 77 | // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294) 78 | float4 j = p - 49.0 * floor(p / 49.0); // mod(p,7*7) 79 | 80 | float4 x_ = floor(j / 7.0); 81 | float4 y_ = floor(j - 7.0 * x_); // mod(j,N) 82 | 83 | float4 x = (x_ * 2.0 + 0.5) / 7.0 - 1.0; 84 | float4 y = (y_ * 2.0 + 0.5) / 7.0 - 1.0; 85 | 86 | float4 h = 1.0 - abs(x) - abs(y); 87 | 88 | float4 b0 = float4(x.xy, y.xy); 89 | float4 b1 = float4(x.zw, y.zw); 90 | 91 | //float4 s0 = float4(lessThan(b0, 0.0)) * 2.0 - 1.0; 92 | //float4 s1 = float4(lessThan(b1, 0.0)) * 2.0 - 1.0; 93 | float4 s0 = floor(b0) * 2.0 + 1.0; 94 | float4 s1 = floor(b1) * 2.0 + 1.0; 95 | float4 sh = -step(h, 0.0); 96 | 97 | float4 a0 = b0.xzyw + s0.xzyw * sh.xxyy; 98 | float4 a1 = b1.xzyw + s1.xzyw * sh.zzww; 99 | 100 | float3 g0 = float3(a0.xy, h.x); 101 | float3 g1 = float3(a0.zw, h.y); 102 | float3 g2 = float3(a1.xy, h.z); 103 | float3 g3 = float3(a1.zw, h.w); 104 | 105 | // Normalise gradients 106 | float4 norm = taylorInvSqrt(float4(dot(g0, g0), dot(g1, g1), dot(g2, g2), dot(g3, g3))); 107 | g0 *= norm.x; 108 | g1 *= norm.y; 109 | g2 *= norm.z; 110 | g3 *= norm.w; 111 | 112 | // Compute noise and gradient at P 113 | float4 m = max(0.6 - float4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0); 114 | float4 m2 = m * m; 115 | float4 m3 = m2 * m; 116 | float4 m4 = m2 * m2; 117 | float3 grad = 118 | -6.0 * m3.x * x0 * dot(x0, g0) + m4.x * g0 + 119 | -6.0 * m3.y * x1 * dot(x1, g1) + m4.y * g1 + 120 | -6.0 * m3.z * x2 * dot(x2, g2) + m4.z * g2 + 121 | -6.0 * m3.w * x3 * dot(x3, g3) + m4.w * g3; 122 | float4 px = float4(dot(x0, g0), dot(x1, g1), dot(x2, g2), dot(x3, g3)); 123 | return 42.0 * float4(grad, dot(m4, px)); 124 | } 125 | 126 | void SimplexNoise3D_float(float3 Vertex, float Scale, out float Noise, out float3 Gradient) 127 | { 128 | float4 noise_vector = snoise_grad(Vertex * Scale); 129 | Noise = noise_vector.w; 130 | Gradient = noise_vector.xyz; 131 | } 132 | 133 | #endif //SIMPLEXNOISE3D_INCLUDE 134 | -------------------------------------------------------------------------------- /Runtime/Shaders/SimplexNoise3D.hlsl.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 552ad89d734a4241a283074c1e2d4359 3 | timeCreated: 1622929530 -------------------------------------------------------------------------------- /Runtime/Shaders/Velocity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8585565b35634666952e9ebd82b22b8a 3 | timeCreated: 1623188172 -------------------------------------------------------------------------------- /Runtime/Shaders/Velocity/Blit.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/PixelGraphics/Velocity/Blit" 2 | { 3 | SubShader 4 | { 5 | Tags 6 | { 7 | "RenderType" = "Opaque" "RenderPipeline" = "UniversalPipeline" 8 | } 9 | LOD 100 10 | 11 | Pass 12 | { 13 | ZTest Always 14 | ZWrite Off 15 | Cull Off 16 | 17 | HLSLPROGRAM 18 | #pragma vertex FullscreenVert 19 | #pragma fragment Fragment 20 | #pragma multi_compile_fragment _ _LINEAR_TO_SRGB_CONVERSION 21 | #pragma multi_compile _ _USE_DRAW_PROCEDURAL 22 | 23 | #include "Packages/com.unity.render-pipelines.universal/Shaders/Utils/Fullscreen.hlsl" 24 | #include "Packages/com.aarthificial.pixelgraphics/Runtime/Shaders/VelocitySimulation.hlsl" 25 | 26 | float4 Fragment(Varyings input) : SV_Target 27 | { 28 | UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); 29 | 30 | return SimulateVelocity(input.uv); 31 | } 32 | ENDHLSL 33 | } 34 | Pass 35 | { 36 | ZTest Always 37 | ZWrite Off 38 | Cull Off 39 | 40 | HLSLPROGRAM 41 | #pragma vertex FullscreenVert 42 | #pragma fragment Fragment 43 | #pragma multi_compile_fragment _ _LINEAR_TO_SRGB_CONVERSION 44 | #pragma multi_compile _ _USE_DRAW_PROCEDURAL 45 | 46 | #include "Packages/com.unity.render-pipelines.universal/Shaders/Utils/Fullscreen.hlsl" 47 | #include "Packages/com.aarthificial.pixelgraphics/Runtime/Shaders/VelocitySimulation.hlsl" 48 | 49 | float4 Fragment(Varyings input) : SV_Target 50 | { 51 | UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); 52 | 53 | float4 result = SimulateVelocity(input.uv); 54 | 55 | float2 temporaryVelocity = SAMPLE_TEXTURE2D(_PG_TemporaryVelocityTexture, sampler_PG_TemporaryVelocityTexture, input.uv).zw; 56 | if (abs(temporaryVelocity.x) > 0) 57 | result.z = temporaryVelocity.x; 58 | if (abs(temporaryVelocity.y) > 0) 59 | result.w = temporaryVelocity.y; 60 | 61 | return result; 62 | } 63 | ENDHLSL 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /Runtime/Shaders/Velocity/Blit.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f34315e2ae49499e9bad3c7cee74f676 3 | timeCreated: 1622589687 -------------------------------------------------------------------------------- /Runtime/Shaders/Velocity/Emitter.shader: -------------------------------------------------------------------------------- 1 | Shader "PixelGraphics/Velocity/Emitter" 2 | { 3 | Properties 4 | { 5 | [HideInInspector] _MainTex ("Base (RGB)", 2D) = "white" {} 6 | } 7 | 8 | HLSLINCLUDE 9 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" 10 | ENDHLSL 11 | 12 | SubShader 13 | { 14 | Tags 15 | { 16 | "Queue" = "Transparent" 17 | "RenderType" = "Transparent" 18 | "RenderPipeline" = "UniversalPipeline" 19 | } 20 | LOD 200 21 | 22 | Pass 23 | { 24 | Cull Off 25 | ZWrite Off 26 | ColorMask BA 27 | 28 | HLSLPROGRAM 29 | #pragma target 3.5 30 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/SurfaceInput.hlsl" 31 | 32 | TEXTURE2D(_MainTex); 33 | SAMPLER(sampler_MainTex); 34 | float4 _PG_PositionDelta; 35 | 36 | struct Attributes 37 | { 38 | float4 positionOS : POSITION; 39 | float2 uv : TEXCOORD0; 40 | }; 41 | 42 | struct Varyings 43 | { 44 | float2 uv : TEXCOORD0; 45 | float4 vertex : SV_POSITION; 46 | UNITY_VERTEX_OUTPUT_STEREO 47 | }; 48 | 49 | Varyings vert(Attributes input) 50 | { 51 | Varyings output = (Varyings)0; 52 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); 53 | 54 | VertexPositionInputs vertexInput = GetVertexPositionInputs(input.positionOS.xyz); 55 | output.vertex = vertexInput.positionCS; 56 | output.uv = input.uv; 57 | 58 | return output; 59 | } 60 | 61 | half4 frag(Varyings input) : SV_Target 62 | { 63 | UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); 64 | 65 | half4 color = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.uv); 66 | clip(color.a - 0.1); 67 | 68 | return half4(0, 0, _PG_PositionDelta.x * 6, _PG_PositionDelta.y * 6); 69 | } 70 | 71 | #pragma vertex vert 72 | #pragma fragment frag 73 | ENDHLSL 74 | } 75 | } 76 | FallBack "Diffuse" 77 | } -------------------------------------------------------------------------------- /Runtime/Shaders/Velocity/Emitter.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e86f705a051c4580a7e5a01073829185 3 | timeCreated: 1622589687 -------------------------------------------------------------------------------- /Runtime/Shaders/Velocity/debug_shader.shadergraph: -------------------------------------------------------------------------------- 1 | { 2 | "m_SGVersion": 2, 3 | "m_Type": "UnityEditor.ShaderGraph.GraphData", 4 | "m_ObjectId": "b3654395f1024b11974319631f612c1f", 5 | "m_Properties": [ 6 | { 7 | "m_Id": "3a6a1e5e57ac41c3974ff8884fe3460a" 8 | }, 9 | { 10 | "m_Id": "25e72013a3f9444c8974e024e5f453f6" 11 | } 12 | ], 13 | "m_Keywords": [], 14 | "m_Nodes": [ 15 | { 16 | "m_Id": "1f25b868e5c240f6b47222c727791cc1" 17 | }, 18 | { 19 | "m_Id": "7a4f2ef5a31d488882d2572cfa1f8250" 20 | }, 21 | { 22 | "m_Id": "be48a7cd22904da1b4748588289f95ec" 23 | }, 24 | { 25 | "m_Id": "fb518f990e70411eb6162a95f74976ed" 26 | }, 27 | { 28 | "m_Id": "1ca86cf05afe46789e5d183136132bff" 29 | }, 30 | { 31 | "m_Id": "be0b6e42a5e74bc6b45d5d47788571d2" 32 | }, 33 | { 34 | "m_Id": "23f1e4c4dde144b193b9119b4651cdc8" 35 | }, 36 | { 37 | "m_Id": "182d178bd08c45d2902e6c222de02c8d" 38 | }, 39 | { 40 | "m_Id": "5e22e02241ec4dff8cbaf3acf79c66e2" 41 | }, 42 | { 43 | "m_Id": "d68e0e7ce99f43b9a266416179cea617" 44 | }, 45 | { 46 | "m_Id": "8c3f3f6c19a648719f0a5af5f0198c64" 47 | }, 48 | { 49 | "m_Id": "8cd892e33fc84ebc96f7641398533598" 50 | }, 51 | { 52 | "m_Id": "a54645f319524fdfaeeccd3a9793e1cc" 53 | }, 54 | { 55 | "m_Id": "307b723a36c34f609369f7cc85c89c83" 56 | }, 57 | { 58 | "m_Id": "e97befc9837647ff88804cd1308e8316" 59 | }, 60 | { 61 | "m_Id": "c20afe45fc6a4ed2a95c198ee698711d" 62 | }, 63 | { 64 | "m_Id": "6945b5ee1d794150b5fb43b45e9585bb" 65 | }, 66 | { 67 | "m_Id": "7db5579fc8b14843a6f729968115cef0" 68 | }, 69 | { 70 | "m_Id": "1620a2e3a0e64f428b0f936b1e9ed422" 71 | } 72 | ], 73 | "m_GroupDatas": [], 74 | "m_StickyNoteDatas": [], 75 | "m_Edges": [ 76 | { 77 | "m_OutputSlot": { 78 | "m_Node": { 79 | "m_Id": "1620a2e3a0e64f428b0f936b1e9ed422" 80 | }, 81 | "m_SlotId": 0 82 | }, 83 | "m_InputSlot": { 84 | "m_Node": { 85 | "m_Id": "a54645f319524fdfaeeccd3a9793e1cc" 86 | }, 87 | "m_SlotId": 0 88 | } 89 | }, 90 | { 91 | "m_OutputSlot": { 92 | "m_Node": { 93 | "m_Id": "182d178bd08c45d2902e6c222de02c8d" 94 | }, 95 | "m_SlotId": 0 96 | }, 97 | "m_InputSlot": { 98 | "m_Node": { 99 | "m_Id": "5e22e02241ec4dff8cbaf3acf79c66e2" 100 | }, 101 | "m_SlotId": 0 102 | } 103 | }, 104 | { 105 | "m_OutputSlot": { 106 | "m_Node": { 107 | "m_Id": "182d178bd08c45d2902e6c222de02c8d" 108 | }, 109 | "m_SlotId": 0 110 | }, 111 | "m_InputSlot": { 112 | "m_Node": { 113 | "m_Id": "d68e0e7ce99f43b9a266416179cea617" 114 | }, 115 | "m_SlotId": 0 116 | } 117 | }, 118 | { 119 | "m_OutputSlot": { 120 | "m_Node": { 121 | "m_Id": "1ca86cf05afe46789e5d183136132bff" 122 | }, 123 | "m_SlotId": 0 124 | }, 125 | "m_InputSlot": { 126 | "m_Node": { 127 | "m_Id": "be0b6e42a5e74bc6b45d5d47788571d2" 128 | }, 129 | "m_SlotId": 1 130 | } 131 | }, 132 | { 133 | "m_OutputSlot": { 134 | "m_Node": { 135 | "m_Id": "307b723a36c34f609369f7cc85c89c83" 136 | }, 137 | "m_SlotId": 6 138 | }, 139 | "m_InputSlot": { 140 | "m_Node": { 141 | "m_Id": "c20afe45fc6a4ed2a95c198ee698711d" 142 | }, 143 | "m_SlotId": 1 144 | } 145 | }, 146 | { 147 | "m_OutputSlot": { 148 | "m_Node": { 149 | "m_Id": "307b723a36c34f609369f7cc85c89c83" 150 | }, 151 | "m_SlotId": 7 152 | }, 153 | "m_InputSlot": { 154 | "m_Node": { 155 | "m_Id": "c20afe45fc6a4ed2a95c198ee698711d" 156 | }, 157 | "m_SlotId": 2 158 | } 159 | }, 160 | { 161 | "m_OutputSlot": { 162 | "m_Node": { 163 | "m_Id": "5e22e02241ec4dff8cbaf3acf79c66e2" 164 | }, 165 | "m_SlotId": 1 166 | }, 167 | "m_InputSlot": { 168 | "m_Node": { 169 | "m_Id": "8c3f3f6c19a648719f0a5af5f0198c64" 170 | }, 171 | "m_SlotId": 0 172 | } 173 | }, 174 | { 175 | "m_OutputSlot": { 176 | "m_Node": { 177 | "m_Id": "7db5579fc8b14843a6f729968115cef0" 178 | }, 179 | "m_SlotId": 2 180 | }, 181 | "m_InputSlot": { 182 | "m_Node": { 183 | "m_Id": "6945b5ee1d794150b5fb43b45e9585bb" 184 | }, 185 | "m_SlotId": 0 186 | } 187 | }, 188 | { 189 | "m_OutputSlot": { 190 | "m_Node": { 191 | "m_Id": "8c3f3f6c19a648719f0a5af5f0198c64" 192 | }, 193 | "m_SlotId": 2 194 | }, 195 | "m_InputSlot": { 196 | "m_Node": { 197 | "m_Id": "fb518f990e70411eb6162a95f74976ed" 198 | }, 199 | "m_SlotId": 0 200 | } 201 | }, 202 | { 203 | "m_OutputSlot": { 204 | "m_Node": { 205 | "m_Id": "8cd892e33fc84ebc96f7641398533598" 206 | }, 207 | "m_SlotId": 0 208 | }, 209 | "m_InputSlot": { 210 | "m_Node": { 211 | "m_Id": "be0b6e42a5e74bc6b45d5d47788571d2" 212 | }, 213 | "m_SlotId": 2 214 | } 215 | }, 216 | { 217 | "m_OutputSlot": { 218 | "m_Node": { 219 | "m_Id": "a54645f319524fdfaeeccd3a9793e1cc" 220 | }, 221 | "m_SlotId": 1 222 | }, 223 | "m_InputSlot": { 224 | "m_Node": { 225 | "m_Id": "e97befc9837647ff88804cd1308e8316" 226 | }, 227 | "m_SlotId": 0 228 | } 229 | }, 230 | { 231 | "m_OutputSlot": { 232 | "m_Node": { 233 | "m_Id": "be0b6e42a5e74bc6b45d5d47788571d2" 234 | }, 235 | "m_SlotId": 4 236 | }, 237 | "m_InputSlot": { 238 | "m_Node": { 239 | "m_Id": "182d178bd08c45d2902e6c222de02c8d" 240 | }, 241 | "m_SlotId": 1 242 | } 243 | }, 244 | { 245 | "m_OutputSlot": { 246 | "m_Node": { 247 | "m_Id": "be0b6e42a5e74bc6b45d5d47788571d2" 248 | }, 249 | "m_SlotId": 5 250 | }, 251 | "m_InputSlot": { 252 | "m_Node": { 253 | "m_Id": "182d178bd08c45d2902e6c222de02c8d" 254 | }, 255 | "m_SlotId": 2 256 | } 257 | }, 258 | { 259 | "m_OutputSlot": { 260 | "m_Node": { 261 | "m_Id": "c20afe45fc6a4ed2a95c198ee698711d" 262 | }, 263 | "m_SlotId": 0 264 | }, 265 | "m_InputSlot": { 266 | "m_Node": { 267 | "m_Id": "e97befc9837647ff88804cd1308e8316" 268 | }, 269 | "m_SlotId": 1 270 | } 271 | }, 272 | { 273 | "m_OutputSlot": { 274 | "m_Node": { 275 | "m_Id": "d68e0e7ce99f43b9a266416179cea617" 276 | }, 277 | "m_SlotId": 1 278 | }, 279 | "m_InputSlot": { 280 | "m_Node": { 281 | "m_Id": "23f1e4c4dde144b193b9119b4651cdc8" 282 | }, 283 | "m_SlotId": 0 284 | } 285 | }, 286 | { 287 | "m_OutputSlot": { 288 | "m_Node": { 289 | "m_Id": "e97befc9837647ff88804cd1308e8316" 290 | }, 291 | "m_SlotId": 2 292 | }, 293 | "m_InputSlot": { 294 | "m_Node": { 295 | "m_Id": "7db5579fc8b14843a6f729968115cef0" 296 | }, 297 | "m_SlotId": 0 298 | } 299 | } 300 | ], 301 | "m_VertexContext": { 302 | "m_Position": { 303 | "x": 0.0, 304 | "y": 0.0 305 | }, 306 | "m_Blocks": [ 307 | { 308 | "m_Id": "1f25b868e5c240f6b47222c727791cc1" 309 | }, 310 | { 311 | "m_Id": "7a4f2ef5a31d488882d2572cfa1f8250" 312 | }, 313 | { 314 | "m_Id": "be48a7cd22904da1b4748588289f95ec" 315 | } 316 | ] 317 | }, 318 | "m_FragmentContext": { 319 | "m_Position": { 320 | "x": 0.0, 321 | "y": 200.0 322 | }, 323 | "m_Blocks": [ 324 | { 325 | "m_Id": "fb518f990e70411eb6162a95f74976ed" 326 | }, 327 | { 328 | "m_Id": "23f1e4c4dde144b193b9119b4651cdc8" 329 | } 330 | ] 331 | }, 332 | "m_PreviewData": { 333 | "serializedMesh": { 334 | "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}", 335 | "m_Guid": "" 336 | } 337 | }, 338 | "m_Path": "Shader Graphs", 339 | "m_ConcretePrecision": 0, 340 | "m_PreviewMode": 2, 341 | "m_OutputNode": { 342 | "m_Id": "" 343 | }, 344 | "m_ActiveTargets": [ 345 | { 346 | "m_Id": "2cdceabe59d1460f9050c336fae839d4" 347 | } 348 | ] 349 | } 350 | 351 | { 352 | "m_SGVersion": 0, 353 | "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", 354 | "m_ObjectId": "039ce1844b4c42a2a16a0877bcb6fa23", 355 | "m_Id": 1, 356 | "m_DisplayName": "Out", 357 | "m_SlotType": 1, 358 | "m_Hidden": false, 359 | "m_ShaderOutputName": "Out", 360 | "m_StageCapability": 3, 361 | "m_Value": { 362 | "x": 0.0, 363 | "y": 0.0, 364 | "z": 0.0, 365 | "w": 0.0 366 | }, 367 | "m_DefaultValue": { 368 | "x": 0.0, 369 | "y": 0.0, 370 | "z": 0.0, 371 | "w": 0.0 372 | } 373 | } 374 | 375 | { 376 | "m_SGVersion": 0, 377 | "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", 378 | "m_ObjectId": "05236f2519d8413e94001b331b73f360", 379 | "m_Id": 0, 380 | "m_DisplayName": "Alpha", 381 | "m_SlotType": 0, 382 | "m_Hidden": false, 383 | "m_ShaderOutputName": "Alpha", 384 | "m_StageCapability": 2, 385 | "m_Value": 1.0, 386 | "m_DefaultValue": 1.0, 387 | "m_Labels": [] 388 | } 389 | 390 | { 391 | "m_SGVersion": 0, 392 | "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", 393 | "m_ObjectId": "05b630c999fa4311aabd9e52eb67574d", 394 | "m_Id": 1, 395 | "m_DisplayName": "X", 396 | "m_SlotType": 0, 397 | "m_Hidden": false, 398 | "m_ShaderOutputName": "X", 399 | "m_StageCapability": 3, 400 | "m_Value": 0.0, 401 | "m_DefaultValue": 0.0, 402 | "m_Labels": [] 403 | } 404 | 405 | { 406 | "m_SGVersion": 0, 407 | "m_Type": "UnityEditor.ShaderGraph.ObjectNode", 408 | "m_ObjectId": "1620a2e3a0e64f428b0f936b1e9ed422", 409 | "m_Group": { 410 | "m_Id": "" 411 | }, 412 | "m_Name": "Object", 413 | "m_DrawState": { 414 | "m_Expanded": true, 415 | "m_Position": { 416 | "serializedVersion": "2", 417 | "x": -1161.0, 418 | "y": -220.0, 419 | "width": 99.0, 420 | "height": 101.0 421 | } 422 | }, 423 | "m_Slots": [ 424 | { 425 | "m_Id": "38e49f577cef47f8a3a60de5e6d03266" 426 | }, 427 | { 428 | "m_Id": "900807d4eb924047ad6d002bf188dd35" 429 | } 430 | ], 431 | "synonyms": [], 432 | "m_Precision": 0, 433 | "m_PreviewExpanded": true, 434 | "m_PreviewMode": 0, 435 | "m_CustomColors": { 436 | "m_SerializableColors": [] 437 | } 438 | } 439 | 440 | { 441 | "m_SGVersion": 0, 442 | "m_Type": "UnityEditor.ShaderGraph.Vector2Node", 443 | "m_ObjectId": "182d178bd08c45d2902e6c222de02c8d", 444 | "m_Group": { 445 | "m_Id": "" 446 | }, 447 | "m_Name": "Vector 2", 448 | "m_DrawState": { 449 | "m_Expanded": true, 450 | "m_Position": { 451 | "serializedVersion": "2", 452 | "x": -493.0000305175781, 453 | "y": 200.0, 454 | "width": 128.0, 455 | "height": 101.0 456 | } 457 | }, 458 | "m_Slots": [ 459 | { 460 | "m_Id": "05b630c999fa4311aabd9e52eb67574d" 461 | }, 462 | { 463 | "m_Id": "584cdd77e571479db7d0205680053607" 464 | }, 465 | { 466 | "m_Id": "5c1cfb3b20924c67a0b6e24a2953a829" 467 | } 468 | ], 469 | "synonyms": [], 470 | "m_Precision": 0, 471 | "m_PreviewExpanded": true, 472 | "m_PreviewMode": 0, 473 | "m_CustomColors": { 474 | "m_SerializableColors": [] 475 | }, 476 | "m_Value": { 477 | "x": 0.0, 478 | "y": 0.0 479 | } 480 | } 481 | 482 | { 483 | "m_SGVersion": 0, 484 | "m_Type": "UnityEditor.ShaderGraph.PropertyNode", 485 | "m_ObjectId": "1ca86cf05afe46789e5d183136132bff", 486 | "m_Group": { 487 | "m_Id": "" 488 | }, 489 | "m_Name": "Property", 490 | "m_DrawState": { 491 | "m_Expanded": true, 492 | "m_Position": { 493 | "serializedVersion": "2", 494 | "x": -860.0000610351563, 495 | "y": 215.99998474121095, 496 | "width": 117.0, 497 | "height": 34.0 498 | } 499 | }, 500 | "m_Slots": [ 501 | { 502 | "m_Id": "7c182e3759144e5dbf737fd47dd9337b" 503 | } 504 | ], 505 | "synonyms": [], 506 | "m_Precision": 0, 507 | "m_PreviewExpanded": true, 508 | "m_PreviewMode": 0, 509 | "m_CustomColors": { 510 | "m_SerializableColors": [] 511 | }, 512 | "m_Property": { 513 | "m_Id": "25e72013a3f9444c8974e024e5f453f6" 514 | } 515 | } 516 | 517 | { 518 | "m_SGVersion": 0, 519 | "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", 520 | "m_ObjectId": "1d545f15d93b489fad123369489ecc10", 521 | "m_Id": 0, 522 | "m_DisplayName": "RGBA", 523 | "m_SlotType": 1, 524 | "m_Hidden": false, 525 | "m_ShaderOutputName": "RGBA", 526 | "m_StageCapability": 2, 527 | "m_Value": { 528 | "x": 0.0, 529 | "y": 0.0, 530 | "z": 0.0, 531 | "w": 0.0 532 | }, 533 | "m_DefaultValue": { 534 | "x": 0.0, 535 | "y": 0.0, 536 | "z": 0.0, 537 | "w": 0.0 538 | }, 539 | "m_Labels": [] 540 | } 541 | 542 | { 543 | "m_SGVersion": 0, 544 | "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", 545 | "m_ObjectId": "1dbcc806a9b946bb836a1ecab38aff23", 546 | "m_Id": 0, 547 | "m_DisplayName": "A", 548 | "m_SlotType": 0, 549 | "m_Hidden": false, 550 | "m_ShaderOutputName": "A", 551 | "m_StageCapability": 3, 552 | "m_Value": { 553 | "x": 0.0, 554 | "y": 0.0, 555 | "z": 0.0, 556 | "w": 0.0 557 | }, 558 | "m_DefaultValue": { 559 | "x": 0.0, 560 | "y": 0.0, 561 | "z": 0.0, 562 | "w": 0.0 563 | } 564 | } 565 | 566 | { 567 | "m_SGVersion": 0, 568 | "m_Type": "UnityEditor.ShaderGraph.BlockNode", 569 | "m_ObjectId": "1f25b868e5c240f6b47222c727791cc1", 570 | "m_Group": { 571 | "m_Id": "" 572 | }, 573 | "m_Name": "VertexDescription.Position", 574 | "m_DrawState": { 575 | "m_Expanded": true, 576 | "m_Position": { 577 | "serializedVersion": "2", 578 | "x": 0.0, 579 | "y": 0.0, 580 | "width": 0.0, 581 | "height": 0.0 582 | } 583 | }, 584 | "m_Slots": [ 585 | { 586 | "m_Id": "d41b43ef05f7404fb5cd261868b98087" 587 | } 588 | ], 589 | "synonyms": [], 590 | "m_Precision": 0, 591 | "m_PreviewExpanded": true, 592 | "m_PreviewMode": 0, 593 | "m_CustomColors": { 594 | "m_SerializableColors": [] 595 | }, 596 | "m_SerializedDescriptor": "VertexDescription.Position" 597 | } 598 | 599 | { 600 | "m_SGVersion": 0, 601 | "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", 602 | "m_ObjectId": "23bed8fa6b8e44b6ab30cdce2ccd0a9a", 603 | "m_Id": 0, 604 | "m_DisplayName": "A", 605 | "m_SlotType": 0, 606 | "m_Hidden": false, 607 | "m_ShaderOutputName": "A", 608 | "m_StageCapability": 3, 609 | "m_Value": { 610 | "x": 0.0, 611 | "y": 0.0, 612 | "z": 0.0, 613 | "w": 0.0 614 | }, 615 | "m_DefaultValue": { 616 | "x": 0.0, 617 | "y": 0.0, 618 | "z": 0.0, 619 | "w": 0.0 620 | } 621 | } 622 | 623 | { 624 | "m_SGVersion": 0, 625 | "m_Type": "UnityEditor.ShaderGraph.BlockNode", 626 | "m_ObjectId": "23f1e4c4dde144b193b9119b4651cdc8", 627 | "m_Group": { 628 | "m_Id": "" 629 | }, 630 | "m_Name": "SurfaceDescription.Alpha", 631 | "m_DrawState": { 632 | "m_Expanded": true, 633 | "m_Position": { 634 | "serializedVersion": "2", 635 | "x": 0.0, 636 | "y": 0.0, 637 | "width": 0.0, 638 | "height": 0.0 639 | } 640 | }, 641 | "m_Slots": [ 642 | { 643 | "m_Id": "05236f2519d8413e94001b331b73f360" 644 | } 645 | ], 646 | "synonyms": [], 647 | "m_Precision": 0, 648 | "m_PreviewExpanded": true, 649 | "m_PreviewMode": 0, 650 | "m_CustomColors": { 651 | "m_SerializableColors": [] 652 | }, 653 | "m_SerializedDescriptor": "SurfaceDescription.Alpha" 654 | } 655 | 656 | { 657 | "m_SGVersion": 0, 658 | "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", 659 | "m_ObjectId": "25335e051d194862931b7ee4157e2f18", 660 | "m_Id": 6, 661 | "m_DisplayName": "B", 662 | "m_SlotType": 1, 663 | "m_Hidden": false, 664 | "m_ShaderOutputName": "B", 665 | "m_StageCapability": 2, 666 | "m_Value": 0.0, 667 | "m_DefaultValue": 0.0, 668 | "m_Labels": [] 669 | } 670 | 671 | { 672 | "m_SGVersion": 0, 673 | "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", 674 | "m_ObjectId": "253eb9e8dbba46ab8232403bc81b0d9b", 675 | "m_Id": 1, 676 | "m_DisplayName": "Out", 677 | "m_SlotType": 1, 678 | "m_Hidden": false, 679 | "m_ShaderOutputName": "Out", 680 | "m_StageCapability": 3, 681 | "m_Value": { 682 | "x": 0.0, 683 | "y": 0.0, 684 | "z": 0.0 685 | }, 686 | "m_DefaultValue": { 687 | "x": 0.0, 688 | "y": 0.0, 689 | "z": 0.0 690 | }, 691 | "m_Labels": [] 692 | } 693 | 694 | { 695 | "m_SGVersion": 0, 696 | "m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty", 697 | "m_ObjectId": "25e72013a3f9444c8974e024e5f453f6", 698 | "m_Guid": { 699 | "m_GuidSerialized": "b6757712-7d06-49eb-8493-b86947324363" 700 | }, 701 | "m_Name": "Velocity", 702 | "m_DefaultReferenceName": "Texture2D_25e72013a3f9444c8974e024e5f453f6", 703 | "m_OverrideReferenceName": "_PG_VelocityTexture", 704 | "m_GeneratePropertyBlock": false, 705 | "m_Precision": 0, 706 | "overrideHLSLDeclaration": false, 707 | "hlslDeclarationOverride": 0, 708 | "m_Hidden": false, 709 | "m_Value": { 710 | "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", 711 | "m_Guid": "" 712 | }, 713 | "m_Modifiable": true, 714 | "m_DefaultType": 0 715 | } 716 | 717 | { 718 | "m_SGVersion": 0, 719 | "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget", 720 | "m_ObjectId": "2cdceabe59d1460f9050c336fae839d4", 721 | "m_ActiveSubTarget": { 722 | "m_Id": "88e97dc6843f4716b57719f38779ea76" 723 | }, 724 | "m_SurfaceType": 1, 725 | "m_AlphaMode": 0, 726 | "m_TwoSided": false, 727 | "m_AlphaClip": false, 728 | "m_CustomEditorGUI": "" 729 | } 730 | 731 | { 732 | "m_SGVersion": 0, 733 | "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", 734 | "m_ObjectId": "2f60cb3584a5491ca77d72e8e4776ab6", 735 | "m_Id": 2, 736 | "m_DisplayName": "Out", 737 | "m_SlotType": 1, 738 | "m_Hidden": false, 739 | "m_ShaderOutputName": "Out", 740 | "m_StageCapability": 3, 741 | "m_Value": { 742 | "e00": 0.0, 743 | "e01": 0.0, 744 | "e02": 0.0, 745 | "e03": 0.0, 746 | "e10": 0.0, 747 | "e11": 0.0, 748 | "e12": 0.0, 749 | "e13": 0.0, 750 | "e20": 0.0, 751 | "e21": 0.0, 752 | "e22": 0.0, 753 | "e23": 0.0, 754 | "e30": 0.0, 755 | "e31": 0.0, 756 | "e32": 0.0, 757 | "e33": 0.0 758 | }, 759 | "m_DefaultValue": { 760 | "e00": 1.0, 761 | "e01": 0.0, 762 | "e02": 0.0, 763 | "e03": 0.0, 764 | "e10": 0.0, 765 | "e11": 1.0, 766 | "e12": 0.0, 767 | "e13": 0.0, 768 | "e20": 0.0, 769 | "e21": 0.0, 770 | "e22": 1.0, 771 | "e23": 0.0, 772 | "e30": 0.0, 773 | "e31": 0.0, 774 | "e32": 0.0, 775 | "e33": 1.0 776 | } 777 | } 778 | 779 | { 780 | "m_SGVersion": 0, 781 | "m_Type": "UnityEditor.ShaderGraph.CameraNode", 782 | "m_ObjectId": "307b723a36c34f609369f7cc85c89c83", 783 | "m_Group": { 784 | "m_Id": "" 785 | }, 786 | "m_Name": "Camera", 787 | "m_DrawState": { 788 | "m_Expanded": false, 789 | "m_Position": { 790 | "serializedVersion": "2", 791 | "x": -1061.0, 792 | "y": -36.999977111816409, 793 | "width": 91.00000762939453, 794 | "height": 101.0 795 | } 796 | }, 797 | "m_Slots": [ 798 | { 799 | "m_Id": "9fd8710895ee4154b8b7fccc5f4902a7" 800 | }, 801 | { 802 | "m_Id": "4a66d230b76c4cfba23531f374356484" 803 | }, 804 | { 805 | "m_Id": "881800957bd249b2966a1116738ccc84" 806 | }, 807 | { 808 | "m_Id": "5919baef4ef74f858e9984ff84466624" 809 | }, 810 | { 811 | "m_Id": "f5cb7cadec484e4b92cf8c82ffc7ac79" 812 | }, 813 | { 814 | "m_Id": "825eb4ae890842d9905383825304cd53" 815 | }, 816 | { 817 | "m_Id": "dc04e2b32c6f48b1a79f7b9a75433a02" 818 | }, 819 | { 820 | "m_Id": "6beeb0f62dd046f59cd4035935d5740d" 821 | } 822 | ], 823 | "synonyms": [], 824 | "m_Precision": 0, 825 | "m_PreviewExpanded": true, 826 | "m_PreviewMode": 0, 827 | "m_CustomColors": { 828 | "m_SerializableColors": [] 829 | } 830 | } 831 | 832 | { 833 | "m_SGVersion": 0, 834 | "m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot", 835 | "m_ObjectId": "30f36bf06f3e4147a3dac194b626d3a0", 836 | "m_Id": 0, 837 | "m_DisplayName": "Tangent", 838 | "m_SlotType": 0, 839 | "m_Hidden": false, 840 | "m_ShaderOutputName": "Tangent", 841 | "m_StageCapability": 1, 842 | "m_Value": { 843 | "x": 0.0, 844 | "y": 0.0, 845 | "z": 0.0 846 | }, 847 | "m_DefaultValue": { 848 | "x": 0.0, 849 | "y": 0.0, 850 | "z": 0.0 851 | }, 852 | "m_Labels": [], 853 | "m_Space": 0 854 | } 855 | 856 | { 857 | "m_SGVersion": 0, 858 | "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", 859 | "m_ObjectId": "38e49f577cef47f8a3a60de5e6d03266", 860 | "m_Id": 0, 861 | "m_DisplayName": "Position", 862 | "m_SlotType": 1, 863 | "m_Hidden": false, 864 | "m_ShaderOutputName": "Position", 865 | "m_StageCapability": 3, 866 | "m_Value": { 867 | "x": 0.0, 868 | "y": 0.0, 869 | "z": 0.0 870 | }, 871 | "m_DefaultValue": { 872 | "x": 0.0, 873 | "y": 0.0, 874 | "z": 0.0 875 | }, 876 | "m_Labels": [] 877 | } 878 | 879 | { 880 | "m_SGVersion": 0, 881 | "m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty", 882 | "m_ObjectId": "3a6a1e5e57ac41c3974ff8884fe3460a", 883 | "m_Guid": { 884 | "m_GuidSerialized": "b8f34a85-6314-4c5f-b7a2-37d5751a77aa" 885 | }, 886 | "m_Name": "MainTex", 887 | "m_DefaultReferenceName": "Texture2D_3a6a1e5e57ac41c3974ff8884fe3460a", 888 | "m_OverrideReferenceName": "_MainTex", 889 | "m_GeneratePropertyBlock": true, 890 | "m_Precision": 0, 891 | "overrideHLSLDeclaration": false, 892 | "hlslDeclarationOverride": 0, 893 | "m_Hidden": false, 894 | "m_Value": { 895 | "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", 896 | "m_Guid": "" 897 | }, 898 | "m_Modifiable": true, 899 | "m_DefaultType": 0 900 | } 901 | 902 | { 903 | "m_SGVersion": 0, 904 | "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", 905 | "m_ObjectId": "3e1d9cbacca44cfd86c5f37038bc9b3d", 906 | "m_Id": 2, 907 | "m_DisplayName": "Out", 908 | "m_SlotType": 1, 909 | "m_Hidden": false, 910 | "m_ShaderOutputName": "Out", 911 | "m_StageCapability": 3, 912 | "m_Value": { 913 | "x": 0.0, 914 | "y": 0.0, 915 | "z": 0.0, 916 | "w": 0.0 917 | }, 918 | "m_DefaultValue": { 919 | "x": 0.0, 920 | "y": 0.0, 921 | "z": 0.0, 922 | "w": 0.0 923 | } 924 | } 925 | 926 | { 927 | "m_SGVersion": 0, 928 | "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", 929 | "m_ObjectId": "3e5313fb3850424eaa8d01ff73e669c3", 930 | "m_Id": 1, 931 | "m_DisplayName": "Texture", 932 | "m_SlotType": 0, 933 | "m_Hidden": false, 934 | "m_ShaderOutputName": "Texture", 935 | "m_StageCapability": 3, 936 | "m_BareResource": false, 937 | "m_Texture": { 938 | "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", 939 | "m_Guid": "" 940 | }, 941 | "m_DefaultType": 0 942 | } 943 | 944 | { 945 | "m_SGVersion": 0, 946 | "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", 947 | "m_ObjectId": "4a66d230b76c4cfba23531f374356484", 948 | "m_Id": 1, 949 | "m_DisplayName": "Direction", 950 | "m_SlotType": 1, 951 | "m_Hidden": false, 952 | "m_ShaderOutputName": "Direction", 953 | "m_StageCapability": 3, 954 | "m_Value": { 955 | "x": 0.0, 956 | "y": 0.0, 957 | "z": 0.0 958 | }, 959 | "m_DefaultValue": { 960 | "x": 0.0, 961 | "y": 0.0, 962 | "z": 0.0 963 | }, 964 | "m_Labels": [] 965 | } 966 | 967 | { 968 | "m_SGVersion": 0, 969 | "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", 970 | "m_ObjectId": "544636cc56954ba9aed8ada96bc3418f", 971 | "m_Id": 2, 972 | "m_DisplayName": "Out", 973 | "m_SlotType": 1, 974 | "m_Hidden": false, 975 | "m_ShaderOutputName": "Out", 976 | "m_StageCapability": 3, 977 | "m_Value": { 978 | "x": 0.0, 979 | "y": 0.0, 980 | "z": 0.0, 981 | "w": 0.0 982 | }, 983 | "m_DefaultValue": { 984 | "x": 0.0, 985 | "y": 0.0, 986 | "z": 0.0, 987 | "w": 0.0 988 | } 989 | } 990 | 991 | { 992 | "m_SGVersion": 0, 993 | "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", 994 | "m_ObjectId": "584cdd77e571479db7d0205680053607", 995 | "m_Id": 2, 996 | "m_DisplayName": "Y", 997 | "m_SlotType": 0, 998 | "m_Hidden": false, 999 | "m_ShaderOutputName": "Y", 1000 | "m_StageCapability": 3, 1001 | "m_Value": 0.0, 1002 | "m_DefaultValue": 0.0, 1003 | "m_Labels": [ 1004 | "Y" 1005 | ] 1006 | } 1007 | 1008 | { 1009 | "m_SGVersion": 0, 1010 | "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", 1011 | "m_ObjectId": "5919baef4ef74f858e9984ff84466624", 1012 | "m_Id": 3, 1013 | "m_DisplayName": "Near Plane", 1014 | "m_SlotType": 1, 1015 | "m_Hidden": false, 1016 | "m_ShaderOutputName": "Near Plane", 1017 | "m_StageCapability": 3, 1018 | "m_Value": 0.0, 1019 | "m_DefaultValue": 0.0, 1020 | "m_Labels": [] 1021 | } 1022 | 1023 | { 1024 | "m_SGVersion": 0, 1025 | "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", 1026 | "m_ObjectId": "5c1cfb3b20924c67a0b6e24a2953a829", 1027 | "m_Id": 0, 1028 | "m_DisplayName": "Out", 1029 | "m_SlotType": 1, 1030 | "m_Hidden": false, 1031 | "m_ShaderOutputName": "Out", 1032 | "m_StageCapability": 3, 1033 | "m_Value": { 1034 | "x": 0.0, 1035 | "y": 0.0 1036 | }, 1037 | "m_DefaultValue": { 1038 | "x": 0.0, 1039 | "y": 0.0 1040 | }, 1041 | "m_Labels": [] 1042 | } 1043 | 1044 | { 1045 | "m_SGVersion": 0, 1046 | "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", 1047 | "m_ObjectId": "5cf57b195f754f1f9a4cf304b2328c39", 1048 | "m_Id": 0, 1049 | "m_DisplayName": "In", 1050 | "m_SlotType": 0, 1051 | "m_Hidden": false, 1052 | "m_ShaderOutputName": "In", 1053 | "m_StageCapability": 3, 1054 | "m_Value": { 1055 | "x": 0.0, 1056 | "y": 0.0, 1057 | "z": 0.0 1058 | }, 1059 | "m_DefaultValue": { 1060 | "x": 0.0, 1061 | "y": 0.0, 1062 | "z": 0.0 1063 | }, 1064 | "m_Labels": [] 1065 | } 1066 | 1067 | { 1068 | "m_SGVersion": 0, 1069 | "m_Type": "UnityEditor.ShaderGraph.NormalizeNode", 1070 | "m_ObjectId": "5e22e02241ec4dff8cbaf3acf79c66e2", 1071 | "m_Group": { 1072 | "m_Id": "" 1073 | }, 1074 | "m_Name": "Normalize", 1075 | "m_DrawState": { 1076 | "m_Expanded": true, 1077 | "m_Position": { 1078 | "serializedVersion": "2", 1079 | "x": -347.0, 1080 | "y": 200.0, 1081 | "width": 132.0, 1082 | "height": 94.00000762939453 1083 | } 1084 | }, 1085 | "m_Slots": [ 1086 | { 1087 | "m_Id": "8ec50f8b46ee4027abfe5d8bf96b5cc6" 1088 | }, 1089 | { 1090 | "m_Id": "039ce1844b4c42a2a16a0877bcb6fa23" 1091 | } 1092 | ], 1093 | "synonyms": [], 1094 | "m_Precision": 0, 1095 | "m_PreviewExpanded": false, 1096 | "m_PreviewMode": 0, 1097 | "m_CustomColors": { 1098 | "m_SerializableColors": [] 1099 | } 1100 | } 1101 | 1102 | { 1103 | "m_SGVersion": 0, 1104 | "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", 1105 | "m_ObjectId": "6341a484ee1c498b93e3c18414897bf9", 1106 | "m_Id": 1, 1107 | "m_DisplayName": "Out", 1108 | "m_SlotType": 1, 1109 | "m_Hidden": false, 1110 | "m_ShaderOutputName": "Out", 1111 | "m_StageCapability": 3, 1112 | "m_Value": 0.0, 1113 | "m_DefaultValue": 0.0, 1114 | "m_Labels": [] 1115 | } 1116 | 1117 | { 1118 | "m_SGVersion": 0, 1119 | "m_Type": "UnityEditor.ShaderGraph.MultiplyNode", 1120 | "m_ObjectId": "6945b5ee1d794150b5fb43b45e9585bb", 1121 | "m_Group": { 1122 | "m_Id": "" 1123 | }, 1124 | "m_Name": "Multiply", 1125 | "m_DrawState": { 1126 | "m_Expanded": false, 1127 | "m_Position": { 1128 | "serializedVersion": "2", 1129 | "x": -412.9999694824219, 1130 | "y": -220.0, 1131 | "width": 130.0, 1132 | "height": 94.0 1133 | } 1134 | }, 1135 | "m_Slots": [ 1136 | { 1137 | "m_Id": "be172e5e813144aa9c1163a15e5b0b58" 1138 | }, 1139 | { 1140 | "m_Id": "83e7eee9c03c4ee1a1a786964e682b65" 1141 | }, 1142 | { 1143 | "m_Id": "2f60cb3584a5491ca77d72e8e4776ab6" 1144 | } 1145 | ], 1146 | "synonyms": [], 1147 | "m_Precision": 0, 1148 | "m_PreviewExpanded": false, 1149 | "m_PreviewMode": 0, 1150 | "m_CustomColors": { 1151 | "m_SerializableColors": [] 1152 | } 1153 | } 1154 | 1155 | { 1156 | "m_SGVersion": 0, 1157 | "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", 1158 | "m_ObjectId": "6beeb0f62dd046f59cd4035935d5740d", 1159 | "m_Id": 7, 1160 | "m_DisplayName": "Height", 1161 | "m_SlotType": 1, 1162 | "m_Hidden": false, 1163 | "m_ShaderOutputName": "Height", 1164 | "m_StageCapability": 3, 1165 | "m_Value": 1.0, 1166 | "m_DefaultValue": 1.0, 1167 | "m_Labels": [] 1168 | } 1169 | 1170 | { 1171 | "m_SGVersion": 0, 1172 | "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", 1173 | "m_ObjectId": "7019ff219e6f4141bf26221cc218da7b", 1174 | "m_Id": 2, 1175 | "m_DisplayName": "UV", 1176 | "m_SlotType": 0, 1177 | "m_Hidden": false, 1178 | "m_ShaderOutputName": "UV", 1179 | "m_StageCapability": 3, 1180 | "m_Value": { 1181 | "x": 0.0, 1182 | "y": 0.0 1183 | }, 1184 | "m_DefaultValue": { 1185 | "x": 0.0, 1186 | "y": 0.0 1187 | }, 1188 | "m_Labels": [], 1189 | "m_Channel": 0 1190 | } 1191 | 1192 | { 1193 | "m_SGVersion": 0, 1194 | "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", 1195 | "m_ObjectId": "729abe19cfb64381bce1fcce2b94fe85", 1196 | "m_Id": 2, 1197 | "m_DisplayName": "Out", 1198 | "m_SlotType": 1, 1199 | "m_Hidden": false, 1200 | "m_ShaderOutputName": "Out", 1201 | "m_StageCapability": 3, 1202 | "m_Value": { 1203 | "x": 0.0, 1204 | "y": 0.0, 1205 | "z": 0.0, 1206 | "w": 0.0 1207 | }, 1208 | "m_DefaultValue": { 1209 | "x": 0.0, 1210 | "y": 0.0, 1211 | "z": 0.0, 1212 | "w": 0.0 1213 | } 1214 | } 1215 | 1216 | { 1217 | "m_SGVersion": 0, 1218 | "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", 1219 | "m_ObjectId": "77278e5d2c91428fa1d26e9056a50b83", 1220 | "m_Id": 0, 1221 | "m_DisplayName": "A", 1222 | "m_SlotType": 0, 1223 | "m_Hidden": false, 1224 | "m_ShaderOutputName": "A", 1225 | "m_StageCapability": 3, 1226 | "m_Value": { 1227 | "x": 0.0, 1228 | "y": 0.0, 1229 | "z": 0.0, 1230 | "w": 0.0 1231 | }, 1232 | "m_DefaultValue": { 1233 | "x": 0.0, 1234 | "y": 0.0, 1235 | "z": 0.0, 1236 | "w": 0.0 1237 | } 1238 | } 1239 | 1240 | { 1241 | "m_SGVersion": 0, 1242 | "m_Type": "UnityEditor.ShaderGraph.BlockNode", 1243 | "m_ObjectId": "7a4f2ef5a31d488882d2572cfa1f8250", 1244 | "m_Group": { 1245 | "m_Id": "" 1246 | }, 1247 | "m_Name": "VertexDescription.Normal", 1248 | "m_DrawState": { 1249 | "m_Expanded": true, 1250 | "m_Position": { 1251 | "serializedVersion": "2", 1252 | "x": 0.0, 1253 | "y": 0.0, 1254 | "width": 0.0, 1255 | "height": 0.0 1256 | } 1257 | }, 1258 | "m_Slots": [ 1259 | { 1260 | "m_Id": "a282715c4fa24511afc2eacec6c3aaf4" 1261 | } 1262 | ], 1263 | "synonyms": [], 1264 | "m_Precision": 0, 1265 | "m_PreviewExpanded": true, 1266 | "m_PreviewMode": 0, 1267 | "m_CustomColors": { 1268 | "m_SerializableColors": [] 1269 | }, 1270 | "m_SerializedDescriptor": "VertexDescription.Normal" 1271 | } 1272 | 1273 | { 1274 | "m_SGVersion": 0, 1275 | "m_Type": "UnityEditor.ShaderGraph.Texture2DMaterialSlot", 1276 | "m_ObjectId": "7c182e3759144e5dbf737fd47dd9337b", 1277 | "m_Id": 0, 1278 | "m_DisplayName": "Velocity", 1279 | "m_SlotType": 1, 1280 | "m_Hidden": false, 1281 | "m_ShaderOutputName": "Out", 1282 | "m_StageCapability": 3, 1283 | "m_BareResource": false 1284 | } 1285 | 1286 | { 1287 | "m_SGVersion": 0, 1288 | "m_Type": "UnityEditor.ShaderGraph.AddNode", 1289 | "m_ObjectId": "7db5579fc8b14843a6f729968115cef0", 1290 | "m_Group": { 1291 | "m_Id": "" 1292 | }, 1293 | "m_Name": "Add", 1294 | "m_DrawState": { 1295 | "m_Expanded": false, 1296 | "m_Position": { 1297 | "serializedVersion": "2", 1298 | "x": -567.0, 1299 | "y": -220.0, 1300 | "width": 130.0, 1301 | "height": 94.0 1302 | } 1303 | }, 1304 | "m_Slots": [ 1305 | { 1306 | "m_Id": "1dbcc806a9b946bb836a1ecab38aff23" 1307 | }, 1308 | { 1309 | "m_Id": "c8d5c0cfcaa14c9e9aaa08754f49fbfd" 1310 | }, 1311 | { 1312 | "m_Id": "3e1d9cbacca44cfd86c5f37038bc9b3d" 1313 | } 1314 | ], 1315 | "synonyms": [], 1316 | "m_Precision": 0, 1317 | "m_PreviewExpanded": false, 1318 | "m_PreviewMode": 0, 1319 | "m_CustomColors": { 1320 | "m_SerializableColors": [] 1321 | } 1322 | } 1323 | 1324 | { 1325 | "m_SGVersion": 0, 1326 | "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", 1327 | "m_ObjectId": "825eb4ae890842d9905383825304cd53", 1328 | "m_Id": 5, 1329 | "m_DisplayName": "Z Buffer Sign", 1330 | "m_SlotType": 1, 1331 | "m_Hidden": false, 1332 | "m_ShaderOutputName": "Z Buffer Sign", 1333 | "m_StageCapability": 3, 1334 | "m_Value": 1.0, 1335 | "m_DefaultValue": 1.0, 1336 | "m_Labels": [] 1337 | } 1338 | 1339 | { 1340 | "m_SGVersion": 0, 1341 | "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", 1342 | "m_ObjectId": "83e7eee9c03c4ee1a1a786964e682b65", 1343 | "m_Id": 1, 1344 | "m_DisplayName": "B", 1345 | "m_SlotType": 0, 1346 | "m_Hidden": false, 1347 | "m_ShaderOutputName": "B", 1348 | "m_StageCapability": 3, 1349 | "m_Value": { 1350 | "e00": 0.5, 1351 | "e01": 0.5, 1352 | "e02": 0.0, 1353 | "e03": 2.0, 1354 | "e10": 2.0, 1355 | "e11": 2.0, 1356 | "e12": 2.0, 1357 | "e13": 2.0, 1358 | "e20": 2.0, 1359 | "e21": 2.0, 1360 | "e22": 2.0, 1361 | "e23": 2.0, 1362 | "e30": 2.0, 1363 | "e31": 2.0, 1364 | "e32": 2.0, 1365 | "e33": 2.0 1366 | }, 1367 | "m_DefaultValue": { 1368 | "e00": 1.0, 1369 | "e01": 0.0, 1370 | "e02": 0.0, 1371 | "e03": 0.0, 1372 | "e10": 0.0, 1373 | "e11": 1.0, 1374 | "e12": 0.0, 1375 | "e13": 0.0, 1376 | "e20": 0.0, 1377 | "e21": 0.0, 1378 | "e22": 1.0, 1379 | "e23": 0.0, 1380 | "e30": 0.0, 1381 | "e31": 0.0, 1382 | "e32": 0.0, 1383 | "e33": 1.0 1384 | } 1385 | } 1386 | 1387 | { 1388 | "m_SGVersion": 0, 1389 | "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", 1390 | "m_ObjectId": "881800957bd249b2966a1116738ccc84", 1391 | "m_Id": 2, 1392 | "m_DisplayName": "Orthographic", 1393 | "m_SlotType": 1, 1394 | "m_Hidden": false, 1395 | "m_ShaderOutputName": "Orthographic", 1396 | "m_StageCapability": 3, 1397 | "m_Value": 0.0, 1398 | "m_DefaultValue": 0.0, 1399 | "m_Labels": [] 1400 | } 1401 | 1402 | { 1403 | "m_SGVersion": 0, 1404 | "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget", 1405 | "m_ObjectId": "88e97dc6843f4716b57719f38779ea76" 1406 | } 1407 | 1408 | { 1409 | "m_SGVersion": 0, 1410 | "m_Type": "UnityEditor.ShaderGraph.AddNode", 1411 | "m_ObjectId": "8c3f3f6c19a648719f0a5af5f0198c64", 1412 | "m_Group": { 1413 | "m_Id": "" 1414 | }, 1415 | "m_Name": "Add", 1416 | "m_DrawState": { 1417 | "m_Expanded": false, 1418 | "m_Position": { 1419 | "serializedVersion": "2", 1420 | "x": -196.0, 1421 | "y": 200.0, 1422 | "width": 130.0, 1423 | "height": 94.00000762939453 1424 | } 1425 | }, 1426 | "m_Slots": [ 1427 | { 1428 | "m_Id": "23bed8fa6b8e44b6ab30cdce2ccd0a9a" 1429 | }, 1430 | { 1431 | "m_Id": "d676553e958d4cf19f5f27cf2e5b87c8" 1432 | }, 1433 | { 1434 | "m_Id": "729abe19cfb64381bce1fcce2b94fe85" 1435 | } 1436 | ], 1437 | "synonyms": [], 1438 | "m_Precision": 0, 1439 | "m_PreviewExpanded": false, 1440 | "m_PreviewMode": 0, 1441 | "m_CustomColors": { 1442 | "m_SerializableColors": [] 1443 | } 1444 | } 1445 | 1446 | { 1447 | "m_SGVersion": 0, 1448 | "m_Type": "UnityEditor.ShaderGraph.ScreenPositionNode", 1449 | "m_ObjectId": "8cd892e33fc84ebc96f7641398533598", 1450 | "m_Group": { 1451 | "m_Id": "" 1452 | }, 1453 | "m_Name": "Screen Position", 1454 | "m_DrawState": { 1455 | "m_Expanded": true, 1456 | "m_Position": { 1457 | "serializedVersion": "2", 1458 | "x": -888.0000610351563, 1459 | "y": 258.0000305175781, 1460 | "width": 145.0, 1461 | "height": 130.0 1462 | } 1463 | }, 1464 | "m_Slots": [ 1465 | { 1466 | "m_Id": "e8d265f08d0348f6996249650d4008b5" 1467 | } 1468 | ], 1469 | "synonyms": [], 1470 | "m_Precision": 0, 1471 | "m_PreviewExpanded": false, 1472 | "m_PreviewMode": 0, 1473 | "m_CustomColors": { 1474 | "m_SerializableColors": [] 1475 | }, 1476 | "m_ScreenSpaceType": 0 1477 | } 1478 | 1479 | { 1480 | "m_SGVersion": 0, 1481 | "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", 1482 | "m_ObjectId": "8e3712bd51b2419b8fe63631f2014188", 1483 | "m_Id": 2, 1484 | "m_DisplayName": "Y", 1485 | "m_SlotType": 0, 1486 | "m_Hidden": false, 1487 | "m_ShaderOutputName": "Y", 1488 | "m_StageCapability": 3, 1489 | "m_Value": 0.0, 1490 | "m_DefaultValue": 0.0, 1491 | "m_Labels": [ 1492 | "Y" 1493 | ] 1494 | } 1495 | 1496 | { 1497 | "m_SGVersion": 0, 1498 | "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", 1499 | "m_ObjectId": "8ec50f8b46ee4027abfe5d8bf96b5cc6", 1500 | "m_Id": 0, 1501 | "m_DisplayName": "In", 1502 | "m_SlotType": 0, 1503 | "m_Hidden": false, 1504 | "m_ShaderOutputName": "In", 1505 | "m_StageCapability": 3, 1506 | "m_Value": { 1507 | "x": 0.0, 1508 | "y": 0.0, 1509 | "z": 0.0, 1510 | "w": 0.0 1511 | }, 1512 | "m_DefaultValue": { 1513 | "x": 0.0, 1514 | "y": 0.0, 1515 | "z": 0.0, 1516 | "w": 0.0 1517 | } 1518 | } 1519 | 1520 | { 1521 | "m_SGVersion": 0, 1522 | "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", 1523 | "m_ObjectId": "900807d4eb924047ad6d002bf188dd35", 1524 | "m_Id": 1, 1525 | "m_DisplayName": "Scale", 1526 | "m_SlotType": 1, 1527 | "m_Hidden": false, 1528 | "m_ShaderOutputName": "Scale", 1529 | "m_StageCapability": 3, 1530 | "m_Value": { 1531 | "x": 0.0, 1532 | "y": 0.0, 1533 | "z": 0.0 1534 | }, 1535 | "m_DefaultValue": { 1536 | "x": 0.0, 1537 | "y": 0.0, 1538 | "z": 0.0 1539 | }, 1540 | "m_Labels": [] 1541 | } 1542 | 1543 | { 1544 | "m_SGVersion": 0, 1545 | "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", 1546 | "m_ObjectId": "9db447b26afc4d74b55eb74e52700b9f", 1547 | "m_Id": 5, 1548 | "m_DisplayName": "G", 1549 | "m_SlotType": 1, 1550 | "m_Hidden": false, 1551 | "m_ShaderOutputName": "G", 1552 | "m_StageCapability": 2, 1553 | "m_Value": 0.0, 1554 | "m_DefaultValue": 0.0, 1555 | "m_Labels": [] 1556 | } 1557 | 1558 | { 1559 | "m_SGVersion": 0, 1560 | "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", 1561 | "m_ObjectId": "9e0baa37a5974046b93c3f3a433285ef", 1562 | "m_Id": 4, 1563 | "m_DisplayName": "R", 1564 | "m_SlotType": 1, 1565 | "m_Hidden": false, 1566 | "m_ShaderOutputName": "R", 1567 | "m_StageCapability": 2, 1568 | "m_Value": 0.0, 1569 | "m_DefaultValue": 0.0, 1570 | "m_Labels": [] 1571 | } 1572 | 1573 | { 1574 | "m_SGVersion": 0, 1575 | "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", 1576 | "m_ObjectId": "9fd8710895ee4154b8b7fccc5f4902a7", 1577 | "m_Id": 0, 1578 | "m_DisplayName": "Position", 1579 | "m_SlotType": 1, 1580 | "m_Hidden": false, 1581 | "m_ShaderOutputName": "Position", 1582 | "m_StageCapability": 3, 1583 | "m_Value": { 1584 | "x": 0.0, 1585 | "y": 0.0, 1586 | "z": 0.0 1587 | }, 1588 | "m_DefaultValue": { 1589 | "x": 0.0, 1590 | "y": 0.0, 1591 | "z": 0.0 1592 | }, 1593 | "m_Labels": [] 1594 | } 1595 | 1596 | { 1597 | "m_SGVersion": 0, 1598 | "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", 1599 | "m_ObjectId": "a282715c4fa24511afc2eacec6c3aaf4", 1600 | "m_Id": 0, 1601 | "m_DisplayName": "Normal", 1602 | "m_SlotType": 0, 1603 | "m_Hidden": false, 1604 | "m_ShaderOutputName": "Normal", 1605 | "m_StageCapability": 1, 1606 | "m_Value": { 1607 | "x": 0.0, 1608 | "y": 0.0, 1609 | "z": 0.0 1610 | }, 1611 | "m_DefaultValue": { 1612 | "x": 0.0, 1613 | "y": 0.0, 1614 | "z": 0.0 1615 | }, 1616 | "m_Labels": [], 1617 | "m_Space": 0 1618 | } 1619 | 1620 | { 1621 | "m_SGVersion": 0, 1622 | "m_Type": "UnityEditor.ShaderGraph.TransformNode", 1623 | "m_ObjectId": "a54645f319524fdfaeeccd3a9793e1cc", 1624 | "m_Group": { 1625 | "m_Id": "" 1626 | }, 1627 | "m_Name": "Transform", 1628 | "m_DrawState": { 1629 | "m_Expanded": true, 1630 | "m_Position": { 1631 | "serializedVersion": "2", 1632 | "x": -1035.0, 1633 | "y": -220.0, 1634 | "width": 213.0, 1635 | "height": 159.0 1636 | } 1637 | }, 1638 | "m_Slots": [ 1639 | { 1640 | "m_Id": "5cf57b195f754f1f9a4cf304b2328c39" 1641 | }, 1642 | { 1643 | "m_Id": "253eb9e8dbba46ab8232403bc81b0d9b" 1644 | } 1645 | ], 1646 | "synonyms": [], 1647 | "m_Precision": 0, 1648 | "m_PreviewExpanded": false, 1649 | "m_PreviewMode": 0, 1650 | "m_CustomColors": { 1651 | "m_SerializableColors": [] 1652 | }, 1653 | "m_Conversion": { 1654 | "from": 2, 1655 | "to": 1 1656 | }, 1657 | "m_ConversionType": 0 1658 | } 1659 | 1660 | { 1661 | "m_SGVersion": 0, 1662 | "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", 1663 | "m_ObjectId": "a7df9adc19ee4fc095af347fa662bf49", 1664 | "m_Id": 0, 1665 | "m_DisplayName": "In", 1666 | "m_SlotType": 0, 1667 | "m_Hidden": false, 1668 | "m_ShaderOutputName": "In", 1669 | "m_StageCapability": 3, 1670 | "m_Value": { 1671 | "x": 0.0, 1672 | "y": 0.0, 1673 | "z": 0.0, 1674 | "w": 0.0 1675 | }, 1676 | "m_DefaultValue": { 1677 | "x": 0.0, 1678 | "y": 0.0, 1679 | "z": 0.0, 1680 | "w": 0.0 1681 | } 1682 | } 1683 | 1684 | { 1685 | "m_SGVersion": 0, 1686 | "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", 1687 | "m_ObjectId": "b2ee76552e454977aa08b8acce4535e9", 1688 | "m_Id": 1, 1689 | "m_DisplayName": "X", 1690 | "m_SlotType": 0, 1691 | "m_Hidden": false, 1692 | "m_ShaderOutputName": "X", 1693 | "m_StageCapability": 3, 1694 | "m_Value": 0.0, 1695 | "m_DefaultValue": 0.0, 1696 | "m_Labels": [] 1697 | } 1698 | 1699 | { 1700 | "m_SGVersion": 0, 1701 | "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", 1702 | "m_ObjectId": "b4cc52981d8c41d6a3ac460b526f56a3", 1703 | "m_Id": 7, 1704 | "m_DisplayName": "A", 1705 | "m_SlotType": 1, 1706 | "m_Hidden": false, 1707 | "m_ShaderOutputName": "A", 1708 | "m_StageCapability": 2, 1709 | "m_Value": 0.0, 1710 | "m_DefaultValue": 0.0, 1711 | "m_Labels": [] 1712 | } 1713 | 1714 | { 1715 | "m_SGVersion": 0, 1716 | "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", 1717 | "m_ObjectId": "b962a80539df4d32a9925c784c450283", 1718 | "m_Id": 3, 1719 | "m_DisplayName": "Sampler", 1720 | "m_SlotType": 0, 1721 | "m_Hidden": false, 1722 | "m_ShaderOutputName": "Sampler", 1723 | "m_StageCapability": 3, 1724 | "m_BareResource": false 1725 | } 1726 | 1727 | { 1728 | "m_SGVersion": 0, 1729 | "m_Type": "UnityEditor.ShaderGraph.SampleTexture2DNode", 1730 | "m_ObjectId": "be0b6e42a5e74bc6b45d5d47788571d2", 1731 | "m_Group": { 1732 | "m_Id": "" 1733 | }, 1734 | "m_Name": "Sample Texture 2D", 1735 | "m_DrawState": { 1736 | "m_Expanded": true, 1737 | "m_Position": { 1738 | "serializedVersion": "2", 1739 | "x": -719.0000610351563, 1740 | "y": 176.00001525878907, 1741 | "width": 208.0, 1742 | "height": 437.0 1743 | } 1744 | }, 1745 | "m_Slots": [ 1746 | { 1747 | "m_Id": "1d545f15d93b489fad123369489ecc10" 1748 | }, 1749 | { 1750 | "m_Id": "9e0baa37a5974046b93c3f3a433285ef" 1751 | }, 1752 | { 1753 | "m_Id": "9db447b26afc4d74b55eb74e52700b9f" 1754 | }, 1755 | { 1756 | "m_Id": "25335e051d194862931b7ee4157e2f18" 1757 | }, 1758 | { 1759 | "m_Id": "b4cc52981d8c41d6a3ac460b526f56a3" 1760 | }, 1761 | { 1762 | "m_Id": "3e5313fb3850424eaa8d01ff73e669c3" 1763 | }, 1764 | { 1765 | "m_Id": "7019ff219e6f4141bf26221cc218da7b" 1766 | }, 1767 | { 1768 | "m_Id": "b962a80539df4d32a9925c784c450283" 1769 | } 1770 | ], 1771 | "synonyms": [], 1772 | "m_Precision": 0, 1773 | "m_PreviewExpanded": true, 1774 | "m_PreviewMode": 0, 1775 | "m_CustomColors": { 1776 | "m_SerializableColors": [] 1777 | }, 1778 | "m_TextureType": 0, 1779 | "m_NormalMapSpace": 0 1780 | } 1781 | 1782 | { 1783 | "m_SGVersion": 0, 1784 | "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", 1785 | "m_ObjectId": "be172e5e813144aa9c1163a15e5b0b58", 1786 | "m_Id": 0, 1787 | "m_DisplayName": "A", 1788 | "m_SlotType": 0, 1789 | "m_Hidden": false, 1790 | "m_ShaderOutputName": "A", 1791 | "m_StageCapability": 3, 1792 | "m_Value": { 1793 | "e00": 0.0, 1794 | "e01": 0.0, 1795 | "e02": 0.0, 1796 | "e03": 0.0, 1797 | "e10": 0.0, 1798 | "e11": 0.0, 1799 | "e12": 0.0, 1800 | "e13": 0.0, 1801 | "e20": 0.0, 1802 | "e21": 0.0, 1803 | "e22": 0.0, 1804 | "e23": 0.0, 1805 | "e30": 0.0, 1806 | "e31": 0.0, 1807 | "e32": 0.0, 1808 | "e33": 0.0 1809 | }, 1810 | "m_DefaultValue": { 1811 | "e00": 1.0, 1812 | "e01": 0.0, 1813 | "e02": 0.0, 1814 | "e03": 0.0, 1815 | "e10": 0.0, 1816 | "e11": 1.0, 1817 | "e12": 0.0, 1818 | "e13": 0.0, 1819 | "e20": 0.0, 1820 | "e21": 0.0, 1821 | "e22": 1.0, 1822 | "e23": 0.0, 1823 | "e30": 0.0, 1824 | "e31": 0.0, 1825 | "e32": 0.0, 1826 | "e33": 1.0 1827 | } 1828 | } 1829 | 1830 | { 1831 | "m_SGVersion": 0, 1832 | "m_Type": "UnityEditor.ShaderGraph.BlockNode", 1833 | "m_ObjectId": "be48a7cd22904da1b4748588289f95ec", 1834 | "m_Group": { 1835 | "m_Id": "" 1836 | }, 1837 | "m_Name": "VertexDescription.Tangent", 1838 | "m_DrawState": { 1839 | "m_Expanded": true, 1840 | "m_Position": { 1841 | "serializedVersion": "2", 1842 | "x": 0.0, 1843 | "y": 0.0, 1844 | "width": 0.0, 1845 | "height": 0.0 1846 | } 1847 | }, 1848 | "m_Slots": [ 1849 | { 1850 | "m_Id": "30f36bf06f3e4147a3dac194b626d3a0" 1851 | } 1852 | ], 1853 | "synonyms": [], 1854 | "m_Precision": 0, 1855 | "m_PreviewExpanded": true, 1856 | "m_PreviewMode": 0, 1857 | "m_CustomColors": { 1858 | "m_SerializableColors": [] 1859 | }, 1860 | "m_SerializedDescriptor": "VertexDescription.Tangent" 1861 | } 1862 | 1863 | { 1864 | "m_SGVersion": 0, 1865 | "m_Type": "UnityEditor.ShaderGraph.Vector3Node", 1866 | "m_ObjectId": "c20afe45fc6a4ed2a95c198ee698711d", 1867 | "m_Group": { 1868 | "m_Id": "" 1869 | }, 1870 | "m_Name": "Vector 3", 1871 | "m_DrawState": { 1872 | "m_Expanded": true, 1873 | "m_Position": { 1874 | "serializedVersion": "2", 1875 | "x": -950.0000610351563, 1876 | "y": -36.999977111816409, 1877 | "width": 128.0, 1878 | "height": 125.00000762939453 1879 | } 1880 | }, 1881 | "m_Slots": [ 1882 | { 1883 | "m_Id": "b2ee76552e454977aa08b8acce4535e9" 1884 | }, 1885 | { 1886 | "m_Id": "8e3712bd51b2419b8fe63631f2014188" 1887 | }, 1888 | { 1889 | "m_Id": "eb2a20ac1f6144f3a45e6d3e48d34545" 1890 | }, 1891 | { 1892 | "m_Id": "d59c8f64b7124c73bb55c4f38c298863" 1893 | } 1894 | ], 1895 | "synonyms": [], 1896 | "m_Precision": 0, 1897 | "m_PreviewExpanded": true, 1898 | "m_PreviewMode": 0, 1899 | "m_CustomColors": { 1900 | "m_SerializableColors": [] 1901 | }, 1902 | "m_Value": { 1903 | "x": 0.0, 1904 | "y": 0.0, 1905 | "z": 0.0 1906 | } 1907 | } 1908 | 1909 | { 1910 | "m_SGVersion": 0, 1911 | "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", 1912 | "m_ObjectId": "c2508beedd9a48ffa3ea925de6b80ac8", 1913 | "m_Id": 0, 1914 | "m_DisplayName": "Base Color", 1915 | "m_SlotType": 0, 1916 | "m_Hidden": false, 1917 | "m_ShaderOutputName": "BaseColor", 1918 | "m_StageCapability": 2, 1919 | "m_Value": { 1920 | "x": 0.5, 1921 | "y": 0.5, 1922 | "z": 0.5 1923 | }, 1924 | "m_DefaultValue": { 1925 | "x": 0.0, 1926 | "y": 0.0, 1927 | "z": 0.0 1928 | }, 1929 | "m_Labels": [], 1930 | "m_ColorMode": 0, 1931 | "m_DefaultColor": { 1932 | "r": 0.5, 1933 | "g": 0.5, 1934 | "b": 0.5, 1935 | "a": 1.0 1936 | } 1937 | } 1938 | 1939 | { 1940 | "m_SGVersion": 0, 1941 | "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", 1942 | "m_ObjectId": "c8d5c0cfcaa14c9e9aaa08754f49fbfd", 1943 | "m_Id": 1, 1944 | "m_DisplayName": "B", 1945 | "m_SlotType": 0, 1946 | "m_Hidden": false, 1947 | "m_ShaderOutputName": "B", 1948 | "m_StageCapability": 3, 1949 | "m_Value": { 1950 | "x": 1.0, 1951 | "y": 1.0, 1952 | "z": 0.0, 1953 | "w": 0.0 1954 | }, 1955 | "m_DefaultValue": { 1956 | "x": 0.0, 1957 | "y": 0.0, 1958 | "z": 0.0, 1959 | "w": 0.0 1960 | } 1961 | } 1962 | 1963 | { 1964 | "m_SGVersion": 0, 1965 | "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", 1966 | "m_ObjectId": "d0bca73501374a05bfaf3604cff0cad0", 1967 | "m_Id": 1, 1968 | "m_DisplayName": "B", 1969 | "m_SlotType": 0, 1970 | "m_Hidden": false, 1971 | "m_ShaderOutputName": "B", 1972 | "m_StageCapability": 3, 1973 | "m_Value": { 1974 | "x": 2.0, 1975 | "y": 2.0, 1976 | "z": 2.0, 1977 | "w": 2.0 1978 | }, 1979 | "m_DefaultValue": { 1980 | "x": 0.0, 1981 | "y": 0.0, 1982 | "z": 0.0, 1983 | "w": 0.0 1984 | } 1985 | } 1986 | 1987 | { 1988 | "m_SGVersion": 0, 1989 | "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", 1990 | "m_ObjectId": "d41b43ef05f7404fb5cd261868b98087", 1991 | "m_Id": 0, 1992 | "m_DisplayName": "Position", 1993 | "m_SlotType": 0, 1994 | "m_Hidden": false, 1995 | "m_ShaderOutputName": "Position", 1996 | "m_StageCapability": 1, 1997 | "m_Value": { 1998 | "x": 0.0, 1999 | "y": 0.0, 2000 | "z": 0.0 2001 | }, 2002 | "m_DefaultValue": { 2003 | "x": 0.0, 2004 | "y": 0.0, 2005 | "z": 0.0 2006 | }, 2007 | "m_Labels": [], 2008 | "m_Space": 0 2009 | } 2010 | 2011 | { 2012 | "m_SGVersion": 0, 2013 | "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", 2014 | "m_ObjectId": "d59c8f64b7124c73bb55c4f38c298863", 2015 | "m_Id": 0, 2016 | "m_DisplayName": "Out", 2017 | "m_SlotType": 1, 2018 | "m_Hidden": false, 2019 | "m_ShaderOutputName": "Out", 2020 | "m_StageCapability": 3, 2021 | "m_Value": { 2022 | "x": 0.0, 2023 | "y": 0.0, 2024 | "z": 0.0 2025 | }, 2026 | "m_DefaultValue": { 2027 | "x": 0.0, 2028 | "y": 0.0, 2029 | "z": 0.0 2030 | }, 2031 | "m_Labels": [] 2032 | } 2033 | 2034 | { 2035 | "m_SGVersion": 0, 2036 | "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", 2037 | "m_ObjectId": "d676553e958d4cf19f5f27cf2e5b87c8", 2038 | "m_Id": 1, 2039 | "m_DisplayName": "B", 2040 | "m_SlotType": 0, 2041 | "m_Hidden": false, 2042 | "m_ShaderOutputName": "B", 2043 | "m_StageCapability": 3, 2044 | "m_Value": { 2045 | "x": 0.5, 2046 | "y": 0.5, 2047 | "z": 0.0, 2048 | "w": 0.0 2049 | }, 2050 | "m_DefaultValue": { 2051 | "x": 0.0, 2052 | "y": 0.0, 2053 | "z": 0.0, 2054 | "w": 0.0 2055 | } 2056 | } 2057 | 2058 | { 2059 | "m_SGVersion": 0, 2060 | "m_Type": "UnityEditor.ShaderGraph.LengthNode", 2061 | "m_ObjectId": "d68e0e7ce99f43b9a266416179cea617", 2062 | "m_Group": { 2063 | "m_Id": "" 2064 | }, 2065 | "m_Name": "Length", 2066 | "m_DrawState": { 2067 | "m_Expanded": true, 2068 | "m_Position": { 2069 | "serializedVersion": "2", 2070 | "x": -345.00006103515627, 2071 | "y": 314.0000305175781, 2072 | "width": 130.0, 2073 | "height": 94.00000762939453 2074 | } 2075 | }, 2076 | "m_Slots": [ 2077 | { 2078 | "m_Id": "a7df9adc19ee4fc095af347fa662bf49" 2079 | }, 2080 | { 2081 | "m_Id": "6341a484ee1c498b93e3c18414897bf9" 2082 | } 2083 | ], 2084 | "synonyms": [], 2085 | "m_Precision": 0, 2086 | "m_PreviewExpanded": false, 2087 | "m_PreviewMode": 0, 2088 | "m_CustomColors": { 2089 | "m_SerializableColors": [] 2090 | } 2091 | } 2092 | 2093 | { 2094 | "m_SGVersion": 0, 2095 | "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", 2096 | "m_ObjectId": "dc04e2b32c6f48b1a79f7b9a75433a02", 2097 | "m_Id": 6, 2098 | "m_DisplayName": "Width", 2099 | "m_SlotType": 1, 2100 | "m_Hidden": false, 2101 | "m_ShaderOutputName": "Width", 2102 | "m_StageCapability": 3, 2103 | "m_Value": 1.0, 2104 | "m_DefaultValue": 1.0, 2105 | "m_Labels": [] 2106 | } 2107 | 2108 | { 2109 | "m_SGVersion": 0, 2110 | "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", 2111 | "m_ObjectId": "e8d265f08d0348f6996249650d4008b5", 2112 | "m_Id": 0, 2113 | "m_DisplayName": "Out", 2114 | "m_SlotType": 1, 2115 | "m_Hidden": false, 2116 | "m_ShaderOutputName": "Out", 2117 | "m_StageCapability": 3, 2118 | "m_Value": { 2119 | "x": 0.0, 2120 | "y": 0.0, 2121 | "z": 0.0, 2122 | "w": 0.0 2123 | }, 2124 | "m_DefaultValue": { 2125 | "x": 0.0, 2126 | "y": 0.0, 2127 | "z": 0.0, 2128 | "w": 0.0 2129 | }, 2130 | "m_Labels": [] 2131 | } 2132 | 2133 | { 2134 | "m_SGVersion": 0, 2135 | "m_Type": "UnityEditor.ShaderGraph.DivideNode", 2136 | "m_ObjectId": "e97befc9837647ff88804cd1308e8316", 2137 | "m_Group": { 2138 | "m_Id": "" 2139 | }, 2140 | "m_Name": "Divide", 2141 | "m_DrawState": { 2142 | "m_Expanded": true, 2143 | "m_Position": { 2144 | "serializedVersion": "2", 2145 | "x": -790.0000610351563, 2146 | "y": -220.0, 2147 | "width": 208.0, 2148 | "height": 302.0 2149 | } 2150 | }, 2151 | "m_Slots": [ 2152 | { 2153 | "m_Id": "77278e5d2c91428fa1d26e9056a50b83" 2154 | }, 2155 | { 2156 | "m_Id": "d0bca73501374a05bfaf3604cff0cad0" 2157 | }, 2158 | { 2159 | "m_Id": "544636cc56954ba9aed8ada96bc3418f" 2160 | } 2161 | ], 2162 | "synonyms": [], 2163 | "m_Precision": 0, 2164 | "m_PreviewExpanded": true, 2165 | "m_PreviewMode": 0, 2166 | "m_CustomColors": { 2167 | "m_SerializableColors": [] 2168 | } 2169 | } 2170 | 2171 | { 2172 | "m_SGVersion": 0, 2173 | "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", 2174 | "m_ObjectId": "eb2a20ac1f6144f3a45e6d3e48d34545", 2175 | "m_Id": 3, 2176 | "m_DisplayName": "Z", 2177 | "m_SlotType": 0, 2178 | "m_Hidden": false, 2179 | "m_ShaderOutputName": "Z", 2180 | "m_StageCapability": 3, 2181 | "m_Value": 1.0, 2182 | "m_DefaultValue": 0.0, 2183 | "m_Labels": [ 2184 | "Z" 2185 | ] 2186 | } 2187 | 2188 | { 2189 | "m_SGVersion": 0, 2190 | "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", 2191 | "m_ObjectId": "f5cb7cadec484e4b92cf8c82ffc7ac79", 2192 | "m_Id": 4, 2193 | "m_DisplayName": "Far Plane", 2194 | "m_SlotType": 1, 2195 | "m_Hidden": false, 2196 | "m_ShaderOutputName": "Far Plane", 2197 | "m_StageCapability": 3, 2198 | "m_Value": 1.0, 2199 | "m_DefaultValue": 1.0, 2200 | "m_Labels": [] 2201 | } 2202 | 2203 | { 2204 | "m_SGVersion": 0, 2205 | "m_Type": "UnityEditor.ShaderGraph.BlockNode", 2206 | "m_ObjectId": "fb518f990e70411eb6162a95f74976ed", 2207 | "m_Group": { 2208 | "m_Id": "" 2209 | }, 2210 | "m_Name": "SurfaceDescription.BaseColor", 2211 | "m_DrawState": { 2212 | "m_Expanded": true, 2213 | "m_Position": { 2214 | "serializedVersion": "2", 2215 | "x": 0.0, 2216 | "y": 0.0, 2217 | "width": 0.0, 2218 | "height": 0.0 2219 | } 2220 | }, 2221 | "m_Slots": [ 2222 | { 2223 | "m_Id": "c2508beedd9a48ffa3ea925de6b80ac8" 2224 | } 2225 | ], 2226 | "synonyms": [], 2227 | "m_Precision": 0, 2228 | "m_PreviewExpanded": true, 2229 | "m_PreviewMode": 0, 2230 | "m_CustomColors": { 2231 | "m_SerializableColors": [] 2232 | }, 2233 | "m_SerializedDescriptor": "SurfaceDescription.BaseColor" 2234 | } 2235 | 2236 | -------------------------------------------------------------------------------- /Runtime/Shaders/Velocity/debug_shader.shadergraph.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7e584f6b129c7b5408ae04970c36d089 3 | ScriptedImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 2 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} 11 | -------------------------------------------------------------------------------- /Runtime/Shaders/VelocitySimulation.hlsl: -------------------------------------------------------------------------------- 1 | #ifndef VELOCITYSIMULATION_INCLUDE 2 | #define VELOCITYSIMULATION_INCLUDE 3 | #define SAMPLE_PREVIOUS_VELOCITY(coordX, coordY) SAMPLE_TEXTURE2D(_PG_PreviousVelocityTexture, sampler_PG_PreviousVelocityTexture, uv - _PG_CameraPositionDelta.xy + float2(coordX, coordY)) 4 | 5 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" 6 | 7 | CBUFFER_START(UnityPerMaterial) 8 | TEXTURE2D(_PG_PreviousVelocityTexture); 9 | SAMPLER(sampler_PG_PreviousVelocityTexture); 10 | float4 _PG_PreviousVelocityTexture_TexelSize; 11 | TEXTURE2D(_PG_TemporaryVelocityTexture); 12 | SAMPLER(sampler_PG_TemporaryVelocityTexture); 13 | 14 | float4 _PG_VelocitySimulationParams; 15 | float4 _PG_CameraPositionDelta; 16 | CBUFFER_END 17 | 18 | float4 SimulateVelocity(float2 uv) 19 | { 20 | float4 previousData = SAMPLE_PREVIOUS_VELOCITY(0, 0); 21 | float2 offset = _PG_PreviousVelocityTexture_TexelSize.xy; 22 | 23 | float4 neighbouringData = SAMPLE_PREVIOUS_VELOCITY(offset.x, 0); 24 | neighbouringData += SAMPLE_PREVIOUS_VELOCITY(-offset.x, 0); 25 | neighbouringData += SAMPLE_PREVIOUS_VELOCITY(0, offset.y); 26 | neighbouringData += SAMPLE_PREVIOUS_VELOCITY(0, -offset.y); 27 | 28 | neighbouringData *= 0.25f; 29 | previousData = lerp(previousData, neighbouringData, _PG_VelocitySimulationParams.z); 30 | 31 | float2 distance = previousData.xy; 32 | float2 velocity = previousData.zw; 33 | 34 | if (uv.x < offset.x 35 | || uv.x > 1 - offset.x 36 | || uv.y < offset.y 37 | || uv.y > 1 - offset.y 38 | ) 39 | { 40 | velocity = 0; 41 | distance = 0; 42 | } 43 | 44 | float dt = min(unity_DeltaTime.x, _PG_VelocitySimulationParams.w); 45 | float2 acceleration = -distance * _PG_VelocitySimulationParams.x - velocity * _PG_VelocitySimulationParams.y; 46 | velocity += acceleration * dt; 47 | distance += velocity * dt; 48 | 49 | return float4(distance.x, distance.y, velocity.x, velocity.y); 50 | } 51 | 52 | #endif //VELOCITYSIMULATION_INCLUDE 53 | -------------------------------------------------------------------------------- /Runtime/Shaders/VelocitySimulation.hlsl.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d9df3223c6c840988fd5e7bc20753a9f 3 | timeCreated: 1623192641 -------------------------------------------------------------------------------- /Runtime/Unity.PixelGraphics.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Unity.PixelGraphics", 3 | "rootNamespace": "Aarthificial.PixelGraphics", 4 | "references": [ 5 | "Unity.RenderPipelines.Core.Runtime", 6 | "Unity.RenderPipelines.Universal.Runtime" 7 | ], 8 | "includePlatforms": [], 9 | "excludePlatforms": [], 10 | "allowUnsafeCode": false, 11 | "overrideReferences": false, 12 | "precompiledReferences": [], 13 | "autoReferenced": true, 14 | "defineConstraints": [], 15 | "versionDefines": [], 16 | "noEngineReferences": false 17 | } -------------------------------------------------------------------------------- /Runtime/Unity.PixelGraphics.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3de5e10799b9bd042a82b40f7799230c 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Runtime/Universal.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d9c4e57751064d7891e9dec24bd8a6c0 3 | timeCreated: 1623188076 -------------------------------------------------------------------------------- /Runtime/Universal/VelocityCamera.cs: -------------------------------------------------------------------------------- 1 | using Aarthificial.PixelGraphics.Common; 2 | using UnityEngine; 3 | using UnityEngine.Experimental.Rendering; 4 | using UnityEngine.Rendering; 5 | using UnityEngine.Rendering.Universal; 6 | 7 | namespace Aarthificial.PixelGraphics.Universal 8 | { 9 | [AddComponentMenu("PixelGraphics/Velocity Camera")] 10 | [RequireComponent(typeof(Camera))] 11 | public class VelocityCamera : MonoBehaviour 12 | { 13 | [SerializeField] internal VelocityPassSettings settings; 14 | [SerializeField] private SimulationSettings simulation; 15 | [SerializeField] [HideInInspector] private Shader blitShader; 16 | 17 | private RenderTexture _temporaryVelocityTexture; 18 | private RenderTexture _previousVelocityTexture; 19 | private RenderTexture _velocityTexture; 20 | private Camera _originalCamera; 21 | private Camera _velocityCamera; 22 | private Vector2Int _cameraSize; 23 | private Vector2Int _textureSize; 24 | private Vector2 _previousPosition; 25 | private Material _blitMaterial; 26 | 27 | private void Awake() 28 | { 29 | #if UNITY_EDITOR 30 | if (blitShader == null) 31 | blitShader = Shader.Find(ShaderIds.VelocityBlitShader); 32 | #endif 33 | _blitMaterial = CoreUtils.CreateEngineMaterial(blitShader); 34 | _originalCamera = GetComponent(); 35 | _originalCamera.cullingMask &= ~settings.layerMask; 36 | } 37 | 38 | private void OnValidate() 39 | { 40 | if (blitShader == null) 41 | blitShader = Shader.Find(ShaderIds.VelocityBlitShader); 42 | } 43 | 44 | private void OnEnable() 45 | { 46 | RenderPipelineManager.beginCameraRendering += HandleBeginCameraRendering; 47 | 48 | if (_velocityCamera == null) 49 | { 50 | var go = new GameObject("Velocity Camera", typeof(Camera)); 51 | go.transform.SetParent(transform, false); 52 | _velocityCamera = go.GetComponent(); 53 | } 54 | 55 | _velocityCamera.CopyFrom(_originalCamera); 56 | UpdateTextures(true); 57 | } 58 | 59 | private void OnDisable() 60 | { 61 | RenderPipelineManager.beginCameraRendering -= HandleBeginCameraRendering; 62 | RenderTexture.ReleaseTemporary(_temporaryVelocityTexture); 63 | 64 | if (_velocityCamera != null) 65 | Destroy(_velocityCamera.gameObject); 66 | _velocityCamera = null; 67 | } 68 | 69 | private void HandleBeginCameraRendering(ScriptableRenderContext context, Camera currentCamera) 70 | { 71 | if (!ReferenceEquals(_velocityCamera, currentCamera)) return; 72 | 73 | _velocityCamera.CopyFrom(_originalCamera); 74 | _velocityCamera.targetTexture = _temporaryVelocityTexture; 75 | _velocityCamera.cullingMask = settings.layerMask; 76 | _velocityCamera.backgroundColor = Color.clear; 77 | 78 | float height = 2 * _originalCamera.orthographicSize * settings.pixelsPerUnit; 79 | float width = height * _originalCamera.aspect; 80 | 81 | var cameraPosition = (Vector2) _originalCamera.transform.position; 82 | var delta = _previousPosition - cameraPosition; 83 | _previousPosition = cameraPosition; 84 | var screenDelta = _originalCamera.projectionMatrix * _originalCamera.worldToCameraMatrix * delta; 85 | var cmd = CommandBufferPool.Get(); 86 | cmd.Clear(); 87 | 88 | cmd.SetGlobalVector(ShaderIds.VelocitySimulationParams, simulation.Value); 89 | cmd.SetGlobalVector(ShaderIds.CameraPositionDelta, screenDelta * 0.5f); 90 | cmd.SetGlobalTexture(ShaderIds.VelocityTexture, _velocityTexture); 91 | cmd.SetGlobalTexture(ShaderIds.PreviousVelocityTexture, _previousVelocityTexture); 92 | cmd.SetGlobalTexture(ShaderIds.TemporaryVelocityTexture, _temporaryVelocityTexture); 93 | cmd.SetGlobalVector( 94 | ShaderIds.PixelScreenParams, 95 | new Vector4( 96 | width, 97 | height, 98 | settings.pixelsPerUnit, 99 | 1 / settings.pixelsPerUnit 100 | ) 101 | ); 102 | 103 | // TODO Implement proper double buffering 104 | cmd.Blit(_velocityTexture, _previousVelocityTexture); 105 | 106 | CoreUtils.SetRenderTarget(cmd, _velocityTexture); 107 | cmd.SetViewProjectionMatrices(Matrix4x4.identity, Matrix4x4.identity); 108 | cmd.SetViewport(new Rect(0, 0, _textureSize.x, _textureSize.y)); 109 | cmd.DrawMesh(RenderingUtils.fullscreenMesh, Matrix4x4.identity, _blitMaterial, 0, 1); 110 | 111 | context.ExecuteCommandBuffer(cmd); 112 | cmd.Release(); 113 | } 114 | 115 | private void UpdateTextures(bool initial = false) 116 | { 117 | if (!initial) 118 | { 119 | RenderTexture.ReleaseTemporary(_temporaryVelocityTexture); 120 | RenderTexture.ReleaseTemporary(_previousVelocityTexture); 121 | RenderTexture.ReleaseTemporary(_velocityTexture); 122 | } 123 | 124 | _textureSize.x = Mathf.FloorToInt(_originalCamera.pixelWidth * settings.textureScale); 125 | _textureSize.y = Mathf.FloorToInt(_originalCamera.pixelHeight * settings.textureScale); 126 | 127 | _temporaryVelocityTexture = RenderTexture.GetTemporary( 128 | _textureSize.x, 129 | _textureSize.y, 130 | 0, 131 | GraphicsFormat.R16G16B16A16_SFloat 132 | ); 133 | _previousVelocityTexture = RenderTexture.GetTemporary( 134 | _textureSize.x, 135 | _textureSize.y, 136 | 0, 137 | GraphicsFormat.R16G16B16A16_SFloat 138 | ); 139 | _velocityTexture = RenderTexture.GetTemporary( 140 | _textureSize.x, 141 | _textureSize.y, 142 | 0, 143 | GraphicsFormat.R16G16B16A16_SFloat 144 | ); 145 | } 146 | 147 | private void Update() 148 | { 149 | if (_cameraSize.x == _originalCamera.pixelWidth && _cameraSize.y == _originalCamera.pixelHeight) return; 150 | 151 | _cameraSize.x = _originalCamera.pixelWidth; 152 | _cameraSize.y = _originalCamera.pixelHeight; 153 | 154 | UpdateTextures(); 155 | } 156 | } 157 | } -------------------------------------------------------------------------------- /Runtime/Universal/VelocityCamera.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3d7460f1d3ac25243b1b9fecf3405b59 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {fileID: 2800000, guid: da7e0bd0358b2b74b81c8756f887e625, type: 3} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Tests.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: def499e0224af7d44b66d6250d76edf5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Tests/Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c664baef7bd5ca4199e57a38e72f769 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Tests/Runtime/Unity.PixelGraphics.Tests.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Unity.PixelGraphics.Tests", 3 | "rootNamespace": "Aarthificial.PixelGraphics.Tests", 4 | "references": [ 5 | "Unity.PixelGraphics", 6 | "UnityEngine.TestRunner", 7 | "UnityEditor.TestRunner" 8 | ], 9 | "includePlatforms": [], 10 | "excludePlatforms": [], 11 | "allowUnsafeCode": false, 12 | "overrideReferences": true, 13 | "precompiledReferences": [ 14 | "nunit.framework.dll" 15 | ], 16 | "autoReferenced": false, 17 | "defineConstraints": [ 18 | "UNITY_INCLUDE_TESTS" 19 | ], 20 | "versionDefines": [], 21 | "noEngineReferences": false 22 | } -------------------------------------------------------------------------------- /Tests/Runtime/Unity.PixelGraphics.Tests.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 765772a6ed6efb14daaca17faf37ba52 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.aarthificial.pixelgraphics", 3 | "version": "1.0.1", 4 | "displayName": "Pixel Graphics", 5 | "description": "A collection of pixel art visual effects", 6 | "unity": "2020.2", 7 | "author": { 8 | "name": "aarthificial", 9 | "email": "aarthificial+business@gmail.com", 10 | "url": "https://www.youtube.com/aarthificial" 11 | }, 12 | "type": "library", 13 | "dependencies": { 14 | "com.unity.render-pipelines.universal": "10.4.0" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3483b34443957b449978c071b8ab0c9b 3 | PackageManifestImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /release.config.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const path = require('path'); 3 | 4 | module.exports = { 5 | tagFormat: 'v${version}', 6 | branches: [ 7 | 'master', 8 | { 9 | name: 'preview', 10 | prerelease: 'preview' 11 | } 12 | ], 13 | plugins: [ 14 | [ 15 | '@semantic-release/commit-analyzer', 16 | { 17 | preset: 'angular' 18 | } 19 | ], 20 | [ 21 | '@semantic-release/release-notes-generator', 22 | { 23 | writerOpts: { 24 | headerPartial: fs.readFileSync(path.resolve(__dirname, './.github/templates/header.hbs'), 'utf-8') 25 | } 26 | } 27 | ], 28 | [ 29 | '@semantic-release/changelog', 30 | { 31 | preset: 'angular' 32 | } 33 | ], 34 | [ 35 | '@semantic-release/npm', 36 | { 37 | npmPublish: false 38 | } 39 | ], 40 | [ 41 | '@semantic-release/git', 42 | { 43 | assets: [ 44 | 'package.json', 45 | 'CHANGELOG.md' 46 | ], 47 | message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}' 48 | } 49 | ], 50 | '@semantic-release/github' 51 | ] 52 | } -------------------------------------------------------------------------------- /release.config.js.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 83888d04236c18344aa7f78658327a15 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | --------------------------------------------------------------------------------