add kinect point cloud

This commit is contained in:
Chikashi Miyama 2019-11-03 23:37:01 +01:00
parent 9d23608998
commit 0808bec831
11 changed files with 6807 additions and 127 deletions

View file

@ -56,6 +56,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Assets\KinectPointCloud.cs" />
<Compile Include="Assets\Scenes\Examples\Composition\script\BallMapping.cs" />
<Compile Include="Assets\Scenes\Examples\Composition\script\RmsAnalyzer.cs" />
<Compile Include="Assets\Scenes\Examples\KinectSkeleton\script\RightHandFire.cs" />
@ -76,6 +77,7 @@
<Compile Include="Assets\Scenes\Examples\TimbreID\script\IdToText.cs" />
<Compile Include="Assets\Scenes\Examples\VisualEffectGraph\script\FlareBind.cs" />
<Compile Include="Assets\Scenes\Examples\VisualEffectGraph\script\SmokeBind.cs" />
<Compile Include="Assets\Scripts\Kinect\DifferenceTexture.cs" />
<Compile Include="Assets\Scripts\Kinect\KinectJointBind.cs" />
<Compile Include="Assets\Scripts\Kinect\KinectManagerBehaviour.cs" />
<Compile Include="Assets\Scripts\Math\BodyHolder.cs" />

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 3a4d3d5be59a1e049aa7f5a5df312385
VisualEffectImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,742 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!2058629511 &1
VisualEffectResource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: KinectPointCloudSubgraphOperator
m_Graph: {fileID: 2}
m_ShaderSources: []
m_Infos:
m_Expressions:
m_Expressions: []
m_NeedsLocalToWorld: 0
m_NeedsWorldToLocal: 0
m_NeededMainCameraBuffers: 0
m_PropertySheet:
m_Float:
m_Array: []
m_Vector2f:
m_Array: []
m_Vector3f:
m_Array: []
m_Vector4f:
m_Array: []
m_Uint:
m_Array: []
m_Int:
m_Array: []
m_Matrix4x4f:
m_Array: []
m_AnimationCurve:
m_Array: []
m_Gradient:
m_Array: []
m_NamedObject:
m_Array: []
m_Bool:
m_Array: []
m_ExposedExpressions: []
m_Buffers: []
m_TemporaryBuffers: []
m_CPUBuffers: []
m_Events: []
m_RuntimeVersion: 0
m_RendererSettings:
motionVectorGenerationMode: 0
shadowCastingMode: 0
receiveShadows: 0
reflectionProbeUsage: 0
lightProbeUsage: 0
m_CullingFlags: 3
m_UpdateMode: 0
m_PreWarmDeltaTime: 0.05
m_PreWarmStepCount: 0
m_Systems: []
--- !u!114 &2
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7d4c867f6b72b714dbb5fd1780afe208, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Parent: {fileID: 0}
m_Children:
- {fileID: 4}
- {fileID: 15}
- {fileID: 17}
m_UIPosition: {x: 0, y: 0}
m_UICollapsed: 1
m_UISuperCollapsed: 0
m_UIInfos: {fileID: 3}
m_ParameterInfo:
- name: DepthImage
path: DepthImage
tooltip:
sheetType: m_NamedObject
realType: Texture2D
defaultValue:
m_Type:
m_SerializableType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
m_SerializableObject: '{"obj":{"fileID":2800000,"guid":"276d9e395ae18fe40a9b4988549f2349","type":3}}'
min: -Infinity
max: Infinity
descendantCount: 0
- name: uv
path: uv
tooltip:
sheetType: m_Vector2f
realType: Vector2
defaultValue:
m_Type:
m_SerializableType: UnityEngine.Vector2, UnityEngine.CoreModule, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
m_SerializableObject: '{"x":0.0,"y":0.0}'
min: -Infinity
max: Infinity
descendantCount: 0
m_GraphVersion: 2
m_saved: 1
m_SubgraphDependencies: []
m_CategoryPath:
--- !u!114 &3
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d01270efd3285ea4a9d6c555cb0a8027, type: 3}
m_Name:
m_EditorClassIdentifier:
groupInfos: []
stickyNoteInfos: []
systemInfos: []
categories: []
uiBounds:
serializedVersion: 2
x: 0
y: 0
width: 0
height: 0
--- !u!114 &4
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 49ad58bc1dec884458b12f6731fc091c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Parent: {fileID: 2}
m_Children: []
m_UIPosition: {x: 289, y: 93}
m_UICollapsed: 0
m_UISuperCollapsed: 0
m_InputSlots:
- {fileID: 5}
- {fileID: 6}
- {fileID: 9}
m_OutputSlots:
- {fileID: 10}
--- !u!114 &5
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 70a331b1d86cc8d4aa106ccbe0da5852, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Parent: {fileID: 0}
m_Children: []
m_UIPosition: {x: 0, y: 0}
m_UICollapsed: 1
m_UISuperCollapsed: 0
m_MasterSlot: {fileID: 5}
m_MasterData:
m_Owner: {fileID: 4}
m_Value:
m_Type:
m_SerializableType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
m_SerializableObject:
m_Space: 2147483647
m_Property:
name: texture
m_serializedType:
m_SerializableType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
attributes:
- m_Type: 3
m_Min: -Infinity
m_Max: Infinity
m_Tooltip: The texture to sample from.
m_Regex:
m_RegexMaxLength: 0
m_Direction: 0
m_LinkedSlots:
- {fileID: 16}
--- !u!114 &6
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1b2b751071c7fc14f9fa503163991826, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Parent: {fileID: 0}
m_Children:
- {fileID: 7}
- {fileID: 8}
m_UIPosition: {x: 0, y: 0}
m_UICollapsed: 1
m_UISuperCollapsed: 0
m_MasterSlot: {fileID: 6}
m_MasterData:
m_Owner: {fileID: 4}
m_Value:
m_Type:
m_SerializableType: UnityEngine.Vector2, UnityEngine.CoreModule, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
m_SerializableObject: '{"x":0.0,"y":0.0}'
m_Space: 2147483647
m_Property:
name: uv
m_serializedType:
m_SerializableType: UnityEngine.Vector2, UnityEngine.CoreModule, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
attributes:
- m_Type: 3
m_Min: -Infinity
m_Max: Infinity
m_Tooltip: The texture coordinate used for the sampling.
m_Regex:
m_RegexMaxLength: 0
m_Direction: 0
m_LinkedSlots:
- {fileID: 18}
--- !u!114 &7
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Parent: {fileID: 6}
m_Children: []
m_UIPosition: {x: 0, y: 0}
m_UICollapsed: 1
m_UISuperCollapsed: 0
m_MasterSlot: {fileID: 6}
m_MasterData:
m_Owner: {fileID: 0}
m_Value:
m_Type:
m_SerializableType:
m_SerializableObject:
m_Space: 2147483647
m_Property:
name: x
m_serializedType:
m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
attributes: []
m_Direction: 0
m_LinkedSlots: []
--- !u!114 &8
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Parent: {fileID: 6}
m_Children: []
m_UIPosition: {x: 0, y: 0}
m_UICollapsed: 1
m_UISuperCollapsed: 0
m_MasterSlot: {fileID: 6}
m_MasterData:
m_Owner: {fileID: 0}
m_Value:
m_Type:
m_SerializableType:
m_SerializableObject:
m_Space: 2147483647
m_Property:
name: y
m_serializedType:
m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
attributes: []
m_Direction: 0
m_LinkedSlots: []
--- !u!114 &9
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Parent: {fileID: 0}
m_Children: []
m_UIPosition: {x: 0, y: 0}
m_UICollapsed: 1
m_UISuperCollapsed: 0
m_MasterSlot: {fileID: 9}
m_MasterData:
m_Owner: {fileID: 4}
m_Value:
m_Type:
m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
m_SerializableObject: 0
m_Space: 2147483647
m_Property:
name: mipLevel
m_serializedType:
m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
attributes:
- m_Type: 1
m_Min: 0
m_Max: Infinity
m_Tooltip:
m_Regex:
m_RegexMaxLength: 0
- m_Type: 3
m_Min: -Infinity
m_Max: Infinity
m_Tooltip: The mip level to sample from.
m_Regex:
m_RegexMaxLength: 0
m_Direction: 0
m_LinkedSlots: []
--- !u!114 &10
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c499060cea9bbb24b8d723eafa343303, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Parent: {fileID: 0}
m_Children:
- {fileID: 11}
- {fileID: 12}
- {fileID: 13}
- {fileID: 14}
m_UIPosition: {x: 0, y: 0}
m_UICollapsed: 0
m_UISuperCollapsed: 0
m_MasterSlot: {fileID: 10}
m_MasterData:
m_Owner: {fileID: 4}
m_Value:
m_Type:
m_SerializableType: UnityEngine.Vector4, UnityEngine.CoreModule, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
m_SerializableObject: '{"x":0.0,"y":0.0,"z":0.0,"w":0.0}'
m_Space: 2147483647
m_Property:
name: s
m_serializedType:
m_SerializableType: UnityEngine.Vector4, UnityEngine.CoreModule, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
attributes: []
m_Direction: 1
m_LinkedSlots: []
--- !u!114 &11
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Parent: {fileID: 10}
m_Children: []
m_UIPosition: {x: 0, y: 0}
m_UICollapsed: 1
m_UISuperCollapsed: 0
m_MasterSlot: {fileID: 10}
m_MasterData:
m_Owner: {fileID: 0}
m_Value:
m_Type:
m_SerializableType:
m_SerializableObject:
m_Space: 2147483647
m_Property:
name: x
m_serializedType:
m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
attributes: []
m_Direction: 1
m_LinkedSlots: []
--- !u!114 &12
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Parent: {fileID: 10}
m_Children: []
m_UIPosition: {x: 0, y: 0}
m_UICollapsed: 1
m_UISuperCollapsed: 0
m_MasterSlot: {fileID: 10}
m_MasterData:
m_Owner: {fileID: 0}
m_Value:
m_Type:
m_SerializableType:
m_SerializableObject:
m_Space: 2147483647
m_Property:
name: y
m_serializedType:
m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
attributes: []
m_Direction: 1
m_LinkedSlots: []
--- !u!114 &13
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Parent: {fileID: 10}
m_Children: []
m_UIPosition: {x: 0, y: 0}
m_UICollapsed: 1
m_UISuperCollapsed: 0
m_MasterSlot: {fileID: 10}
m_MasterData:
m_Owner: {fileID: 0}
m_Value:
m_Type:
m_SerializableType:
m_SerializableObject:
m_Space: 2147483647
m_Property:
name: z
m_serializedType:
m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
attributes: []
m_Direction: 1
m_LinkedSlots: []
--- !u!114 &14
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Parent: {fileID: 10}
m_Children: []
m_UIPosition: {x: 0, y: 0}
m_UICollapsed: 1
m_UISuperCollapsed: 0
m_MasterSlot: {fileID: 10}
m_MasterData:
m_Owner: {fileID: 0}
m_Value:
m_Type:
m_SerializableType:
m_SerializableObject:
m_Space: 2147483647
m_Property:
name: w
m_serializedType:
m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
attributes: []
m_Direction: 1
m_LinkedSlots: []
--- !u!114 &15
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 330e0fca1717dde4aaa144f48232aa64, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Parent: {fileID: 2}
m_Children: []
m_UIPosition: {x: 0, y: 0}
m_UICollapsed: 1
m_UISuperCollapsed: 0
m_InputSlots: []
m_OutputSlots:
- {fileID: 16}
m_ExposedName: DepthImage
m_Exposed: 1
m_Order: 0
m_Category:
m_Min:
m_Type:
m_SerializableType:
m_SerializableObject:
m_Max:
m_Type:
m_SerializableType:
m_SerializableObject:
m_IsOutput: 0
m_Tooltip:
m_Nodes:
- m_Id: 0
linkedSlots:
- outputSlot: {fileID: 16}
inputSlot: {fileID: 5}
position: {x: 89, y: 93}
expandedSlots: []
expanded: 0
--- !u!114 &16
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 70a331b1d86cc8d4aa106ccbe0da5852, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Parent: {fileID: 0}
m_Children: []
m_UIPosition: {x: 0, y: 0}
m_UICollapsed: 1
m_UISuperCollapsed: 0
m_MasterSlot: {fileID: 16}
m_MasterData:
m_Owner: {fileID: 15}
m_Value:
m_Type:
m_SerializableType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
m_SerializableObject: '{"obj":{"fileID":2800000,"guid":"276d9e395ae18fe40a9b4988549f2349","type":3}}'
m_Space: 2147483647
m_Property:
name: o
m_serializedType:
m_SerializableType: UnityEngine.Texture2D, UnityEngine.CoreModule, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
attributes: []
m_Direction: 1
m_LinkedSlots:
- {fileID: 5}
--- !u!114 &17
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 330e0fca1717dde4aaa144f48232aa64, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Parent: {fileID: 2}
m_Children: []
m_UIPosition: {x: 0, y: 0}
m_UICollapsed: 1
m_UISuperCollapsed: 0
m_InputSlots: []
m_OutputSlots:
- {fileID: 18}
m_ExposedName: uv
m_Exposed: 1
m_Order: 1
m_Category:
m_Min:
m_Type:
m_SerializableType:
m_SerializableObject:
m_Max:
m_Type:
m_SerializableType:
m_SerializableObject:
m_IsOutput: 0
m_Tooltip:
m_Nodes:
- m_Id: 0
linkedSlots:
- outputSlot: {fileID: 18}
inputSlot: {fileID: 6}
position: {x: 89, y: 125}
expandedSlots: []
expanded: 0
--- !u!114 &18
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1b2b751071c7fc14f9fa503163991826, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Parent: {fileID: 0}
m_Children:
- {fileID: 19}
- {fileID: 20}
m_UIPosition: {x: 0, y: 0}
m_UICollapsed: 1
m_UISuperCollapsed: 0
m_MasterSlot: {fileID: 18}
m_MasterData:
m_Owner: {fileID: 17}
m_Value:
m_Type:
m_SerializableType: UnityEngine.Vector2, UnityEngine.CoreModule, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
m_SerializableObject:
m_Space: 2147483647
m_Property:
name: o
m_serializedType:
m_SerializableType: UnityEngine.Vector2, UnityEngine.CoreModule, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
attributes: []
m_Direction: 1
m_LinkedSlots:
- {fileID: 6}
--- !u!114 &19
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Parent: {fileID: 18}
m_Children: []
m_UIPosition: {x: 0, y: 0}
m_UICollapsed: 1
m_UISuperCollapsed: 0
m_MasterSlot: {fileID: 18}
m_MasterData:
m_Owner: {fileID: 0}
m_Value:
m_Type:
m_SerializableType:
m_SerializableObject:
m_Space: 2147483647
m_Property:
name: x
m_serializedType:
m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
attributes: []
m_Direction: 1
m_LinkedSlots: []
--- !u!114 &20
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f780aa281814f9842a7c076d436932e7, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Parent: {fileID: 18}
m_Children: []
m_UIPosition: {x: 0, y: 0}
m_UICollapsed: 1
m_UISuperCollapsed: 0
m_MasterSlot: {fileID: 18}
m_MasterData:
m_Owner: {fileID: 0}
m_Value:
m_Type:
m_SerializableType:
m_SerializableObject:
m_Space: 2147483647
m_Property:
name: y
m_serializedType:
m_SerializableType: System.Single, mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
attributes: []
m_Direction: 1
m_LinkedSlots: []

