add kinect point cloud
This commit is contained in:
parent
9d23608998
commit
0808bec831
11 changed files with 6807 additions and 127 deletions
|
@ -56,6 +56,7 @@
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="Assets\KinectPointCloud.cs" />
|
||||||
<Compile Include="Assets\Scenes\Examples\Composition\script\BallMapping.cs" />
|
<Compile Include="Assets\Scenes\Examples\Composition\script\BallMapping.cs" />
|
||||||
<Compile Include="Assets\Scenes\Examples\Composition\script\RmsAnalyzer.cs" />
|
<Compile Include="Assets\Scenes\Examples\Composition\script\RmsAnalyzer.cs" />
|
||||||
<Compile Include="Assets\Scenes\Examples\KinectSkeleton\script\RightHandFire.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\TimbreID\script\IdToText.cs" />
|
||||||
<Compile Include="Assets\Scenes\Examples\VisualEffectGraph\script\FlareBind.cs" />
|
<Compile Include="Assets\Scenes\Examples\VisualEffectGraph\script\FlareBind.cs" />
|
||||||
<Compile Include="Assets\Scenes\Examples\VisualEffectGraph\script\SmokeBind.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\KinectJointBind.cs" />
|
||||||
<Compile Include="Assets\Scripts\Kinect\KinectManagerBehaviour.cs" />
|
<Compile Include="Assets\Scripts\Kinect\KinectManagerBehaviour.cs" />
|
||||||
<Compile Include="Assets\Scripts\Math\BodyHolder.cs" />
|
<Compile Include="Assets\Scripts\Math\BodyHolder.cs" />
|
||||||
|
|
5678
UnityProject/Assets/HDRP/KinectPointCloud.vfx
Normal file
5678
UnityProject/Assets/HDRP/KinectPointCloud.vfx
Normal file
File diff suppressed because it is too large
Load diff
7
UnityProject/Assets/HDRP/KinectPointCloud.vfx.meta
Normal file
7
UnityProject/Assets/HDRP/KinectPointCloud.vfx.meta
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3a4d3d5be59a1e049aa7f5a5df312385
|
||||||
|
VisualEffectImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -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: []
|
|
@ -0,0 +1,7 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0bbfee71185b44647989dc8f4595b36f
|
||||||
|
VisualEffectImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -635,59 +635,61 @@ VisualEffectResource:
|
||||||
m_ShaderSources:
|
m_ShaderSources:
|
||||||
- compute: 1
|
- compute: 1
|
||||||
name: '[System 1]Initialize'
|
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
|
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
|
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#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/Common/VFXCommonCompute.cginc\"\n#include
|
||||||
\"Packages/com.unity.visualeffectgraph/Shaders/VFXCommon.cginc\"\n\n\n\nRWByteAddressBuffer
|
\"Packages/com.unity.visualeffectgraph/Shaders/VFXCommon.cginc\"\n\n\r\n\r\nRWByteAddressBuffer
|
||||||
attributeBuffer;\nByteAddressBuffer sourceAttributeBuffer;\n\nCBUFFER_START(initParams)\n#if
|
attributeBuffer;\r\nByteAddressBuffer sourceAttributeBuffer;\r\n\r\nCBUFFER_START(initParams)\r\n#if
|
||||||
!VFX_USE_SPAWNER_FROM_GPU\n uint nbSpawned;\t\t\t\t\t// Numbers of particle
|
!VFX_USE_SPAWNER_FROM_GPU\r\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
|
spawned\r\n uint spawnIndex;\t\t\t\t// Index of the first particle spawned\r\n
|
||||||
\ uint dispatchWidth;\n#else\n uint offsetInAdditionalOutput;\n\tuint nbMax;\n#endif\n\tuint
|
\ uint dispatchWidth;\r\n#else\r\n uint offsetInAdditionalOutput;\r\n\tuint
|
||||||
systemSeed;\nCBUFFER_END\n\n#if VFX_USE_ALIVE_CURRENT\nRWStructuredBuffer<uint>
|
nbMax;\r\n#endif\r\n\tuint systemSeed;\r\nCBUFFER_END\r\n\r\n#if VFX_USE_ALIVE_CURRENT\r\nRWStructuredBuffer<uint>
|
||||||
deadListIn;\nByteAddressBuffer deadListCount; // This is bad to use a SRV to
|
deadListIn;\r\nByteAddressBuffer deadListCount; // This is bad to use a SRV
|
||||||
fetch deadList count but Unity API currently prevent from copying to CB\n#endif\n\n#if
|
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\nStructuredBuffer<uint> eventList;\nByteAddressBuffer
|
VFX_USE_SPAWNER_FROM_GPU\r\nStructuredBuffer<uint> eventList;\r\nByteAddressBuffer
|
||||||
inputAdditional;\n#endif\n\nvoid SetAttribute_E6295C0(inout float3 velocity,
|
inputAdditional;\r\n#endif\r\n\r\nvoid SetAttribute_E6295C0(inout float3 velocity,
|
||||||
inout uint seed, float3 A, float3 B) /*attribute:velocity Composition:Overwrite
|
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
|
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
|
SetAttribute_F01429A3(inout float lifetime, inout uint seed, float A, float
|
||||||
B) /*attribute:lifetime Composition:Overwrite Source:Slot Random:Uniform channels:XYZ
|
B) /*attribute:lifetime Composition:Overwrite Source:Slot Random:Uniform channels:XYZ
|
||||||
*/\n{\n lifetime = lerp(A,B,RAND);\n}\nvoid SetAttribute_48A7BD6E(inout float
|
*/\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
|
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
|
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,\n uint3 groupThreadId
|
CSMain(uint3 groupId : SV_GroupID,\r\n uint3 groupThreadId
|
||||||
\ : SV_GroupThreadID)\n{\n uint id = groupThreadId.x + groupId.x * NB_THREADS_PER_GROUP;\n#if
|
\ : SV_GroupThreadID)\r\n{\r\n uint id = groupThreadId.x + groupId.x *
|
||||||
!VFX_USE_SPAWNER_FROM_GPU\n id += groupId.y * dispatchWidth * NB_THREADS_PER_GROUP;\n#endif\n\n#if
|
NB_THREADS_PER_GROUP;\r\n#if !VFX_USE_SPAWNER_FROM_GPU\r\n id += groupId.y
|
||||||
VFX_USE_SPAWNER_FROM_GPU\n uint maxThreadId = inputAdditional.Load((offsetInAdditionalOutput
|
* dispatchWidth * NB_THREADS_PER_GROUP;\r\n#endif\r\n\r\n#if VFX_USE_SPAWNER_FROM_GPU\r\n
|
||||||
* 2 + 0) << 2);\n uint currentSpawnIndex = inputAdditional.Load((offsetInAdditionalOutput
|
\ uint maxThreadId = inputAdditional.Load((offsetInAdditionalOutput * 2 +
|
||||||
* 2 + 1) << 2) - maxThreadId;\n#else\n uint maxThreadId = nbSpawned;\n uint
|
0) << 2);\r\n uint currentSpawnIndex = inputAdditional.Load((offsetInAdditionalOutput
|
||||||
currentSpawnIndex = spawnIndex;\n#endif\n\n#if VFX_USE_ALIVE_CURRENT\n maxThreadId
|
* 2 + 1) << 2) - maxThreadId;\r\n#else\r\n uint maxThreadId = nbSpawned;\r\n
|
||||||
= min(maxThreadId, deadListCount.Load(0x0));\n#elif VFX_USE_SPAWNER_FROM_GPU\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
|
\ 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
|
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];\n#endif\n uint particleIndex
|
\ int sourceIndex = eventList[id];\r\n#endif\r\n uint particleIndex
|
||||||
= id + currentSpawnIndex;\n\t\t\n#if !VFX_USE_SPAWNER_FROM_GPU\n int
|
= 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
|
sourceIndex = 0;\n /*//Loop with 1 iteration generate a wrong IL Assembly
|
||||||
(and actually, useless code)\n uint currentSumSpawnCount = 0u;\n for
|
(and actually, useless code)\n uint currentSumSpawnCount = 0u;\n for
|
||||||
(sourceIndex=0; sourceIndex<1; sourceIndex++)\n {\n currentSumSpawnCount
|
(sourceIndex=0; sourceIndex<1; sourceIndex++)\n {\n currentSumSpawnCount
|
||||||
+= uint(asfloat(sourceAttributeBuffer.Load((sourceIndex * 0x1 + 0x0) << 2)));\n
|
+= uint(asfloat(sourceAttributeBuffer.Load((sourceIndex * 0x1 + 0x0) << 2)));\n
|
||||||
\ if (id < currentSumSpawnCount)\n {\n break;\n
|
\ if (id < currentSumSpawnCount)\n {\n break;\n
|
||||||
\ }\n }\n */\n \n\n#endif\n float3 velocity
|
\ }\n }\n */\n \n\r\n#endif\r\n float3
|
||||||
= float3(0,0,0);\n uint seed = (uint)0;\n float lifetime = (float)1;\n
|
velocity = float3(0, 0, 0);\n uint seed = (uint)0;\n float lifetime
|
||||||
\ float angleZ = (float)0;\n float texIndex = (float)0;\n float3
|
= (float)1;\n float angleZ = (float)0;\n float texIndex = (float)0;\n
|
||||||
position = float3(0,0,0);\n bool alive = (bool)true;\n float age
|
\ float3 position = float3(0, 0, 0);\n bool alive = (bool)true;\n
|
||||||
= (float)0;\n \n\n#if VFX_USE_PARTICLEID_CURRENT\n particleId
|
\ float age = (float)0;\n \n\r\n#if VFX_USE_PARTICLEID_CURRENT\r\n
|
||||||
= particleIndex;\n#endif\n#if VFX_USE_SEED_CURRENT\n seed = WangHash(particleIndex
|
\ particleId = particleIndex;\r\n#endif\r\n#if VFX_USE_SEED_CURRENT\r\n
|
||||||
^ systemSeed);\n#endif\n \n {\n SetAttribute_E6295C0(
|
\ seed = WangHash(particleIndex ^ systemSeed);\r\n#endif\r\n \r\n
|
||||||
/*inout */velocity, /*inout */seed, float3(-0.333,0.8,-0.333), float3(0.333,1,0.333));\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,
|
\ }\n {\n SetAttribute_F01429A3( /*inout */lifetime,
|
||||||
\ /*inout */seed, (float)6, (float)12);\n }\n {\n SetAttribute_48A7BD6E(
|
\ /*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
|
/*inout */angleZ, /*inout */seed, (float)0, (float)360);\n }\n \n\r\n\r\n#if
|
||||||
VFX_USE_ALIVE_CURRENT\n if (alive)\n {\n\t\t\tuint deadIndex =
|
VFX_USE_ALIVE_CURRENT\r\n if (alive)\r\n {\r\n\t\t\tuint deadIndex
|
||||||
deadListIn.DecrementCounter();\n uint index = deadListIn[deadIndex];\n
|
= deadListIn.DecrementCounter();\r\n uint index = deadListIn[deadIndex];\r\n
|
||||||
\ attributeBuffer.Store3((index * 0x4 + 0x0) << 2,asuint(velocity));\n
|
\ attributeBuffer.Store3((index * 0x4 + 0x0) << 2,asuint(velocity));\n
|
||||||
\ attributeBuffer.Store((index * 0x1 + 0x100) << 2,asuint(lifetime));\n
|
\ attributeBuffer.Store((index * 0x1 + 0x100) << 2,asuint(lifetime));\n
|
||||||
\ attributeBuffer.Store((index * 0x1 + 0x140) << 2,asuint(angleZ));\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.Store3((index * 0x4 + 0x240) << 2,asuint(position));\n
|
||||||
\ attributeBuffer.Store((index * 0x3 + 0x181) << 2,uint(alive));\n
|
\ attributeBuffer.Store((index * 0x3 + 0x181) << 2,uint(alive));\n
|
||||||
\ attributeBuffer.Store((index * 0x3 + 0x182) << 2,asuint(age));\n
|
\ attributeBuffer.Store((index * 0x3 + 0x182) << 2,asuint(age));\n
|
||||||
\ \n\n }\n#else\n uint index = particleIndex;\n attributeBuffer.Store3((index
|
\ \n\r\n }\r\n#else\r\n uint index = particleIndex;\r\n
|
||||||
* 0x4 + 0x0) << 2,asuint(velocity));\n attributeBuffer.Store((index *
|
\ attributeBuffer.Store3((index * 0x4 + 0x0) << 2,asuint(velocity));\n
|
||||||
0x1 + 0x100) << 2,asuint(lifetime));\n attributeBuffer.Store((index *
|
\ attributeBuffer.Store((index * 0x1 + 0x100) << 2,asuint(lifetime));\n
|
||||||
0x1 + 0x140) << 2,asuint(angleZ));\n attributeBuffer.Store((index * 0x3
|
\ attributeBuffer.Store((index * 0x1 + 0x140) << 2,asuint(angleZ));\n
|
||||||
+ 0x180) << 2,asuint(texIndex));\n attributeBuffer.Store3((index * 0x4
|
\ attributeBuffer.Store((index * 0x3 + 0x180) << 2,asuint(texIndex));\n
|
||||||
+ 0x240) << 2,asuint(position));\n attributeBuffer.Store((index * 0x3
|
\ attributeBuffer.Store3((index * 0x4 + 0x240) << 2,asuint(position));\n
|
||||||
+ 0x181) << 2,uint(alive));\n attributeBuffer.Store((index * 0x3 + 0x182)
|
\ attributeBuffer.Store((index * 0x3 + 0x181) << 2,uint(alive));\n attributeBuffer.Store((index
|
||||||
<< 2,asuint(age));\n \n\n#endif\n }\n}\n"
|
* 0x3 + 0x182) << 2,asuint(age));\n \n\r\n#endif\r\n }\r\n}\r\n"
|
||||||
- compute: 1
|
- compute: 1
|
||||||
name: '[System 1]Update'
|
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
|
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
|
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
|
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
|
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
|
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\n#include
|
\ 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/Common/VFXCommonCompute.cginc\"\n#include
|
||||||
\"Packages/com.unity.visualeffectgraph/Shaders/VFXCommon.cginc\"\n\n\n\nRWByteAddressBuffer
|
\"Packages/com.unity.visualeffectgraph/Shaders/VFXCommon.cginc\"\n\n\r\n\r\nRWByteAddressBuffer
|
||||||
attributeBuffer;\n\n#if VFX_USE_ALIVE_CURRENT\nRWStructuredBuffer<uint> deadListOut;\n#endif\n\n#if
|
attributeBuffer;\r\n\r\n#if VFX_USE_ALIVE_CURRENT\r\nRWStructuredBuffer<uint>
|
||||||
VFX_HAS_INDIRECT_DRAW\nRWStructuredBuffer<uint> indirectBuffer;\n#endif\n\nCBUFFER_START(updateParams)\n
|
deadListOut;\r\n#endif\r\n\r\n#if VFX_HAS_INDIRECT_DRAW\r\nRWStructuredBuffer<uint>
|
||||||
\ uint nbMax;\n\tuint dispatchWidth;\n\tuint systemSeed;\nCBUFFER_END\n\nvoid
|
indirectBuffer;\r\n#endif\r\n\r\nCBUFFER_START(updateParams)\r\n uint nbMax;\r\n\tuint
|
||||||
FlipbookPlay_0(inout float texIndex, float FrameRate, float deltaTime) /*mode:Constant
|
dispatchWidth;\r\n\tuint systemSeed;\r\nCBUFFER_END\r\n\r\nvoid FlipbookPlay_0(inout
|
||||||
*/\n{\n texIndex += FrameRate * deltaTime;\n}\nvoid Force_1(inout float3
|
float texIndex, float FrameRate, float deltaTime) /*mode:Constant */\n{\n texIndex
|
||||||
velocity, float mass, float3 Velocity, float Drag, float deltaTime) /*Mode:Relative
|
+= FrameRate * deltaTime;\n}\nvoid Force_1(inout float3 velocity, float mass,
|
||||||
*/\n{\n velocity += (Velocity - velocity) * min(1.0f,Drag * deltaTime / mass);\n}\nvoid
|
float3 Velocity, float Drag, float deltaTime) /*Mode:Relative */\n{\n velocity
|
||||||
Drag_1(inout float3 velocity, float mass, float size, float scaleX, float scaleY,
|
+= (Velocity - velocity) * min(1.0f,Drag * deltaTime / mass);\n}\nvoid Drag_1(inout
|
||||||
float dragCoefficient, float deltaTime) /*UseParticleSize:True */\n{\n \n
|
float3 velocity, float mass, float size, float scaleX, float scaleY, float dragCoefficient,
|
||||||
\ float2 side = size * (scaleX, scaleY);\n dragCoefficient *= side.x *
|
float deltaTime) /*UseParticleSize:True */\n{\n \n float2 side = size
|
||||||
side.y;\n velocity *= max(0.0,(1.0 - (dragCoefficient * deltaTime) / mass));\n}\nvoid
|
* (scaleX, scaleY);\n dragCoefficient *= side.x * side.y;\n velocity *=
|
||||||
EulerIntegration(inout float3 position, float3 velocity, float deltaTime)\n{\n
|
max(0.0,(1.0 - (dragCoefficient * deltaTime) / mass));\n}\nvoid EulerIntegration(inout
|
||||||
\ position += velocity * deltaTime;\n}\nvoid Age(inout float age, float deltaTime)\n{\n
|
float3 position, float3 velocity, float deltaTime)\n{\n position += velocity
|
||||||
\ age += deltaTime;\n}\nvoid Reap(float age, float lifetime, inout bool alive)\n{\n
|
* deltaTime;\n}\nvoid Age(inout float age, float deltaTime)\n{\n age += deltaTime;\n}\nvoid
|
||||||
\ if(age > lifetime) { alive = false; }\n}\n\n\n\n[numthreads(NB_THREADS_PER_GROUP,1,1)]\nvoid
|
Reap(float age, float lifetime, inout bool alive)\n{\n if(age > lifetime)
|
||||||
CSMain(uint3 groupId : SV_GroupID,\n uint3 groupThreadId
|
{ alive = false; }\n}\n\n\r\n\r\n[numthreads(NB_THREADS_PER_GROUP,1,1)]\r\nvoid
|
||||||
\ : SV_GroupThreadID)\n{\n\tuint id = groupThreadId.x + groupId.x * NB_THREADS_PER_GROUP
|
CSMain(uint3 groupId : SV_GroupID,\r\n uint3 groupThreadId
|
||||||
+ groupId.y * dispatchWidth * NB_THREADS_PER_GROUP;\n\tuint index = id;\n\tif
|
\ : SV_GroupThreadID)\r\n{\r\n\tuint id = groupThreadId.x + groupId.x * NB_THREADS_PER_GROUP
|
||||||
(id < nbMax)\n\t{\n#if VFX_USE_ALIVE_CURRENT\n\t\tbool alive = (attributeBuffer.Load((index
|
+ groupId.y * dispatchWidth * NB_THREADS_PER_GROUP;\r\n\tuint index = id;\r\n\tif
|
||||||
* 0x3 + 0x181) << 2));\n\t\t\n\n\t\tif (alive)\n\t\t{\n\t\t\tfloat3 velocity
|
(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.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 * 0x1 + 0x100) << 2));\n\t\t\tfloat texIndex
|
||||||
= asfloat(attributeBuffer.Load((index * 0x3 + 0x180) << 2));\n\t\t\tfloat mass
|
= 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
|
scaleY = (float)1;\n\t\t\tfloat3 position = asfloat(attributeBuffer.Load3((index
|
||||||
* 0x4 + 0x240) << 2));\n\t\t\tfloat age = asfloat(attributeBuffer.Load((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
|
* 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;\n#endif\n\t\t\t\n\t\t\tFlipbookPlay_0( /*inout */texIndex, FrameRate_a,
|
= position;\r\n#endif\r\n\t\t\t\r\n\t\t\tFlipbookPlay_0( /*inout */texIndex,
|
||||||
deltaTime_a);\n\t\t\t{\n\t\t\t Force_1( /*inout */velocity, mass, float3(-0.2,0.8,0),
|
FrameRate_a, deltaTime_a);\n\t\t\t{\n\t\t\t Force_1( /*inout */velocity,
|
||||||
(float)1, deltaTime_a);\n\t\t\t}\n\t\t\t{\n\t\t\t Drag_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
|
||||||
mass, size, scaleX, scaleY, (float)0.1, deltaTime_a);\n\t\t\t}\n\t\t\tEulerIntegration(
|
\ Drag_1( /*inout */velocity, mass, size, scaleX, scaleY, (float)0.100000001,
|
||||||
/*inout */position, velocity, deltaTime_a);\n\t\t\tAge( /*inout */age, deltaTime_a);\n\t\t\tReap(age,
|
deltaTime_a);\n\t\t\t}\n\t\t\tEulerIntegration( /*inout */position, velocity,
|
||||||
lifetime, /*inout */alive);\n\t\t\t\n\n\t\t\tif (alive)\n\t\t\t{\n\t\t\t\tattributeBuffer.Store3((index
|
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 *
|
* 0x4 + 0x0) << 2,asuint(velocity));\n\t\t\t\tattributeBuffer.Store((index *
|
||||||
0x3 + 0x180) << 2,asuint(texIndex));\n\t\t\t\tattributeBuffer.Store3((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
|
* 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
|
* 0x3 + 0x182) << 2,asuint(age));\n\t\t\t\t\n\r\n#if VFX_HAS_INDIRECT_DRAW\r\n
|
||||||
indirectIndex = indirectBuffer.IncrementCounter();\n\t\t\t\tindirectBuffer[indirectIndex]
|
\ uint indirectIndex = indirectBuffer.IncrementCounter();\r\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
|
= 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\n\t\t\t\tuint deadIndex = deadListOut.IncrementCounter();\n\t\t\t\tdeadListOut[deadIndex]
|
* 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;\n\t\t\t}\n\t\t}\n#else\n\t\tfloat3 velocity = asfloat(attributeBuffer.Load3((index
|
= 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
|
* 0x4 + 0x0) << 2));\n\t\tfloat lifetime = asfloat(attributeBuffer.Load((index
|
||||||
* 0x1 + 0x100) << 2));\n\t\tfloat texIndex = 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
|
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
|
* 0x4 + 0x240) << 2));\n\t\tbool alive = (attributeBuffer.Load((index * 0x3
|
||||||
+ 0x181) << 2));\n\t\tfloat age = asfloat(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
|
+ 0x182) << 2));\n\t\t\n\r\n\t\t\r\n#if VFX_USE_OLDPOSITION_CURRENT\r\n\t\toldPosition
|
||||||
= position;\n#endif\n\t\t\n\t\tFlipbookPlay_0( /*inout */texIndex, FrameRate_a,
|
= 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.2,0.8,0),
|
deltaTime_a);\n\t\t{\n\t\t Force_1( /*inout */velocity, mass, float3(-0.200000003,
|
||||||
(float)1, deltaTime_a);\n\t\t}\n\t\t{\n\t\t Drag_1( /*inout */velocity, mass,
|
0.800000012, 0), (float)1, deltaTime_a);\n\t\t}\n\t\t{\n\t\t Drag_1( /*inout
|
||||||
size, scaleX, scaleY, (float)0.1, deltaTime_a);\n\t\t}\n\t\tEulerIntegration(
|
*/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,
|
/*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
|
lifetime, /*inout */alive);\n\t\t\n\r\n\t\tattributeBuffer.Store3((index *
|
||||||
+ 0x0) << 2,asuint(velocity));\n\t\tattributeBuffer.Store((index * 0x3 + 0x180)
|
0x4 + 0x0) << 2,asuint(velocity));\n\t\tattributeBuffer.Store((index * 0x3 +
|
||||||
<< 2,asuint(texIndex));\n\t\tattributeBuffer.Store3((index * 0x4 + 0x240) <<
|
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
|
<< 2,asuint(position));\n\t\tattributeBuffer.Store((index * 0x3 + 0x181) <<
|
||||||
* 0x3 + 0x182) << 2,asuint(age));\n\t\t\n\n#if VFX_HAS_INDIRECT_DRAW\n uint
|
2,uint(alive));\n\t\tattributeBuffer.Store((index * 0x3 + 0x182) << 2,asuint(age));\n\t\t\n\r\n#if
|
||||||
indirectIndex = indirectBuffer.IncrementCounter();\n\t\tindirectBuffer[indirectIndex]
|
VFX_HAS_INDIRECT_DRAW\r\n uint indirectIndex = indirectBuffer.IncrementCounter();\r\n\t\tindirectBuffer[indirectIndex]
|
||||||
= index;\n#endif\n#endif\n\t}\n}\n"
|
= index;\r\n#endif\r\n#endif\r\n\t}\r\n}\r\n"
|
||||||
- compute: 0
|
- compute: 0
|
||||||
name: '[System 1]Lit Quad Output'
|
name: '[System 1]Lit Quad Output'
|
||||||
source: "Shader \"Hidden/VFX/System 1/Lit Quad Output\"\n{\n\tSubShader\n\t{\t\n\t\tCull
|
source: "Shader \"Hidden/VFX/System 1/Lit Quad Output\"\n{\r\n\tSubShader\r\n\t{\t\r\n\t\tCull
|
||||||
Off\n\t\t\n\t\tTags { \"Queue\"=\"Transparent+0\" \"IgnoreProjector\"=\"True\"
|
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
|
\"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
|
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
|
!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_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
|
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
|
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
|
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
|
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
|
_ENABLE_FOG_ON_TRANSPARENT\n\t\t\t#define _DISABLE_DECALS\n\t\t\t#define _BLENDMODE_ALPHA\n\t\t\t#define
|
||||||
|
@ -890,7 +894,7 @@ VisualEffectResource:
|
||||||
lifetime = asfloat(attributeBuffer.Load((index * 0x1 + 0x100) << 2));\n\t\t\t\t\t\tfloat
|
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
|
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
|
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
|
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
|
alpha = (float)1;\n\t\t\t\t\t\tbool alive = (attributeBuffer.Load((index * 0x3
|
||||||
|
@ -905,7 +909,7 @@ VisualEffectResource:
|
||||||
= asfloat(attributeBuffer.Load((index * 0x1 + 0x100) << 2));\n\t\t\t\t\t\tfloat
|
= 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
|
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
|
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
|
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\tfloat3 axisX = float3(1, 0, 0);\n\t\t\t\t\t\tfloat3
|
alpha = (float)1;\n\t\t\t\t\t\tfloat3 axisX = float3(1, 0, 0);\n\t\t\t\t\t\tfloat3
|
||||||
|
@ -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
|
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
|
= 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
|
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
|
= 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
|
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
|
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
|
= 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 =
|
= 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
|
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
|
- compute: 1
|
||||||
name: '[System 1]CameraSort'
|
name: '[System 1]CameraSort'
|
||||||
source: "#pragma kernel CSMain\n#define NB_THREADS_PER_GROUP 64\n#define VFX_USE_POSITION_CURRENT
|
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\nCBUFFER_START(parameters)\n
|
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\n#include \"Packages/com.unity.visualeffectgraph/Shaders/Common/VFXCommonCompute.cginc\"\n#include
|
\ 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\n\nCBUFFER_START(params)\n
|
\"Packages/com.unity.visualeffectgraph/Shaders/VFXCommon.cginc\"\n\n\r\n\r\nCBUFFER_START(params)\r\n
|
||||||
\ uint nbMax;\n uint dispatchWidth;\nCBUFFER_END\n\nCBUFFER_START(cameraParams)\n
|
\ uint nbMax;\r\n uint dispatchWidth;\r\nCBUFFER_END\r\n\r\nCBUFFER_START(cameraParams)\r\n
|
||||||
\ float3 cameraPosition;\nCBUFFER_END\n\nByteAddressBuffer attributeBuffer;\nStructuredBuffer<uint>
|
\ float3 cameraPosition;\r\nCBUFFER_END\r\n\r\nByteAddressBuffer attributeBuffer;\r\nStructuredBuffer<uint>
|
||||||
inputBuffer;\n\n#if USE_DEAD_LIST_COUNT\nByteAddressBuffer deadListCount;\n#endif\n\nstruct
|
inputBuffer;\r\n\r\n#if USE_DEAD_LIST_COUNT\r\nByteAddressBuffer deadListCount;\r\n#endif\r\n\r\nstruct
|
||||||
Kvp\n{\n\tfloat sortKey;\n\tuint index;\n};\n\nRWStructuredBuffer<Kvp> outputBuffer;\n\n[numthreads(NB_THREADS_PER_GROUP,1,1)]\nvoid
|
Kvp\r\n{\r\n\tfloat sortKey;\r\n\tuint index;\r\n};\r\n\r\nRWStructuredBuffer<Kvp>
|
||||||
CSMain(uint3 groupId : SV_GroupID,\n uint3 groupThreadId
|
outputBuffer;\r\n\r\n[numthreads(NB_THREADS_PER_GROUP,1,1)]\r\nvoid CSMain(uint3
|
||||||
\ : SV_GroupThreadID)\n{\n\tuint threshold = nbMax;\n#if USE_DEAD_LIST_COUNT\n\tthreshold
|
groupId : SV_GroupID,\r\n uint3 groupThreadId : SV_GroupThreadID)\r\n{\r\n\tuint
|
||||||
-= deadListCount.Load(0);\n#endif\n\tuint id = groupThreadId.x + groupId.x *
|
threshold = nbMax;\r\n#if USE_DEAD_LIST_COUNT\r\n\tthreshold -= deadListCount.Load(0);\r\n#endif\r\n\tuint
|
||||||
NB_THREADS_PER_GROUP + groupId.y * dispatchWidth * NB_THREADS_PER_GROUP;\n\tif
|
id = groupThreadId.x + groupId.x * NB_THREADS_PER_GROUP + groupId.y * dispatchWidth
|
||||||
(id < threshold)\n\t{\n\t\tuint index = inputBuffer[id];\n\t\tfloat3 position
|
* NB_THREADS_PER_GROUP;\r\n\tif (id < threshold)\r\n\t{\r\n\t\tuint index =
|
||||||
= asfloat(attributeBuffer.Load3((index * 0x4 + 0x240) << 2));\n\t\t\n\n\t\t\n#if
|
inputBuffer[id];\r\n\t\tfloat3 position = asfloat(attributeBuffer.Load3((index
|
||||||
VFX_LOCAL_SPACE\n\t\tfloat3 wPos = mul(localToWorld,float4(position,1.0f)).xyz;\n#else\n\t\tfloat3
|
* 0x4 + 0x240) << 2));\n\t\t\n\r\n\t\t\r\n#if VFX_LOCAL_SPACE\r\n\t\tfloat3
|
||||||
wPos = position;\n#endif\n\t\tfloat3 camToPos = wPos - cameraPosition;\n\t\t\n\t\tKvp
|
wPos = mul(localToWorld,float4(position,1.0f)).xyz;\r\n#else\r\n\t\tfloat3 wPos
|
||||||
kvp;\n\t\tkvp.sortKey = dot(camToPos,camToPos); // sqr distance to the camera\n\t\tkvp.index
|
= position;\r\n#endif\r\n\t\tfloat3 camToPos = wPos - cameraPosition;\r\n\t\t\r\n\t\tKvp
|
||||||
= index;\n\n\t\toutputBuffer[id] = kvp;\n\t}\n}\n"
|
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_Infos:
|
||||||
m_Expressions:
|
m_Expressions:
|
||||||
m_Expressions:
|
m_Expressions:
|
||||||
|
|
33
UnityProject/Assets/KinectPointCloud.cs
Normal file
33
UnityProject/Assets/KinectPointCloud.cs
Normal 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_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
11
UnityProject/Assets/KinectPointCloud.cs.meta
Normal file
11
UnityProject/Assets/KinectPointCloud.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3f9b3ce38c9309e4c939678d9d08a9ec
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -164,6 +164,17 @@ MonoBehaviour:
|
||||||
m_StringArgument:
|
m_StringArgument:
|
||||||
m_BoolArgument: 0
|
m_BoolArgument: 0
|
||||||
m_CallState: 2
|
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
|
skeleton: 1
|
||||||
skeletonDataReceived:
|
skeletonDataReceived:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
|
@ -206,6 +217,7 @@ Transform:
|
||||||
- {fileID: 583502374}
|
- {fileID: 583502374}
|
||||||
- {fileID: 479263793}
|
- {fileID: 479263793}
|
||||||
- {fileID: 1806371279}
|
- {fileID: 1806371279}
|
||||||
|
- {fileID: 2145444544}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 2
|
m_RootOrder: 2
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
@ -523,6 +535,9 @@ VisualEffect:
|
||||||
- m_Value: {x: 0, y: 0, z: 0}
|
- m_Value: {x: 0, y: 0, z: 0}
|
||||||
m_Name: SourcePoisiotn
|
m_Name: SourcePoisiotn
|
||||||
m_Overridden: 1
|
m_Overridden: 1
|
||||||
|
- m_Value: {x: 0, y: 0, z: 0}
|
||||||
|
m_Name: SourcePosition
|
||||||
|
m_Overridden: 1
|
||||||
m_Vector4f:
|
m_Vector4f:
|
||||||
m_Array: []
|
m_Array: []
|
||||||
m_Uint:
|
m_Uint:
|
||||||
|
@ -682,7 +697,7 @@ Transform:
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1931119204}
|
m_GameObject: {fileID: 1931119204}
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
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_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
|
@ -981,3 +996,130 @@ MonoBehaviour:
|
||||||
kernelSize: 5
|
kernelSize: 5
|
||||||
lightAngle: 1
|
lightAngle: 1
|
||||||
maxDepthBias: 0.001
|
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}
|
||||||
|
|
42
UnityProject/Assets/Scripts/Kinect/DifferenceTexture.cs
Normal file
42
UnityProject/Assets/Scripts/Kinect/DifferenceTexture.cs
Normal 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_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
11
UnityProject/Assets/Scripts/Kinect/DifferenceTexture.cs.meta
Normal file
11
UnityProject/Assets/Scripts/Kinect/DifferenceTexture.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c0392de87fccb6346bc6b0c1a48a8855
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Loading…
Reference in a new issue