├── .gitattributes ├── .gitignore ├── Assets ├── URPMobileGrassInstancedIndirectDemo.meta └── URPMobileGrassInstancedIndirectDemo │ ├── InstancedIndirectGrass.meta │ ├── InstancedIndirectGrass │ ├── Core.meta │ ├── Core │ │ ├── CullingCompute.compute │ │ ├── CullingCompute.compute.meta │ │ ├── GrassBending.meta │ │ ├── GrassBending │ │ │ ├── GrassBendingRTPrePass.cs │ │ │ ├── GrassBendingRTPrePass.cs.meta │ │ │ ├── GrassBendingRTPrePassPS.mat │ │ │ ├── GrassBendingRTPrePassPS.mat.meta │ │ │ ├── GrassBendingRTPrePassTrailShader.shader │ │ │ ├── GrassBendingRTPrePassTrailShader.shader.meta │ │ │ ├── GrassBendingTrailRenderer.prefab │ │ │ └── GrassBendingTrailRenderer.prefab.meta │ │ ├── InstancedIndirectGrass.mat │ │ ├── InstancedIndirectGrass.mat.meta │ │ ├── InstancedIndirectGrass.shader │ │ ├── InstancedIndirectGrass.shader.meta │ │ ├── InstancedIndirectGrassPosDefine.cs │ │ ├── InstancedIndirectGrassPosDefine.cs.meta │ │ ├── InstancedIndirectGrassRenderer.cs │ │ ├── InstancedIndirectGrassRenderer.cs.meta │ │ ├── InstancedIndirectGrassVertexColor.jpg │ │ └── InstancedIndirectGrassVertexColor.jpg.meta │ ├── TestScene.meta │ └── TestScene │ │ ├── ApplicationFPS60.cs │ │ ├── ApplicationFPS60.cs.meta │ │ ├── Black Dynamic.mat │ │ ├── Black Dynamic.mat.meta │ │ ├── GrassGround.mat │ │ ├── GrassGround.mat.meta │ │ ├── MoveCamera.cs │ │ ├── MoveCamera.cs.meta │ │ ├── Player.controller │ │ ├── Player.controller.meta │ │ ├── PlayerMove.anim │ │ ├── PlayerMove.anim.meta │ │ ├── RotateLight.cs │ │ ├── RotateLight.cs.meta │ │ ├── UniversalRenderPipelineAsset.asset │ │ ├── UniversalRenderPipelineAsset.asset.meta │ │ ├── UniversalRenderPipelineAsset_Renderer.asset │ │ ├── UniversalRenderPipelineAsset_Renderer.asset.meta │ │ ├── scene.meta │ │ ├── scene.unity │ │ ├── scene.unity.meta │ │ └── scene │ │ ├── LightingData.asset │ │ ├── LightingData.asset.meta │ │ ├── Lightmap-0_comp_dir.png │ │ ├── Lightmap-0_comp_dir.png.meta │ │ ├── Lightmap-0_comp_light.exr │ │ ├── Lightmap-0_comp_light.exr.meta │ │ ├── ReflectionProbe-0.exr │ │ └── ReflectionProbe-0.exr.meta │ ├── SkyBox.meta │ └── SkyBox │ ├── SkyBox.mat │ ├── SkyBox.mat.meta │ ├── SkyBox.shader │ └── SkyBox.shader.meta ├── LICENSE ├── Packages ├── manifest.json └── packages-lock.json ├── ProjectSettings ├── AudioManager.asset ├── BurstAotSettings_Android.json ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── PackageManagerSettings.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── TimelineSettings.asset ├── URPProjectSettings.asset ├── UnityConnectSettings.asset ├── VFXManager.asset ├── VersionControlSettings.asset └── XRSettings.asset ├── README.md └── UserSettings └── EditorUserSettings.asset /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.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 | /[Mm]emoryCaptures/ 12 | 13 | # Never ignore Asset meta data 14 | !/[Aa]ssets/**/*.meta 15 | 16 | # Uncomment this line if you wish to ignore the asset store tools plugin 17 | # /[Aa]ssets/AssetStoreTools* 18 | 19 | # Autogenerated Jetbrains Rider plugin 20 | [Aa]ssets/Plugins/Editor/JetBrains* 21 | 22 | # Visual Studio cache directory 23 | .vs/ 24 | 25 | # Gradle cache directory 26 | .gradle/ 27 | 28 | # Autogenerated VS/MD/Consulo solution and project files 29 | ExportedObj/ 30 | .consulo/ 31 | *.csproj 32 | *.unityproj 33 | *.sln 34 | *.suo 35 | *.tmp 36 | *.user 37 | *.userprefs 38 | *.pidb 39 | *.booproj 40 | *.svd 41 | *.pdb 42 | *.mdb 43 | *.opendb 44 | *.VC.db 45 | 46 | # Unity3D generated meta files 47 | *.pidb.meta 48 | *.pdb.meta 49 | *.mdb.meta 50 | 51 | # Unity3D generated file on crash reports 52 | sysinfo.txt 53 | 54 | # Builds 55 | *.apk 56 | *.unitypackage 57 | 58 | # Crashlytics generated file 59 | crashlytics-build.properties 60 | 61 | # Autogenerated Jetbrains Rider plugin 62 | [Aa]ssets/ExternalAssets* 63 | 64 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b5f1a6e1970fb8d4fb90ef53ef9aa4a2 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a8828e32a402aff4c964595e1f00f8cf 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/Core.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a512c6d3bbd7eff4bb745cd18c77c3dd 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/Core/CullingCompute.compute: -------------------------------------------------------------------------------- 1 | #pragma kernel CSMain 2 | 3 | //Matrix4x4 v = Camera.main.worldToCameraMatrix; 4 | //Matrix4x4 p = Camera.main.projectionMatrix; //unity C# use opengl standard projection matrix 5 | //cullingComputeShader.SetMatrix("_VPMatrix", p * v); //set from C# 6 | float4x4 _VPMatrix; 7 | float _MaxDrawDistance; 8 | uint _StartOffset; 9 | StructuredBuffer _AllInstancesPosWSBuffer; //will not change until instance count change 10 | AppendStructuredBuffer _VisibleInstancesOnlyPosWSIDBuffer; //will set counter to 0 per frame, then fill in by this compute shader 11 | 12 | [numthreads(64,1,1)] 13 | void CSMain (uint3 id : SV_DispatchThreadID) 14 | { 15 | //posWS -> posCS 16 | float4 absPosCS = abs(mul(_VPMatrix,float4(_AllInstancesPosWSBuffer[id.x + _StartOffset],1.0))); 17 | 18 | //do culling test in clip space, result is the same as doing test in NDC space. 19 | //prefer clip space here because doing culling test in clip space is faster than doing culling test in NDC, because we can skip 1 division. 20 | //the test is using OpenGL standard projection matrix, because all matrix from unity C# is OpenGL standard 21 | //if instance is inside camera frustum, and is within draw distance, we append it to _VisibleInstanceOnlyTransformBuffer 22 | //y test allow 50% more threshold (hardcode for grass) 23 | //x test allow 10% more threshold (hardcode for grass) 24 | if (absPosCS.z <= absPosCS.w && absPosCS.y <= absPosCS.w*1.5 && absPosCS.x <= absPosCS.w*1.1 && absPosCS.w <= _MaxDrawDistance) 25 | _VisibleInstancesOnlyPosWSIDBuffer.Append(id.x + _StartOffset); 26 | } 27 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/Core/CullingCompute.compute.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ff257ce2a1c37546a9b544e669e976b 3 | ComputeShaderImporter: 4 | externalObjects: {} 5 | currentAPIMask: 2099204 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/Core/GrassBending.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c118256f2d35285458aa39c598f129e6 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/Core/GrassBending/GrassBendingRTPrePass.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.Rendering; 3 | using UnityEngine.Rendering.Universal; 4 | 5 | public class GrassBendingRTPrePass : ScriptableRendererFeature 6 | { 7 | class CustomRenderPass : ScriptableRenderPass 8 | { 9 | static readonly int _GrassBendingRT_pid = Shader.PropertyToID("_GrassBendingRT"); 10 | static readonly RenderTargetIdentifier _GrassBendingRT_rti = new RenderTargetIdentifier(_GrassBendingRT_pid); 11 | ShaderTagId GrassBending_stid = new ShaderTagId("GrassBending"); 12 | 13 | // This method is called before executing the render pass. 14 | // It can be used to configure render targets and their clear state. Also to create temporary render target textures. 15 | // When empty this render pass will render to the active camera render target. 16 | // You should never call CommandBuffer.SetRenderTarget. Instead call ConfigureTarget and ConfigureClear. 17 | // The render pipeline will ensure target setup and clearing happens in an performance manner. 18 | public override void Configure(CommandBuffer cmd, RenderTextureDescriptor cameraTextureDescriptor) 19 | { 20 | //512*512 is big enough for this demo's max grass count, can use a much smaller RT in regular use case 21 | //TODO: make RT render pos follow main camera view frustrum, allow using a much smaller size RT 22 | cmd.GetTemporaryRT(_GrassBendingRT_pid, new RenderTextureDescriptor(512, 512, RenderTextureFormat.R8,0)); 23 | ConfigureTarget(_GrassBendingRT_rti); 24 | ConfigureClear(ClearFlag.All, Color.white); 25 | } 26 | 27 | // Here you can implement the rendering logic. 28 | // Use ScriptableRenderContext to issue drawing commands or execute command buffers 29 | // https://docs.unity3d.com/ScriptReference/Rendering.ScriptableRenderContext.html 30 | // You don't have to call ScriptableRenderContext.submit, the render pipeline will call it at specific points in the pipeline. 31 | public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData) 32 | { 33 | if (!InstancedIndirectGrassRenderer.instance) 34 | { 35 | Debug.LogWarning("InstancedIndirectGrassRenderer not found, abort GrassBendingRTPrePass's Execute"); 36 | return; 37 | } 38 | 39 | CommandBuffer cmd = CommandBufferPool.Get("GrassBendingRT"); 40 | 41 | //make a new view matrix that is the same as an imaginary camera above grass center 1 units and looking at grass(bird view) 42 | //scale.z is -1 because view space will look into -Z while world space will look into +Z 43 | //camera transform's local to world's inverse means camera's world to view = world to local 44 | Matrix4x4 viewMatrix = Matrix4x4.TRS(InstancedIndirectGrassRenderer.instance.transform.position + new Vector3(0, 1, 0),Quaternion.LookRotation(-Vector3.up), new Vector3(1,1,-1)).inverse; 45 | 46 | //ortho camera with 1:1 aspect, size = 50 47 | float sizeX = InstancedIndirectGrassRenderer.instance.transform.localScale.x; 48 | float sizeZ = InstancedIndirectGrassRenderer.instance.transform.localScale.z; 49 | Matrix4x4 projectionMatrix = Matrix4x4.Ortho(-sizeX,sizeX, -sizeZ, sizeZ, 0.5f, 1.5f); 50 | 51 | //override view & Projection matrix 52 | cmd.SetViewProjectionMatrices(viewMatrix, projectionMatrix); 53 | context.ExecuteCommandBuffer(cmd); 54 | 55 | //draw all trail renderer using SRP batching 56 | var drawSetting = CreateDrawingSettings(GrassBending_stid, ref renderingData, SortingCriteria.CommonTransparent); 57 | var filterSetting = new FilteringSettings(RenderQueueRange.all); 58 | context.DrawRenderers(renderingData.cullResults, ref drawSetting, ref filterSetting); 59 | 60 | //restore camera matrix 61 | cmd.Clear(); 62 | cmd.SetViewProjectionMatrices(renderingData.cameraData.camera.worldToCameraMatrix, renderingData.cameraData.camera.projectionMatrix); 63 | 64 | //set global RT 65 | cmd.SetGlobalTexture(_GrassBendingRT_pid, new RenderTargetIdentifier(_GrassBendingRT_pid)); 66 | 67 | context.ExecuteCommandBuffer(cmd); 68 | CommandBufferPool.Release(cmd); 69 | } 70 | 71 | /// Cleanup any allocated resources that were created during the execution of this render pass. 72 | public override void FrameCleanup(CommandBuffer cmd) 73 | { 74 | cmd.ReleaseTemporaryRT(_GrassBendingRT_pid); 75 | } 76 | } 77 | 78 | CustomRenderPass m_ScriptablePass; 79 | 80 | public override void Create() 81 | { 82 | m_ScriptablePass = new CustomRenderPass(); 83 | 84 | // Configures where the render pass should be injected. 85 | m_ScriptablePass.renderPassEvent = RenderPassEvent.AfterRenderingPrePasses; //don't do RT switch when rendering _CameraColorTexture, so use AfterRenderingPrePasses 86 | } 87 | 88 | // Here you can inject one or multiple render passes in the renderer. 89 | // This method is called when setting up the renderer once per-camera. 90 | public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData) 91 | { 92 | renderer.EnqueuePass(m_ScriptablePass); 93 | } 94 | } 95 | 96 | 97 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/Core/GrassBending/GrassBendingRTPrePass.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9eadc27cc8a56ba4c880962453e388e8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/Core/GrassBending/GrassBendingRTPrePassPS.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: GrassBendingRTPrePassPS 11 | m_Shader: {fileID: 4800000, guid: 91755c17faee27e4f9e4267da00da25c, type: 3} 12 | m_ShaderKeywords: 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 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/Core/GrassBending/GrassBendingRTPrePassPS.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 481756766bafef24cb4d80894112ddea 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/Core/GrassBending/GrassBendingRTPrePassTrailShader.shader: -------------------------------------------------------------------------------- 1 | Shader "URPMobileGrassInstancedIndirectDemo/GrassBendingRTPrePassPS" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Texture", 2D) = "white" {} 6 | } 7 | SubShader 8 | { 9 | Tags 10 | { 11 | // With SRP we introduced a new "RenderPipeline" tag in Subshader. This allows you to create shaders 12 | // that can match multiple render pipelines. If a RenderPipeline tag is not set it will match 13 | // any render pipeline. In case you want your subshader to only run in URP, set the tag to 14 | // "UniversalRenderPipeline" 15 | "RenderPipeline" = "UniversalRenderPipeline" 16 | } 17 | Tags { "RenderType"="Transparent" "Queue"="Transparent" } 18 | 19 | Pass 20 | { 21 | Cull Off 22 | ZTest Always 23 | Blend Zero SrcColor 24 | 25 | Tags 26 | { 27 | "LightMode" = "GrassBending" 28 | } 29 | CGPROGRAM 30 | #pragma vertex vert 31 | #pragma fragment frag 32 | 33 | #include "UnityCG.cginc" 34 | 35 | struct appdata 36 | { 37 | float4 vertex : POSITION; 38 | float2 uv : TEXCOORD0; 39 | half4 color : COLOR; 40 | }; 41 | 42 | struct v2f 43 | { 44 | float2 uv : TEXCOORD0; 45 | float4 vertex : SV_POSITION; 46 | half4 color : COLOR; 47 | }; 48 | 49 | sampler2D _MainTex; 50 | float4 _MainTex_ST; 51 | 52 | v2f vert (appdata v) 53 | { 54 | v2f o; 55 | o.vertex = UnityObjectToClipPos(v.vertex); 56 | o.uv = TRANSFORM_TEX(v.uv, _MainTex); 57 | o.color = v.color; 58 | return o; 59 | } 60 | 61 | fixed4 frag (v2f i) : SV_Target 62 | { 63 | // sample the texture 64 | fixed4 col = tex2D(_MainTex, i.uv) * i.color; 65 | return col; 66 | } 67 | ENDCG 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/Core/GrassBending/GrassBendingRTPrePassTrailShader.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 91755c17faee27e4f9e4267da00da25c 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/Core/GrassBending/GrassBendingTrailRenderer.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &5769739721523732314 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: 3511933678040990990} 12 | m_Layer: 0 13 | m_Name: GrassBendingTrail 14 | m_TagString: Untagged 15 | m_Icon: {fileID: 0} 16 | m_NavMeshLayer: 0 17 | m_StaticEditorFlags: 0 18 | m_IsActive: 1 19 | --- !u!4 &3511933678040990990 20 | Transform: 21 | m_ObjectHideFlags: 0 22 | m_CorrespondingSourceObject: {fileID: 0} 23 | m_PrefabInstance: {fileID: 0} 24 | m_PrefabAsset: {fileID: 0} 25 | m_GameObject: {fileID: 5769739721523732314} 26 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 27 | m_LocalPosition: {x: 0, y: -1, z: 0} 28 | m_LocalScale: {x: 1, y: 1, z: 1} 29 | m_Children: 30 | - {fileID: 6374744695962225617} 31 | m_Father: {fileID: 0} 32 | m_RootOrder: 0 33 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 34 | --- !u!1 &6374744695962225616 35 | GameObject: 36 | m_ObjectHideFlags: 0 37 | m_CorrespondingSourceObject: {fileID: 0} 38 | m_PrefabInstance: {fileID: 0} 39 | m_PrefabAsset: {fileID: 0} 40 | serializedVersion: 6 41 | m_Component: 42 | - component: {fileID: 6374744695962225617} 43 | - component: {fileID: 6374744695962225618} 44 | m_Layer: 0 45 | m_Name: Trail 46 | m_TagString: Untagged 47 | m_Icon: {fileID: 0} 48 | m_NavMeshLayer: 0 49 | m_StaticEditorFlags: 0 50 | m_IsActive: 1 51 | --- !u!4 &6374744695962225617 52 | Transform: 53 | m_ObjectHideFlags: 0 54 | m_CorrespondingSourceObject: {fileID: 0} 55 | m_PrefabInstance: {fileID: 0} 56 | m_PrefabAsset: {fileID: 0} 57 | m_GameObject: {fileID: 6374744695962225616} 58 | m_LocalRotation: {x: -0.70710576, y: -0, z: -0, w: 0.70710784} 59 | m_LocalPosition: {x: 0, y: 0, z: 0} 60 | m_LocalScale: {x: 1, y: 1, z: 1} 61 | m_Children: [] 62 | m_Father: {fileID: 3511933678040990990} 63 | m_RootOrder: 0 64 | m_LocalEulerAnglesHint: {x: -90.00001, y: 0, z: 0} 65 | --- !u!96 &6374744695962225618 66 | TrailRenderer: 67 | serializedVersion: 2 68 | m_ObjectHideFlags: 0 69 | m_CorrespondingSourceObject: {fileID: 0} 70 | m_PrefabInstance: {fileID: 0} 71 | m_PrefabAsset: {fileID: 0} 72 | m_GameObject: {fileID: 6374744695962225616} 73 | m_Enabled: 1 74 | m_CastShadows: 1 75 | m_ReceiveShadows: 1 76 | m_DynamicOccludee: 1 77 | m_MotionVectors: 0 78 | m_LightProbeUsage: 0 79 | m_ReflectionProbeUsage: 0 80 | m_RayTracingMode: 0 81 | m_RenderingLayerMask: 1 82 | m_RendererPriority: 0 83 | m_Materials: 84 | - {fileID: 2100000, guid: 481756766bafef24cb4d80894112ddea, type: 2} 85 | m_StaticBatchInfo: 86 | firstSubMesh: 0 87 | subMeshCount: 0 88 | m_StaticBatchRoot: {fileID: 0} 89 | m_ProbeAnchor: {fileID: 0} 90 | m_LightProbeVolumeOverride: {fileID: 0} 91 | m_ScaleInLightmap: 1 92 | m_ReceiveGI: 1 93 | m_PreserveUVs: 0 94 | m_IgnoreNormalsForChartDetection: 0 95 | m_ImportantGI: 0 96 | m_StitchLightmapSeams: 1 97 | m_SelectedEditorRenderState: 3 98 | m_MinimumChartSize: 4 99 | m_AutoUVMaxDistance: 0.5 100 | m_AutoUVMaxAngle: 89 101 | m_LightmapParameters: {fileID: 0} 102 | m_SortingLayerID: 0 103 | m_SortingLayer: 0 104 | m_SortingOrder: 0 105 | m_Time: 5 106 | m_Parameters: 107 | serializedVersion: 3 108 | widthMultiplier: 1 109 | widthCurve: 110 | serializedVersion: 2 111 | m_Curve: 112 | - serializedVersion: 3 113 | time: 0 114 | value: 1 115 | inSlope: 0 116 | outSlope: 0 117 | tangentMode: 0 118 | weightedMode: 0 119 | inWeight: 0.33333334 120 | outWeight: 0.33333334 121 | m_PreInfinity: 2 122 | m_PostInfinity: 2 123 | m_RotationOrder: 4 124 | colorGradient: 125 | serializedVersion: 2 126 | key0: {r: 0, g: 0, b: 0, a: 1} 127 | key1: {r: 1, g: 1, b: 1, a: 1} 128 | key2: {r: 0, g: 0, b: 0, a: 0} 129 | key3: {r: 0, g: 0, b: 0, a: 0} 130 | key4: {r: 0, g: 0, b: 0, a: 0} 131 | key5: {r: 0, g: 0, b: 0, a: 0} 132 | key6: {r: 0, g: 0, b: 0, a: 0} 133 | key7: {r: 0, g: 0, b: 0, a: 0} 134 | ctime0: 0 135 | ctime1: 65535 136 | ctime2: 0 137 | ctime3: 0 138 | ctime4: 0 139 | ctime5: 0 140 | ctime6: 0 141 | ctime7: 0 142 | atime0: 0 143 | atime1: 65535 144 | atime2: 0 145 | atime3: 0 146 | atime4: 0 147 | atime5: 0 148 | atime6: 0 149 | atime7: 0 150 | m_Mode: 0 151 | m_NumColorKeys: 2 152 | m_NumAlphaKeys: 2 153 | numCornerVertices: 0 154 | numCapVertices: 0 155 | alignment: 1 156 | textureMode: 0 157 | shadowBias: 0.5 158 | generateLightingData: 0 159 | m_MinVertexDistance: 0.1 160 | m_Autodestruct: 0 161 | m_Emitting: 1 162 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/Core/GrassBending/GrassBendingTrailRenderer.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f6ba7152c8bde8a4683072c5f8fa8d6b 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/Core/InstancedIndirectGrass.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: InstancedIndirectGrass 11 | m_Shader: {fileID: 4800000, guid: fd090f3b1d7b5df4f9c363d609cfa330, type: 3} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 1 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: 2000 17 | stringTagMap: 18 | RenderType: Opaque 19 | disabledShaderPasses: [] 20 | m_SavedProperties: 21 | serializedVersion: 3 22 | m_TexEnvs: 23 | - _BaseColorTexture: 24 | m_Texture: {fileID: 2800000, guid: edec5ef3226950841ac8090d6ac18095, type: 3} 25 | m_Scale: {x: 0.02, y: 0.02} 26 | m_Offset: {x: -0.43, y: -1.87} 27 | - _BaseMap: 28 | m_Texture: {fileID: 10309, guid: 0000000000000000f000000000000000, type: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | - _BaseTex: 32 | m_Texture: {fileID: 0} 33 | m_Scale: {x: 1, y: 1} 34 | m_Offset: {x: 0, y: 0} 35 | - _BumpMap: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _EmissionMap: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - _MainTex: 44 | m_Texture: {fileID: 0} 45 | m_Scale: {x: 1, y: 1} 46 | m_Offset: {x: 0, y: 0} 47 | - _MetallicGlossMap: 48 | m_Texture: {fileID: 0} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | - _OcclusionMap: 52 | m_Texture: {fileID: 0} 53 | m_Scale: {x: 1, y: 1} 54 | m_Offset: {x: 0, y: 0} 55 | - _SpecGlossMap: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | m_Floats: 60 | - _AlphaClip: 0 61 | - _Blend: 0 62 | - _BoundSize: 50 63 | - _BoundSizeX: 50 64 | - _BoundSizeZ: 1 65 | - _BumpScale: 1 66 | - _Cull: 2 67 | - _Cutoff: 0.5 68 | - _DrawDistance: 125 69 | - _DstBlend: 0 70 | - _EnvironmentReflections: 1 71 | - _GlossMapScale: 0 72 | - _Glossiness: 0 73 | - _GlossyReflections: 0 74 | - _GrassHeight: 1 75 | - _GrassWidth: 1 76 | - _Metallic: 0 77 | - _OcclusionStrength: 1 78 | - _QueueOffset: 0 79 | - _RandomNormal: 0.15 80 | - _ReceiveShadows: 1 81 | - _SampleGI: 0 82 | - _Smoothness: 0.5 83 | - _SmoothnessTextureChannel: 0 84 | - _SpecularHighlights: 1 85 | - _SrcBlend: 1 86 | - _Surface: 0 87 | - _WindAFrequency: 4 88 | - _WindAIntensity: 1.77 89 | - _WindBFrequency: 7.7 90 | - _WindBIntensity: 0.25 91 | - _WindCFrequency: 11.7 92 | - _WindCIntensity: 0.125 93 | - _WindFrequency: 4 94 | - _WindIntensity: 1 95 | - _WorkflowMode: 1 96 | - _ZWrite: 1 97 | m_Colors: 98 | - _BaseColor: {r: 1, g: 1, b: 1, a: 1} 99 | - _BoundSize: {r: 250, g: 250, b: 0, a: 0} 100 | - _Color: {r: 1, g: 1, b: 1, a: 1} 101 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 102 | - _GroundColor: {r: 0.2195755, g: 0.46226418, b: 0.2581851, a: 1} 103 | - _PivotPosWS: {r: 6.2, g: 0, b: 27.1, a: 0} 104 | - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} 105 | - _WindADirection: {r: 0.1, g: 0.1, b: 0, a: 1} 106 | - _WindATiling: {r: 0.1, g: 0.1, b: 0, a: 1} 107 | - _WindAWrap: {r: 0.5, g: 0.5, b: 0, a: 1} 108 | - _WindBDirection: {r: 0.35, g: 0, b: 0, a: 1} 109 | - _WindBTiling: {r: 0.37, g: 3, b: 0, a: 1} 110 | - _WindBWrap: {r: 0.5, g: 0.5, b: 0, a: 1} 111 | - _WindCDirection: {r: 0.7, g: -0.1, b: 0, a: 1} 112 | - _WindCTiling: {r: 0.77, g: 3, b: 0, a: 1} 113 | - _WindCWrap: {r: 0.5, g: 0.5, b: 0, a: 1} 114 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/Core/InstancedIndirectGrass.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a0ca5d9e755e74448eaac7a643303db 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/Core/InstancedIndirectGrass.shader: -------------------------------------------------------------------------------- 1 | Shader "MobileDrawMeshInstancedIndirect/SingleGrass" 2 | { 3 | Properties 4 | { 5 | [MainColor] _BaseColor("BaseColor", Color) = (1,1,1,1) 6 | _BaseColorTexture("_BaseColorTexture", 2D) = "white" {} 7 | _GroundColor("_GroundColor", Color) = (0.5,0.5,0.5) 8 | 9 | [Header(Grass Shape)] 10 | _GrassWidth("_GrassWidth", Float) = 1 11 | _GrassHeight("_GrassHeight", Float) = 1 12 | 13 | [Header(Wind)] 14 | _WindAIntensity("_WindAIntensity", Float) = 1.77 15 | _WindAFrequency("_WindAFrequency", Float) = 4 16 | _WindATiling("_WindATiling", Vector) = (0.1,0.1,0) 17 | _WindAWrap("_WindAWrap", Vector) = (0.5,0.5,0) 18 | 19 | _WindBIntensity("_WindBIntensity", Float) = 0.25 20 | _WindBFrequency("_WindBFrequency", Float) = 7.7 21 | _WindBTiling("_WindBTiling", Vector) = (.37,3,0) 22 | _WindBWrap("_WindBWrap", Vector) = (0.5,0.5,0) 23 | 24 | 25 | _WindCIntensity("_WindCIntensity", Float) = 0.125 26 | _WindCFrequency("_WindCFrequency", Float) = 11.7 27 | _WindCTiling("_WindCTiling", Vector) = (0.77,3,0) 28 | _WindCWrap("_WindCWrap", Vector) = (0.5,0.5,0) 29 | 30 | [Header(Lighting)] 31 | _RandomNormal("_RandomNormal", Float) = 0.15 32 | 33 | //make SRP batcher happy 34 | [HideInInspector]_PivotPosWS("_PivotPosWS", Vector) = (0,0,0,0) 35 | [HideInInspector]_BoundSize("_BoundSize", Vector) = (1,1,0) 36 | } 37 | 38 | SubShader 39 | { 40 | Tags { "RenderType" = "Opaque" "RenderPipeline" = "UniversalRenderPipeline"} 41 | 42 | Pass 43 | { 44 | Cull Back //use default culling because this shader is billboard 45 | ZTest Less 46 | Tags { "LightMode" = "UniversalForward" } 47 | 48 | HLSLPROGRAM 49 | #pragma vertex vert 50 | #pragma fragment frag 51 | 52 | // ------------------------------------- 53 | // Universal Render Pipeline keywords 54 | // When doing custom shaders you most often want to copy and paste these #pragmas 55 | // These multi_compile variants are stripped from the build depending on: 56 | // 1) Settings in the URP Asset assigned in the GraphicsSettings at build time 57 | // e.g If you disabled AdditionalLights in the asset then all _ADDITIONA_LIGHTS variants 58 | // will be stripped from build 59 | // 2) Invalid combinations are stripped. e.g variants with _MAIN_LIGHT_SHADOWS_CASCADE 60 | // but not _MAIN_LIGHT_SHADOWS are invalid and therefore stripped. 61 | #pragma multi_compile _ _MAIN_LIGHT_SHADOWS 62 | #pragma multi_compile _ _MAIN_LIGHT_SHADOWS_CASCADE 63 | #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS 64 | #pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS 65 | #pragma multi_compile _ _SHADOWS_SOFT 66 | // ------------------------------------- 67 | // Unity defined keywords 68 | #pragma multi_compile_fog 69 | // ------------------------------------- 70 | 71 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" 72 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" 73 | 74 | struct Attributes 75 | { 76 | float4 positionOS : POSITION; 77 | }; 78 | 79 | struct Varyings 80 | { 81 | float4 positionCS : SV_POSITION; 82 | half3 color : COLOR; 83 | }; 84 | 85 | CBUFFER_START(UnityPerMaterial) 86 | float3 _PivotPosWS; 87 | float2 _BoundSize; 88 | 89 | float _GrassWidth; 90 | float _GrassHeight; 91 | 92 | float _WindAIntensity; 93 | float _WindAFrequency; 94 | float2 _WindATiling; 95 | float2 _WindAWrap; 96 | 97 | float _WindBIntensity; 98 | float _WindBFrequency; 99 | float2 _WindBTiling; 100 | float2 _WindBWrap; 101 | 102 | float _WindCIntensity; 103 | float _WindCFrequency; 104 | float2 _WindCTiling; 105 | float2 _WindCWrap; 106 | 107 | half3 _BaseColor; 108 | float4 _BaseColorTexture_ST; 109 | half3 _GroundColor; 110 | 111 | half _RandomNormal; 112 | 113 | StructuredBuffer _AllInstancesTransformBuffer; 114 | StructuredBuffer _VisibleInstanceOnlyTransformIDBuffer; 115 | CBUFFER_END 116 | 117 | sampler2D _GrassBendingRT; 118 | sampler2D _BaseColorTexture; 119 | 120 | half3 ApplySingleDirectLight(Light light, half3 N, half3 V, half3 albedo, half positionOSY) 121 | { 122 | half3 H = normalize(light.direction + V); 123 | 124 | //direct diffuse 125 | half directDiffuse = dot(N, light.direction) * 0.5 + 0.5; //half lambert, to fake grass SSS 126 | 127 | //direct specular 128 | float directSpecular = saturate(dot(N,H)); 129 | //pow(directSpecular,8) 130 | directSpecular *= directSpecular; 131 | directSpecular *= directSpecular; 132 | directSpecular *= directSpecular; 133 | //directSpecular *= directSpecular; //enable this line = change to pow(directSpecular,16) 134 | 135 | //add direct directSpecular to result 136 | directSpecular *= 0.1 * positionOSY;//only apply directSpecular to grass's top area, to simulate grass AO 137 | 138 | half3 lighting = light.color * (light.shadowAttenuation * light.distanceAttenuation); 139 | half3 result = (albedo * directDiffuse + directSpecular) * lighting; 140 | return result; 141 | } 142 | 143 | Varyings vert(Attributes IN, uint instanceID : SV_InstanceID) 144 | { 145 | Varyings OUT; 146 | 147 | float3 perGrassPivotPosWS = _AllInstancesTransformBuffer[_VisibleInstanceOnlyTransformIDBuffer[instanceID]];//we pre-transform to posWS in C# now 148 | 149 | float perGrassHeight = lerp(2,5,(sin(perGrassPivotPosWS.x*23.4643 + perGrassPivotPosWS.z) * 0.45 + 0.55)) * _GrassHeight; 150 | 151 | //get "is grass stepped" data(bending) from RT 152 | float2 grassBendingUV = ((perGrassPivotPosWS.xz - _PivotPosWS.xz) / _BoundSize) * 0.5 + 0.5;//claculate where is this grass inside bound (can optimize to 2 MAD) 153 | float stepped = tex2Dlod(_GrassBendingRT, float4(grassBendingUV, 0, 0)).x; 154 | 155 | //rotation(make grass LookAt() camera just like a billboard) 156 | //========================================= 157 | float3 cameraTransformRightWS = UNITY_MATRIX_V[0].xyz;//UNITY_MATRIX_V[0].xyz == world space camera Right unit vector 158 | float3 cameraTransformUpWS = UNITY_MATRIX_V[1].xyz;//UNITY_MATRIX_V[1].xyz == world space camera Up unit vector 159 | float3 cameraTransformForwardWS = -UNITY_MATRIX_V[2].xyz;//UNITY_MATRIX_V[2].xyz == -1 * world space camera Forward unit vector 160 | 161 | //Expand Billboard (billboard Left+right) 162 | float3 positionOS = IN.positionOS.x * cameraTransformRightWS * _GrassWidth * (sin(perGrassPivotPosWS.x*95.4643 + perGrassPivotPosWS.z) * 0.45 + 0.55);//random width from posXZ, min 0.1 163 | 164 | //Expand Billboard (billboard Up) 165 | positionOS += IN.positionOS.y * cameraTransformUpWS; 166 | //========================================= 167 | 168 | //bending by RT (hard code) 169 | float3 bendDir = cameraTransformForwardWS; 170 | bendDir.xz *= 0.5; //make grass shorter when bending, looks better 171 | bendDir.y = min(-0.5,bendDir.y);//prevent grass become too long if camera forward is / near parallel to ground 172 | positionOS = lerp(positionOS.xyz + bendDir * positionOS.y / -bendDir.y, positionOS.xyz, stepped * 0.95 + 0.05);//don't fully bend, will produce ZFighting 173 | 174 | //per grass height scale 175 | positionOS.y *= perGrassHeight; 176 | 177 | //camera distance scale (make grass width larger if grass is far away to camera, to hide smaller than pixel size triangle flicker) 178 | float3 viewWS = _WorldSpaceCameraPos - perGrassPivotPosWS; 179 | float ViewWSLength = length(viewWS); 180 | positionOS += cameraTransformRightWS * IN.positionOS.x * max(0, ViewWSLength * 0.0225); 181 | 182 | 183 | //move grass posOS -> posWS 184 | float3 positionWS = positionOS + perGrassPivotPosWS; 185 | 186 | //wind animation (biilboard Left Right direction only sin wave) 187 | float wind = 0; 188 | wind += (sin(_Time.y * _WindAFrequency + perGrassPivotPosWS.x * _WindATiling.x + perGrassPivotPosWS.z * _WindATiling.y)*_WindAWrap.x+_WindAWrap.y) * _WindAIntensity; //windA 189 | wind += (sin(_Time.y * _WindBFrequency + perGrassPivotPosWS.x * _WindBTiling.x + perGrassPivotPosWS.z * _WindBTiling.y)*_WindBWrap.x+_WindBWrap.y) * _WindBIntensity; //windB 190 | wind += (sin(_Time.y * _WindCFrequency + perGrassPivotPosWS.x * _WindCTiling.x + perGrassPivotPosWS.z * _WindCTiling.y)*_WindCWrap.x+_WindCWrap.y) * _WindCIntensity; //windC 191 | wind *= IN.positionOS.y; //wind only affect top region, don't affect root region 192 | float3 windOffset = cameraTransformRightWS * wind; //swing using billboard left right direction 193 | positionWS.xyz += windOffset; 194 | 195 | //vertex position logic done, complete posWS -> posCS 196 | OUT.positionCS = TransformWorldToHClip(positionWS); 197 | 198 | ///////////////////////////////////////////////////////////////////// 199 | //lighting & color 200 | ///////////////////////////////////////////////////////////////////// 201 | 202 | //lighting data 203 | Light mainLight; 204 | #if _MAIN_LIGHT_SHADOWS 205 | mainLight = GetMainLight(TransformWorldToShadowCoord(positionWS)); 206 | #else 207 | mainLight = GetMainLight(); 208 | #endif 209 | half3 randomAddToN = (_RandomNormal* sin(perGrassPivotPosWS.x * 82.32523 + perGrassPivotPosWS.z) + wind * -0.25) * cameraTransformRightWS;//random normal per grass 210 | //default grass's normal is pointing 100% upward in world space, it is an important but simple grass normal trick 211 | //-apply random to normal else lighting is too uniform 212 | //-apply cameraTransformForwardWS to normal because grass is billboard 213 | half3 N = normalize(half3(0,1,0) + randomAddToN - cameraTransformForwardWS*0.5); 214 | 215 | half3 V = viewWS / ViewWSLength; 216 | 217 | half3 baseColor = tex2Dlod(_BaseColorTexture, float4(TRANSFORM_TEX(positionWS.xz,_BaseColorTexture),0,0)) * _BaseColor;//sample mip 0 only 218 | half3 albedo = lerp(_GroundColor,baseColor, IN.positionOS.y); 219 | 220 | //indirect 221 | half3 lightingResult = SampleSH(0) * albedo; 222 | 223 | //main direct light 224 | lightingResult += ApplySingleDirectLight(mainLight, N, V, albedo, positionOS.y); 225 | 226 | // Additional lights loop 227 | #if _ADDITIONAL_LIGHTS 228 | 229 | // Returns the amount of lights affecting the object being renderer. 230 | // These lights are culled per-object in the forward renderer 231 | int additionalLightsCount = GetAdditionalLightsCount(); 232 | for (int i = 0; i < additionalLightsCount; ++i) 233 | { 234 | // Similar to GetMainLight, but it takes a for-loop index. This figures out the 235 | // per-object light index and samples the light buffer accordingly to initialized the 236 | // Light struct. If _ADDITIONAL_LIGHT_SHADOWS is defined it will also compute shadows. 237 | Light light = GetAdditionalLight(i, positionWS); 238 | 239 | // Same functions used to shade the main light. 240 | lightingResult += ApplySingleDirectLight(light, N, V, albedo, positionOS.y); 241 | } 242 | #endif 243 | 244 | //fog 245 | float fogFactor = ComputeFogFactor(OUT.positionCS.z); 246 | // Mix the pixel color with fogColor. You can optionaly use MixFogColor to override the fogColor 247 | // with a custom one. 248 | OUT.color = MixFog(lightingResult, fogFactor); 249 | 250 | return OUT; 251 | } 252 | 253 | half4 frag(Varyings IN) : SV_Target 254 | { 255 | return half4(IN.color,1); 256 | } 257 | ENDHLSL 258 | } 259 | 260 | //copy pass, change LightMode to ShadowCaster will make grass cast shadow 261 | //copy pass, change LightMode to DepthOnly will make grass render into _CameraDepthTexture 262 | } 263 | } -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/Core/InstancedIndirectGrass.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fd090f3b1d7b5df4f9c363d609cfa330 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | preprocessorOverride: 0 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/Core/InstancedIndirectGrassPosDefine.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | [ExecuteAlways] 6 | public class InstancedIndirectGrassPosDefine : MonoBehaviour 7 | { 8 | [Range(1, 40000000)] 9 | public int instanceCount = 1000000; 10 | public float drawDistance = 125; 11 | 12 | private int cacheCount = -1; 13 | 14 | // Start is called before the first frame update 15 | void Start() 16 | { 17 | UpdatePosIfNeeded(); 18 | } 19 | private void Update() 20 | { 21 | UpdatePosIfNeeded(); 22 | } 23 | private void OnGUI() 24 | { 25 | GUI.Label(new Rect(300, 50, 200, 30), "Instance Count: " + instanceCount / 1000000 + "Million"); 26 | instanceCount = Mathf.Max(1, (int)(GUI.HorizontalSlider(new Rect(300, 100, 200, 30), instanceCount / 1000000f, 1, 10)) * 1000000); 27 | 28 | GUI.Label(new Rect(300, 150, 200, 30), "Draw Distance: " + drawDistance); 29 | drawDistance = Mathf.Max(1, (int)(GUI.HorizontalSlider(new Rect(300, 200, 200, 30), drawDistance / 25f, 1, 8)) * 25); 30 | InstancedIndirectGrassRenderer.instance.drawDistance = drawDistance; 31 | } 32 | private void UpdatePosIfNeeded() 33 | { 34 | if (instanceCount == cacheCount) 35 | return; 36 | 37 | Debug.Log("UpdatePos (Slow)"); 38 | 39 | //same seed to keep grass visual the same 40 | UnityEngine.Random.InitState(123); 41 | 42 | //auto keep density the same 43 | float scale = Mathf.Sqrt((instanceCount / 4)) / 2f; 44 | transform.localScale = new Vector3(scale, transform.localScale.y, scale); 45 | 46 | ////////////////////////////////////////////////////////////////////////// 47 | //can define any posWS in this section, random is just an example 48 | ////////////////////////////////////////////////////////////////////////// 49 | List positions = new List(instanceCount); 50 | for (int i = 0; i < instanceCount; i++) 51 | { 52 | Vector3 pos = Vector3.zero; 53 | 54 | pos.x = UnityEngine.Random.Range(-1f, 1f) * transform.lossyScale.x; 55 | pos.z = UnityEngine.Random.Range(-1f, 1f) * transform.lossyScale.z; 56 | 57 | //transform to posWS in C# 58 | pos += transform.position; 59 | 60 | positions.Add(new Vector3(pos.x, pos.y, pos.z)); 61 | } 62 | 63 | //send all posWS to renderer 64 | InstancedIndirectGrassRenderer.instance.allGrassPos = positions; 65 | cacheCount = positions.Count; 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/Core/InstancedIndirectGrassPosDefine.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e9d6ee35f46cc6a449199c3d64518325 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/Core/InstancedIndirectGrassRenderer.cs: -------------------------------------------------------------------------------- 1 | //see this for ref: https://docs.unity3d.com/ScriptReference/Graphics.DrawMeshInstancedIndirect.html 2 | 3 | using System; 4 | using System.Collections.Generic; 5 | using Unity.Collections; 6 | using Unity.Jobs; 7 | using UnityEngine; 8 | using UnityEngine.Profiling; 9 | 10 | [ExecuteAlways] 11 | public class InstancedIndirectGrassRenderer : MonoBehaviour 12 | { 13 | [Header("Settings")] 14 | public float drawDistance = 125;//this setting will affect performance a lot! 15 | public Material instanceMaterial; 16 | 17 | [Header("Internal")] 18 | public ComputeShader cullingComputeShader; 19 | 20 | [NonSerialized] 21 | public List allGrassPos = new List();//user should update this list using C# 22 | //===================================================== 23 | [HideInInspector] 24 | public static InstancedIndirectGrassRenderer instance;// global ref to this script 25 | 26 | private int cellCountX = -1; 27 | private int cellCountZ = -1; 28 | private int dispatchCount = -1; 29 | 30 | //smaller the number, CPU needs more time, but GPU is faster 31 | private float cellSizeX = 10; //unity unit (m) 32 | private float cellSizeZ = 10; //unity unit (m) 33 | 34 | private int instanceCountCache = -1; 35 | private Mesh cachedGrassMesh; 36 | 37 | private ComputeBuffer allInstancesPosWSBuffer; 38 | private ComputeBuffer visibleInstancesOnlyPosWSIDBuffer; 39 | private ComputeBuffer argsBuffer; 40 | 41 | private List[] cellPosWSsList; //for binning: binning will put each posWS into correct cell 42 | private float minX, minZ, maxX, maxZ; 43 | private List visibleCellIDList = new List(); 44 | private Plane[] cameraFrustumPlanes = new Plane[6]; 45 | 46 | bool shouldBatchDispatch = true; 47 | //===================================================== 48 | 49 | private void OnEnable() 50 | { 51 | instance = this; // assign global ref using this script 52 | } 53 | 54 | void LateUpdate() 55 | { 56 | // recreate all buffers if needed 57 | UpdateAllInstanceTransformBufferIfNeeded(); 58 | 59 | //===================================================================================================== 60 | // rough quick big cell frustum culling in CPU first 61 | //===================================================================================================== 62 | visibleCellIDList.Clear();//fill in this cell ID list using CPU frustum culling first 63 | Camera cam = Camera.main; 64 | 65 | //Do frustum culling using per cell bound 66 | //https://docs.unity3d.com/ScriptReference/GeometryUtility.CalculateFrustumPlanes.html 67 | //https://docs.unity3d.com/ScriptReference/GeometryUtility.TestPlanesAABB.html 68 | float cameraOriginalFarPlane = cam.farClipPlane; 69 | cam.farClipPlane = drawDistance;//allow drawDistance control 70 | GeometryUtility.CalculateFrustumPlanes(cam, cameraFrustumPlanes);//Ordering: [0] = Left, [1] = Right, [2] = Down, [3] = Up, [4] = Near, [5] = Far 71 | cam.farClipPlane = cameraOriginalFarPlane;//revert far plane edit 72 | 73 | //slow loop 74 | //TODO: (A)replace this forloop by a quadtree test? 75 | //TODO: (B)convert this forloop to job+burst? (UnityException: TestPlanesAABB can only be called from the main thread.) 76 | Profiler.BeginSample("CPU cell frustum culling (heavy)"); 77 | 78 | for (int i = 0; i < cellPosWSsList.Length; i++) 79 | { 80 | //create cell bound 81 | Vector3 centerPosWS = new Vector3 (i % cellCountX + 0.5f, 0, i / cellCountX + 0.5f); 82 | centerPosWS.x = Mathf.Lerp(minX, maxX, centerPosWS.x / cellCountX); 83 | centerPosWS.z = Mathf.Lerp(minZ, maxZ, centerPosWS.z / cellCountZ); 84 | Vector3 sizeWS = new Vector3(Mathf.Abs(maxX - minX) / cellCountX,0,Mathf.Abs(maxX - minX) / cellCountX); 85 | Bounds cellBound = new Bounds(centerPosWS, sizeWS); 86 | 87 | if (GeometryUtility.TestPlanesAABB(cameraFrustumPlanes, cellBound)) 88 | { 89 | visibleCellIDList.Add(i); 90 | } 91 | } 92 | Profiler.EndSample(); 93 | 94 | //===================================================================================================== 95 | // then loop though only visible cells, each visible cell dispatch GPU culling job once 96 | // at the end compute shader will fill all visible instance into visibleInstancesOnlyPosWSIDBuffer 97 | //===================================================================================================== 98 | Matrix4x4 v = cam.worldToCameraMatrix; 99 | Matrix4x4 p = cam.projectionMatrix; 100 | Matrix4x4 vp = p * v; 101 | 102 | visibleInstancesOnlyPosWSIDBuffer.SetCounterValue(0); 103 | 104 | //set once only 105 | cullingComputeShader.SetMatrix("_VPMatrix", vp); 106 | cullingComputeShader.SetFloat("_MaxDrawDistance", drawDistance); 107 | 108 | //dispatch per visible cell 109 | dispatchCount = 0; 110 | for (int i = 0; i < visibleCellIDList.Count; i++) 111 | { 112 | int targetCellFlattenID = visibleCellIDList[i]; 113 | int memoryOffset = 0; 114 | for (int j = 0; j < targetCellFlattenID; j++) 115 | { 116 | memoryOffset += cellPosWSsList[j].Count; 117 | } 118 | cullingComputeShader.SetInt("_StartOffset", memoryOffset); //culling read data started at offseted pos, will start from cell's total offset in memory 119 | int jobLength = cellPosWSsList[targetCellFlattenID].Count; 120 | 121 | //============================================================================================ 122 | //batch n dispatchs into 1 dispatch, if memory is continuous in allInstancesPosWSBuffer 123 | if(shouldBatchDispatch) 124 | { 125 | while ((i < visibleCellIDList.Count - 1) && //test this first to avoid out of bound access to visibleCellIDList 126 | (visibleCellIDList[i + 1] == visibleCellIDList[i] + 1)) 127 | { 128 | //if memory is continuous, append them together into the same dispatch call 129 | jobLength += cellPosWSsList[visibleCellIDList[i + 1]].Count; 130 | i++; 131 | } 132 | } 133 | //============================================================================================ 134 | 135 | cullingComputeShader.Dispatch(0, Mathf.CeilToInt(jobLength / 64f), 1, 1); //disaptch.X division number must match numthreads.x in compute shader (e.g. 64) 136 | dispatchCount++; 137 | } 138 | 139 | //==================================================================================== 140 | // Final 1 big DrawMeshInstancedIndirect draw call 141 | //==================================================================================== 142 | // GPU per instance culling finished, copy visible count to argsBuffer, to setup DrawMeshInstancedIndirect's draw amount 143 | ComputeBuffer.CopyCount(visibleInstancesOnlyPosWSIDBuffer, argsBuffer, 4); 144 | 145 | // Render 1 big drawcall using DrawMeshInstancedIndirect 146 | Bounds renderBound = new Bounds(); 147 | renderBound.SetMinMax(new Vector3(minX, 0, minZ), new Vector3(maxX, 0, maxZ));//if camera frustum is not overlapping this bound, DrawMeshInstancedIndirect will not even render 148 | Graphics.DrawMeshInstancedIndirect(GetGrassMeshCache(), 0, instanceMaterial, renderBound, argsBuffer); 149 | } 150 | 151 | private void OnGUI() 152 | { 153 | GUI.contentColor = Color.black; 154 | GUI.Label(new Rect(200, 0, 400, 60), 155 | $"After CPU cell frustum culling,\n" + 156 | $"-Visible cell count = {visibleCellIDList.Count}/{cellCountX * cellCountZ}\n" + 157 | $"-Real compute dispatch count = {dispatchCount} (saved by batching = {visibleCellIDList.Count - dispatchCount})"); 158 | 159 | shouldBatchDispatch = GUI.Toggle(new Rect(400, 400, 200, 100), shouldBatchDispatch, "shouldBatchDispatch"); 160 | } 161 | 162 | void OnDisable() 163 | { 164 | //release all compute buffers 165 | if (allInstancesPosWSBuffer != null) 166 | allInstancesPosWSBuffer.Release(); 167 | allInstancesPosWSBuffer = null; 168 | 169 | if (visibleInstancesOnlyPosWSIDBuffer != null) 170 | visibleInstancesOnlyPosWSIDBuffer.Release(); 171 | visibleInstancesOnlyPosWSIDBuffer = null; 172 | 173 | if (argsBuffer != null) 174 | argsBuffer.Release(); 175 | argsBuffer = null; 176 | 177 | instance = null; 178 | } 179 | 180 | Mesh GetGrassMeshCache() 181 | { 182 | if (!cachedGrassMesh) 183 | { 184 | //if not exist, create a 3 vertices hardcode triangle grass mesh 185 | cachedGrassMesh = new Mesh(); 186 | 187 | //single grass (vertices) 188 | Vector3[] verts = new Vector3[3]; 189 | verts[0] = new Vector3(-0.25f, 0); 190 | verts[1] = new Vector3(+0.25f, 0); 191 | verts[2] = new Vector3(-0.0f, 1); 192 | //single grass (Triangle index) 193 | int[] trinagles = new int[3] { 2, 1, 0, }; //order to fit Cull Back in grass shader 194 | 195 | cachedGrassMesh.SetVertices(verts); 196 | cachedGrassMesh.SetTriangles(trinagles, 0); 197 | } 198 | 199 | return cachedGrassMesh; 200 | } 201 | 202 | void UpdateAllInstanceTransformBufferIfNeeded() 203 | { 204 | //always update 205 | instanceMaterial.SetVector("_PivotPosWS", transform.position); 206 | instanceMaterial.SetVector("_BoundSize", new Vector2(transform.localScale.x, transform.localScale.z)); 207 | 208 | //early exit if no need to update buffer 209 | if (instanceCountCache == allGrassPos.Count && 210 | argsBuffer != null && 211 | allInstancesPosWSBuffer != null && 212 | visibleInstancesOnlyPosWSIDBuffer != null) 213 | { 214 | return; 215 | } 216 | 217 | ///////////////////////////////////////////////////////////////////////////////////////////////////// 218 | ///////////////////////////////////////////////////////////////////////////////////////////////////// 219 | 220 | Debug.Log("UpdateAllInstanceTransformBuffer (Slow)"); 221 | 222 | /////////////////////////// 223 | // allInstancesPosWSBuffer buffer 224 | /////////////////////////// 225 | if (allInstancesPosWSBuffer != null) 226 | allInstancesPosWSBuffer.Release(); 227 | allInstancesPosWSBuffer = new ComputeBuffer(allGrassPos.Count, sizeof(float)*3); //float3 posWS only, per grass 228 | 229 | if (visibleInstancesOnlyPosWSIDBuffer != null) 230 | visibleInstancesOnlyPosWSIDBuffer.Release(); 231 | visibleInstancesOnlyPosWSIDBuffer = new ComputeBuffer(allGrassPos.Count, sizeof(uint), ComputeBufferType.Append); //uint only, per visible grass 232 | 233 | //find all instances's posWS XZ bound min max 234 | minX = float.MaxValue; 235 | minZ = float.MaxValue; 236 | maxX = float.MinValue; 237 | maxZ = float.MinValue; 238 | for (int i = 0; i < allGrassPos.Count; i++) 239 | { 240 | Vector3 target = allGrassPos[i]; 241 | minX = Mathf.Min(target.x, minX); 242 | minZ = Mathf.Min(target.z, minZ); 243 | maxX = Mathf.Max(target.x, maxX); 244 | maxZ = Mathf.Max(target.z, maxZ); 245 | } 246 | 247 | //decide cellCountX,Z here using min max 248 | //each cell is cellSizeX x cellSizeZ 249 | cellCountX = Mathf.CeilToInt((maxX - minX) / cellSizeX); 250 | cellCountZ = Mathf.CeilToInt((maxZ - minZ) / cellSizeZ); 251 | 252 | //init per cell posWS list memory 253 | cellPosWSsList = new List[cellCountX * cellCountZ]; //flatten 2D array 254 | for (int i = 0; i < cellPosWSsList.Length; i++) 255 | { 256 | cellPosWSsList[i] = new List(); 257 | } 258 | 259 | //binning, put each posWS into the correct cell 260 | for (int i = 0; i < allGrassPos.Count; i++) 261 | { 262 | Vector3 pos = allGrassPos[i]; 263 | 264 | //find cellID 265 | int xID = Mathf.Min(cellCountX-1,Mathf.FloorToInt(Mathf.InverseLerp(minX, maxX, pos.x) * cellCountX)); //use min to force within 0~[cellCountX-1] 266 | int zID = Mathf.Min(cellCountZ-1,Mathf.FloorToInt(Mathf.InverseLerp(minZ, maxZ, pos.z) * cellCountZ)); //use min to force within 0~[cellCountZ-1] 267 | 268 | cellPosWSsList[xID + zID * cellCountX].Add(pos); 269 | } 270 | 271 | //combine to a flatten array for compute buffer 272 | int offset = 0; 273 | Vector3[] allGrassPosWSSortedByCell = new Vector3[allGrassPos.Count]; 274 | for (int i = 0; i < cellPosWSsList.Length; i++) 275 | { 276 | for (int j = 0; j < cellPosWSsList[i].Count; j++) 277 | { 278 | allGrassPosWSSortedByCell[offset] = cellPosWSsList[i][j]; 279 | offset++; 280 | } 281 | } 282 | 283 | allInstancesPosWSBuffer.SetData(allGrassPosWSSortedByCell); 284 | instanceMaterial.SetBuffer("_AllInstancesTransformBuffer", allInstancesPosWSBuffer); 285 | instanceMaterial.SetBuffer("_VisibleInstanceOnlyTransformIDBuffer", visibleInstancesOnlyPosWSIDBuffer); 286 | 287 | /////////////////////////// 288 | // Indirect args buffer 289 | /////////////////////////// 290 | if (argsBuffer != null) 291 | argsBuffer.Release(); 292 | uint[] args = new uint[5] { 0, 0, 0, 0, 0 }; 293 | argsBuffer = new ComputeBuffer(1, args.Length * sizeof(uint), ComputeBufferType.IndirectArguments); 294 | 295 | args[0] = (uint)GetGrassMeshCache().GetIndexCount(0); 296 | args[1] = (uint)allGrassPos.Count; 297 | args[2] = (uint)GetGrassMeshCache().GetIndexStart(0); 298 | args[3] = (uint)GetGrassMeshCache().GetBaseVertex(0); 299 | args[4] = 0; 300 | 301 | argsBuffer.SetData(args); 302 | 303 | /////////////////////////// 304 | // Update Cache 305 | /////////////////////////// 306 | //update cache to prevent future no-op buffer update, which waste performance 307 | instanceCountCache = allGrassPos.Count; 308 | 309 | 310 | //set buffer 311 | cullingComputeShader.SetBuffer(0, "_AllInstancesPosWSBuffer", allInstancesPosWSBuffer); 312 | cullingComputeShader.SetBuffer(0, "_VisibleInstancesOnlyPosWSIDBuffer", visibleInstancesOnlyPosWSIDBuffer); 313 | } 314 | } -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/Core/InstancedIndirectGrassRenderer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2ed67b81fb4b64d498a58bbb1c32d63d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/Core/InstancedIndirectGrassVertexColor.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinLeung-NiloCat/UnityURP-MobileDrawMeshInstancedIndirectExample/cd9f9be6296e21ec7c49b678c3d4cce8c7bc64cd/Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/Core/InstancedIndirectGrassVertexColor.jpg -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/Core/InstancedIndirectGrassVertexColor.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: edec5ef3226950841ac8090d6ac18095 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 0 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: -1 38 | wrapV: -1 39 | wrapW: -1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 0 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | applyGammaDecoding: 0 61 | platformSettings: 62 | - serializedVersion: 3 63 | buildTarget: DefaultTexturePlatform 64 | maxTextureSize: 256 65 | resizeAlgorithm: 0 66 | textureFormat: -1 67 | textureCompression: 2 68 | compressionQuality: 50 69 | crunchedCompression: 0 70 | allowsAlphaSplitting: 0 71 | overridden: 0 72 | androidETC2FallbackOverride: 0 73 | forceMaximumCompressionQuality_BC6H_BC7: 0 74 | - serializedVersion: 3 75 | buildTarget: Standalone 76 | maxTextureSize: 256 77 | resizeAlgorithm: 0 78 | textureFormat: -1 79 | textureCompression: 2 80 | compressionQuality: 50 81 | crunchedCompression: 0 82 | allowsAlphaSplitting: 0 83 | overridden: 0 84 | androidETC2FallbackOverride: 0 85 | forceMaximumCompressionQuality_BC6H_BC7: 0 86 | - serializedVersion: 3 87 | buildTarget: iPhone 88 | maxTextureSize: 256 89 | resizeAlgorithm: 0 90 | textureFormat: -1 91 | textureCompression: 2 92 | compressionQuality: 50 93 | crunchedCompression: 0 94 | allowsAlphaSplitting: 0 95 | overridden: 0 96 | androidETC2FallbackOverride: 0 97 | forceMaximumCompressionQuality_BC6H_BC7: 0 98 | - serializedVersion: 3 99 | buildTarget: Android 100 | maxTextureSize: 256 101 | resizeAlgorithm: 0 102 | textureFormat: -1 103 | textureCompression: 2 104 | compressionQuality: 50 105 | crunchedCompression: 0 106 | allowsAlphaSplitting: 0 107 | overridden: 0 108 | androidETC2FallbackOverride: 0 109 | forceMaximumCompressionQuality_BC6H_BC7: 0 110 | spriteSheet: 111 | serializedVersion: 2 112 | sprites: [] 113 | outline: [] 114 | physicsShape: [] 115 | bones: [] 116 | spriteID: 117 | internalID: 0 118 | vertices: [] 119 | indices: 120 | edges: [] 121 | weights: [] 122 | secondaryTextures: [] 123 | spritePackingTag: 124 | pSDRemoveMatte: 0 125 | pSDShowRemoveMatteOption: 0 126 | userData: 127 | assetBundleName: 128 | assetBundleVariant: 129 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2f9df52daf4ad6b4c9f5e1ea092b8024 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/ApplicationFPS60.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class ApplicationFPS60 : MonoBehaviour 6 | { 7 | // Start is called before the first frame update 8 | void Awake() 9 | { 10 | Application.targetFrameRate = 60; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/ApplicationFPS60.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7ec354bcee1da17489c1e17c6a6d73ce 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/Black Dynamic.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &-6908009374229884843 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 11 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | version: 1 16 | --- !u!21 &2100000 17 | Material: 18 | serializedVersion: 6 19 | m_ObjectHideFlags: 0 20 | m_CorrespondingSourceObject: {fileID: 0} 21 | m_PrefabInstance: {fileID: 0} 22 | m_PrefabAsset: {fileID: 0} 23 | m_Name: Black Dynamic 24 | m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} 25 | m_ShaderKeywords: _EMISSION 26 | m_LightmapFlags: 2 27 | m_EnableInstancingVariants: 0 28 | m_DoubleSidedGI: 0 29 | m_CustomRenderQueue: 2050 30 | stringTagMap: 31 | RenderType: Opaque 32 | disabledShaderPasses: [] 33 | m_SavedProperties: 34 | serializedVersion: 3 35 | m_TexEnvs: 36 | - _BaseMap: 37 | m_Texture: {fileID: 0} 38 | m_Scale: {x: 1, y: 1} 39 | m_Offset: {x: 0, y: 0} 40 | - _BumpMap: 41 | m_Texture: {fileID: 0} 42 | m_Scale: {x: 1, y: 1} 43 | m_Offset: {x: 0, y: 0} 44 | - _EmissionMap: 45 | m_Texture: {fileID: 0} 46 | m_Scale: {x: 1, y: 1} 47 | m_Offset: {x: 0, y: 0} 48 | - _MainTex: 49 | m_Texture: {fileID: 0} 50 | m_Scale: {x: 1, y: 1} 51 | m_Offset: {x: 0, y: 0} 52 | - _MetallicGlossMap: 53 | m_Texture: {fileID: 0} 54 | m_Scale: {x: 1, y: 1} 55 | m_Offset: {x: 0, y: 0} 56 | - _OcclusionMap: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | - _SpecGlossMap: 61 | m_Texture: {fileID: 0} 62 | m_Scale: {x: 1, y: 1} 63 | m_Offset: {x: 0, y: 0} 64 | m_Floats: 65 | - _AlphaClip: 0 66 | - _Blend: 0 67 | - _BumpScale: 1 68 | - _Cull: 2 69 | - _Cutoff: 0.5 70 | - _DstBlend: 0 71 | - _EnvironmentReflections: 1 72 | - _GlossMapScale: 0 73 | - _Glossiness: 0 74 | - _GlossyReflections: 0 75 | - _Metallic: 0 76 | - _OcclusionStrength: 1 77 | - _QueueOffset: 0 78 | - _ReceiveShadows: 1 79 | - _Smoothness: 0 80 | - _SmoothnessTextureChannel: 0 81 | - _SpecularHighlights: 1 82 | - _SrcBlend: 1 83 | - _Surface: 0 84 | - _WorkflowMode: 1 85 | - _ZWrite: 1 86 | m_Colors: 87 | - _BaseColor: {r: 0, g: 0, b: 0, a: 1} 88 | - _Color: {r: 1, g: 1, b: 1, a: 1} 89 | - _EmissionColor: {r: 2.6701574, g: 2.2857304, b: 0.8010472, a: 1} 90 | - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} 91 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/Black Dynamic.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e02b21a96e26af1429c35d255d688c90 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/GrassGround.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &-6001497606457883106 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 11 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | version: 1 16 | --- !u!21 &2100000 17 | Material: 18 | serializedVersion: 6 19 | m_ObjectHideFlags: 0 20 | m_CorrespondingSourceObject: {fileID: 0} 21 | m_PrefabInstance: {fileID: 0} 22 | m_PrefabAsset: {fileID: 0} 23 | m_Name: GrassGround 24 | m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} 25 | m_ShaderKeywords: _ENVIRONMENTREFLECTIONS_OFF _SPECULARHIGHLIGHTS_OFF 26 | m_LightmapFlags: 4 27 | m_EnableInstancingVariants: 0 28 | m_DoubleSidedGI: 0 29 | m_CustomRenderQueue: 2050 30 | stringTagMap: 31 | RenderType: Opaque 32 | disabledShaderPasses: [] 33 | m_SavedProperties: 34 | serializedVersion: 3 35 | m_TexEnvs: 36 | - _BaseMap: 37 | m_Texture: {fileID: 0} 38 | m_Scale: {x: 1, y: 1} 39 | m_Offset: {x: 0, y: 0} 40 | - _BumpMap: 41 | m_Texture: {fileID: 0} 42 | m_Scale: {x: 1, y: 1} 43 | m_Offset: {x: 0, y: 0} 44 | - _EmissionMap: 45 | m_Texture: {fileID: 0} 46 | m_Scale: {x: 1, y: 1} 47 | m_Offset: {x: 0, y: 0} 48 | - _MainTex: 49 | m_Texture: {fileID: 0} 50 | m_Scale: {x: 1, y: 1} 51 | m_Offset: {x: 0, y: 0} 52 | - _MetallicGlossMap: 53 | m_Texture: {fileID: 0} 54 | m_Scale: {x: 1, y: 1} 55 | m_Offset: {x: 0, y: 0} 56 | - _OcclusionMap: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | - _SpecGlossMap: 61 | m_Texture: {fileID: 0} 62 | m_Scale: {x: 1, y: 1} 63 | m_Offset: {x: 0, y: 0} 64 | m_Floats: 65 | - _AlphaClip: 0 66 | - _Blend: 0 67 | - _BumpScale: 1 68 | - _Cull: 2 69 | - _Cutoff: 0.5 70 | - _DstBlend: 0 71 | - _EnvironmentReflections: 0 72 | - _GlossMapScale: 0 73 | - _Glossiness: 0 74 | - _GlossyReflections: 0 75 | - _Metallic: 0 76 | - _OcclusionStrength: 1 77 | - _QueueOffset: 0 78 | - _ReceiveShadows: 1 79 | - _Smoothness: 0 80 | - _SmoothnessTextureChannel: 0 81 | - _SpecularHighlights: 0 82 | - _SrcBlend: 1 83 | - _Surface: 0 84 | - _WorkflowMode: 1 85 | - _ZWrite: 1 86 | m_Colors: 87 | - _BaseColor: {r: 0.1731043, g: 0.3773585, b: 0.13705945, a: 1} 88 | - _Color: {r: 0.3506952, g: 1.1353015, b: 0.48146293, a: 1} 89 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 90 | - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} 91 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/GrassGround.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 51f5ff1887fa6d44e9b663a87b55b7bb 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/MoveCamera.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class MoveCamera : MonoBehaviour 6 | { 7 | public Camera camera; 8 | public List allCameraTransforms = new List(); 9 | 10 | int index = 0; 11 | private void OnGUI() 12 | { 13 | if(GUI.Button(new Rect(100, 450, 200, 100), "Move camera")) 14 | { 15 | index = (index+1) % allCameraTransforms.Count; 16 | } 17 | } 18 | 19 | private void LateUpdate() 20 | { 21 | Transform target = allCameraTransforms[index]; 22 | 23 | camera.transform.position = Vector3.Lerp(camera.transform.position,target.position, Time.deltaTime * 2); 24 | camera.transform.rotation = Quaternion.Slerp(camera.transform.rotation,target.rotation, Time.deltaTime * 2); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/MoveCamera.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4d3dcd5268ab47e4ca4ee6571239811a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/Player.controller: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!91 &9100000 4 | AnimatorController: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: Player 10 | serializedVersion: 5 11 | m_AnimatorParameters: [] 12 | m_AnimatorLayers: 13 | - serializedVersion: 5 14 | m_Name: Base Layer 15 | m_StateMachine: {fileID: 982782744694329294} 16 | m_Mask: {fileID: 0} 17 | m_Motions: [] 18 | m_Behaviours: [] 19 | m_BlendingMode: 0 20 | m_SyncedLayerIndex: -1 21 | m_DefaultWeight: 0 22 | m_IKPass: 0 23 | m_SyncedLayerAffectsTiming: 0 24 | m_Controller: {fileID: 9100000} 25 | --- !u!1107 &982782744694329294 26 | AnimatorStateMachine: 27 | serializedVersion: 5 28 | m_ObjectHideFlags: 1 29 | m_CorrespondingSourceObject: {fileID: 0} 30 | m_PrefabInstance: {fileID: 0} 31 | m_PrefabAsset: {fileID: 0} 32 | m_Name: Base Layer 33 | m_ChildStates: 34 | - serializedVersion: 1 35 | m_State: {fileID: 3370831165694713542} 36 | m_Position: {x: 200, y: 0, z: 0} 37 | m_ChildStateMachines: [] 38 | m_AnyStateTransitions: [] 39 | m_EntryTransitions: [] 40 | m_StateMachineTransitions: {} 41 | m_StateMachineBehaviours: [] 42 | m_AnyStatePosition: {x: 50, y: 20, z: 0} 43 | m_EntryPosition: {x: 50, y: 120, z: 0} 44 | m_ExitPosition: {x: 800, y: 120, z: 0} 45 | m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} 46 | m_DefaultState: {fileID: 3370831165694713542} 47 | --- !u!1102 &3370831165694713542 48 | AnimatorState: 49 | serializedVersion: 5 50 | m_ObjectHideFlags: 1 51 | m_CorrespondingSourceObject: {fileID: 0} 52 | m_PrefabInstance: {fileID: 0} 53 | m_PrefabAsset: {fileID: 0} 54 | m_Name: PlayerMove 55 | m_Speed: 1 56 | m_CycleOffset: 0 57 | m_Transitions: [] 58 | m_StateMachineBehaviours: [] 59 | m_Position: {x: 50, y: 50, z: 0} 60 | m_IKOnFeet: 0 61 | m_WriteDefaultValues: 1 62 | m_Mirror: 0 63 | m_SpeedParameterActive: 0 64 | m_MirrorParameterActive: 0 65 | m_CycleOffsetParameterActive: 0 66 | m_TimeParameterActive: 0 67 | m_Motion: {fileID: 7400000, guid: 811aa85b06456c648be0ccbde7139fb4, type: 2} 68 | m_Tag: 69 | m_SpeedParameter: 70 | m_MirrorParameter: 71 | m_CycleOffsetParameter: 72 | m_TimeParameter: 73 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/Player.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: acc3d0d5da0a12246b00469c08fd457a 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/PlayerMove.anim: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!74 &7400000 4 | AnimationClip: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: PlayerMove 10 | serializedVersion: 6 11 | m_Legacy: 0 12 | m_Compressed: 0 13 | m_UseHighQualityCurve: 1 14 | m_RotationCurves: [] 15 | m_CompressedRotationCurves: [] 16 | m_EulerCurves: [] 17 | m_PositionCurves: 18 | - curve: 19 | serializedVersion: 2 20 | m_Curve: 21 | - serializedVersion: 3 22 | time: 0 23 | value: {x: 48.1, y: 5.7, z: 4.9} 24 | inSlope: {x: 0, y: 0, z: 0} 25 | outSlope: {x: 0, y: 0, z: 0} 26 | tangentMode: 0 27 | weightedMode: 0 28 | inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 29 | outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 30 | - serializedVersion: 3 31 | time: 0.95 32 | value: {x: 23.2, y: 5.7, z: 50.3} 33 | inSlope: {x: -10.054055, y: 0, z: 0} 34 | outSlope: {x: -10.054055, y: 0, z: 0} 35 | tangentMode: 0 36 | weightedMode: 0 37 | inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 38 | outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 39 | - serializedVersion: 3 40 | time: 2.4666667 41 | value: {x: 17, y: 5.7, z: 3.1} 42 | inSlope: {x: 0, y: 0, z: 0} 43 | outSlope: {x: 0, y: 0, z: 0} 44 | tangentMode: 0 45 | weightedMode: 0 46 | inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 47 | outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 48 | - serializedVersion: 3 49 | time: 4.6666665 50 | value: {x: 54.3, y: 5.7, z: 18.4} 51 | inSlope: {x: 0, y: 0, z: 0} 52 | outSlope: {x: 0, y: 0, z: 0} 53 | tangentMode: 0 54 | weightedMode: 0 55 | inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 56 | outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 57 | - serializedVersion: 3 58 | time: 6 59 | value: {x: 44, y: 5.7, z: -14.4} 60 | inSlope: {x: 0, y: 0, z: 0} 61 | outSlope: {x: 0, y: 0, z: 0} 62 | tangentMode: 0 63 | weightedMode: 0 64 | inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 65 | outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 66 | - serializedVersion: 3 67 | time: 7.5666666 68 | value: {x: 48.1, y: 5.7, z: 4.9} 69 | inSlope: {x: 0, y: 0, z: 0} 70 | outSlope: {x: 0, y: 0, z: 0} 71 | tangentMode: 0 72 | weightedMode: 0 73 | inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 74 | outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} 75 | m_PreInfinity: 2 76 | m_PostInfinity: 2 77 | m_RotationOrder: 4 78 | path: 79 | m_ScaleCurves: [] 80 | m_FloatCurves: [] 81 | m_PPtrCurves: [] 82 | m_SampleRate: 60 83 | m_WrapMode: 0 84 | m_Bounds: 85 | m_Center: {x: 0, y: 0, z: 0} 86 | m_Extent: {x: 0, y: 0, z: 0} 87 | m_ClipBindingConstant: 88 | genericBindings: 89 | - serializedVersion: 2 90 | path: 0 91 | attribute: 1 92 | script: {fileID: 0} 93 | typeID: 4 94 | customType: 0 95 | isPPtrCurve: 0 96 | pptrCurveMapping: [] 97 | m_AnimationClipSettings: 98 | serializedVersion: 2 99 | m_AdditiveReferencePoseClip: {fileID: 0} 100 | m_AdditiveReferencePoseTime: 0 101 | m_StartTime: 0 102 | m_StopTime: 7.5666666 103 | m_OrientationOffsetY: 0 104 | m_Level: 0 105 | m_CycleOffset: 0 106 | m_HasAdditiveReferencePose: 0 107 | m_LoopTime: 1 108 | m_LoopBlend: 1 109 | m_LoopBlendOrientation: 0 110 | m_LoopBlendPositionY: 0 111 | m_LoopBlendPositionXZ: 0 112 | m_KeepOriginalOrientation: 0 113 | m_KeepOriginalPositionY: 1 114 | m_KeepOriginalPositionXZ: 0 115 | m_HeightFromFeet: 0 116 | m_Mirror: 0 117 | m_EditorCurves: 118 | - curve: 119 | serializedVersion: 2 120 | m_Curve: 121 | - serializedVersion: 3 122 | time: 0 123 | value: 48.1 124 | inSlope: 0 125 | outSlope: 0 126 | tangentMode: 136 127 | weightedMode: 0 128 | inWeight: 0.33333334 129 | outWeight: 0.33333334 130 | - serializedVersion: 3 131 | time: 0.95 132 | value: 23.2 133 | inSlope: -10.054055 134 | outSlope: -10.054055 135 | tangentMode: 136 136 | weightedMode: 0 137 | inWeight: 0.33333334 138 | outWeight: 0.33333334 139 | - serializedVersion: 3 140 | time: 2.4666667 141 | value: 17 142 | inSlope: 0 143 | outSlope: 0 144 | tangentMode: 136 145 | weightedMode: 0 146 | inWeight: 0.33333334 147 | outWeight: 0.33333334 148 | - serializedVersion: 3 149 | time: 4.6666665 150 | value: 54.3 151 | inSlope: 0 152 | outSlope: 0 153 | tangentMode: 136 154 | weightedMode: 0 155 | inWeight: 0.33333334 156 | outWeight: 0.33333334 157 | - serializedVersion: 3 158 | time: 6 159 | value: 44 160 | inSlope: 0 161 | outSlope: 0 162 | tangentMode: 136 163 | weightedMode: 0 164 | inWeight: 0.33333334 165 | outWeight: 0.33333334 166 | - serializedVersion: 3 167 | time: 7.5666666 168 | value: 48.1 169 | inSlope: 0 170 | outSlope: 0 171 | tangentMode: 136 172 | weightedMode: 0 173 | inWeight: 0.33333334 174 | outWeight: 0.33333334 175 | m_PreInfinity: 2 176 | m_PostInfinity: 2 177 | m_RotationOrder: 4 178 | attribute: m_LocalPosition.x 179 | path: 180 | classID: 4 181 | script: {fileID: 0} 182 | - curve: 183 | serializedVersion: 2 184 | m_Curve: 185 | - serializedVersion: 3 186 | time: 0 187 | value: 5.7 188 | inSlope: 0 189 | outSlope: 0 190 | tangentMode: 136 191 | weightedMode: 0 192 | inWeight: 0.33333334 193 | outWeight: 0.33333334 194 | - serializedVersion: 3 195 | time: 0.95 196 | value: 5.7 197 | inSlope: 0 198 | outSlope: 0 199 | tangentMode: 136 200 | weightedMode: 0 201 | inWeight: 0.33333334 202 | outWeight: 0.33333334 203 | - serializedVersion: 3 204 | time: 2.4666667 205 | value: 5.7 206 | inSlope: 0 207 | outSlope: 0 208 | tangentMode: 136 209 | weightedMode: 0 210 | inWeight: 0.33333334 211 | outWeight: 0.33333334 212 | - serializedVersion: 3 213 | time: 4.6666665 214 | value: 5.7 215 | inSlope: 0 216 | outSlope: 0 217 | tangentMode: 136 218 | weightedMode: 0 219 | inWeight: 0.33333334 220 | outWeight: 0.33333334 221 | - serializedVersion: 3 222 | time: 6 223 | value: 5.7 224 | inSlope: 0 225 | outSlope: 0 226 | tangentMode: 136 227 | weightedMode: 0 228 | inWeight: 0.33333334 229 | outWeight: 0.33333334 230 | - serializedVersion: 3 231 | time: 7.5666666 232 | value: 5.7 233 | inSlope: 0 234 | outSlope: 0 235 | tangentMode: 136 236 | weightedMode: 0 237 | inWeight: 0.33333334 238 | outWeight: 0.33333334 239 | m_PreInfinity: 2 240 | m_PostInfinity: 2 241 | m_RotationOrder: 4 242 | attribute: m_LocalPosition.y 243 | path: 244 | classID: 4 245 | script: {fileID: 0} 246 | - curve: 247 | serializedVersion: 2 248 | m_Curve: 249 | - serializedVersion: 3 250 | time: 0 251 | value: 4.9 252 | inSlope: 0 253 | outSlope: 0 254 | tangentMode: 136 255 | weightedMode: 0 256 | inWeight: 0.33333334 257 | outWeight: 0.33333334 258 | - serializedVersion: 3 259 | time: 0.95 260 | value: 50.3 261 | inSlope: 0 262 | outSlope: 0 263 | tangentMode: 136 264 | weightedMode: 0 265 | inWeight: 0.33333334 266 | outWeight: 0.33333334 267 | - serializedVersion: 3 268 | time: 2.4666667 269 | value: 3.1 270 | inSlope: 0 271 | outSlope: 0 272 | tangentMode: 136 273 | weightedMode: 0 274 | inWeight: 0.33333334 275 | outWeight: 0.33333334 276 | - serializedVersion: 3 277 | time: 4.6666665 278 | value: 18.4 279 | inSlope: 0 280 | outSlope: 0 281 | tangentMode: 136 282 | weightedMode: 0 283 | inWeight: 0.33333334 284 | outWeight: 0.33333334 285 | - serializedVersion: 3 286 | time: 6 287 | value: -14.4 288 | inSlope: 0 289 | outSlope: 0 290 | tangentMode: 136 291 | weightedMode: 0 292 | inWeight: 0.33333334 293 | outWeight: 0.33333334 294 | - serializedVersion: 3 295 | time: 7.5666666 296 | value: 4.9 297 | inSlope: 0 298 | outSlope: 0 299 | tangentMode: 136 300 | weightedMode: 0 301 | inWeight: 0.33333334 302 | outWeight: 0.33333334 303 | m_PreInfinity: 2 304 | m_PostInfinity: 2 305 | m_RotationOrder: 4 306 | attribute: m_LocalPosition.z 307 | path: 308 | classID: 4 309 | script: {fileID: 0} 310 | m_EulerEditorCurves: [] 311 | m_HasGenericRootTransform: 1 312 | m_HasMotionFloatCurves: 0 313 | m_Events: [] 314 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/PlayerMove.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 811aa85b06456c648be0ccbde7139fb4 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/RotateLight.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class RotateLight : MonoBehaviour 6 | { 7 | public Light mainLight; 8 | public Light pointLight; 9 | 10 | public float YRotateSpeed = 45; 11 | 12 | // Update is called once per frame 13 | void Update() 14 | { 15 | mainLight.transform.Rotate(Vector3.up, YRotateSpeed * Time.deltaTime,Space.World); 16 | } 17 | 18 | private void OnGUI() 19 | { 20 | mainLight.enabled = GUI.Toggle(new Rect(100, 150, 200, 30), mainLight.enabled, "Main Light On/OFF"); 21 | pointLight.enabled = GUI.Toggle(new Rect(100, 250, 200, 30), pointLight.enabled, "PointLight Light On/OFF"); 22 | 23 | GUI.Label(new Rect(100, 350, 200, 30), "Light Rotate Speed"); 24 | YRotateSpeed = (int)(GUI.HorizontalSlider(new Rect(100, 400, 200, 30), YRotateSpeed, 0, 90)); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/RotateLight.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f37394f213b227343a10e54034969be4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/UniversalRenderPipelineAsset.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: bf2edee5c58d82540a51f03df9d42094, type: 3} 13 | m_Name: UniversalRenderPipelineAsset 14 | m_EditorClassIdentifier: 15 | k_AssetVersion: 5 16 | k_AssetPreviousVersion: 5 17 | m_RendererType: 1 18 | m_RendererData: {fileID: 0} 19 | m_RendererDataList: 20 | - {fileID: 11400000, guid: 6886f3f13f6f021418952724d2f0507e, type: 2} 21 | m_DefaultRendererIndex: 0 22 | m_RequireDepthTexture: 0 23 | m_RequireOpaqueTexture: 0 24 | m_OpaqueDownsampling: 1 25 | m_SupportsTerrainHoles: 0 26 | m_SupportsHDR: 0 27 | m_MSAA: 1 28 | m_RenderScale: 0.8 29 | m_MainLightRenderingMode: 1 30 | m_MainLightShadowsSupported: 1 31 | m_MainLightShadowmapResolution: 512 32 | m_AdditionalLightsRenderingMode: 1 33 | m_AdditionalLightsPerObjectLimit: 4 34 | m_AdditionalLightShadowsSupported: 1 35 | m_AdditionalLightsShadowmapResolution: 256 36 | m_ShadowDistance: 200 37 | m_ShadowCascades: 0 38 | m_Cascade2Split: 0.25 39 | m_Cascade4Split: {x: 0.067, y: 0.2, z: 0.467} 40 | m_ShadowDepthBias: 1 41 | m_ShadowNormalBias: 1 42 | m_SoftShadowsSupported: 0 43 | m_UseSRPBatcher: 1 44 | m_SupportsDynamicBatching: 0 45 | m_MixedLightingSupported: 0 46 | m_DebugLevel: 0 47 | m_PostProcessingFeatureSet: 0 48 | m_ColorGradingMode: 0 49 | m_ColorGradingLutSize: 16 50 | m_ShadowType: 1 51 | m_LocalShadowsSupported: 0 52 | m_LocalShadowsAtlasResolution: 256 53 | m_MaxPixelLights: 0 54 | m_ShadowAtlasResolution: 256 55 | m_ShaderVariantLogLevel: 0 56 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/UniversalRenderPipelineAsset.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 67e17f87458eb844a9a8fd6f37c788ac 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/UniversalRenderPipelineAsset_Renderer.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: de640fe3d0db1804a85f9fc8f5cadab6, type: 3} 13 | m_Name: UniversalRenderPipelineAsset_Renderer 14 | m_EditorClassIdentifier: 15 | m_RendererFeatures: 16 | - {fileID: 510789421377466797} 17 | m_RendererFeatureMap: ad313bc045b01607 18 | postProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2} 19 | shaders: 20 | blitPS: {fileID: 4800000, guid: c17132b1f77d20942aa75f8429c0f8bc, type: 3} 21 | copyDepthPS: {fileID: 4800000, guid: d6dae50ee9e1bfa4db75f19f99355220, type: 3} 22 | screenSpaceShadowPS: {fileID: 4800000, guid: 0f854b35a0cf61a429bd5dcfea30eddd, 23 | type: 3} 24 | samplingPS: {fileID: 4800000, guid: 04c410c9937594faa893a11dceb85f7e, type: 3} 25 | fallbackErrorPS: {fileID: 4800000, guid: e6e9a19c3678ded42a3bc431ebef7dbd, type: 3} 26 | m_OpaqueLayerMask: 27 | serializedVersion: 2 28 | m_Bits: 4294967295 29 | m_TransparentLayerMask: 30 | serializedVersion: 2 31 | m_Bits: 4294967295 32 | m_DefaultStencilState: 33 | overrideStencilState: 0 34 | stencilReference: 0 35 | stencilCompareFunction: 8 36 | passOperation: 0 37 | failOperation: 0 38 | zFailOperation: 0 39 | m_ShadowTransparentReceive: 0 40 | --- !u!114 &510789421377466797 41 | MonoBehaviour: 42 | m_ObjectHideFlags: 0 43 | m_CorrespondingSourceObject: {fileID: 0} 44 | m_PrefabInstance: {fileID: 0} 45 | m_PrefabAsset: {fileID: 0} 46 | m_GameObject: {fileID: 0} 47 | m_Enabled: 1 48 | m_EditorHideFlags: 0 49 | m_Script: {fileID: 11500000, guid: 9eadc27cc8a56ba4c880962453e388e8, type: 3} 50 | m_Name: NewGrassBendingRTPrePass 51 | m_EditorClassIdentifier: 52 | m_Active: 1 53 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/UniversalRenderPipelineAsset_Renderer.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6886f3f13f6f021418952724d2f0507e 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/scene.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c1ab577a0060cc40af4dc8d0d6e16e0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/scene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b4bb10ac330c5c04680371d58f56a3a1 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/scene/LightingData.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinLeung-NiloCat/UnityURP-MobileDrawMeshInstancedIndirectExample/cd9f9be6296e21ec7c49b678c3d4cce8c7bc64cd/Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/scene/LightingData.asset -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/scene/LightingData.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1c88819250a3b194a93cf3412d456661 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/scene/Lightmap-0_comp_dir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinLeung-NiloCat/UnityURP-MobileDrawMeshInstancedIndirectExample/cd9f9be6296e21ec7c49b678c3d4cce8c7bc64cd/Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/scene/Lightmap-0_comp_dir.png -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/scene/Lightmap-0_comp_dir.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2b3a04f0d3d535c41b3e191a9cf544a7 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 0 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: 1 35 | aniso: 3 36 | mipBias: 0 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 0 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | applyGammaDecoding: 0 61 | platformSettings: 62 | - serializedVersion: 3 63 | buildTarget: DefaultTexturePlatform 64 | maxTextureSize: 2048 65 | resizeAlgorithm: 0 66 | textureFormat: -1 67 | textureCompression: 1 68 | compressionQuality: 50 69 | crunchedCompression: 0 70 | allowsAlphaSplitting: 0 71 | overridden: 0 72 | androidETC2FallbackOverride: 0 73 | forceMaximumCompressionQuality_BC6H_BC7: 0 74 | spriteSheet: 75 | serializedVersion: 2 76 | sprites: [] 77 | outline: [] 78 | physicsShape: [] 79 | bones: [] 80 | spriteID: 81 | internalID: 0 82 | vertices: [] 83 | indices: 84 | edges: [] 85 | weights: [] 86 | secondaryTextures: [] 87 | spritePackingTag: 88 | pSDRemoveMatte: 0 89 | pSDShowRemoveMatteOption: 0 90 | userData: 91 | assetBundleName: 92 | assetBundleVariant: 93 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/scene/Lightmap-0_comp_light.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinLeung-NiloCat/UnityURP-MobileDrawMeshInstancedIndirectExample/cd9f9be6296e21ec7c49b678c3d4cce8c7bc64cd/Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/scene/Lightmap-0_comp_light.exr -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/scene/Lightmap-0_comp_light.exr.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fdb09265ee228f841837865b94f91ee4 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: 1 35 | aniso: 3 36 | mipBias: 0 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 0 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 6 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | applyGammaDecoding: 0 61 | platformSettings: 62 | - serializedVersion: 3 63 | buildTarget: DefaultTexturePlatform 64 | maxTextureSize: 2048 65 | resizeAlgorithm: 0 66 | textureFormat: -1 67 | textureCompression: 1 68 | compressionQuality: 50 69 | crunchedCompression: 0 70 | allowsAlphaSplitting: 0 71 | overridden: 0 72 | androidETC2FallbackOverride: 0 73 | forceMaximumCompressionQuality_BC6H_BC7: 0 74 | spriteSheet: 75 | serializedVersion: 2 76 | sprites: [] 77 | outline: [] 78 | physicsShape: [] 79 | bones: [] 80 | spriteID: 81 | internalID: 0 82 | vertices: [] 83 | indices: 84 | edges: [] 85 | weights: [] 86 | secondaryTextures: [] 87 | spritePackingTag: 88 | pSDRemoveMatte: 0 89 | pSDShowRemoveMatteOption: 0 90 | userData: 91 | assetBundleName: 92 | assetBundleVariant: 93 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/scene/ReflectionProbe-0.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ColinLeung-NiloCat/UnityURP-MobileDrawMeshInstancedIndirectExample/cd9f9be6296e21ec7c49b678c3d4cce8c7bc64cd/Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/scene/ReflectionProbe-0.exr -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/scene/ReflectionProbe-0.exr.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 53ce169df7acf6c44bcb3a3369318d3b 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 1 29 | seamlessCubemap: 1 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: 2 35 | aniso: 0 36 | mipBias: 0 37 | wrapU: 1 38 | wrapV: 1 39 | wrapW: 1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 0 55 | textureShape: 2 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | applyGammaDecoding: 0 61 | platformSettings: 62 | - serializedVersion: 3 63 | buildTarget: DefaultTexturePlatform 64 | maxTextureSize: 2048 65 | resizeAlgorithm: 0 66 | textureFormat: -1 67 | textureCompression: 1 68 | compressionQuality: 100 69 | crunchedCompression: 0 70 | allowsAlphaSplitting: 0 71 | overridden: 0 72 | androidETC2FallbackOverride: 0 73 | forceMaximumCompressionQuality_BC6H_BC7: 0 74 | spriteSheet: 75 | serializedVersion: 2 76 | sprites: [] 77 | outline: [] 78 | physicsShape: [] 79 | bones: [] 80 | spriteID: 81 | internalID: 0 82 | vertices: [] 83 | indices: 84 | edges: [] 85 | weights: [] 86 | secondaryTextures: [] 87 | spritePackingTag: 88 | pSDRemoveMatte: 0 89 | pSDShowRemoveMatteOption: 0 90 | userData: 91 | assetBundleName: 92 | assetBundleVariant: 93 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/SkyBox.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fb102f7a1d3c77e4ba044a2d8b0a0e56 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/SkyBox/SkyBox.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: SkyBox 11 | m_Shader: {fileID: 4800000, guid: 4f0fe8165c896ae4590d85abb1fd7ba1, type: 3} 12 | m_ShaderKeywords: 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: 2800000, guid: 606abc37fcc31474699772fde405e2b4, type: 3} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | m_Floats: 27 | - _FogHeight: 0.2 28 | m_Colors: 29 | - _ColorMiddle: {r: 0.7971698, g: 1, b: 1, a: 1} 30 | - _ColorTop: {r: 0.4198113, g: 1, b: 0.9761566, a: 1} 31 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/SkyBox/SkyBox.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eb06ea4bb74a06e4c91328c44f3d4c4b 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/SkyBox/SkyBox.shader: -------------------------------------------------------------------------------- 1 | /* 2 | For a skybox shader, 3 | It has a name containing "Skybox" (case sensitive) 4 | It is tagged "RenderType" = "Background" 5 | It is tagged "PreviewType" = "Skybox" 6 | */ 7 | Shader "URPMobileGrassInstancedIndirectDemo/SkyBox" 8 | { 9 | Properties 10 | { 11 | _ColorTop ("_ColorTop", Color) = (1,1,1) 12 | _ColorMiddle("_ColorMiddle", Color) = (0,0,0) 13 | _FogHeight("_FogHeight", range(0,1)) = 0.1 14 | } 15 | SubShader 16 | { 17 | Tags { "RenderType" = "Background" "PreviewType" = "Skybox"} 18 | 19 | Pass 20 | { 21 | Name "Skybox" 22 | 23 | ZWrite Off 24 | 25 | HLSLPROGRAM 26 | #pragma vertex vert 27 | #pragma fragment frag 28 | 29 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" 30 | 31 | CBUFFER_START(UnityPerMaterial) 32 | half3 _ColorTop; 33 | half3 _ColorMiddle; 34 | half _FogHeight; 35 | CBUFFER_END 36 | 37 | struct appdata 38 | { 39 | float4 vertex : POSITION; 40 | float2 uv : TEXCOORD0; 41 | }; 42 | 43 | struct v2f 44 | { 45 | float2 uv : TEXCOORD0; 46 | float3 color : COLOR; 47 | float4 vertex : SV_POSITION; 48 | }; 49 | 50 | v2f vert (appdata v) 51 | { 52 | v2f o; 53 | o.vertex = TransformObjectToHClip(v.vertex.xyz); 54 | o.uv = v.uv; 55 | 56 | //calculate base skybox color per vertex 57 | float height = v.uv.y; //top = 1, middle = 0, bottom = -1 58 | height = saturate(height); //top = 1, middle = 0, bottom = 0 59 | half3 col = lerp(_ColorMiddle,_ColorTop,height); 60 | 61 | //middle override by fog color 62 | col = lerp(unity_FogColor.rgb,col, smoothstep(0,_FogHeight,height)); 63 | 64 | o.color = col; 65 | return o; 66 | } 67 | 68 | half4 frag (v2f i) : SV_Target 69 | { 70 | return half4(i.color,1); 71 | } 72 | ENDHLSL 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Assets/URPMobileGrassInstancedIndirectDemo/SkyBox/SkyBox.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f0fe8165c896ae4590d85abb1fd7ba1 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 ColinLeung-NiloCat 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. 22 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.burst": "1.2.3", 4 | "com.unity.ide.visualstudio": "2.0.1", 5 | "com.unity.mathematics": "1.2.1", 6 | "com.unity.render-pipelines.universal": "7.3.1", 7 | "com.unity.ugui": "1.0.0", 8 | "com.unity.modules.ai": "1.0.0", 9 | "com.unity.modules.androidjni": "1.0.0", 10 | "com.unity.modules.animation": "1.0.0", 11 | "com.unity.modules.assetbundle": "1.0.0", 12 | "com.unity.modules.audio": "1.0.0", 13 | "com.unity.modules.cloth": "1.0.0", 14 | "com.unity.modules.director": "1.0.0", 15 | "com.unity.modules.imageconversion": "1.0.0", 16 | "com.unity.modules.imgui": "1.0.0", 17 | "com.unity.modules.jsonserialize": "1.0.0", 18 | "com.unity.modules.particlesystem": "1.0.0", 19 | "com.unity.modules.physics": "1.0.0", 20 | "com.unity.modules.physics2d": "1.0.0", 21 | "com.unity.modules.screencapture": "1.0.0", 22 | "com.unity.modules.terrain": "1.0.0", 23 | "com.unity.modules.terrainphysics": "1.0.0", 24 | "com.unity.modules.tilemap": "1.0.0", 25 | "com.unity.modules.ui": "1.0.0", 26 | "com.unity.modules.uielements": "1.0.0", 27 | "com.unity.modules.umbra": "1.0.0", 28 | "com.unity.modules.unityanalytics": "1.0.0", 29 | "com.unity.modules.unitywebrequest": "1.0.0", 30 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 31 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 32 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 33 | "com.unity.modules.unitywebrequestwww": "1.0.0", 34 | "com.unity.modules.vehicles": "1.0.0", 35 | "com.unity.modules.video": "1.0.0", 36 | "com.unity.modules.vr": "1.0.0", 37 | "com.unity.modules.wind": "1.0.0", 38 | "com.unity.modules.xr": "1.0.0" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.burst": { 4 | "version": "1.2.3", 5 | "depth": 0, 6 | "source": "registry", 7 | "dependencies": { 8 | "com.unity.mathematics": "1.1.0" 9 | }, 10 | "url": "https://packages.unity.com" 11 | }, 12 | "com.unity.ide.visualstudio": { 13 | "version": "2.0.1", 14 | "depth": 0, 15 | "source": "registry", 16 | "dependencies": {}, 17 | "url": "https://packages.unity.com" 18 | }, 19 | "com.unity.mathematics": { 20 | "version": "1.2.1", 21 | "depth": 0, 22 | "source": "registry", 23 | "dependencies": {}, 24 | "url": "https://packages.unity.com" 25 | }, 26 | "com.unity.render-pipelines.core": { 27 | "version": "7.3.1", 28 | "depth": 1, 29 | "source": "registry", 30 | "dependencies": { 31 | "com.unity.ugui": "1.0.0" 32 | }, 33 | "url": "https://packages.unity.com" 34 | }, 35 | "com.unity.render-pipelines.universal": { 36 | "version": "7.3.1", 37 | "depth": 0, 38 | "source": "registry", 39 | "dependencies": { 40 | "com.unity.render-pipelines.core": "7.3.1", 41 | "com.unity.shadergraph": "7.3.1" 42 | }, 43 | "url": "https://packages.unity.com" 44 | }, 45 | "com.unity.shadergraph": { 46 | "version": "7.3.1", 47 | "depth": 1, 48 | "source": "registry", 49 | "dependencies": { 50 | "com.unity.render-pipelines.core": "7.3.1" 51 | }, 52 | "url": "https://packages.unity.com" 53 | }, 54 | "com.unity.ugui": { 55 | "version": "1.0.0", 56 | "depth": 0, 57 | "source": "builtin", 58 | "dependencies": { 59 | "com.unity.modules.ui": "1.0.0", 60 | "com.unity.modules.imgui": "1.0.0" 61 | } 62 | }, 63 | "com.unity.modules.ai": { 64 | "version": "1.0.0", 65 | "depth": 0, 66 | "source": "builtin", 67 | "dependencies": {} 68 | }, 69 | "com.unity.modules.androidjni": { 70 | "version": "1.0.0", 71 | "depth": 0, 72 | "source": "builtin", 73 | "dependencies": {} 74 | }, 75 | "com.unity.modules.animation": { 76 | "version": "1.0.0", 77 | "depth": 0, 78 | "source": "builtin", 79 | "dependencies": {} 80 | }, 81 | "com.unity.modules.assetbundle": { 82 | "version": "1.0.0", 83 | "depth": 0, 84 | "source": "builtin", 85 | "dependencies": {} 86 | }, 87 | "com.unity.modules.audio": { 88 | "version": "1.0.0", 89 | "depth": 0, 90 | "source": "builtin", 91 | "dependencies": {} 92 | }, 93 | "com.unity.modules.cloth": { 94 | "version": "1.0.0", 95 | "depth": 0, 96 | "source": "builtin", 97 | "dependencies": { 98 | "com.unity.modules.physics": "1.0.0" 99 | } 100 | }, 101 | "com.unity.modules.director": { 102 | "version": "1.0.0", 103 | "depth": 0, 104 | "source": "builtin", 105 | "dependencies": { 106 | "com.unity.modules.audio": "1.0.0", 107 | "com.unity.modules.animation": "1.0.0" 108 | } 109 | }, 110 | "com.unity.modules.imageconversion": { 111 | "version": "1.0.0", 112 | "depth": 0, 113 | "source": "builtin", 114 | "dependencies": {} 115 | }, 116 | "com.unity.modules.imgui": { 117 | "version": "1.0.0", 118 | "depth": 0, 119 | "source": "builtin", 120 | "dependencies": {} 121 | }, 122 | "com.unity.modules.jsonserialize": { 123 | "version": "1.0.0", 124 | "depth": 0, 125 | "source": "builtin", 126 | "dependencies": {} 127 | }, 128 | "com.unity.modules.particlesystem": { 129 | "version": "1.0.0", 130 | "depth": 0, 131 | "source": "builtin", 132 | "dependencies": {} 133 | }, 134 | "com.unity.modules.physics": { 135 | "version": "1.0.0", 136 | "depth": 0, 137 | "source": "builtin", 138 | "dependencies": {} 139 | }, 140 | "com.unity.modules.physics2d": { 141 | "version": "1.0.0", 142 | "depth": 0, 143 | "source": "builtin", 144 | "dependencies": {} 145 | }, 146 | "com.unity.modules.screencapture": { 147 | "version": "1.0.0", 148 | "depth": 0, 149 | "source": "builtin", 150 | "dependencies": { 151 | "com.unity.modules.imageconversion": "1.0.0" 152 | } 153 | }, 154 | "com.unity.modules.subsystems": { 155 | "version": "1.0.0", 156 | "depth": 1, 157 | "source": "builtin", 158 | "dependencies": { 159 | "com.unity.modules.jsonserialize": "1.0.0" 160 | } 161 | }, 162 | "com.unity.modules.terrain": { 163 | "version": "1.0.0", 164 | "depth": 0, 165 | "source": "builtin", 166 | "dependencies": {} 167 | }, 168 | "com.unity.modules.terrainphysics": { 169 | "version": "1.0.0", 170 | "depth": 0, 171 | "source": "builtin", 172 | "dependencies": { 173 | "com.unity.modules.physics": "1.0.0", 174 | "com.unity.modules.terrain": "1.0.0" 175 | } 176 | }, 177 | "com.unity.modules.tilemap": { 178 | "version": "1.0.0", 179 | "depth": 0, 180 | "source": "builtin", 181 | "dependencies": { 182 | "com.unity.modules.physics2d": "1.0.0" 183 | } 184 | }, 185 | "com.unity.modules.ui": { 186 | "version": "1.0.0", 187 | "depth": 0, 188 | "source": "builtin", 189 | "dependencies": {} 190 | }, 191 | "com.unity.modules.uielements": { 192 | "version": "1.0.0", 193 | "depth": 0, 194 | "source": "builtin", 195 | "dependencies": { 196 | "com.unity.modules.imgui": "1.0.0", 197 | "com.unity.modules.jsonserialize": "1.0.0" 198 | } 199 | }, 200 | "com.unity.modules.umbra": { 201 | "version": "1.0.0", 202 | "depth": 0, 203 | "source": "builtin", 204 | "dependencies": {} 205 | }, 206 | "com.unity.modules.unityanalytics": { 207 | "version": "1.0.0", 208 | "depth": 0, 209 | "source": "builtin", 210 | "dependencies": { 211 | "com.unity.modules.unitywebrequest": "1.0.0", 212 | "com.unity.modules.jsonserialize": "1.0.0" 213 | } 214 | }, 215 | "com.unity.modules.unitywebrequest": { 216 | "version": "1.0.0", 217 | "depth": 0, 218 | "source": "builtin", 219 | "dependencies": {} 220 | }, 221 | "com.unity.modules.unitywebrequestassetbundle": { 222 | "version": "1.0.0", 223 | "depth": 0, 224 | "source": "builtin", 225 | "dependencies": { 226 | "com.unity.modules.assetbundle": "1.0.0", 227 | "com.unity.modules.unitywebrequest": "1.0.0" 228 | } 229 | }, 230 | "com.unity.modules.unitywebrequestaudio": { 231 | "version": "1.0.0", 232 | "depth": 0, 233 | "source": "builtin", 234 | "dependencies": { 235 | "com.unity.modules.unitywebrequest": "1.0.0", 236 | "com.unity.modules.audio": "1.0.0" 237 | } 238 | }, 239 | "com.unity.modules.unitywebrequesttexture": { 240 | "version": "1.0.0", 241 | "depth": 0, 242 | "source": "builtin", 243 | "dependencies": { 244 | "com.unity.modules.unitywebrequest": "1.0.0", 245 | "com.unity.modules.imageconversion": "1.0.0" 246 | } 247 | }, 248 | "com.unity.modules.unitywebrequestwww": { 249 | "version": "1.0.0", 250 | "depth": 0, 251 | "source": "builtin", 252 | "dependencies": { 253 | "com.unity.modules.unitywebrequest": "1.0.0", 254 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 255 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 256 | "com.unity.modules.audio": "1.0.0", 257 | "com.unity.modules.assetbundle": "1.0.0", 258 | "com.unity.modules.imageconversion": "1.0.0" 259 | } 260 | }, 261 | "com.unity.modules.vehicles": { 262 | "version": "1.0.0", 263 | "depth": 0, 264 | "source": "builtin", 265 | "dependencies": { 266 | "com.unity.modules.physics": "1.0.0" 267 | } 268 | }, 269 | "com.unity.modules.video": { 270 | "version": "1.0.0", 271 | "depth": 0, 272 | "source": "builtin", 273 | "dependencies": { 274 | "com.unity.modules.audio": "1.0.0", 275 | "com.unity.modules.ui": "1.0.0", 276 | "com.unity.modules.unitywebrequest": "1.0.0" 277 | } 278 | }, 279 | "com.unity.modules.vr": { 280 | "version": "1.0.0", 281 | "depth": 0, 282 | "source": "builtin", 283 | "dependencies": { 284 | "com.unity.modules.jsonserialize": "1.0.0", 285 | "com.unity.modules.physics": "1.0.0", 286 | "com.unity.modules.xr": "1.0.0" 287 | } 288 | }, 289 | "com.unity.modules.wind": { 290 | "version": "1.0.0", 291 | "depth": 0, 292 | "source": "builtin", 293 | "dependencies": {} 294 | }, 295 | "com.unity.modules.xr": { 296 | "version": "1.0.0", 297 | "depth": 0, 298 | "source": "builtin", 299 | "dependencies": { 300 | "com.unity.modules.physics": "1.0.0", 301 | "com.unity.modules.jsonserialize": "1.0.0", 302 | "com.unity.modules.subsystems": "1.0.0" 303 | } 304 | } 305 | } 306 | } 307 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 0 20 | -------------------------------------------------------------------------------- /ProjectSettings/BurstAotSettings_Android.json: -------------------------------------------------------------------------------- 1 | { 2 | "MonoBehaviour": { 3 | "m_Enabled": true, 4 | "m_EditorHideFlags": 0, 5 | "m_Name": "", 6 | "m_EditorClassIdentifier": "Unity.Burst.Editor:Unity.Burst.Editor:BurstPlatformAotSettings", 7 | "DisableOptimisations": false, 8 | "DisableSafetyChecks": true, 9 | "DisableBurstCompilation": false 10 | } 11 | } -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0.1 18 | m_ClothInterCollisionStiffness: 0.2 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ClothGravity: {x: 0, y: -9.81, z: 0} 26 | m_ContactPairsMode: 0 27 | m_BroadphaseType: 0 28 | m_WorldBounds: 29 | m_Center: {x: 0, y: 0, z: 0} 30 | m_Extent: {x: 250, y: 250, z: 250} 31 | m_WorldSubdivisions: 8 32 | m_FrictionType: 0 33 | m_EnableEnhancedDeterminism: 0 34 | m_EnableUnifiedHeightmaps: 1 35 | m_SolverType: 0 36 | m_DefaultMaxAngularSpeed: 7 37 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/TestScene/scene.unity 10 | guid: b4bb10ac330c5c04680371d58f56a3a1 11 | m_configObjects: {} 12 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_AssetPipelineMode: 1 6 | m_ObjectHideFlags: 0 7 | serializedVersion: 10 8 | m_ExternalVersionControlSupport: Visible Meta Files 9 | m_SerializationMode: 2 10 | m_LineEndingsForNewScripts: 1 11 | m_DefaultBehaviorMode: 0 12 | m_PrefabRegularEnvironment: {fileID: 0} 13 | m_PrefabUIEnvironment: {fileID: 0} 14 | m_SpritePackerMode: 0 15 | m_SpritePackerPaddingPower: 1 16 | m_EtcTextureCompressorBehavior: 1 17 | m_EtcTextureFastCompressor: 1 18 | m_EtcTextureNormalCompressor: 2 19 | m_EtcTextureBestCompressor: 4 20 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;asmref;rsp 21 | m_ProjectGenerationRootNamespace: 22 | m_CollabEditorSettings: 23 | inProgressEnabled: 1 24 | m_EnableTextureStreamingInEditMode: 1 25 | m_EnableTextureStreamingInPlayMode: 1 26 | m_AsyncShaderCompilation: 1 27 | m_EnterPlayModeOptionsEnabled: 0 28 | m_EnterPlayModeOptions: 3 29 | m_ShowLightmapResolutionOverlay: 1 30 | m_UseLegacyProbeSampleCount: 0 31 | m_SerializeInlineMappingsOnOneLine: 1 32 | -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0} 39 | - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} 40 | - {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0} 41 | - {fileID: 16003, guid: 0000000000000000f000000000000000, type: 0} 42 | - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} 43 | m_PreloadedShaders: [] 44 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 45 | type: 0} 46 | m_CustomRenderPipeline: {fileID: 11400000, guid: 67e17f87458eb844a9a8fd6f37c788ac, 47 | type: 2} 48 | m_TransparencySortMode: 0 49 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 50 | m_DefaultRenderingPath: 1 51 | m_DefaultMobileRenderingPath: 1 52 | m_TierSettings: [] 53 | m_LightmapStripping: 0 54 | m_FogStripping: 0 55 | m_InstancingStripping: 0 56 | m_LightmapKeepPlain: 1 57 | m_LightmapKeepDirCombined: 1 58 | m_LightmapKeepDynamicPlain: 1 59 | m_LightmapKeepDynamicDirCombined: 1 60 | m_LightmapKeepShadowMask: 1 61 | m_LightmapKeepSubtractive: 1 62 | m_FogKeepLinear: 1 63 | m_FogKeepExp: 1 64 | m_FogKeepExp2: 1 65 | m_AlbedoSwatchInfos: [] 66 | m_LightsUseLinearIntensity: 1 67 | m_LightsUseColorTemperature: 0 68 | m_LogWhenShaderIsCompiled: 0 69 | m_AllowEnlightenSupportForUpgradedProject: 0 70 | -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | - serializedVersion: 3 297 | m_Name: Enable Debug Button 1 298 | descriptiveName: 299 | descriptiveNegativeName: 300 | negativeButton: 301 | positiveButton: left ctrl 302 | altNegativeButton: 303 | altPositiveButton: joystick button 8 304 | gravity: 0 305 | dead: 0 306 | sensitivity: 0 307 | snap: 0 308 | invert: 0 309 | type: 0 310 | axis: 0 311 | joyNum: 0 312 | - serializedVersion: 3 313 | m_Name: Enable Debug Button 2 314 | descriptiveName: 315 | descriptiveNegativeName: 316 | negativeButton: 317 | positiveButton: backspace 318 | altNegativeButton: 319 | altPositiveButton: joystick button 9 320 | gravity: 0 321 | dead: 0 322 | sensitivity: 0 323 | snap: 0 324 | invert: 0 325 | type: 0 326 | axis: 0 327 | joyNum: 0 328 | - serializedVersion: 3 329 | m_Name: Debug Reset 330 | descriptiveName: 331 | descriptiveNegativeName: 332 | negativeButton: 333 | positiveButton: left alt 334 | altNegativeButton: 335 | altPositiveButton: joystick button 1 336 | gravity: 0 337 | dead: 0 338 | sensitivity: 0 339 | snap: 0 340 | invert: 0 341 | type: 0 342 | axis: 0 343 | joyNum: 0 344 | - serializedVersion: 3 345 | m_Name: Debug Next 346 | descriptiveName: 347 | descriptiveNegativeName: 348 | negativeButton: 349 | positiveButton: page down 350 | altNegativeButton: 351 | altPositiveButton: joystick button 5 352 | gravity: 0 353 | dead: 0 354 | sensitivity: 0 355 | snap: 0 356 | invert: 0 357 | type: 0 358 | axis: 0 359 | joyNum: 0 360 | - serializedVersion: 3 361 | m_Name: Debug Previous 362 | descriptiveName: 363 | descriptiveNegativeName: 364 | negativeButton: 365 | positiveButton: page up 366 | altNegativeButton: 367 | altPositiveButton: joystick button 4 368 | gravity: 0 369 | dead: 0 370 | sensitivity: 0 371 | snap: 0 372 | invert: 0 373 | type: 0 374 | axis: 0 375 | joyNum: 0 376 | - serializedVersion: 3 377 | m_Name: Debug Validate 378 | descriptiveName: 379 | descriptiveNegativeName: 380 | negativeButton: 381 | positiveButton: return 382 | altNegativeButton: 383 | altPositiveButton: joystick button 0 384 | gravity: 0 385 | dead: 0 386 | sensitivity: 0 387 | snap: 0 388 | invert: 0 389 | type: 0 390 | axis: 0 391 | joyNum: 0 392 | - serializedVersion: 3 393 | m_Name: Debug Persistent 394 | descriptiveName: 395 | descriptiveNegativeName: 396 | negativeButton: 397 | positiveButton: right shift 398 | altNegativeButton: 399 | altPositiveButton: joystick button 2 400 | gravity: 0 401 | dead: 0 402 | sensitivity: 0 403 | snap: 0 404 | invert: 0 405 | type: 0 406 | axis: 0 407 | joyNum: 0 408 | - serializedVersion: 3 409 | m_Name: Debug Multiplier 410 | descriptiveName: 411 | descriptiveNegativeName: 412 | negativeButton: 413 | positiveButton: left shift 414 | altNegativeButton: 415 | altPositiveButton: joystick button 3 416 | gravity: 0 417 | dead: 0 418 | sensitivity: 0 419 | snap: 0 420 | invert: 0 421 | type: 0 422 | axis: 0 423 | joyNum: 0 424 | - serializedVersion: 3 425 | m_Name: Debug Horizontal 426 | descriptiveName: 427 | descriptiveNegativeName: 428 | negativeButton: left 429 | positiveButton: right 430 | altNegativeButton: 431 | altPositiveButton: 432 | gravity: 1000 433 | dead: 0.001 434 | sensitivity: 1000 435 | snap: 0 436 | invert: 0 437 | type: 0 438 | axis: 0 439 | joyNum: 0 440 | - serializedVersion: 3 441 | m_Name: Debug Vertical 442 | descriptiveName: 443 | descriptiveNegativeName: 444 | negativeButton: down 445 | positiveButton: up 446 | altNegativeButton: 447 | altPositiveButton: 448 | gravity: 1000 449 | dead: 0.001 450 | sensitivity: 1000 451 | snap: 0 452 | invert: 0 453 | type: 0 454 | axis: 0 455 | joyNum: 0 456 | - serializedVersion: 3 457 | m_Name: Debug Vertical 458 | descriptiveName: 459 | descriptiveNegativeName: 460 | negativeButton: down 461 | positiveButton: up 462 | altNegativeButton: 463 | altPositiveButton: 464 | gravity: 1000 465 | dead: 0.001 466 | sensitivity: 1000 467 | snap: 0 468 | invert: 0 469 | type: 2 470 | axis: 6 471 | joyNum: 0 472 | - serializedVersion: 3 473 | m_Name: Debug Horizontal 474 | descriptiveName: 475 | descriptiveNegativeName: 476 | negativeButton: left 477 | positiveButton: right 478 | altNegativeButton: 479 | altPositiveButton: 480 | gravity: 1000 481 | dead: 0.001 482 | sensitivity: 1000 483 | snap: 0 484 | invert: 0 485 | type: 2 486 | axis: 5 487 | joyNum: 0 488 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13960, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_ScopedRegistriesSettingsExpanded: 1 16 | oneTimeWarningShown: 0 17 | m_Registries: 18 | - m_Id: main 19 | m_Name: 20 | m_Url: https://packages.unity.com 21 | m_Scopes: [] 22 | m_IsDefault: 1 23 | m_UserSelectedRegistryName: 24 | m_UserAddingNewScopedRegistry: 0 25 | m_RegistryInfoDraft: 26 | m_ErrorMessage: 27 | m_Original: 28 | m_Id: 29 | m_Name: 30 | m_Url: 31 | m_Scopes: [] 32 | m_IsDefault: 0 33 | m_Modified: 0 34 | m_Name: 35 | m_Url: 36 | m_Scopes: 37 | - 38 | m_SelectedScopeIndex: 0 39 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | m_DefaultList: 7 | - type: 8 | m_NativeTypeID: 108 9 | m_ManagedTypePPtr: {fileID: 0} 10 | m_ManagedTypeFallback: 11 | defaultPresets: 12 | - m_Preset: {fileID: 2655988077585873504, guid: 463065d4f17d1d94d848aa127b94dd43, 13 | type: 2} 14 | - type: 15 | m_NativeTypeID: 1020 16 | m_ManagedTypePPtr: {fileID: 0} 17 | m_ManagedTypeFallback: 18 | defaultPresets: 19 | - m_Preset: {fileID: 2655988077585873504, guid: e7689051185d12f4298e1ebb2693a29f, 20 | type: 2} 21 | - type: 22 | m_NativeTypeID: 1006 23 | m_ManagedTypePPtr: {fileID: 0} 24 | m_ManagedTypeFallback: 25 | defaultPresets: 26 | - m_Preset: {fileID: 2655988077585873504, guid: e8537455c6c08bd4e8bf0be3707da685, 27 | type: 2} 28 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 20 7 | productGUID: 48e3f611beb8bc943b7a36a97fa4c553 8 | AndroidProfiler: 0 9 | AndroidFilterTouchesWhenObscured: 0 10 | AndroidEnableSustainedPerformanceMode: 0 11 | defaultScreenOrientation: 4 12 | targetDevice: 2 13 | useOnDemandResources: 0 14 | accelerometerFrequency: 60 15 | companyName: DefaultCompany 16 | productName: URP_DrawMeshInstancedIndirect 17 | defaultCursor: {fileID: 0} 18 | cursorHotspot: {x: 0, y: 0} 19 | m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} 20 | m_ShowUnitySplashScreen: 1 21 | m_ShowUnitySplashLogo: 1 22 | m_SplashScreenOverlayOpacity: 1 23 | m_SplashScreenAnimation: 1 24 | m_SplashScreenLogoStyle: 1 25 | m_SplashScreenDrawMode: 0 26 | m_SplashScreenBackgroundAnimationZoom: 1 27 | m_SplashScreenLogoAnimationZoom: 1 28 | m_SplashScreenBackgroundLandscapeAspect: 1 29 | m_SplashScreenBackgroundPortraitAspect: 1 30 | m_SplashScreenBackgroundLandscapeUvs: 31 | serializedVersion: 2 32 | x: 0 33 | y: 0 34 | width: 1 35 | height: 1 36 | m_SplashScreenBackgroundPortraitUvs: 37 | serializedVersion: 2 38 | x: 0 39 | y: 0 40 | width: 1 41 | height: 1 42 | m_SplashScreenLogos: [] 43 | m_VirtualRealitySplashScreen: {fileID: 0} 44 | m_HolographicTrackingLossScreen: {fileID: 0} 45 | defaultScreenWidth: 1024 46 | defaultScreenHeight: 768 47 | defaultScreenWidthWeb: 960 48 | defaultScreenHeightWeb: 600 49 | m_StereoRenderingPath: 0 50 | m_ActiveColorSpace: 1 51 | m_MTRendering: 1 52 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 53 | iosShowActivityIndicatorOnLoading: -1 54 | androidShowActivityIndicatorOnLoading: -1 55 | iosUseCustomAppBackgroundBehavior: 0 56 | iosAllowHTTPDownload: 1 57 | allowedAutorotateToPortrait: 0 58 | allowedAutorotateToPortraitUpsideDown: 0 59 | allowedAutorotateToLandscapeRight: 1 60 | allowedAutorotateToLandscapeLeft: 1 61 | useOSAutorotation: 1 62 | use32BitDisplayBuffer: 0 63 | preserveFramebufferAlpha: 0 64 | disableDepthAndStencilBuffers: 0 65 | androidStartInFullscreen: 1 66 | androidRenderOutsideSafeArea: 1 67 | androidUseSwappy: 0 68 | androidBlitType: 1 69 | defaultIsNativeResolution: 1 70 | macRetinaSupport: 1 71 | runInBackground: 0 72 | captureSingleScreen: 0 73 | muteOtherAudioSources: 0 74 | Prepare IOS For Recording: 0 75 | Force IOS Speakers When Recording: 0 76 | deferSystemGesturesMode: 0 77 | hideHomeButton: 0 78 | submitAnalytics: 1 79 | usePlayerLog: 1 80 | bakeCollisionMeshes: 0 81 | forceSingleInstance: 0 82 | useFlipModelSwapchain: 1 83 | resizableWindow: 0 84 | useMacAppStoreValidation: 0 85 | macAppStoreCategory: public.app-category.games 86 | gpuSkinning: 1 87 | xboxPIXTextureCapture: 0 88 | xboxEnableAvatar: 0 89 | xboxEnableKinect: 0 90 | xboxEnableKinectAutoTracking: 0 91 | xboxEnableFitness: 0 92 | visibleInBackground: 1 93 | allowFullscreenSwitch: 1 94 | fullscreenMode: 1 95 | xboxSpeechDB: 0 96 | xboxEnableHeadOrientation: 0 97 | xboxEnableGuest: 0 98 | xboxEnablePIXSampling: 0 99 | metalFramebufferOnly: 0 100 | xboxOneResolution: 0 101 | xboxOneSResolution: 0 102 | xboxOneXResolution: 3 103 | xboxOneMonoLoggingLevel: 0 104 | xboxOneLoggingLevel: 1 105 | xboxOneDisableEsram: 0 106 | xboxOneEnableTypeOptimization: 0 107 | xboxOnePresentImmediateThreshold: 0 108 | switchQueueCommandMemory: 1048576 109 | switchQueueControlMemory: 16384 110 | switchQueueComputeMemory: 262144 111 | switchNVNShaderPoolsGranularity: 33554432 112 | switchNVNDefaultPoolsGranularity: 16777216 113 | switchNVNOtherPoolsGranularity: 16777216 114 | stadiaPresentMode: 0 115 | stadiaTargetFramerate: 0 116 | vulkanNumSwapchainBuffers: 3 117 | vulkanEnableSetSRGBWrite: 0 118 | m_SupportedAspectRatios: 119 | 4:3: 1 120 | 5:4: 1 121 | 16:10: 1 122 | 16:9: 1 123 | Others: 1 124 | bundleVersion: 1.0 125 | preloadedAssets: [] 126 | metroInputSource: 0 127 | wsaTransparentSwapchain: 0 128 | m_HolographicPauseOnTrackingLoss: 1 129 | xboxOneDisableKinectGpuReservation: 1 130 | xboxOneEnable7thCore: 1 131 | vrSettings: 132 | cardboard: 133 | depthFormat: 0 134 | enableTransitionView: 0 135 | daydream: 136 | depthFormat: 0 137 | useSustainedPerformanceMode: 0 138 | enableVideoLayer: 0 139 | useProtectedVideoMemory: 0 140 | minimumSupportedHeadTracking: 0 141 | maximumSupportedHeadTracking: 1 142 | hololens: 143 | depthFormat: 1 144 | depthBufferSharingEnabled: 1 145 | lumin: 146 | depthFormat: 0 147 | frameTiming: 2 148 | enableGLCache: 0 149 | glCacheMaxBlobSize: 524288 150 | glCacheMaxFileSize: 8388608 151 | oculus: 152 | sharedDepthBuffer: 1 153 | dashSupport: 1 154 | lowOverheadMode: 0 155 | protectedContext: 0 156 | v2Signing: 1 157 | enable360StereoCapture: 0 158 | isWsaHolographicRemotingEnabled: 0 159 | enableFrameTimingStats: 1 160 | useHDRDisplay: 0 161 | D3DHDRBitDepth: 0 162 | m_ColorGamuts: 00000000 163 | targetPixelDensity: 420 164 | resolutionScalingMode: 1 165 | androidSupportedAspectRatio: 1 166 | androidMaxAspectRatio: 2.1 167 | applicationIdentifier: {} 168 | buildNumber: {} 169 | AndroidBundleVersionCode: 1 170 | AndroidMinSdkVersion: 19 171 | AndroidTargetSdkVersion: 0 172 | AndroidPreferredInstallLocation: 1 173 | aotOptions: 174 | stripEngineCode: 1 175 | iPhoneStrippingLevel: 0 176 | iPhoneScriptCallOptimization: 0 177 | ForceInternetPermission: 0 178 | ForceSDCardPermission: 0 179 | CreateWallpaper: 0 180 | APKExpansionFiles: 0 181 | keepLoadedShadersAlive: 1 182 | StripUnusedMeshComponents: 0 183 | VertexChannelCompressionMask: 4054 184 | iPhoneSdkVersion: 988 185 | iOSTargetOSVersionString: 11.0 186 | tvOSSdkVersion: 0 187 | tvOSRequireExtendedGameController: 0 188 | tvOSTargetOSVersionString: 11.0 189 | uIPrerenderedIcon: 0 190 | uIRequiresPersistentWiFi: 0 191 | uIRequiresFullScreen: 1 192 | uIStatusBarHidden: 1 193 | uIExitOnSuspend: 0 194 | uIStatusBarStyle: 0 195 | appleTVSplashScreen: {fileID: 0} 196 | appleTVSplashScreen2x: {fileID: 0} 197 | tvOSSmallIconLayers: [] 198 | tvOSSmallIconLayers2x: [] 199 | tvOSLargeIconLayers: [] 200 | tvOSLargeIconLayers2x: [] 201 | tvOSTopShelfImageLayers: [] 202 | tvOSTopShelfImageLayers2x: [] 203 | tvOSTopShelfImageWideLayers: [] 204 | tvOSTopShelfImageWideLayers2x: [] 205 | iOSLaunchScreenType: 0 206 | iOSLaunchScreenPortrait: {fileID: 0} 207 | iOSLaunchScreenLandscape: {fileID: 0} 208 | iOSLaunchScreenBackgroundColor: 209 | serializedVersion: 2 210 | rgba: 0 211 | iOSLaunchScreenFillPct: 100 212 | iOSLaunchScreenSize: 100 213 | iOSLaunchScreenCustomXibPath: 214 | iOSLaunchScreeniPadType: 0 215 | iOSLaunchScreeniPadImage: {fileID: 0} 216 | iOSLaunchScreeniPadBackgroundColor: 217 | serializedVersion: 2 218 | rgba: 0 219 | iOSLaunchScreeniPadFillPct: 100 220 | iOSLaunchScreeniPadSize: 100 221 | iOSLaunchScreeniPadCustomXibPath: 222 | iOSUseLaunchScreenStoryboard: 0 223 | iOSLaunchScreenCustomStoryboardPath: 224 | iOSDeviceRequirements: [] 225 | iOSURLSchemes: [] 226 | iOSBackgroundModes: 0 227 | iOSMetalForceHardShadows: 0 228 | metalEditorSupport: 1 229 | metalAPIValidation: 1 230 | iOSRenderExtraFrameOnPause: 0 231 | appleDeveloperTeamID: 232 | iOSManualSigningProvisioningProfileID: 233 | tvOSManualSigningProvisioningProfileID: 234 | iOSManualSigningProvisioningProfileType: 0 235 | tvOSManualSigningProvisioningProfileType: 0 236 | appleEnableAutomaticSigning: 0 237 | iOSRequireARKit: 0 238 | iOSAutomaticallyDetectAndAddCapabilities: 1 239 | appleEnableProMotion: 0 240 | clonedFromGUID: 9870af204204ab84596f8a656f2f2ce6 241 | templatePackageId: com.unity.template.universal@7.1.7 242 | templateDefaultScene: Assets/Scenes/SampleScene.unity 243 | AndroidTargetArchitectures: 1 244 | AndroidSplashScreenScale: 0 245 | androidSplashScreen: {fileID: 0} 246 | AndroidKeystoreName: 247 | AndroidKeyaliasName: 248 | AndroidBuildApkPerCpuArchitecture: 0 249 | AndroidTVCompatibility: 0 250 | AndroidIsGame: 1 251 | AndroidEnableTango: 0 252 | androidEnableBanner: 1 253 | androidUseLowAccuracyLocation: 0 254 | androidUseCustomKeystore: 0 255 | m_AndroidBanners: 256 | - width: 320 257 | height: 180 258 | banner: {fileID: 0} 259 | androidGamepadSupportLevel: 0 260 | AndroidValidateAppBundleSize: 1 261 | AndroidAppBundleSizeToValidate: 150 262 | m_BuildTargetIcons: [] 263 | m_BuildTargetPlatformIcons: 264 | - m_BuildTarget: Android 265 | m_Icons: 266 | - m_Textures: [] 267 | m_Width: 192 268 | m_Height: 192 269 | m_Kind: 0 270 | m_SubKind: 271 | - m_Textures: [] 272 | m_Width: 144 273 | m_Height: 144 274 | m_Kind: 0 275 | m_SubKind: 276 | - m_Textures: [] 277 | m_Width: 96 278 | m_Height: 96 279 | m_Kind: 0 280 | m_SubKind: 281 | - m_Textures: [] 282 | m_Width: 72 283 | m_Height: 72 284 | m_Kind: 0 285 | m_SubKind: 286 | - m_Textures: [] 287 | m_Width: 48 288 | m_Height: 48 289 | m_Kind: 0 290 | m_SubKind: 291 | - m_Textures: [] 292 | m_Width: 36 293 | m_Height: 36 294 | m_Kind: 0 295 | m_SubKind: 296 | - m_Textures: [] 297 | m_Width: 192 298 | m_Height: 192 299 | m_Kind: 1 300 | m_SubKind: 301 | - m_Textures: [] 302 | m_Width: 144 303 | m_Height: 144 304 | m_Kind: 1 305 | m_SubKind: 306 | - m_Textures: [] 307 | m_Width: 96 308 | m_Height: 96 309 | m_Kind: 1 310 | m_SubKind: 311 | - m_Textures: [] 312 | m_Width: 72 313 | m_Height: 72 314 | m_Kind: 1 315 | m_SubKind: 316 | - m_Textures: [] 317 | m_Width: 48 318 | m_Height: 48 319 | m_Kind: 1 320 | m_SubKind: 321 | - m_Textures: [] 322 | m_Width: 36 323 | m_Height: 36 324 | m_Kind: 1 325 | m_SubKind: 326 | - m_Textures: [] 327 | m_Width: 432 328 | m_Height: 432 329 | m_Kind: 2 330 | m_SubKind: 331 | - m_Textures: [] 332 | m_Width: 324 333 | m_Height: 324 334 | m_Kind: 2 335 | m_SubKind: 336 | - m_Textures: [] 337 | m_Width: 216 338 | m_Height: 216 339 | m_Kind: 2 340 | m_SubKind: 341 | - m_Textures: [] 342 | m_Width: 162 343 | m_Height: 162 344 | m_Kind: 2 345 | m_SubKind: 346 | - m_Textures: [] 347 | m_Width: 108 348 | m_Height: 108 349 | m_Kind: 2 350 | m_SubKind: 351 | - m_Textures: [] 352 | m_Width: 81 353 | m_Height: 81 354 | m_Kind: 2 355 | m_SubKind: 356 | m_BuildTargetBatching: [] 357 | m_BuildTargetGraphicsJobs: [] 358 | m_BuildTargetGraphicsJobMode: [] 359 | m_BuildTargetGraphicsAPIs: 360 | - m_BuildTarget: AndroidPlayer 361 | m_APIs: 150000000b000000 362 | m_Automatic: 0 363 | m_BuildTargetVRSettings: [] 364 | openGLRequireES31: 1 365 | openGLRequireES31AEP: 1 366 | openGLRequireES32: 1 367 | m_TemplateCustomTags: {} 368 | mobileMTRendering: 369 | Android: 1 370 | iPhone: 1 371 | tvOS: 1 372 | m_BuildTargetGroupLightmapEncodingQuality: [] 373 | m_BuildTargetGroupLightmapSettings: 374 | - m_BuildTarget: Android 375 | m_TextureStreamingEnabled: 0 376 | m_TextureStreamingPriority: 0 377 | playModeTestRunnerEnabled: 0 378 | runPlayModeTestAsEditModeTest: 0 379 | actionOnDotNetUnhandledException: 1 380 | enableInternalProfiler: 0 381 | logObjCUncaughtExceptions: 1 382 | enableCrashReportAPI: 0 383 | cameraUsageDescription: 384 | locationUsageDescription: 385 | microphoneUsageDescription: 386 | switchNetLibKey: 387 | switchSocketMemoryPoolSize: 6144 388 | switchSocketAllocatorPoolSize: 128 389 | switchSocketConcurrencyLimit: 14 390 | switchScreenResolutionBehavior: 2 391 | switchUseCPUProfiler: 0 392 | switchApplicationID: 0x01004b9000490000 393 | switchNSODependencies: 394 | switchTitleNames_0: 395 | switchTitleNames_1: 396 | switchTitleNames_2: 397 | switchTitleNames_3: 398 | switchTitleNames_4: 399 | switchTitleNames_5: 400 | switchTitleNames_6: 401 | switchTitleNames_7: 402 | switchTitleNames_8: 403 | switchTitleNames_9: 404 | switchTitleNames_10: 405 | switchTitleNames_11: 406 | switchTitleNames_12: 407 | switchTitleNames_13: 408 | switchTitleNames_14: 409 | switchPublisherNames_0: 410 | switchPublisherNames_1: 411 | switchPublisherNames_2: 412 | switchPublisherNames_3: 413 | switchPublisherNames_4: 414 | switchPublisherNames_5: 415 | switchPublisherNames_6: 416 | switchPublisherNames_7: 417 | switchPublisherNames_8: 418 | switchPublisherNames_9: 419 | switchPublisherNames_10: 420 | switchPublisherNames_11: 421 | switchPublisherNames_12: 422 | switchPublisherNames_13: 423 | switchPublisherNames_14: 424 | switchIcons_0: {fileID: 0} 425 | switchIcons_1: {fileID: 0} 426 | switchIcons_2: {fileID: 0} 427 | switchIcons_3: {fileID: 0} 428 | switchIcons_4: {fileID: 0} 429 | switchIcons_5: {fileID: 0} 430 | switchIcons_6: {fileID: 0} 431 | switchIcons_7: {fileID: 0} 432 | switchIcons_8: {fileID: 0} 433 | switchIcons_9: {fileID: 0} 434 | switchIcons_10: {fileID: 0} 435 | switchIcons_11: {fileID: 0} 436 | switchIcons_12: {fileID: 0} 437 | switchIcons_13: {fileID: 0} 438 | switchIcons_14: {fileID: 0} 439 | switchSmallIcons_0: {fileID: 0} 440 | switchSmallIcons_1: {fileID: 0} 441 | switchSmallIcons_2: {fileID: 0} 442 | switchSmallIcons_3: {fileID: 0} 443 | switchSmallIcons_4: {fileID: 0} 444 | switchSmallIcons_5: {fileID: 0} 445 | switchSmallIcons_6: {fileID: 0} 446 | switchSmallIcons_7: {fileID: 0} 447 | switchSmallIcons_8: {fileID: 0} 448 | switchSmallIcons_9: {fileID: 0} 449 | switchSmallIcons_10: {fileID: 0} 450 | switchSmallIcons_11: {fileID: 0} 451 | switchSmallIcons_12: {fileID: 0} 452 | switchSmallIcons_13: {fileID: 0} 453 | switchSmallIcons_14: {fileID: 0} 454 | switchManualHTML: 455 | switchAccessibleURLs: 456 | switchLegalInformation: 457 | switchMainThreadStackSize: 1048576 458 | switchPresenceGroupId: 459 | switchLogoHandling: 0 460 | switchReleaseVersion: 0 461 | switchDisplayVersion: 1.0.0 462 | switchStartupUserAccount: 0 463 | switchTouchScreenUsage: 0 464 | switchSupportedLanguagesMask: 0 465 | switchLogoType: 0 466 | switchApplicationErrorCodeCategory: 467 | switchUserAccountSaveDataSize: 0 468 | switchUserAccountSaveDataJournalSize: 0 469 | switchApplicationAttribute: 0 470 | switchCardSpecSize: -1 471 | switchCardSpecClock: -1 472 | switchRatingsMask: 0 473 | switchRatingsInt_0: 0 474 | switchRatingsInt_1: 0 475 | switchRatingsInt_2: 0 476 | switchRatingsInt_3: 0 477 | switchRatingsInt_4: 0 478 | switchRatingsInt_5: 0 479 | switchRatingsInt_6: 0 480 | switchRatingsInt_7: 0 481 | switchRatingsInt_8: 0 482 | switchRatingsInt_9: 0 483 | switchRatingsInt_10: 0 484 | switchRatingsInt_11: 0 485 | switchRatingsInt_12: 0 486 | switchLocalCommunicationIds_0: 487 | switchLocalCommunicationIds_1: 488 | switchLocalCommunicationIds_2: 489 | switchLocalCommunicationIds_3: 490 | switchLocalCommunicationIds_4: 491 | switchLocalCommunicationIds_5: 492 | switchLocalCommunicationIds_6: 493 | switchLocalCommunicationIds_7: 494 | switchParentalControl: 0 495 | switchAllowsScreenshot: 1 496 | switchAllowsVideoCapturing: 1 497 | switchAllowsRuntimeAddOnContentInstall: 0 498 | switchDataLossConfirmation: 0 499 | switchUserAccountLockEnabled: 0 500 | switchSystemResourceMemory: 16777216 501 | switchSupportedNpadStyles: 22 502 | switchNativeFsCacheSize: 32 503 | switchIsHoldTypeHorizontal: 0 504 | switchSupportedNpadCount: 8 505 | switchSocketConfigEnabled: 0 506 | switchTcpInitialSendBufferSize: 32 507 | switchTcpInitialReceiveBufferSize: 64 508 | switchTcpAutoSendBufferSizeMax: 256 509 | switchTcpAutoReceiveBufferSizeMax: 256 510 | switchUdpSendBufferSize: 9 511 | switchUdpReceiveBufferSize: 42 512 | switchSocketBufferEfficiency: 4 513 | switchSocketInitializeEnabled: 1 514 | switchNetworkInterfaceManagerInitializeEnabled: 1 515 | switchPlayerConnectionEnabled: 1 516 | ps4NPAgeRating: 12 517 | ps4NPTitleSecret: 518 | ps4NPTrophyPackPath: 519 | ps4ParentalLevel: 11 520 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 521 | ps4Category: 0 522 | ps4MasterVersion: 01.00 523 | ps4AppVersion: 01.00 524 | ps4AppType: 0 525 | ps4ParamSfxPath: 526 | ps4VideoOutPixelFormat: 0 527 | ps4VideoOutInitialWidth: 1920 528 | ps4VideoOutBaseModeInitialWidth: 1920 529 | ps4VideoOutReprojectionRate: 60 530 | ps4PronunciationXMLPath: 531 | ps4PronunciationSIGPath: 532 | ps4BackgroundImagePath: 533 | ps4StartupImagePath: 534 | ps4StartupImagesFolder: 535 | ps4IconImagesFolder: 536 | ps4SaveDataImagePath: 537 | ps4SdkOverride: 538 | ps4BGMPath: 539 | ps4ShareFilePath: 540 | ps4ShareOverlayImagePath: 541 | ps4PrivacyGuardImagePath: 542 | ps4NPtitleDatPath: 543 | ps4RemotePlayKeyAssignment: -1 544 | ps4RemotePlayKeyMappingDir: 545 | ps4PlayTogetherPlayerCount: 0 546 | ps4EnterButtonAssignment: 2 547 | ps4ApplicationParam1: 0 548 | ps4ApplicationParam2: 0 549 | ps4ApplicationParam3: 0 550 | ps4ApplicationParam4: 0 551 | ps4DownloadDataSize: 0 552 | ps4GarlicHeapSize: 2048 553 | ps4ProGarlicHeapSize: 2560 554 | playerPrefsMaxSize: 32768 555 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 556 | ps4pnSessions: 1 557 | ps4pnPresence: 1 558 | ps4pnFriends: 1 559 | ps4pnGameCustomData: 1 560 | playerPrefsSupport: 0 561 | enableApplicationExit: 0 562 | resetTempFolder: 1 563 | restrictedAudioUsageRights: 0 564 | ps4UseResolutionFallback: 0 565 | ps4ReprojectionSupport: 0 566 | ps4UseAudio3dBackend: 0 567 | ps4UseLowGarlicFragmentationMode: 1 568 | ps4SocialScreenEnabled: 0 569 | ps4ScriptOptimizationLevel: 2 570 | ps4Audio3dVirtualSpeakerCount: 14 571 | ps4attribCpuUsage: 0 572 | ps4PatchPkgPath: 573 | ps4PatchLatestPkgPath: 574 | ps4PatchChangeinfoPath: 575 | ps4PatchDayOne: 0 576 | ps4attribUserManagement: 0 577 | ps4attribMoveSupport: 0 578 | ps4attrib3DSupport: 0 579 | ps4attribShareSupport: 0 580 | ps4attribExclusiveVR: 0 581 | ps4disableAutoHideSplash: 0 582 | ps4videoRecordingFeaturesUsed: 0 583 | ps4contentSearchFeaturesUsed: 0 584 | ps4attribEyeToEyeDistanceSettingVR: 0 585 | ps4IncludedModules: [] 586 | ps4attribVROutputEnabled: 0 587 | monoEnv: 588 | splashScreenBackgroundSourceLandscape: {fileID: 0} 589 | splashScreenBackgroundSourcePortrait: {fileID: 0} 590 | blurSplashScreenBackground: 1 591 | spritePackerPolicy: 592 | webGLMemorySize: 32 593 | webGLExceptionSupport: 1 594 | webGLNameFilesAsHashes: 0 595 | webGLDataCaching: 1 596 | webGLDebugSymbols: 0 597 | webGLEmscriptenArgs: 598 | webGLModulesDirectory: 599 | webGLTemplate: APPLICATION:Default 600 | webGLAnalyzeBuildSize: 0 601 | webGLUseEmbeddedResources: 0 602 | webGLCompressionFormat: 0 603 | webGLLinkerTarget: 1 604 | webGLThreadsSupport: 0 605 | webGLWasmStreaming: 0 606 | scriptingDefineSymbols: {} 607 | platformArchitecture: {} 608 | scriptingBackend: {} 609 | il2cppCompilerConfiguration: {} 610 | managedStrippingLevel: {} 611 | incrementalIl2cppBuild: {} 612 | allowUnsafeCode: 0 613 | additionalIl2CppArgs: 614 | scriptingRuntimeVersion: 1 615 | gcIncremental: 1 616 | gcWBarrierValidation: 0 617 | apiCompatibilityLevelPerPlatform: {} 618 | m_RenderingPath: 1 619 | m_MobileRenderingPath: 1 620 | metroPackageName: NiceTimeShaderCheck 621 | metroPackageVersion: 622 | metroCertificatePath: 623 | metroCertificatePassword: 624 | metroCertificateSubject: 625 | metroCertificateIssuer: 626 | metroCertificateNotAfter: 0000000000000000 627 | metroApplicationDescription: NiceTimeShaderCheck 628 | wsaImages: {} 629 | metroTileShortName: 630 | metroTileShowName: 0 631 | metroMediumTileShowName: 0 632 | metroLargeTileShowName: 0 633 | metroWideTileShowName: 0 634 | metroSupportStreamingInstall: 0 635 | metroLastRequiredScene: 0 636 | metroDefaultTileSize: 1 637 | metroTileForegroundText: 2 638 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 639 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, 640 | a: 1} 641 | metroSplashScreenUseBackgroundColor: 0 642 | platformCapabilities: {} 643 | metroTargetDeviceFamilies: {} 644 | metroFTAName: 645 | metroFTAFileTypes: [] 646 | metroProtocolName: 647 | XboxOneProductId: 648 | XboxOneUpdateKey: 649 | XboxOneSandboxId: 650 | XboxOneContentId: 651 | XboxOneTitleId: 652 | XboxOneSCId: 653 | XboxOneGameOsOverridePath: 654 | XboxOnePackagingOverridePath: 655 | XboxOneAppManifestOverridePath: 656 | XboxOneVersion: 1.0.0.0 657 | XboxOnePackageEncryption: 0 658 | XboxOnePackageUpdateGranularity: 2 659 | XboxOneDescription: 660 | XboxOneLanguage: 661 | - enus 662 | XboxOneCapability: [] 663 | XboxOneGameRating: {} 664 | XboxOneIsContentPackage: 0 665 | XboxOneEnableGPUVariability: 1 666 | XboxOneSockets: {} 667 | XboxOneSplashScreen: {fileID: 0} 668 | XboxOneAllowedProductIds: [] 669 | XboxOnePersistentLocalStorageSize: 0 670 | XboxOneXTitleMemory: 8 671 | XboxOneOverrideIdentityName: 672 | XboxOneOverrideIdentityPublisher: 673 | vrEditorSettings: 674 | daydream: 675 | daydreamIconForeground: {fileID: 0} 676 | daydreamIconBackground: {fileID: 0} 677 | cloudServicesEnabled: {} 678 | luminIcon: 679 | m_Name: 680 | m_ModelFolderPath: 681 | m_PortalFolderPath: 682 | luminCert: 683 | m_CertPath: 684 | m_SignPackage: 1 685 | luminIsChannelApp: 0 686 | luminVersion: 687 | m_VersionCode: 1 688 | m_VersionName: 689 | apiCompatibilityLevel: 6 690 | cloudProjectId: 691 | framebufferDepthMemorylessMode: 0 692 | projectName: 693 | organizationId: 694 | cloudEnabled: 0 695 | enableNativePlatformBackendsForNewInputSystem: 0 696 | disableOldInputManagerSupport: 0 697 | legacyClampBlendShapeWeights: 0 698 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2019.4.15f1 2 | m_EditorVersionWithRevision: 2019.4.15f1 (fbf367ac14e9) 3 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 0 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Default 11 | pixelLightCount: 2 12 | shadows: 2 13 | shadowResolution: 1 14 | shadowProjection: 1 15 | shadowCascades: 2 16 | shadowDistance: 40 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 1 21 | skinWeights: 2 22 | textureQuality: 0 23 | anisotropicTextures: 1 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 1 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 1 31 | maximumLODLevel: 0 32 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 256 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 16 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | customRenderPipeline: {fileID: 11400000, guid: 67e17f87458eb844a9a8fd6f37c788ac, 44 | type: 2} 45 | excludedTargetPlatforms: [] 46 | m_PerPlatformDefaultQuality: 47 | Android: 0 48 | Lumin: 0 49 | Nintendo Switch: 0 50 | PS4: 0 51 | Stadia: 0 52 | Standalone: 0 53 | WebGL: 0 54 | Windows Store Apps: 0 55 | XboxOne: 0 56 | iPhone: 0 57 | tvOS: 0 58 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.1 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /ProjectSettings/TimelineSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: a287be6c49135cd4f9b2b8666c39d999, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | assetDefaultFramerate: 60 16 | -------------------------------------------------------------------------------- /ProjectSettings/URPProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 11500000, guid: 247994e1f5a72c2419c26a37e9334c01, type: 3} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_LastMaterialVersion: 1 16 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 0 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_RenderPipeSettingsPath: 10 | m_FixedTimeStep: 0.016666668 11 | m_MaxDeltaTime: 0.05 12 | -------------------------------------------------------------------------------- /ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UnityURP-MobileDrawMeshInstancedIndirectExample 2 | 3 | youtube runtime demo video: https://youtu.be/A7rav4tS88s 4 | download .apk, try it on your android phone: https://drive.google.com/file/d/185JWZXYPnVyDnA451cEZkS2H2wOYSce_/view 5 | 6 | DrawMeshInstancedIndirect ON 7 | ![screenshot](https://i.imgur.com/oQoFK46.png) 8 | DrawMeshInstancedIndirect ON (grass bending) 9 | ![screenshot](https://i.imgur.com/QDXbEZw.png) 10 | ![screenshot](https://i.imgur.com/E7wEEPR.png) 11 | DrawMeshInstancedIndirect OFF 12 | ![screenshot](https://i.imgur.com/xOhTW6d.png) 13 | 14 | Why create this repository? 15 | ------------- 16 | To demonstrate an API that can draw millions of instance -> DrawMeshInstancedIndirect(), running on mobile devices. 17 | 18 | Can this demo runs on midrange mobile? 19 | --------------- 20 | - can handle 10 million instances on Samsung Galaxy A70 (GPU = adreno612, not a strong GPU), 50~60fps, performance mainly affected by visible grass count on screen(draw distance = 125) 21 | - can handle 10 million instances on Lenovo S5 (GPU = adreno506, a weak GPU), 30fps, performance mainly affected by visible grass count on screen(draw distance = 75) 22 | 23 | Requirement 24 | ----------------- 25 | if you want to try the pre-built .apk, your android device must support Opengles3.2 / Vulkan 26 | download .apk: https://drive.google.com/file/d/185JWZXYPnVyDnA451cEZkS2H2wOYSce_/view 27 | 28 | Where are the important files 29 | ---------------- 30 | https://github.com/ColinLeung-NiloCat/UnityURP-MobileDrawMeshInstancedIndirectExample/tree/master/Assets/URPMobileGrassInstancedIndirectDemo/InstancedIndirectGrass/Core 31 | 32 | Editor 33 | ------------ 34 | 2019.4.15f1 35 | 36 | Note 37 | ------------- 38 | This is a simplified example repository to demonstrate DrawMeshInstancedIndirect API on mobile platform. 39 | This repository is as simple as possible, only contains a simple CPU cell frustum culling(not even a quadtree) -> minimum compute GPU frustum culling (no Acceleration Algorithms), then just 1 DrawMeshInstancedIndirect call, nothing else, code is very short. 40 | 41 | Lighting and animation is not the main focus of this project, but ~40% of the time was spent on writing grass shader's lighting & animation, you can have a look at InstancedIndirectGrass.shader if you are interested. 42 | 43 | This repository also contains a RendererFeature(GrassBendingRTPrePass.cs) to render an offscreen RT(R8), which renders top down view grass bending area (by trail renderer following moving objects), it is a very simple method but the result is good enough for this demo. 44 | 45 | reference 46 | ------------------- 47 | - https://github.com/ellioman/Indirect-Rendering-With-Compute-Shaders 48 | - https://github.com/tiiago11/Unity-InstancedIndirectExamples 49 | - https://assetstore.unity.com/packages/tools/utilities/gpu-instancer-117566 50 | - https://assetstore.unity.com/packages/tools/terrain/advanced-terrain-grass-100014 51 | 52 | -------------------------------------------------------------------------------- /UserSettings/EditorUserSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!162 &1 4 | EditorUserSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_ConfigSettings: 8 | RecentlyUsedScenePath-0: 9 | value: 22424703114646680e0b0227036c6c111b07142f1f2b233e2867083debf42d 10 | flags: 0 11 | RecentlyUsedScenePath-1: 12 | value: 224247031146466e3f3e4c36152e4f1c17031d651f2b233e283a5200e3ed2434e7d435ece93f7129370bfb25 13 | flags: 0 14 | RecentlyUsedScenePath-2: 15 | value: 224247031146467d0c001823033a1f231d0e1a2534680002080c5217e7ed3b77c4e638fde629267c0a09f63e0b264119c02f2c4bd20e07045146a45841e7464341d5008c54dd1115df00 16 | flags: 0 17 | lightmappingDeviceAndPlatform: 18 | value: 53 19 | flags: 0 20 | vcSharedLogLevel: 21 | value: 0d5e400f0650 22 | flags: 0 23 | m_VCAutomaticAdd: 1 24 | m_VCDebugCom: 0 25 | m_VCDebugCmd: 0 26 | m_VCDebugOut: 0 27 | m_SemanticMergeMode: 2 28 | m_VCShowFailedCheckout: 1 29 | m_VCOverwriteFailedCheckoutAssets: 1 30 | m_VCProjectOverlayIcons: 1 31 | m_VCHierarchyOverlayIcons: 1 32 | m_VCOtherOverlayIcons: 1 33 | m_VCAllowAsyncUpdate: 0 34 | --------------------------------------------------------------------------------