View file

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 0bbfee71185b44647989dc8f4595b36f
VisualEffectImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -635,59 +635,61 @@ VisualEffectResource:
m_ShaderSources:
- compute: 1
name: '[System 1]Initialize'
source: "#pragma kernel CSMain\n#define NB_THREADS_PER_GROUP 64\n#define VFX_USE_VELOCITY_CURRENT
source: "#pragma kernel CSMain\r\n#define NB_THREADS_PER_GROUP 64\n#define VFX_USE_VELOCITY_CURRENT
1\n#define VFX_USE_SEED_CURRENT 1\n#define VFX_USE_LIFETIME_CURRENT 1\n#define
VFX_USE_ANGLEZ_CURRENT 1\n#define VFX_USE_TEXINDEX_CURRENT 1\n#define VFX_USE_POSITION_CURRENT
1\n#define VFX_USE_ALIVE_CURRENT 1\n#define VFX_USE_AGE_CURRENT 1\n#define VFX_LOCAL_SPACE
1\n#include \"Packages/com.unity.visualeffectgraph/Shaders/RenderPipeline/HDRP/VFXDefines.hlsl\"\n\n\n\n#include
1\n#include \"Packages/com.unity.visualeffectgraph/Shaders/RenderPipeline/HDRP/VFXDefines.hlsl\"\n\n\r\n\r\n#include
\"Packages/com.unity.visualeffectgraph/Shaders/Common/VFXCommonCompute.cginc\"\n#include
\"Packages/com.unity.visualeffectgraph/Shaders/VFXCommon.cginc\"\n\n\n\nRWByteAddressBuffer
attributeBuffer;\nByteAddressBuffer sourceAttributeBuffer;\n\nCBUFFER_START(initParams)\n#if
!VFX_USE_SPAWNER_FROM_GPU\n uint nbSpawned;\t\t\t\t\t// Numbers of particle
spawned\n uint spawnIndex;\t\t\t\t// Index of the first particle spawned\n
\ uint dispatchWidth;\n#else\n uint offsetInAdditionalOutput;\n\tuint nbMax;\n#endif\n\tuint
systemSeed;\nCBUFFER_END\n\n#if VFX_USE_ALIVE_CURRENT\nRWStructuredBuffer<uint>
deadListIn;\nByteAddressBuffer deadListCount; // This is bad to use a SRV to
fetch deadList count but Unity API currently prevent from copying to CB\n#endif\n\n#if
VFX_USE_SPAWNER_FROM_GPU\nStructuredBuffer<uint> eventList;\nByteAddressBuffer
inputAdditional;\n#endif\n\nvoid SetAttribute_E6295C0(inout float3 velocity,
\"Packages/com.unity.visualeffectgraph/Shaders/VFXCommon.cginc\"\n\n\r\n\r\nRWByteAddressBuffer
attributeBuffer;\r\nByteAddressBuffer sourceAttributeBuffer;\r\n\r\nCBUFFER_START(initParams)\r\n#if
!VFX_USE_SPAWNER_FROM_GPU\r\n uint nbSpawned;\t\t\t\t\t// Numbers of particle
spawned\r\n uint spawnIndex;\t\t\t\t// Index of the first particle spawned\r\n
\ uint dispatchWidth;\r\n#else\r\n uint offsetInAdditionalOutput;\r\n\tuint
nbMax;\r\n#endif\r\n\tuint systemSeed;\r\nCBUFFER_END\r\n\r\n#if VFX_USE_ALIVE_CURRENT\r\nRWStructuredBuffer<uint>
deadListIn;\r\nByteAddressBuffer deadListCount; // This is bad to use a SRV
to fetch deadList count but Unity API currently prevent from copying to CB\r\n#endif\r\n\r\n#if
VFX_USE_SPAWNER_FROM_GPU\r\nStructuredBuffer<uint> eventList;\r\nByteAddressBuffer
inputAdditional;\r\n#endif\r\n\r\nvoid SetAttribute_E6295C0(inout float3 velocity,
inout uint seed, float3 A, float3 B) /*attribute:velocity Composition:Overwrite
Source:Slot Random:PerComponent channels:XYZ */\n{\n velocity = lerp(A,B,RAND3);\n}\nvoid
SetAttribute_F01429A3(inout float lifetime, inout uint seed, float A, float
B) /*attribute:lifetime Composition:Overwrite Source:Slot Random:Uniform channels:XYZ
*/\n{\n lifetime = lerp(A,B,RAND);\n}\nvoid SetAttribute_48A7BD6E(inout float
angleZ, inout uint seed, float A, float B) /*attribute:angle Composition:Overwrite
Source:Slot Random:PerComponent channels:Z */\n{\n angleZ = lerp(A.x,B.x,RAND);\n}\n\n\n\n[numthreads(NB_THREADS_PER_GROUP,1,1)]\nvoid
CSMain(uint3 groupId : SV_GroupID,\n uint3 groupThreadId
\ : SV_GroupThreadID)\n{\n uint id = groupThreadId.x + groupId.x * NB_THREADS_PER_GROUP;\n#if
!VFX_USE_SPAWNER_FROM_GPU\n id += groupId.y * dispatchWidth * NB_THREADS_PER_GROUP;\n#endif\n\n#if
VFX_USE_SPAWNER_FROM_GPU\n uint maxThreadId = inputAdditional.Load((offsetInAdditionalOutput
* 2 + 0) << 2);\n uint currentSpawnIndex = inputAdditional.Load((offsetInAdditionalOutput
* 2 + 1) << 2) - maxThreadId;\n#else\n uint maxThreadId = nbSpawned;\n uint
currentSpawnIndex = spawnIndex;\n#endif\n\n#if VFX_USE_ALIVE_CURRENT\n maxThreadId
= min(maxThreadId, deadListCount.Load(0x0));\n#elif VFX_USE_SPAWNER_FROM_GPU\n
Source:Slot Random:PerComponent channels:Z */\n{\n angleZ = lerp(A.x,B.x,RAND);\n}\n\n\r\n\r\n[numthreads(NB_THREADS_PER_GROUP,1,1)]\r\nvoid
CSMain(uint3 groupId : SV_GroupID,\r\n uint3 groupThreadId
\ : SV_GroupThreadID)\r\n{\r\n uint id = groupThreadId.x + groupId.x *
NB_THREADS_PER_GROUP;\r\n#if !VFX_USE_SPAWNER_FROM_GPU\r\n id += groupId.y
* dispatchWidth * NB_THREADS_PER_GROUP;\r\n#endif\r\n\r\n#if VFX_USE_SPAWNER_FROM_GPU\r\n
\ uint maxThreadId = inputAdditional.Load((offsetInAdditionalOutput * 2 +
0) << 2);\r\n uint currentSpawnIndex = inputAdditional.Load((offsetInAdditionalOutput
* 2 + 1) << 2) - maxThreadId;\r\n#else\r\n uint maxThreadId = nbSpawned;\r\n
\ uint currentSpawnIndex = spawnIndex;\r\n#endif\r\n\r\n#if VFX_USE_ALIVE_CURRENT\r\n
\ maxThreadId = min(maxThreadId, deadListCount.Load(0x0));\r\n#elif VFX_USE_SPAWNER_FROM_GPU\r\n
\ maxThreadId = min(maxThreadId, nbMax); //otherwise, nbSpawned already clamped
on CPU\n#endif\n\n if (id < maxThreadId)\n {\n#if VFX_USE_SPAWNER_FROM_GPU\n
\ int sourceIndex = eventList[id];\n#endif\n uint particleIndex
= id + currentSpawnIndex;\n\t\t\n#if !VFX_USE_SPAWNER_FROM_GPU\n int
on CPU\r\n#endif\r\n\r\n if (id < maxThreadId)\r\n {\r\n#if VFX_USE_SPAWNER_FROM_GPU\r\n
\ int sourceIndex = eventList[id];\r\n#endif\r\n uint particleIndex
= id + currentSpawnIndex;\r\n\t\t\r\n#if !VFX_USE_SPAWNER_FROM_GPU\r\n int
sourceIndex = 0;\n /*//Loop with 1 iteration generate a wrong IL Assembly
(and actually, useless code)\n uint currentSumSpawnCount = 0u;\n for
(sourceIndex=0; sourceIndex<1; sourceIndex++)\n {\n currentSumSpawnCount
+= uint(asfloat(sourceAttributeBuffer.Load((sourceIndex * 0x1 + 0x0) << 2)));\n
\ if (id < currentSumSpawnCount)\n {\n break;\n
\ }\n }\n */\n \n\n#endif\n float3 velocity
= float3(0,0,0);\n uint seed = (uint)0;\n float lifetime = (float)1;\n
\ float angleZ = (float)0;\n float texIndex = (float)0;\n float3
position = float3(0,0,0);\n bool alive = (bool)true;\n float age
= (float)0;\n \n\n#if VFX_USE_PARTICLEID_CURRENT\n particleId
= particleIndex;\n#endif\n#if VFX_USE_SEED_CURRENT\n seed = WangHash(particleIndex
^ systemSeed);\n#endif\n \n {\n SetAttribute_E6295C0(
/*inout */velocity, /*inout */seed, float3(-0.333,0.8,-0.333), float3(0.333,1,0.333));\n
\ }\n }\n */\n \n\r\n#endif\r\n float3
velocity = float3(0, 0, 0);\n uint seed = (uint)0;\n float lifetime
= (float)1;\n float angleZ = (float)0;\n float texIndex = (float)0;\n
\ float3 position = float3(0, 0, 0);\n bool alive = (bool)true;\n
\ float age = (float)0;\n \n\r\n#if VFX_USE_PARTICLEID_CURRENT\r\n
\ particleId = particleIndex;\r\n#endif\r\n#if VFX_USE_SEED_CURRENT\r\n
\ seed = WangHash(particleIndex ^ systemSeed);\r\n#endif\r\n \r\n
\ {\n SetAttribute_E6295C0( /*inout */velocity, /*inout */seed,
float3(-0.333000004, 0.800000012, -0.333000004), float3(0.333000004, 1, 0.333000004));\n
\ }\n {\n SetAttribute_F01429A3( /*inout */lifetime,
\ /*inout */seed, (float)6, (float)12);\n }\n {\n SetAttribute_48A7BD6E(
/*inout */angleZ, /*inout */seed, (float)0, (float)360);\n }\n \n\n\n#if
VFX_USE_ALIVE_CURRENT\n if (alive)\n {\n\t\t\tuint deadIndex =
deadListIn.DecrementCounter();\n uint index = deadListIn[deadIndex];\n
/*inout */angleZ, /*inout */seed, (float)0, (float)360);\n }\n \n\r\n\r\n#if
VFX_USE_ALIVE_CURRENT\r\n if (alive)\r\n {\r\n\t\t\tuint deadIndex
= deadListIn.DecrementCounter();\r\n uint index = deadListIn[deadIndex];\r\n
\ attributeBuffer.Store3((index * 0x4 + 0x0) << 2,asuint(velocity));\n
\ attributeBuffer.Store((index * 0x1 + 0x100) << 2,asuint(lifetime));\n
\ attributeBuffer.Store((index * 0x1 + 0x140) << 2,asuint(angleZ));\n
@ -695,89 +697,91 @@ VisualEffectResource:
\ attributeBuffer.Store3((index * 0x4 + 0x240) << 2,asuint(position));\n
\ attributeBuffer.Store((index * 0x3 + 0x181) << 2,uint(alive));\n
\ attributeBuffer.Store((index * 0x3 + 0x182) << 2,asuint(age));\n
\ \n\n }\n#else\n uint index = particleIndex;\n attributeBuffer.Store3((index
* 0x4 + 0x0) << 2,asuint(velocity));\n attributeBuffer.Store((index *
0x1 + 0x100) << 2,asuint(lifetime));\n attributeBuffer.Store((index *
0x1 + 0x140) << 2,asuint(angleZ));\n attributeBuffer.Store((index * 0x3
+ 0x180) << 2,asuint(texIndex));\n attributeBuffer.Store3((index * 0x4
+ 0x240) << 2,asuint(position));\n attributeBuffer.Store((index * 0x3
+ 0x181) << 2,uint(alive));\n attributeBuffer.Store((index * 0x3 + 0x182)
<< 2,asuint(age));\n \n\n#endif\n }\n}\n"
\ \n\r\n }\r\n#else\r\n uint index = particleIndex;\r\n
\ attributeBuffer.Store3((index * 0x4 + 0x0) << 2,asuint(velocity));\n
\ attributeBuffer.Store((index * 0x1 + 0x100) << 2,asuint(lifetime));\n
\ attributeBuffer.Store((index * 0x1 + 0x140) << 2,asuint(angleZ));\n
\ attributeBuffer.Store((index * 0x3 + 0x180) << 2,asuint(texIndex));\n
\ attributeBuffer.Store3((index * 0x4 + 0x240) << 2,asuint(position));\n
\ attributeBuffer.Store((index * 0x3 + 0x181) << 2,uint(alive));\n attributeBuffer.Store((index
* 0x3 + 0x182) << 2,asuint(age));\n \n\r\n#endif\r\n }\r\n}\r\n"
- compute: 1
name: '[System 1]Update'
source: "#pragma kernel CSMain\n#define NB_THREADS_PER_GROUP 64\n#define VFX_USE_VELOCITY_CURRENT
source: "#pragma kernel CSMain\r\n#define NB_THREADS_PER_GROUP 64\n#define VFX_USE_VELOCITY_CURRENT
1\n#define VFX_USE_LIFETIME_CURRENT 1\n#define VFX_USE_TEXINDEX_CURRENT 1\n#define
VFX_USE_MASS_CURRENT 1\n#define VFX_USE_SIZE_CURRENT 1\n#define VFX_USE_SCALEX_CURRENT
1\n#define VFX_USE_SCALEY_CURRENT 1\n#define VFX_USE_POSITION_CURRENT 1\n#define
VFX_USE_ALIVE_CURRENT 1\n#define VFX_USE_AGE_CURRENT 1\n#define VFX_HAS_INDIRECT_DRAW
1\n#define VFX_LOCAL_SPACE 1\n#include \"Packages/com.unity.visualeffectgraph/Shaders/RenderPipeline/HDRP/VFXDefines.hlsl\"\n\n\nCBUFFER_START(parameters)\n
\ float FrameRate_a;\n float deltaTime_a;\n uint2 PADDING_0;\nCBUFFER_END\n\n\n#include
1\n#define VFX_LOCAL_SPACE 1\n#include \"Packages/com.unity.visualeffectgraph/Shaders/RenderPipeline/HDRP/VFXDefines.hlsl\"\n\n\r\nCBUFFER_START(parameters)\n
\ float FrameRate_a;\n float deltaTime_a;\n uint2 PADDING_0;\nCBUFFER_END\n\n\r\n#include
\"Packages/com.unity.visualeffectgraph/Shaders/Common/VFXCommonCompute.cginc\"\n#include
\"Packages/com.unity.visualeffectgraph/Shaders/VFXCommon.cginc\"\n\n\n\nRWByteAddressBuffer
attributeBuffer;\n\n#if VFX_USE_ALIVE_CURRENT\nRWStructuredBuffer<uint> deadListOut;\n#endif\n\n#if
VFX_HAS_INDIRECT_DRAW\nRWStructuredBuffer<uint> indirectBuffer;\n#endif\n\nCBUFFER_START(updateParams)\n
\ uint nbMax;\n\tuint dispatchWidth;\n\tuint systemSeed;\nCBUFFER_END\n\nvoid
FlipbookPlay_0(inout float texIndex, float FrameRate, float deltaTime) /*mode:Constant
*/\n{\n texIndex += FrameRate * deltaTime;\n}\nvoid Force_1(inout float3
velocity, float mass, float3 Velocity, float Drag, float deltaTime) /*Mode:Relative
*/\n{\n velocity += (Velocity - velocity) * min(1.0f,Drag * deltaTime / mass);\n}\nvoid
Drag_1(inout float3 velocity, float mass, float size, float scaleX, float scaleY,
float dragCoefficient, float deltaTime) /*UseParticleSize:True */\n{\n \n
\ float2 side = size * (scaleX, scaleY);\n dragCoefficient *= side.x *
side.y;\n velocity *= max(0.0,(1.0 - (dragCoefficient * deltaTime) / mass));\n}\nvoid
EulerIntegration(inout float3 position, float3 velocity, float deltaTime)\n{\n
\ position += velocity * deltaTime;\n}\nvoid Age(inout float age, float deltaTime)\n{\n
\ age += deltaTime;\n}\nvoid Reap(float age, float lifetime, inout bool alive)\n{\n
\ if(age > lifetime) { alive = false; }\n}\n\n\n\n[numthreads(NB_THREADS_PER_GROUP,1,1)]\nvoid
CSMain(uint3 groupId : SV_GroupID,\n uint3 groupThreadId
\ : SV_GroupThreadID)\n{\n\tuint id = groupThreadId.x + groupId.x * NB_THREADS_PER_GROUP
+ groupId.y * dispatchWidth * NB_THREADS_PER_GROUP;\n\tuint index = id;\n\tif
(id < nbMax)\n\t{\n#if VFX_USE_ALIVE_CURRENT\n\t\tbool alive = (attributeBuffer.Load((index
* 0x3 + 0x181) << 2));\n\t\t\n\n\t\tif (alive)\n\t\t{\n\t\t\tfloat3 velocity
\"Packages/com.unity.visualeffectgraph/Shaders/VFXCommon.cginc\"\n\n\r\n\r\nRWByteAddressBuffer
attributeBuffer;\r\n\r\n#if VFX_USE_ALIVE_CURRENT\r\nRWStructuredBuffer<uint>
deadListOut;\r\n#endif\r\n\r\n#if VFX_HAS_INDIRECT_DRAW\r\nRWStructuredBuffer<uint>
indirectBuffer;\r\n#endif\r\n\r\nCBUFFER_START(updateParams)\r\n uint nbMax;\r\n\tuint
dispatchWidth;\r\n\tuint systemSeed;\r\nCBUFFER_END\r\n\r\nvoid FlipbookPlay_0(inout
float texIndex, float FrameRate, float deltaTime) /*mode:Constant */\n{\n texIndex
+= FrameRate * deltaTime;\n}\nvoid Force_1(inout float3 velocity, float mass,
float3 Velocity, float Drag, float deltaTime) /*Mode:Relative */\n{\n velocity
+= (Velocity - velocity) * min(1.0f,Drag * deltaTime / mass);\n}\nvoid Drag_1(inout
float3 velocity, float mass, float size, float scaleX, float scaleY, float dragCoefficient,
float deltaTime) /*UseParticleSize:True */\n{\n \n float2 side = size
* (scaleX, scaleY);\n dragCoefficient *= side.x * side.y;\n velocity *=
max(0.0,(1.0 - (dragCoefficient * deltaTime) / mass));\n}\nvoid EulerIntegration(inout
float3 position, float3 velocity, float deltaTime)\n{\n position += velocity
* deltaTime;\n}\nvoid Age(inout float age, float deltaTime)\n{\n age += deltaTime;\n}\nvoid
Reap(float age, float lifetime, inout bool alive)\n{\n if(age > lifetime)
{ alive = false; }\n}\n\n\r\n\r\n[numthreads(NB_THREADS_PER_GROUP,1,1)]\r\nvoid
CSMain(uint3 groupId : SV_GroupID,\r\n uint3 groupThreadId
\ : SV_GroupThreadID)\r\n{\r\n\tuint id = groupThreadId.x + groupId.x * NB_THREADS_PER_GROUP
+ groupId.y * dispatchWidth * NB_THREADS_PER_GROUP;\r\n\tuint index = id;\r\n\tif
(id < nbMax)\r\n\t{\r\n#if VFX_USE_ALIVE_CURRENT\r\n\t\tbool alive = (attributeBuffer.Load((index
* 0x3 + 0x181) << 2));\n\t\t\n\r\n\t\tif (alive)\r\n\t\t{\r\n\t\t\tfloat3 velocity
= asfloat(attributeBuffer.Load3((index * 0x4 + 0x0) << 2));\n\t\t\tfloat lifetime
= asfloat(attributeBuffer.Load((index * 0x1 + 0x100) << 2));\n\t\t\tfloat texIndex
= asfloat(attributeBuffer.Load((index * 0x3 + 0x180) << 2));\n\t\t\tfloat mass
= (float)1;\n\t\t\tfloat size = (float)0.1;\n\t\t\tfloat scaleX = (float)1;\n\t\t\tfloat
= (float)1;\n\t\t\tfloat size = (float)0.100000001;\n\t\t\tfloat scaleX = (float)1;\n\t\t\tfloat
scaleY = (float)1;\n\t\t\tfloat3 position = asfloat(attributeBuffer.Load3((index
* 0x4 + 0x240) << 2));\n\t\t\tfloat age = asfloat(attributeBuffer.Load((index
* 0x3 + 0x182) << 2));\n\t\t\t\n\n\t\t\t\n#if VFX_USE_OLDPOSITION_CURRENT\n\t\t\toldPosition
= position;\n#endif\n\t\t\t\n\t\t\tFlipbookPlay_0( /*inout */texIndex, FrameRate_a,
deltaTime_a);\n\t\t\t{\n\t\t\t Force_1( /*inout */velocity, mass, float3(-0.2,0.8,0),
(float)1, deltaTime_a);\n\t\t\t}\n\t\t\t{\n\t\t\t Drag_1( /*inout */velocity,
mass, size, scaleX, scaleY, (float)0.1, deltaTime_a);\n\t\t\t}\n\t\t\tEulerIntegration(
/*inout */position, velocity, deltaTime_a);\n\t\t\tAge( /*inout */age, deltaTime_a);\n\t\t\tReap(age,
lifetime, /*inout */alive);\n\t\t\t\n\n\t\t\tif (alive)\n\t\t\t{\n\t\t\t\tattributeBuffer.Store3((index
* 0x3 + 0x182) << 2));\n\t\t\t\n\r\n\t\t\t\r\n#if VFX_USE_OLDPOSITION_CURRENT\r\n\t\t\toldPosition
= position;\r\n#endif\r\n\t\t\t\r\n\t\t\tFlipbookPlay_0( /*inout */texIndex,
FrameRate_a, deltaTime_a);\n\t\t\t{\n\t\t\t Force_1( /*inout */velocity,
mass, float3(-0.200000003, 0.800000012, 0), (float)1, deltaTime_a);\n\t\t\t}\n\t\t\t{\n\t\t\t
\ Drag_1( /*inout */velocity, mass, size, scaleX, scaleY, (float)0.100000001,
deltaTime_a);\n\t\t\t}\n\t\t\tEulerIntegration( /*inout */position, velocity,
deltaTime_a);\n\t\t\tAge( /*inout */age, deltaTime_a);\n\t\t\tReap(age, lifetime,
\ /*inout */alive);\n\t\t\t\n\r\n\t\t\tif (alive)\r\n\t\t\t{\r\n\t\t\t\tattributeBuffer.Store3((index
* 0x4 + 0x0) << 2,asuint(velocity));\n\t\t\t\tattributeBuffer.Store((index *
0x3 + 0x180) << 2,asuint(texIndex));\n\t\t\t\tattributeBuffer.Store3((index
* 0x4 + 0x240) << 2,asuint(position));\n\t\t\t\tattributeBuffer.Store((index
* 0x3 + 0x182) << 2,asuint(age));\n\t\t\t\t\n\n#if VFX_HAS_INDIRECT_DRAW\n uint
indirectIndex = indirectBuffer.IncrementCounter();\n\t\t\t\tindirectBuffer[indirectIndex]
= index;\n#endif\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tattributeBuffer.Store((index
* 0x3 + 0x181) << 2,uint(alive));\n\t\t\t\t\n\n\t\t\t\tuint deadIndex = deadListOut.IncrementCounter();\n\t\t\t\tdeadListOut[deadIndex]
= index;\n\t\t\t}\n\t\t}\n#else\n\t\tfloat3 velocity = asfloat(attributeBuffer.Load3((index
* 0x3 + 0x182) << 2,asuint(age));\n\t\t\t\t\n\r\n#if VFX_HAS_INDIRECT_DRAW\r\n
\ uint indirectIndex = indirectBuffer.IncrementCounter();\r\n\t\t\t\tindirectBuffer[indirectIndex]
= index;\r\n#endif\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tattributeBuffer.Store((index
* 0x3 + 0x181) << 2,uint(alive));\n\t\t\t\t\n\r\n\t\t\t\tuint deadIndex = deadListOut.IncrementCounter();\r\n\t\t\t\tdeadListOut[deadIndex]
= index;\r\n\t\t\t}\r\n\t\t}\r\n#else\r\n\t\tfloat3 velocity = asfloat(attributeBuffer.Load3((index
* 0x4 + 0x0) << 2));\n\t\tfloat lifetime = asfloat(attributeBuffer.Load((index
* 0x1 + 0x100) << 2));\n\t\tfloat texIndex = asfloat(attributeBuffer.Load((index
* 0x3 + 0x180) << 2));\n\t\tfloat mass = (float)1;\n\t\tfloat size = (float)0.1;\n\t\tfloat
* 0x3 + 0x180) << 2));\n\t\tfloat mass = (float)1;\n\t\tfloat size = (float)0.100000001;\n\t\tfloat
scaleX = (float)1;\n\t\tfloat scaleY = (float)1;\n\t\tfloat3 position = asfloat(attributeBuffer.Load3((index
* 0x4 + 0x240) << 2));\n\t\tbool alive = (attributeBuffer.Load((index * 0x3
+ 0x181) << 2));\n\t\tfloat age = asfloat(attributeBuffer.Load((index * 0x3
+ 0x182) << 2));\n\t\t\n\n\t\t\n#if VFX_USE_OLDPOSITION_CURRENT\n\t\toldPosition
= position;\n#endif\n\t\t\n\t\tFlipbookPlay_0( /*inout */texIndex, FrameRate_a,
deltaTime_a);\n\t\t{\n\t\t Force_1( /*inout */velocity, mass, float3(-0.2,0.8,0),
(float)1, deltaTime_a);\n\t\t}\n\t\t{\n\t\t Drag_1( /*inout */velocity, mass,
size, scaleX, scaleY, (float)0.1, deltaTime_a);\n\t\t}\n\t\tEulerIntegration(
+ 0x182) << 2));\n\t\t\n\r\n\t\t\r\n#if VFX_USE_OLDPOSITION_CURRENT\r\n\t\toldPosition
= position;\r\n#endif\r\n\t\t\r\n\t\tFlipbookPlay_0( /*inout */texIndex, FrameRate_a,
deltaTime_a);\n\t\t{\n\t\t Force_1( /*inout */velocity, mass, float3(-0.200000003,
0.800000012, 0), (float)1, deltaTime_a);\n\t\t}\n\t\t{\n\t\t Drag_1( /*inout
*/velocity, mass, size, scaleX, scaleY, (float)0.100000001, deltaTime_a);\n\t\t}\n\t\tEulerIntegration(
/*inout */position, velocity, deltaTime_a);\n\t\tAge( /*inout */age, deltaTime_a);\n\t\tReap(age,
lifetime, /*inout */alive);\n\t\t\n\n\t\tattributeBuffer.Store3((index * 0x4
+ 0x0) << 2,asuint(velocity));\n\t\tattributeBuffer.Store((index * 0x3 + 0x180)
<< 2,asuint(texIndex));\n\t\tattributeBuffer.Store3((index * 0x4 + 0x240) <<
2,asuint(position));\n\t\tattributeBuffer.Store((index * 0x3 + 0x181) << 2,uint(alive));\n\t\tattributeBuffer.Store((index
* 0x3 + 0x182) << 2,asuint(age));\n\t\t\n\n#if VFX_HAS_INDIRECT_DRAW\n uint
indirectIndex = indirectBuffer.IncrementCounter();\n\t\tindirectBuffer[indirectIndex]
= index;\n#endif\n#endif\n\t}\n}\n"
lifetime, /*inout */alive);\n\t\t\n\r\n\t\tattributeBuffer.Store3((index *
0x4 + 0x0) << 2,asuint(velocity));\n\t\tattributeBuffer.Store((index * 0x3 +
0x180) << 2,asuint(texIndex));\n\t\tattributeBuffer.Store3((index * 0x4 + 0x240)
<< 2,asuint(position));\n\t\tattributeBuffer.Store((index * 0x3 + 0x181) <<
2,uint(alive));\n\t\tattributeBuffer.Store((index * 0x3 + 0x182) << 2,asuint(age));\n\t\t\n\r\n#if
VFX_HAS_INDIRECT_DRAW\r\n uint indirectIndex = indirectBuffer.IncrementCounter();\r\n\t\tindirectBuffer[indirectIndex]
= index;\r\n#endif\r\n#endif\r\n\t}\r\n}\r\n"
- compute: 0
name: '[System 1]Lit Quad Output'
source: "Shader \"Hidden/VFX/System 1/Lit Quad Output\"\n{\n\tSubShader\n\t{\t\n\t\tCull
Off\n\t\t\n\t\tTags { \"Queue\"=\"Transparent+0\" \"IgnoreProjector\"=\"True\"
source: "Shader \"Hidden/VFX/System 1/Lit Quad Output\"\n{\r\n\tSubShader\r\n\t{\t\r\n\t\tCull
Off\r\n\t\t\r\n\t\tTags { \"Queue\"=\"Transparent+0\" \"IgnoreProjector\"=\"True\"
\"RenderType\"=\"Transparent\" }\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tBlend
One OneMinusSrcAlpha \n\t\tZTest LEqual\n\t\tZWrite Off\n\t\tCull Off\n\t\t\n\t\n\t\t\t\n\t\tHLSLINCLUDE\n\t\t#if
!defined(VFX_WORLD_SPACE) && !defined(VFX_LOCAL_SPACE)\n\t\t#define VFX_LOCAL_SPACE
@ -804,7 +808,7 @@ VisualEffectResource:
|| VFX_USE_ALPHA_CURRENT)\n\t\t\n\t\tByteAddressBuffer attributeBuffer;\t\n\t\t\n\t\t#if
VFX_HAS_INDIRECT_DRAW\n\t\tStructuredBuffer<uint> indirectBuffer;\t\n\t\t#endif\t\n\t\t\n\t\t#if
USE_DEAD_LIST_COUNT\n\t\tByteAddressBuffer deadListCount;\n\t\t#endif\n\t\t\n\t\tCBUFFER_START(outputParams)\n\t\t\tfloat
nbMax;\n\t\t\tfloat systemSeed;\n\t\tCBUFFER_END\n\t\t\n\t\tENDHLSL\n\t\t\n\n\t\t\n\t\t\n\t\t//
nbMax;\n\t\t\tfloat systemSeed;\n\t\tCBUFFER_END\n\t\t\n\t\tENDHLSL\n\t\t\n\r\n\t\t\r\n\t\t\r\n\t\t//
Forward pass\n\t\tPass\n\t\t{\t\t\n\t\t\tTags { \"LightMode\"=\"Forward\"}\n\t\t\t\t\t\n\t\t\tHLSLPROGRAM\n\t\t\t#pragma
target 4.5\n\t\t\t\n\t\t\t#define UNITY_MATERIAL_LIT\n\t\t\t#define LIGHTLOOP_TILE_PASS\n\t\t\t#define
_ENABLE_FOG_ON_TRANSPARENT\n\t\t\t#define _DISABLE_DECALS\n\t\t\t#define _BLENDMODE_ALPHA\n\t\t\t#define
@ -890,12 +894,12 @@ VisualEffectResource:
lifetime = asfloat(attributeBuffer.Load((index * 0x1 + 0x100) << 2));\n\t\t\t\t\t\tfloat
angleZ = asfloat(attributeBuffer.Load((index * 0x1 + 0x140) << 2));\n\t\t\t\t\t\tfloat
texIndex = asfloat(attributeBuffer.Load((index * 0x3 + 0x180) << 2));\n\t\t\t\t\t\tfloat
size = (float)0.1;\n\t\t\t\t\t\tfloat scaleX = (float)1;\n\t\t\t\t\t\tfloat
size = (float)0.100000001;\n\t\t\t\t\t\tfloat scaleX = (float)1;\n\t\t\t\t\t\tfloat
scaleY = (float)1;\n\t\t\t\t\t\tfloat3 position = asfloat(attributeBuffer.Load3((index
* 0x4 + 0x240) << 2));\n\t\t\t\t\t\tfloat3 color = float3(1,1,1);\n\t\t\t\t\t\tfloat
* 0x4 + 0x240) << 2));\n\t\t\t\t\t\tfloat3 color = float3(1, 1, 1);\n\t\t\t\t\t\tfloat
alpha = (float)1;\n\t\t\t\t\t\tbool alive = (attributeBuffer.Load((index * 0x3
+ 0x181) << 2));\n\t\t\t\t\t\tfloat3 axisX = float3(1,0,0);\n\t\t\t\t\t\tfloat3
axisY = float3(0,1,0);\n\t\t\t\t\t\tfloat3 axisZ = float3(0,0,1);\n\t\t\t\t\t\tfloat
+ 0x181) << 2));\n\t\t\t\t\t\tfloat3 axisX = float3(1, 0, 0);\n\t\t\t\t\t\tfloat3
axisY = float3(0, 1, 0);\n\t\t\t\t\t\tfloat3 axisZ = float3(0, 0, 1);\n\t\t\t\t\t\tfloat
angleX = (float)0;\n\t\t\t\t\t\tfloat angleY = (float)0;\n\t\t\t\t\t\tfloat
pivotX = (float)0;\n\t\t\t\t\t\tfloat pivotY = (float)0;\n\t\t\t\t\t\tfloat
pivotZ = (float)0;\n\t\t\t\t\t\tfloat scaleZ = (float)1;\n\t\t\t\t\t\tfloat
@ -905,11 +909,11 @@ VisualEffectResource:
= asfloat(attributeBuffer.Load((index * 0x1 + 0x100) << 2));\n\t\t\t\t\t\tfloat
angleZ = asfloat(attributeBuffer.Load((index * 0x1 + 0x140) << 2));\n\t\t\t\t\t\tfloat
texIndex = asfloat(attributeBuffer.Load((index * 0x3 + 0x180) << 2));\n\t\t\t\t\t\tfloat
size = (float)0.1;\n\t\t\t\t\t\tfloat scaleX = (float)1;\n\t\t\t\t\t\tfloat
size = (float)0.100000001;\n\t\t\t\t\t\tfloat scaleX = (float)1;\n\t\t\t\t\t\tfloat
scaleY = (float)1;\n\t\t\t\t\t\tfloat3 position = asfloat(attributeBuffer.Load3((index
* 0x4 + 0x240) << 2));\n\t\t\t\t\t\tfloat3 color = float3(1,1,1);\n\t\t\t\t\t\tfloat
alpha = (float)1;\n\t\t\t\t\t\tfloat3 axisX = float3(1,0,0);\n\t\t\t\t\t\tfloat3
axisY = float3(0,1,0);\n\t\t\t\t\t\tfloat3 axisZ = float3(0,0,1);\n\t\t\t\t\t\tfloat
* 0x4 + 0x240) << 2));\n\t\t\t\t\t\tfloat3 color = float3(1, 1, 1);\n\t\t\t\t\t\tfloat
alpha = (float)1;\n\t\t\t\t\t\tfloat3 axisX = float3(1, 0, 0);\n\t\t\t\t\t\tfloat3
axisY = float3(0, 1, 0);\n\t\t\t\t\t\tfloat3 axisZ = float3(0, 0, 1);\n\t\t\t\t\t\tfloat
angleX = (float)0;\n\t\t\t\t\t\tfloat angleY = (float)0;\n\t\t\t\t\t\tfloat
pivotX = (float)0;\n\t\t\t\t\t\tfloat pivotY = (float)0;\n\t\t\t\t\t\tfloat
pivotZ = (float)0;\n\t\t\t\t\t\tfloat scaleZ = (float)1;\n\t\t\t\t\t\tfloat
@ -956,9 +960,9 @@ VisualEffectResource:
= o.VFX_VARYING_UV.xy * uvScale + uvBias;\n\t\t\t\t\t\t#endif\n\t\t\t\t\t\t\n\t\t\t\t\t\t#if
defined(VFX_VARYING_POSWS)\n\t\t\t\t\t\to.VFX_VARYING_POSWS = TransformPositionVFXToWorld(vPos);\n\t\t\t\t\t\t#endif\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t#if
USE_FLIPBOOK\n\t\t\t\t\t\tfloat2 flipBookSize = (float2)0;\n\t\t\t\t\t\t{\n\t\t\t\t\t\t
\ \n\t\t\t\t\t\t flipBookSize = float2(8,8);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\tfloat2
\ \n\t\t\t\t\t\t flipBookSize = float2(8, 8);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\tfloat2
invFlipBookSize = (float2)0;\n\t\t\t\t\t\t{\n\t\t\t\t\t\t \n\t\t\t\t\t\t
\ invFlipBookSize = float2(0.125,0.125);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\tVFXUVData
\ invFlipBookSize = float2(0.125, 0.125);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\tVFXUVData
uvData = GetUVData(flipBookSize, invFlipBookSize, o.VFX_VARYING_UV.xy, texIndex);\n\t\t\t\t\t\to.VFX_VARYING_UV.xy
= uvData.uvs.xy;\n\t\t\t\t\t\t#if USE_FLIPBOOK_INTERPOLATION\n\t\t\t\t\t\to.VFX_VARYING_UV.zw
= uvData.uvs.zw;\n\t\t\t\t\t\to.VFX_VARYING_FRAMEBLEND = uvData.blend;\n\t\t\t\t\t\t#if
@ -972,7 +976,7 @@ VisualEffectResource:
VFX_VARYING_SPECULAR\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\to.VFX_VARYING_SPECULAR
= specularColor;\n\t\t\t\t\t\t\t\t\t#endif\n\t\t\t\t\t\t\t\t\t#elif HDRP_MATERIAL_TYPE_TRANSLUCENT\n\t\t\t\t\t\t\t\t\t#ifdef
VFX_VARYING_THICKNESS\n\t\t\t\t\t\t\t\t\tfloat thickness = (float)0;\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t
\ \n\t\t\t\t\t\t\t\t\t thickness = (float)0.4706581;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\to.VFX_VARYING_THICKNESS
\ \n\t\t\t\t\t\t\t\t\t thickness = (float)0.470658094;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\to.VFX_VARYING_THICKNESS
= thickness;\n\t\t\t\t\t\t\t\t\t#endif\n\t\t\t\t\t\t\t\t\t#endif\n\t\t\t\t\t\t\t\t\t#if
USE_NORMAL_MAP\n\t\t\t\t\t\t\t\t\t#ifdef VFX_VARYING_NORMALSCALE\n\t\t\t\t\t\t\t\t\tfloat
normalScale = (float)0;\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t
@ -1026,27 +1030,28 @@ VisualEffectResource:
= 1.0f;\n\t\t\t\t\t\t\t#ifdef VFX_VARYING_NORMALSCALE\n\t\t\t\t\t\t\tnormalScale
= i.VFX_VARYING_NORMALSCALE;\n\t\t\t\t\t\t\t#endif\n\t\t\t\t\t\t\tnormalWS =
normalize(lerp(normalWS,mul(n,tbn),normalScale));\n\t\t\t\t\t\t\t#endif\n\t\t\t\t\t\t\t#endif\n\t\t\t\t\t\t\t\n\t\t\t\toutColor
= VFXGetPixelOutputForward(i,normalWS,uvData);\n\t\t\t}\n\t\t\tENDHLSL\n\t\t}\n\t\t\n\n\t\t\n\t}\n}\n"
= VFXGetPixelOutputForward(i,normalWS,uvData);\n\t\t\t}\n\t\t\tENDHLSL\n\t\t}\n\t\t\n\r\n\t\t\r\n\t}\r\n}\r\n"
- compute: 1
name: '[System 1]CameraSort'
source: "#pragma kernel CSMain\n#define NB_THREADS_PER_GROUP 64\n#define VFX_USE_POSITION_CURRENT
1\n#define USE_DEAD_LIST_COUNT 1\n#define VFX_LOCAL_SPACE 1\n#include \"Packages/com.unity.visualeffectgraph/Shaders/RenderPipeline/HDRP/VFXDefines.hlsl\"\n\n\nCBUFFER_START(parameters)\n
\ float4x4 localToWorld;\nCBUFFER_END\n\n\n#include \"Packages/com.unity.visualeffectgraph/Shaders/Common/VFXCommonCompute.cginc\"\n#include
\"Packages/com.unity.visualeffectgraph/Shaders/VFXCommon.cginc\"\n\n\n\nCBUFFER_START(params)\n
\ uint nbMax;\n uint dispatchWidth;\nCBUFFER_END\n\nCBUFFER_START(cameraParams)\n
\ float3 cameraPosition;\nCBUFFER_END\n\nByteAddressBuffer attributeBuffer;\nStructuredBuffer<uint>
inputBuffer;\n\n#if USE_DEAD_LIST_COUNT\nByteAddressBuffer deadListCount;\n#endif\n\nstruct
Kvp\n{\n\tfloat sortKey;\n\tuint index;\n};\n\nRWStructuredBuffer<Kvp> outputBuffer;\n\n[numthreads(NB_THREADS_PER_GROUP,1,1)]\nvoid
CSMain(uint3 groupId : SV_GroupID,\n uint3 groupThreadId
\ : SV_GroupThreadID)\n{\n\tuint threshold = nbMax;\n#if USE_DEAD_LIST_COUNT\n\tthreshold
-= deadListCount.Load(0);\n#endif\n\tuint id = groupThreadId.x + groupId.x *
NB_THREADS_PER_GROUP + groupId.y * dispatchWidth * NB_THREADS_PER_GROUP;\n\tif
(id < threshold)\n\t{\n\t\tuint index = inputBuffer[id];\n\t\tfloat3 position
= asfloat(attributeBuffer.Load3((index * 0x4 + 0x240) << 2));\n\t\t\n\n\t\t\n#if
VFX_LOCAL_SPACE\n\t\tfloat3 wPos = mul(localToWorld,float4(position,1.0f)).xyz;\n#else\n\t\tfloat3
wPos = position;\n#endif\n\t\tfloat3 camToPos = wPos - cameraPosition;\n\t\t\n\t\tKvp
kvp;\n\t\tkvp.sortKey = dot(camToPos,camToPos); // sqr distance to the camera\n\t\tkvp.index
= index;\n\n\t\toutputBuffer[id] = kvp;\n\t}\n}\n"
source: "#pragma kernel CSMain\r\n#define NB_THREADS_PER_GROUP 64\n#define VFX_USE_POSITION_CURRENT
1\n#define USE_DEAD_LIST_COUNT 1\n#define VFX_LOCAL_SPACE 1\n#include \"Packages/com.unity.visualeffectgraph/Shaders/RenderPipeline/HDRP/VFXDefines.hlsl\"\n\n\r\nCBUFFER_START(parameters)\n
\ float4x4 localToWorld;\nCBUFFER_END\n\n\r\n#include \"Packages/com.unity.visualeffectgraph/Shaders/Common/VFXCommonCompute.cginc\"\n#include
\"Packages/com.unity.visualeffectgraph/Shaders/VFXCommon.cginc\"\n\n\r\n\r\nCBUFFER_START(params)\r\n
\ uint nbMax;\r\n uint dispatchWidth;\r\nCBUFFER_END\r\n\r\nCBUFFER_START(cameraParams)\r\n
\ float3 cameraPosition;\r\nCBUFFER_END\r\n\r\nByteAddressBuffer attributeBuffer;\r\nStructuredBuffer<uint>
inputBuffer;\r\n\r\n#if USE_DEAD_LIST_COUNT\r\nByteAddressBuffer deadListCount;\r\n#endif\r\n\r\nstruct
Kvp\r\n{\r\n\tfloat sortKey;\r\n\tuint index;\r\n};\r\n\r\nRWStructuredBuffer<Kvp>
outputBuffer;\r\n\r\n[numthreads(NB_THREADS_PER_GROUP,1,1)]\r\nvoid CSMain(uint3
groupId : SV_GroupID,\r\n uint3 groupThreadId : SV_GroupThreadID)\r\n{\r\n\tuint
threshold = nbMax;\r\n#if USE_DEAD_LIST_COUNT\r\n\tthreshold -= deadListCount.Load(0);\r\n#endif\r\n\tuint
id = groupThreadId.x + groupId.x * NB_THREADS_PER_GROUP + groupId.y * dispatchWidth
* NB_THREADS_PER_GROUP;\r\n\tif (id < threshold)\r\n\t{\r\n\t\tuint index =
inputBuffer[id];\r\n\t\tfloat3 position = asfloat(attributeBuffer.Load3((index
* 0x4 + 0x240) << 2));\n\t\t\n\r\n\t\t\r\n#if VFX_LOCAL_SPACE\r\n\t\tfloat3
wPos = mul(localToWorld,float4(position,1.0f)).xyz;\r\n#else\r\n\t\tfloat3 wPos
= position;\r\n#endif\r\n\t\tfloat3 camToPos = wPos - cameraPosition;\r\n\t\t\r\n\t\tKvp
kvp;\r\n\t\tkvp.sortKey = dot(camToPos,camToPos); // sqr distance to the camera\r\n\t\tkvp.index
= index;\r\n\r\n\t\toutputBuffer[id] = kvp;\r\n\t}\r\n}\r\n"
m_Infos:
m_Expressions:
m_Expressions:

View file

@ -0,0 +1,33 @@
using UnityEngine;
using UnityEngine.Experimental.VFX;
namespace cylvester
{
public class KinectPointCloud : MonoBehaviour
{
[SerializeField] private VisualEffect visualEffect;
private Texture2D cachedTexture_;
private Texture2D data_;
public void Start()
{
cachedTexture_ = new Texture2D(512, 424, TextureFormat.R16, false);
data_ = new Texture2D(512, 424, TextureFormat.R16, false);
}
public void Update()
{
//Graphics.CopyTexture(data_, cachedTexture_);
}
public void OnInfraredFrameReceived( Texture2D data)
{
data_ = data;
visualEffect.SetTexture("DepthImage", data_);
visualEffect.SetTexture("CachedTexture", cachedTexture_);
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3f9b3ce38c9309e4c939678d9d08a9ec
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -164,6 +164,17 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 2145444547}
m_MethodName: OnInfraredFrameReceived
m_Mode: 0
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
skeleton: 1
skeletonDataReceived:
m_PersistentCalls:
@ -206,6 +217,7 @@ Transform:
- {fileID: 583502374}
- {fileID: 479263793}
- {fileID: 1806371279}
- {fileID: 2145444544}
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -523,6 +535,9 @@ VisualEffect:
- m_Value: {x: 0, y: 0, z: 0}
m_Name: SourcePoisiotn
m_Overridden: 1
- m_Value: {x: 0, y: 0, z: 0}
m_Name: SourcePosition
m_Overridden: 1
m_Vector4f:
m_Array: []
m_Uint:
@ -682,7 +697,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1931119204}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -10}
m_LocalPosition: {x: 0, y: 0, z: -31.11}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
@ -981,3 +996,130 @@ MonoBehaviour:
kernelSize: 5
lightAngle: 1
maxDepthBias: 0.001
--- !u!1 &2145444543
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2145444544}
- component: {fileID: 2145444546}
- component: {fileID: 2145444545}
- component: {fileID: 2145444547}
m_Layer: 0
m_Name: KinectPointCloud
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2145444544
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2145444543}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 5, y: 5, z: 5}
m_Children: []
m_Father: {fileID: 238320196}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!73398921 &2145444545
VFXRenderer:
m_ObjectHideFlags: 2
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2145444543}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 0
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!2083052967 &2145444546
VisualEffect:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2145444543}
m_Enabled: 1
m_Asset: {fileID: 8926484042661614526, guid: 3a4d3d5be59a1e049aa7f5a5df312385, type: 3}
m_StartSeed: 0
m_ResetSeedOnPlay: 1
m_PropertySheet:
m_Float:
m_Array: []
m_Vector2f:
m_Array: []
m_Vector3f:
m_Array: []
m_Vector4f:
m_Array: []
m_Uint:
m_Array: []
m_Int:
m_Array: []
m_Matrix4x4f:
m_Array: []
m_AnimationCurve:
m_Array: []
m_Gradient:
m_Array: []
m_NamedObject:
m_Array:
- m_Value: {fileID: 0}
m_Name: DepthImage
m_Overridden: 1
- m_Value: {fileID: 0}
m_Name: CahcedTexture
m_Overridden: 1
- m_Value: {fileID: 0}
m_Name: CachedTexture
m_Overridden: 1
m_Bool:
m_Array: []
--- !u!114 &2145444547
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2145444543}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3f9b3ce38c9309e4c939678d9d08a9ec, type: 3}
m_Name:
m_EditorClassIdentifier:
visualEffect: {fileID: 2145444546}

View file

@ -0,0 +1,42 @@
using System;
using UnityEngine;
using UnityEngine.Events;
namespace cylvester
{
[Serializable]
class UnityDifferenceTextureEvent : UnityEvent<Texture2D> { }
public class DifferenceTexture : MonoBehaviour
{
[SerializeField] private UnityDifferenceTextureEvent DifferenceTextureReceived;
private Texture2D cache_;
private Texture2D difference_;
private readonly int size_ = 512 * 424 * 2;
private void Start()
{
cache_ = new Texture2D(512, 424, TextureFormat.R16, false);
difference_ = new Texture2D(512, 424, TextureFormat.R16, false);
}
public void OnInfraredFrameReceived(Texture2D texture)
{
var rawDifference = difference_.GetPixels();
var rawNewTexture = texture.GetRawTextureData();
var rawOldTexture = cache_.GetRawTextureData();
// perhaps the fastest way to calculate on CPU
for (var i = 0; i < rawDifference.Length; ++i)
difference_.Apply();
Graphics.CopyTexture(texture, cache_);
DifferenceTextureReceived.Invoke(difference_);
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c0392de87fccb6346bc6b0c1a48a8855
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: