master
chwan1 6 years ago
parent d57822ca2d
commit 7d829c63cc
  1. 10
      Unity-19050-05-BallPool/Assets/FluidSim3D.meta
  2. 532
      Unity-19050-05-BallPool/Assets/FluidSim3D/FireFluid.unity
  3. 4
      Unity-19050-05-BallPool/Assets/FluidSim3D/FireFluid.unity.meta
  4. 5
      Unity-19050-05-BallPool/Assets/FluidSim3D/Materials.meta
  5. 29
      Unity-19050-05-BallPool/Assets/FluidSim3D/Materials/FireRayCast.mat
  6. 4
      Unity-19050-05-BallPool/Assets/FluidSim3D/Materials/FireRayCast.mat.meta
  7. 27
      Unity-19050-05-BallPool/Assets/FluidSim3D/Materials/Plane.mat
  8. 4
      Unity-19050-05-BallPool/Assets/FluidSim3D/Materials/Plane.mat.meta
  9. 39
      Unity-19050-05-BallPool/Assets/FluidSim3D/Materials/SmokeRayCast.mat
  10. 4
      Unity-19050-05-BallPool/Assets/FluidSim3D/Materials/SmokeRayCast.mat.meta
  11. 5
      Unity-19050-05-BallPool/Assets/FluidSim3D/Prefabs.meta
  12. 123
      Unity-19050-05-BallPool/Assets/FluidSim3D/Prefabs/FireFluidSim.prefab
  13. 4
      Unity-19050-05-BallPool/Assets/FluidSim3D/Prefabs/FireFluidSim.prefab.meta
  14. 119
      Unity-19050-05-BallPool/Assets/FluidSim3D/Prefabs/SmokeFluidSim.prefab
  15. 4
      Unity-19050-05-BallPool/Assets/FluidSim3D/Prefabs/SmokeFluidSim.prefab.meta
  16. 5
      Unity-19050-05-BallPool/Assets/FluidSim3D/Scripts.meta
  17. 464
      Unity-19050-05-BallPool/Assets/FluidSim3D/Scripts/FireFluidSim.cs
  18. 8
      Unity-19050-05-BallPool/Assets/FluidSim3D/Scripts/FireFluidSim.cs.meta
  19. 436
      Unity-19050-05-BallPool/Assets/FluidSim3D/Scripts/SmokeFluidSim.cs
  20. 8
      Unity-19050-05-BallPool/Assets/FluidSim3D/Scripts/SmokeFluidSim.cs.meta
  21. 5
      Unity-19050-05-BallPool/Assets/FluidSim3D/Shaders.meta
  22. 244
      Unity-19050-05-BallPool/Assets/FluidSim3D/Shaders/ApplyAdvection.compute
  23. 4
      Unity-19050-05-BallPool/Assets/FluidSim3D/Shaders/ApplyAdvection.compute.meta
  24. 47
      Unity-19050-05-BallPool/Assets/FluidSim3D/Shaders/ApplyBuoyancy.compute
  25. 4
      Unity-19050-05-BallPool/Assets/FluidSim3D/Shaders/ApplyBuoyancy.compute.meta
  26. 57
      Unity-19050-05-BallPool/Assets/FluidSim3D/Shaders/ApplyImpulse.compute
  27. 4
      Unity-19050-05-BallPool/Assets/FluidSim3D/Shaders/ApplyImpulse.compute.meta
  28. 44
      Unity-19050-05-BallPool/Assets/FluidSim3D/Shaders/ComputeConfinement.compute
  29. 4
      Unity-19050-05-BallPool/Assets/FluidSim3D/Shaders/ComputeConfinement.compute.meta
  30. 49
      Unity-19050-05-BallPool/Assets/FluidSim3D/Shaders/ComputeDivergence.compute
  31. 4
      Unity-19050-05-BallPool/Assets/FluidSim3D/Shaders/ComputeDivergence.compute.meta
  32. 65
      Unity-19050-05-BallPool/Assets/FluidSim3D/Shaders/ComputeJacobi.compute
  33. 4
      Unity-19050-05-BallPool/Assets/FluidSim3D/Shaders/ComputeJacobi.compute.meta
  34. 47
      Unity-19050-05-BallPool/Assets/FluidSim3D/Shaders/ComputeObstacles.compute
  35. 4
      Unity-19050-05-BallPool/Assets/FluidSim3D/Shaders/ComputeObstacles.compute.meta
  36. 76
      Unity-19050-05-BallPool/Assets/FluidSim3D/Shaders/ComputeProjection.compute
  37. 4
      Unity-19050-05-BallPool/Assets/FluidSim3D/Shaders/ComputeProjection.compute.meta
  38. 37
      Unity-19050-05-BallPool/Assets/FluidSim3D/Shaders/ComputeVorticity.compute
  39. 4
      Unity-19050-05-BallPool/Assets/FluidSim3D/Shaders/ComputeVorticity.compute.meta
  40. 193
      Unity-19050-05-BallPool/Assets/FluidSim3D/Shaders/FireRayCast.shader
  41. 5
      Unity-19050-05-BallPool/Assets/FluidSim3D/Shaders/FireRayCast.shader.meta
  42. 183
      Unity-19050-05-BallPool/Assets/FluidSim3D/Shaders/SmokeRayCast.shader
  43. 5
      Unity-19050-05-BallPool/Assets/FluidSim3D/Shaders/SmokeRayCast.shader.meta
  44. 399
      Unity-19050-05-BallPool/Assets/FluidSim3D/SmokeFluid.unity
  45. 4
      Unity-19050-05-BallPool/Assets/FluidSim3D/SmokeFluid.unity.meta
  46. 5
      Unity-19050-05-BallPool/Assets/FluidSim3D/Textures.meta
  47. BIN
      Unity-19050-05-BallPool/Assets/FluidSim3D/Textures/FireGradient.png
  48. 45
      Unity-19050-05-BallPool/Assets/FluidSim3D/Textures/FireGradient.png.meta
  49. 10
      Unity-19050-05-BallPool/Assets/FluidSimControl.meta
  50. 67
      Unity-19050-05-BallPool/Assets/FluidSimControl/FluidSimInputController.cs
  51. 13
      Unity-19050-05-BallPool/Assets/FluidSimControl/FluidSimInputController.cs.meta
  52. 21
      Unity-19050-05-BallPool/Assets/FluidSimControl/SmokeFluidSimUniforms.asset
  53. 10
      Unity-19050-05-BallPool/Assets/FluidSimControl/SmokeFluidSimUniforms.asset.meta
  54. 26
      Unity-19050-05-BallPool/Assets/FluidSimControl/SmokeFluidSimUniforms.cs
  55. 13
      Unity-19050-05-BallPool/Assets/FluidSimControl/SmokeFluidSimUniforms.cs.meta
  56. 2634
      Unity-19050-05-BallPool/Assets/Frozen/Frozen Flow.unity
  57. 9
      Unity-19050-05-BallPool/Assets/Frozen/Frozen Flow.unity.meta
  58. 1424
      Unity-19050-05-BallPool/Assets/Frozen/Frozen.unity
  59. 4289
      Unity-19050-05-BallPool/Assets/Frozen/FrozenTwo.unity
  60. 9
      Unity-19050-05-BallPool/Assets/Frozen/FrozenTwo.unity.meta
  61. 2
      Unity-19050-05-BallPool/Assets/Frozen/Material/Point.mat
  62. 54
      Unity-19050-05-BallPool/Assets/Frozen/Script/GiantSnowflake.cs
  63. 12
      Unity-19050-05-BallPool/Assets/Frozen/Script/SceneController.cs
  64. 120
      Unity-19050-05-BallPool/Assets/Frozen/Script/SnowflakeParticleUpdater.cs
  65. 13
      Unity-19050-05-BallPool/Assets/Frozen/Script/SnowflakeParticleUpdater.cs.meta
  66. 10
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow.meta
  67. 62
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/ApplyKinectFluidBufferShader.compute
  68. 9
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/ApplyKinectFluidBufferShader.compute.meta
  69. 10
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/Grpc.meta
  70. 64
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/Grpc/Kinect2MotionDebug.shader
  71. 10
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/Grpc/Kinect2MotionDebug.shader.meta
  72. 19
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/Grpc/KinectBufferCollect.compute
  73. 10
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/Grpc/KinectBufferCollect.compute.meta
  74. 83
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/Grpc/KinectBufferComposite.compute
  75. 10
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/Grpc/KinectBufferComposite.compute.meta
  76. 367
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/Grpc/KinectGrpcServer.cs
  77. 18
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/Grpc/KinectGrpcServer.cs.meta
  78. 97
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/Grpc/UltraCombos.Kinect2MotionTransmitGrpc.cs
  79. 13
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/Grpc/UltraCombos.Kinect2MotionTransmitGrpc.cs.meta
  80. 650
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/Grpc/UltraCombosKinect2MotionTransmit.cs
  81. 13
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/Grpc/UltraCombosKinect2MotionTransmit.cs.meta
  82. 33
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/Kinect2MotionTexture.renderTexture
  83. 9
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/Kinect2MotionTexture.renderTexture.meta
  84. 33
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/Kinect2MotionTexture1.renderTexture
  85. 9
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/Kinect2MotionTexture1.renderTexture.meta
  86. 863
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/KinectGrpc.unity
  87. 9
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/KinectGrpc.unity.meta
  88. 229
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/KinectOpticalFlow.cs
  89. 12
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/KinectOpticalFlow.cs.meta
  90. 78
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/KinectOpticalFlowDebugMaterial.mat
  91. 9
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/KinectOpticalFlowDebugMaterial.mat.meta
  92. 94
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/KinectOpticalFlowDebugShader.shader
  93. 9
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/KinectOpticalFlowDebugShader.shader.meta
  94. 100
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/KinectOpticalFlowMath.cs
  95. 13
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/KinectOpticalFlowMath.cs.meta
  96. 33
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/KinectRenderTexturePosition.renderTexture
  97. 9
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/KinectRenderTexturePosition.renderTexture.meta
  98. 33
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/KinectRenderTextureVelocity.renderTexture
  99. 9
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/KinectRenderTextureVelocity.renderTexture.meta
  100. 74
      Unity-19050-05-BallPool/Assets/KinectOpticalFlow/KinectUpdateShader.compute
  101. Some files were not shown because too many files have changed in this diff Show More

@ -1,10 +0,0 @@
fileFormatVersion: 2
guid: 8bdf519f8f30b6c479411fed445191a4
folderAsset: yes
timeCreated: 1519695581
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -1,532 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 8
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 3
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
--- !u!157 &4
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_TemporalCoherenceThreshold: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 9
m_Resolution: 1
m_BakeResolution: 50
m_TextureWidth: 1024
m_TextureHeight: 1024
m_AO: 1
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 0
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 1
m_BakeBackend: 0
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVRBounces: 2
m_PVRFiltering: 0
m_PVRFilteringMode: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousColorSigma: 1
m_PVRFilteringAtrousNormalSigma: 1
m_PVRFilteringAtrousPositionSigma: 1
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 0
--- !u!196 &5
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666666
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &410104090
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 100000, guid: 254356bdfdadcdd4aafdd4454a3d8f02, type: 2}
m_PrefabInternal: {fileID: 1685451357}
serializedVersion: 5
m_Component:
- component: {fileID: 410104094}
- component: {fileID: 410104093}
- component: {fileID: 410104092}
- component: {fileID: 410104091}
m_Layer: 0
m_Name: FireFluidSim
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &410104091
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 11400000, guid: 254356bdfdadcdd4aafdd4454a3d8f02,
type: 2}
m_PrefabInternal: {fileID: 1685451357}
m_GameObject: {fileID: 410104090}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 164869986c15313419bf6ec021c90430, type: 3}
m_Name:
m_EditorClassIdentifier:
m_denstyAdvectionType: 1
m_reactionAdvectionType: 1
m_width: 64
m_height: 128
m_depth: 64
m_iterations: 10
m_vorticityStrength: 1
m_densityAmount: 1
m_densityDissipation: 0.999
m_densityBuoyancy: 1
m_densityWeight: 0.0125
m_temperatureAmount: 10
m_temperatureDissipation: 0.995
m_reactionAmount: 1
m_reactionDecay: 0.001
m_reactionExtinguishment: 0.01
m_velocityDissipation: 0.995
m_inputRadius: 0.04
m_inputPos: {x: 0.5, y: 0.1, z: 0.5, w: 0}
m_applyImpulse: {fileID: 7200000, guid: a080c25e6daeb0d4e88fced65f9959ce, type: 3}
m_applyAdvect: {fileID: 7200000, guid: 411cedf0db0a1904693c77b97afbf915, type: 3}
m_computeVorticity: {fileID: 7200000, guid: 62b5b102c778bbd4682f63bf0a9bd2fe, type: 3}
m_computeDivergence: {fileID: 7200000, guid: e25212f321912c44ab6d9430762d37b6, type: 3}
m_computeJacobi: {fileID: 7200000, guid: cebd12b982d79674aab2ed65879e49d0, type: 3}
m_computeProjection: {fileID: 7200000, guid: aa1de4528a2c0d24983dce181ecd63af, type: 3}
m_computeConfinement: {fileID: 7200000, guid: 4b0055f0edf774c4ea97ac8cd62e6158,
type: 3}
m_computeObstacles: {fileID: 7200000, guid: 6a49b38e37bae7a4ab2903fbdde8e4ac, type: 3}
m_applyBuoyancy: {fileID: 7200000, guid: 0d7710a16db583e418df13bddb0be43d, type: 3}
--- !u!23 &410104092
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 2300000, guid: 254356bdfdadcdd4aafdd4454a3d8f02,
type: 2}
m_PrefabInternal: {fileID: 1685451357}
m_GameObject: {fileID: 410104090}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 2006b3393d311dc49ab782b940924419, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
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!33 &410104093
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 3300000, guid: 254356bdfdadcdd4aafdd4454a3d8f02,
type: 2}
m_PrefabInternal: {fileID: 1685451357}
m_GameObject: {fileID: 410104090}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &410104094
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 400000, guid: 254356bdfdadcdd4aafdd4454a3d8f02, type: 2}
m_PrefabInternal: {fileID: 1685451357}
m_GameObject: {fileID: 410104090}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 4.001, z: 12}
m_LocalScale: {x: 4, y: 8, z: 4}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1470411171
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 100004, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1470411177}
- component: {fileID: 1470411176}
- component: {fileID: 1470411175}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!92 &1470411175
Behaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 9200000, guid: 9d4133d5d30b644bd87802a347eaccbe,
type: 2}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1470411171}
m_Enabled: 1
--- !u!20 &1470411176
Camera:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 2000000, guid: 9d4133d5d30b644bd87802a347eaccbe,
type: 2}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1470411171}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.42647058, g: 0.42647058, b: 0.42647058, a: 1}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 60
field of view: 40
orthographic: 0
orthographic size: 100
m_Depth: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294966527
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 0
m_AllowMSAA: 1
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
m_StereoMirrorMode: 0
--- !u!4 &1470411177
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 400004, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1470411171}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 2, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1685451357
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 400000, guid: 254356bdfdadcdd4aafdd4454a3d8f02, type: 2}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 254356bdfdadcdd4aafdd4454a3d8f02, type: 2}
propertyPath: m_LocalPosition.y
value: 4.00099993
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 254356bdfdadcdd4aafdd4454a3d8f02, type: 2}
propertyPath: m_LocalPosition.z
value: 12
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 254356bdfdadcdd4aafdd4454a3d8f02, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 254356bdfdadcdd4aafdd4454a3d8f02, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 254356bdfdadcdd4aafdd4454a3d8f02, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 254356bdfdadcdd4aafdd4454a3d8f02, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 254356bdfdadcdd4aafdd4454a3d8f02, type: 2}
propertyPath: m_width
value: 64
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 254356bdfdadcdd4aafdd4454a3d8f02, type: 2}
propertyPath: m_depth
value: 64
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 254356bdfdadcdd4aafdd4454a3d8f02, type: 2}
propertyPath: m_LocalScale.x
value: 4
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 254356bdfdadcdd4aafdd4454a3d8f02, type: 2}
propertyPath: m_LocalScale.z
value: 4
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 254356bdfdadcdd4aafdd4454a3d8f02, type: 2}
propertyPath: m_reactionDecay
value: .00100000005
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 254356bdfdadcdd4aafdd4454a3d8f02, type: 2}
propertyPath: m_reactionAdvectionType
value: 1
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 254356bdfdadcdd4aafdd4454a3d8f02, type: 2}
propertyPath: m_reactionExtinguishment
value: .00999999978
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 254356bdfdadcdd4aafdd4454a3d8f02, type: 2}
propertyPath: m_densityDissipation
value: .999000013
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 254356bdfdadcdd4aafdd4454a3d8f02, type: 2}
m_RootGameObject: {fileID: 410104090}
m_IsPrefabParent: 0
--- !u!1 &1803253977
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1803253979}
- component: {fileID: 1803253978}
m_Layer: 0
m_Name: Directional light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &1803253978
Light:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1803253977}
m_Enabled: 1
serializedVersion: 8
m_Type: 1
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_CookieSize: 10
m_Shadows:
m_Type: 0
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_Lightmapping: 1
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_FalloffTable:
m_Table[0]: 0
m_Table[1]: 0
m_Table[2]: 0
m_Table[3]: 0
m_Table[4]: 0
m_Table[5]: 0
m_Table[6]: 0
m_Table[7]: 0
m_Table[8]: 0
m_Table[9]: 0
m_Table[10]: 0
m_Table[11]: 0
m_Table[12]: 0
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &1803253979
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1803253977}
m_LocalRotation: {x: 0.40821794, y: -0.23456973, z: 0.10938166, w: 0.8754261}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2140950347
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 2140950351}
- component: {fileID: 2140950350}
- component: {fileID: 2140950349}
- component: {fileID: 2140950348}
m_Layer: 0
m_Name: Plane
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!23 &2140950348
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2140950347}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 0d538acbbf71af343b5efaa45bd9af35, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
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!64 &2140950349
MeshCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2140950347}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Convex: 0
m_InflateMesh: 0
m_SkinWidth: 0.01
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &2140950350
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2140950347}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &2140950351
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2140950347}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 8, y: 8, z: 8}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

@ -1,4 +0,0 @@
fileFormatVersion: 2
guid: 405ae8807e9bbb141953d785d46979aa
DefaultImporter:
userData:

@ -1,5 +0,0 @@
fileFormatVersion: 2
guid: f6db2bc76e7b3754886e1b8e79996ff0
folderAsset: yes
DefaultImporter:
userData:

@ -1,29 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: FireRayCast
m_Shader: {fileID: 4800000, guid: ce7e14398ee00d84193a82fb0174f3f6, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _FireGradient:
m_Texture: {fileID: 2800000, guid: ac2c4961e13090042b382bb1c186bc31, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _FireAbsorption: 30
- _SmokeAbsorption: 60
m_Colors:
- _SmokeColor: {r: 0, g: 0, b: 0, a: 1}

@ -1,4 +0,0 @@
fileFormatVersion: 2
guid: 2006b3393d311dc49ab782b940924419
NativeFormatImporter:
userData:

@ -1,27 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Plane
m_Shader: {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats: []
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}

@ -1,4 +0,0 @@
fileFormatVersion: 2
guid: 0d538acbbf71af343b5efaa45bd9af35
NativeFormatImporter:
userData:

@ -1,39 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: SmokeRayCast
m_Shader: {fileID: 4800000, guid: edf7886cf7d957f4c8416e250df7367c, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _FireGradient:
m_Texture: {fileID: 2800000, guid: ac2c4961e13090042b382bb1c186bc31, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Noise:
m_Texture: {fileID: 2800000, guid: 4c7152dd0f6e54d46952f29abb57d4d5, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SmokeGradient:
m_Texture: {fileID: 2800000, guid: e0a2b0af0d77f45478f599c74d453d6f, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _Absorption: 60
- _FireAbsorption: 40
- _SmokeAbsorption: 60
m_Colors:
- _Color: {r: 0, g: 0, b: 0, a: 1}
- _SmokeColor: {r: 0, g: 0, b: 0, a: 1}

@ -1,4 +0,0 @@
fileFormatVersion: 2
guid: dfd547b8d6e669e43901fd5e9e8632f1
NativeFormatImporter:
userData:

@ -1,5 +0,0 @@
fileFormatVersion: 2
guid: fd9ac0e19d371c4468b5b921ab7d92a3
folderAsset: yes
DefaultImporter:
userData:

@ -1,123 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &100000
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 400000}
- component: {fileID: 3300000}
- component: {fileID: 2300000}
- component: {fileID: 11400000}
m_Layer: 0
m_Name: FireFluidSim
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &400000
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 4.001, z: 24}
m_LocalScale: {x: 4, y: 8, z: 4}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &2300000
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 2006b3393d311dc49ab782b940924419, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
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!33 &3300000
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 164869986c15313419bf6ec021c90430, type: 3}
m_Name:
m_EditorClassIdentifier:
m_denstyAdvectionType: 1
m_reactionAdvectionType: 1
m_width: 128
m_height: 128
m_depth: 128
m_iterations: 10
m_vorticityStrength: 1
m_densityAmount: 1
m_densityDissipation: 0.999
m_densityBuoyancy: 1
m_densityWeight: 0.0125
m_temperatureAmount: 10
m_temperatureDissipation: 0.995
m_reactionAmount: 1
m_reactionDecay: 0.001
m_reactionExtinguishment: 0.01
m_velocityDissipation: 0.995
m_inputRadius: 0.04
m_inputPos: {x: 0.5, y: 0.1, z: 0.5, w: 0}
m_applyImpulse: {fileID: 7200000, guid: a080c25e6daeb0d4e88fced65f9959ce, type: 3}
m_applyAdvect: {fileID: 7200000, guid: 411cedf0db0a1904693c77b97afbf915, type: 3}
m_computeVorticity: {fileID: 7200000, guid: 62b5b102c778bbd4682f63bf0a9bd2fe, type: 3}
m_computeDivergence: {fileID: 7200000, guid: e25212f321912c44ab6d9430762d37b6, type: 3}
m_computeJacobi: {fileID: 7200000, guid: cebd12b982d79674aab2ed65879e49d0, type: 3}
m_computeProjection: {fileID: 7200000, guid: aa1de4528a2c0d24983dce181ecd63af, type: 3}
m_computeConfinement: {fileID: 7200000, guid: 4b0055f0edf774c4ea97ac8cd62e6158,
type: 3}
m_computeObstacles: {fileID: 7200000, guid: 6a49b38e37bae7a4ab2903fbdde8e4ac, type: 3}
m_applyBuoyancy: {fileID: 7200000, guid: 0d7710a16db583e418df13bddb0be43d, type: 3}
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 100000}
m_IsPrefabParent: 1

@ -1,4 +0,0 @@
fileFormatVersion: 2
guid: 254356bdfdadcdd4aafdd4454a3d8f02
NativeFormatImporter:
userData:

@ -1,119 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &100000
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 400000}
- component: {fileID: 3300000}
- component: {fileID: 2300000}
- component: {fileID: 11400000}
m_Layer: 0
m_Name: SmokeFluidSim
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &400000
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 4.001, z: 24}
m_LocalScale: {x: 4, y: 8, z: 4}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &2300000
MeshRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: dfd547b8d6e669e43901fd5e9e8632f1, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
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!33 &3300000
MeshFilter:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a924471615937564f81ebb1540cd8b36, type: 3}
m_Name:
m_EditorClassIdentifier:
m_advectionType: 1
m_width: 64
m_height: 128
m_depth: 64
m_iterations: 10
m_vorticityStrength: 1
m_densityAmount: 1
m_densityDissipation: 0.999
m_densityBuoyancy: 1
m_densityWeight: 0.0125
m_temperatureAmount: 10
m_temperatureDissipation: 0.995
m_velocityDissipation: 0.995
m_inputRadius: 0.04
m_inputPos: {x: 0.5, y: 0.1, z: 0.5, w: 0}
m_applyImpulse: {fileID: 7200000, guid: a080c25e6daeb0d4e88fced65f9959ce, type: 3}
m_applyAdvect: {fileID: 7200000, guid: 411cedf0db0a1904693c77b97afbf915, type: 3}
m_computeVorticity: {fileID: 7200000, guid: 62b5b102c778bbd4682f63bf0a9bd2fe, type: 3}
m_computeDivergence: {fileID: 7200000, guid: e25212f321912c44ab6d9430762d37b6, type: 3}
m_computeJacobi: {fileID: 7200000, guid: cebd12b982d79674aab2ed65879e49d0, type: 3}
m_computeProjection: {fileID: 7200000, guid: aa1de4528a2c0d24983dce181ecd63af, type: 3}
m_computeConfinement: {fileID: 7200000, guid: 4b0055f0edf774c4ea97ac8cd62e6158,
type: 3}
m_computeObstacles: {fileID: 7200000, guid: 6a49b38e37bae7a4ab2903fbdde8e4ac, type: 3}
m_applyBuoyancy: {fileID: 7200000, guid: 0d7710a16db583e418df13bddb0be43d, type: 3}
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 100000}
m_IsPrefabParent: 1

@ -1,4 +0,0 @@
fileFormatVersion: 2
guid: 0b40c0b4ea4208b4792d95085b850676
NativeFormatImporter:
userData:

@ -1,5 +0,0 @@
fileFormatVersion: 2
guid: 0f670c9ec84a88d4cab33481a41f9b00
folderAsset: yes
DefaultImporter:
userData:

@ -1,464 +0,0 @@
using UnityEngine;
using System.Collections;
namespace FluidSim3DProject
{
public class FireFluidSim : MonoBehaviour
{
//DONT CHANGE THESE
const int READ = 0;
const int WRITE = 1;
const int PHI_N_HAT = 0;
const int PHI_N_1_HAT = 1;
public enum ADVECTION { NORMAL = 1, BFECC = 2, MACCORMACK = 3 };
//You can change this but you must change the same value in all the compute shader's to the same
//Must be a pow2 number
const int NUM_THREADS = 8;
//You can change this or even use Time.DeltaTime but large time steps can cause numerical errors
const float TIME_STEP = 0.1f;
public ADVECTION m_denstyAdvectionType = ADVECTION.NORMAL;
public ADVECTION m_reactionAdvectionType = ADVECTION.NORMAL;
public int m_width = 128;
public int m_height = 128;
public int m_depth = 128;
public int m_iterations = 10;
public float m_vorticityStrength = 1.0f;
public float m_densityAmount = 1.0f;
public float m_densityDissipation = 0.999f;
public float m_densityBuoyancy = 1.0f;
public float m_densityWeight = 0.0125f;
public float m_temperatureAmount = 10.0f;
public float m_temperatureDissipation = 0.995f;
public float m_reactionAmount = 1.0f;
public float m_reactionDecay = 0.001f;
public float m_reactionExtinguishment = 0.01f;
public float m_velocityDissipation = 0.995f;
public float m_inputRadius = 0.04f;
public Vector4 m_inputPos = new Vector4(0.5f,0.1f,0.5f,0.0f);
float m_ambientTemperature = 0.0f;
public ComputeShader m_applyImpulse, m_applyAdvect, m_computeVorticity;
public ComputeShader m_computeDivergence, m_computeJacobi, m_computeProjection;
public ComputeShader m_computeConfinement, m_computeObstacles, m_applyBuoyancy;
Vector4 m_size;
ComputeBuffer[] m_density, m_velocity, m_pressure, m_temperature, m_phi, m_reaction;
ComputeBuffer m_temp3f, m_obstacles;
void Start ()
{
//Dimension sizes must be pow2 numbers
m_width = Mathf.ClosestPowerOfTwo(m_width);
m_height = Mathf.ClosestPowerOfTwo(m_height);
m_depth = Mathf.ClosestPowerOfTwo(m_depth);
//Put all dimension sizes in a vector for easy parsing to shader and also prevents user changing
//dimension sizes during play
m_size = new Vector4(m_width, m_height, m_depth, 0.0f);
//Create all the buffers needed
int SIZE = m_width*m_height*m_depth;
m_density = new ComputeBuffer[2];
m_density[READ] = new ComputeBuffer(SIZE, sizeof(float));
m_density[WRITE] = new ComputeBuffer(SIZE, sizeof(float));
m_temperature = new ComputeBuffer[2];
m_temperature[READ] = new ComputeBuffer(SIZE, sizeof(float));
m_temperature[WRITE] = new ComputeBuffer(SIZE, sizeof(float));
m_reaction = new ComputeBuffer[2];
m_reaction[READ] = new ComputeBuffer(SIZE, sizeof(float));
m_reaction[WRITE] = new ComputeBuffer(SIZE, sizeof(float));
m_phi = new ComputeBuffer[2];
m_phi[READ] = new ComputeBuffer(SIZE, sizeof(float));
m_phi[WRITE] = new ComputeBuffer(SIZE, sizeof(float));
m_velocity = new ComputeBuffer[2];
m_velocity[READ] = new ComputeBuffer(SIZE, sizeof(float)*3);
m_velocity[WRITE] = new ComputeBuffer(SIZE, sizeof(float)*3);
m_pressure = new ComputeBuffer[2];
m_pressure[READ] = new ComputeBuffer(SIZE, sizeof(float));
m_pressure[WRITE] = new ComputeBuffer(SIZE, sizeof(float));
m_obstacles = new ComputeBuffer(SIZE, sizeof(float));
m_temp3f = new ComputeBuffer(SIZE, sizeof(float)*3);
//Any areas that are obstacles need to be masked of in the obstacle buffer
//At the moment is only the border around the edge of the buffers to enforce non-slip boundary conditions
ComputeObstacles();
}
void Swap(ComputeBuffer[] buffer)
{
ComputeBuffer tmp = buffer[READ];
buffer[READ] = buffer[WRITE];
buffer[WRITE] = tmp;
}
void ComputeObstacles()
{
m_computeObstacles.SetVector("_Size", m_size);
m_computeObstacles.SetBuffer(0, "_Write", m_obstacles);
m_computeObstacles.Dispatch(0, (int)m_size.x/NUM_THREADS, (int)m_size.y/NUM_THREADS, (int)m_size.z/NUM_THREADS);
}
void ApplyImpulse(float dt, float amount, ComputeBuffer[] buffer)
{
m_applyImpulse.SetVector("_Size", m_size);
m_applyImpulse.SetFloat("_Radius", m_inputRadius);
m_applyImpulse.SetFloat("_Amount", amount);
m_applyImpulse.SetFloat("_DeltaTime", dt);
m_applyImpulse.SetVector("_Pos", m_inputPos);
m_applyImpulse.SetBuffer(0, "_Read", buffer[READ]);
m_applyImpulse.SetBuffer(0, "_Write", buffer[WRITE]);
m_applyImpulse.Dispatch(0, (int)m_size.x/NUM_THREADS, (int)m_size.y/NUM_THREADS, (int)m_size.z/NUM_THREADS);
Swap(buffer);
}
void ApplyExtinguishmentImpulse(float dt, float amount, ComputeBuffer[] buffer)
{
m_applyImpulse.SetVector("_Size", m_size);
m_applyImpulse.SetFloat("_Radius", m_inputRadius);
m_applyImpulse.SetFloat("_Amount", amount);
m_applyImpulse.SetFloat("_DeltaTime", dt);
m_applyImpulse.SetVector("_Pos", m_inputPos);
m_applyImpulse.SetFloat("_Extinguishment", m_reactionExtinguishment);
m_applyImpulse.SetBuffer(1, "_Read", buffer[READ]);
m_applyImpulse.SetBuffer(1, "_Write", buffer[WRITE]);
m_applyImpulse.SetBuffer(1, "_Reaction", m_reaction[READ]);
m_applyImpulse.Dispatch(1, (int)m_size.x/NUM_THREADS, (int)m_size.y/NUM_THREADS, (int)m_size.z/NUM_THREADS);
Swap(buffer);
}
void ApplyBuoyancy(float dt)
{
m_applyBuoyancy.SetVector("_Size", m_size);
m_applyBuoyancy.SetVector("_Up", new Vector4(0,1,0,0));
m_applyBuoyancy.SetFloat("_Buoyancy", m_densityBuoyancy);
m_applyBuoyancy.SetFloat("_AmbientTemperature", m_ambientTemperature);
m_applyBuoyancy.SetFloat("_Weight", m_densityWeight);
m_applyBuoyancy.SetFloat("_DeltaTime", dt);
m_applyBuoyancy.SetBuffer(0, "_Write", m_velocity[WRITE]);
m_applyBuoyancy.SetBuffer(0, "_Velocity", m_velocity[READ]);
m_applyBuoyancy.SetBuffer(0, "_Density", m_density[READ]);
m_applyBuoyancy.SetBuffer(0, "_Temperature", m_temperature[READ]);
m_applyBuoyancy.Dispatch(0, (int)m_size.x/NUM_THREADS, (int)m_size.y/NUM_THREADS, (int)m_size.z/NUM_THREADS);
Swap(m_velocity);
}
void ApplyAdvection(float dt, float dissipation, float decay, ComputeBuffer[] buffer, float forward = 1.0f)
{
m_applyAdvect.SetVector("_Size", m_size);
m_applyAdvect.SetFloat("_DeltaTime", dt);
m_applyAdvect.SetFloat("_Dissipate", dissipation);
m_applyAdvect.SetFloat("_Forward", forward);
m_applyAdvect.SetFloat("_Decay", decay);
m_applyAdvect.SetBuffer((int)ADVECTION.NORMAL, "_Read1f", buffer[READ]);
m_applyAdvect.SetBuffer((int)ADVECTION.NORMAL, "_Write1f", buffer[WRITE]);
m_applyAdvect.SetBuffer((int)ADVECTION.NORMAL, "_Velocity", m_velocity[READ]);
m_applyAdvect.SetBuffer((int)ADVECTION.NORMAL, "_Obstacles", m_obstacles);
m_applyAdvect.Dispatch((int)ADVECTION.NORMAL, (int)m_size.x/NUM_THREADS, (int)m_size.y/NUM_THREADS, (int)m_size.z/NUM_THREADS);
Swap(buffer);
}
void ApplyAdvection(float dt, float dissipation, float decay, ComputeBuffer read, ComputeBuffer write, float forward = 1.0f)
{
m_applyAdvect.SetVector("_Size", m_size);
m_applyAdvect.SetFloat("_DeltaTime", dt);
m_applyAdvect.SetFloat("_Dissipate", dissipation);
m_applyAdvect.SetFloat("_Forward", forward);
m_applyAdvect.SetFloat("_Decay", decay);
m_applyAdvect.SetBuffer((int)ADVECTION.NORMAL, "_Read1f", read);
m_applyAdvect.SetBuffer((int)ADVECTION.NORMAL, "_Write1f", write);
m_applyAdvect.SetBuffer((int)ADVECTION.NORMAL, "_Velocity", m_velocity[READ]);
m_applyAdvect.SetBuffer((int)ADVECTION.NORMAL, "_Obstacles", m_obstacles);
m_applyAdvect.Dispatch((int)ADVECTION.NORMAL, (int)m_size.x/NUM_THREADS, (int)m_size.y/NUM_THREADS, (int)m_size.z/NUM_THREADS);
}
void ApplyAdvectionBFECC(float dt, float dissipation, float decay, ComputeBuffer[] buffer)
{
m_applyAdvect.SetVector("_Size", m_size);
m_applyAdvect.SetFloat("_DeltaTime", dt);
m_applyAdvect.SetFloat("_Dissipate", dissipation);
m_applyAdvect.SetFloat("_Forward", 1.0f);
m_applyAdvect.SetFloat("_Decay", decay);
m_applyAdvect.SetBuffer((int)ADVECTION.BFECC, "_Read1f", buffer[READ]);
m_applyAdvect.SetBuffer((int)ADVECTION.BFECC, "_Write1f", buffer[WRITE]);
m_applyAdvect.SetBuffer((int)ADVECTION.BFECC, "_Phi_n_hat", m_phi[PHI_N_HAT]);
m_applyAdvect.SetBuffer((int)ADVECTION.BFECC, "_Velocity", m_velocity[READ]);
m_applyAdvect.SetBuffer((int)ADVECTION.BFECC, "_Obstacles", m_obstacles);
m_applyAdvect.Dispatch((int)ADVECTION.BFECC, (int)m_size.x/NUM_THREADS, (int)m_size.y/NUM_THREADS, (int)m_size.z/NUM_THREADS);
Swap(buffer);
}
void ApplyAdvectionMacCormack(float dt, float dissipation, float decay, ComputeBuffer[] buffer)
{
m_applyAdvect.SetVector("_Size", m_size);
m_applyAdvect.SetFloat("_DeltaTime", dt);
m_applyAdvect.SetFloat("_Dissipate", dissipation);
m_applyAdvect.SetFloat("_Forward", 1.0f);
m_applyAdvect.SetFloat("_Decay", decay);
m_applyAdvect.SetBuffer((int)ADVECTION.MACCORMACK, "_Read1f", buffer[READ]);
m_applyAdvect.SetBuffer((int)ADVECTION.MACCORMACK, "_Write1f", buffer[WRITE]);
m_applyAdvect.SetBuffer((int)ADVECTION.MACCORMACK, "_Phi_n_1_hat", m_phi[PHI_N_1_HAT]);
m_applyAdvect.SetBuffer((int)ADVECTION.MACCORMACK, "_Phi_n_hat", m_phi[PHI_N_HAT]);
m_applyAdvect.SetBuffer((int)ADVECTION.MACCORMACK, "_Velocity", m_velocity[READ]);
m_applyAdvect.SetBuffer((int)ADVECTION.MACCORMACK, "_Obstacles", m_obstacles);
m_applyAdvect.Dispatch((int)ADVECTION.MACCORMACK, (int)m_size.x/NUM_THREADS, (int)m_size.y/NUM_THREADS, (int)m_size.z/NUM_THREADS);
Swap(buffer);
}
void ApplyAdvectionVelocity(float dt)
{
m_applyAdvect.SetVector("_Size", m_size);
m_applyAdvect.SetFloat("_DeltaTime", dt);
m_applyAdvect.SetFloat("_Dissipate", m_velocityDissipation);
m_applyAdvect.SetFloat("_Forward", 1.0f);
m_applyAdvect.SetFloat("_Decay", 0.0f);
m_applyAdvect.SetBuffer(0, "_Read3f", m_velocity[READ]);
m_applyAdvect.SetBuffer(0, "_Write3f", m_velocity[WRITE]);
m_applyAdvect.SetBuffer(0, "_Velocity", m_velocity[READ]);
m_applyAdvect.SetBuffer(0, "_Obstacles", m_obstacles);
m_applyAdvect.Dispatch(0, (int)m_size.x/NUM_THREADS, (int)m_size.y/NUM_THREADS, (int)m_size.z/NUM_THREADS);
Swap(m_velocity);
}
void ComputeVorticityConfinement(float dt)
{
m_computeVorticity.SetVector("_Size", m_size);
m_computeVorticity.SetBuffer(0, "_Write", m_temp3f);
m_computeVorticity.SetBuffer(0, "_Velocity", m_velocity[READ]);
m_computeVorticity.Dispatch(0, (int)m_size.x/NUM_THREADS, (int)m_size.y/NUM_THREADS, (int)m_size.z/NUM_THREADS);
m_computeConfinement.SetVector("_Size", m_size);
m_computeConfinement.SetFloat("_DeltaTime", dt);
m_computeConfinement.SetFloat("_Epsilon", m_vorticityStrength);
m_computeConfinement.SetBuffer(0, "_Write", m_velocity[WRITE]);
m_computeConfinement.SetBuffer(0, "_Read", m_velocity[READ]);
m_computeConfinement.SetBuffer(0, "_Vorticity", m_temp3f);
m_computeConfinement.Dispatch(0, (int)m_size.x/NUM_THREADS, (int)m_size.y/NUM_THREADS, (int)m_size.z/NUM_THREADS);
Swap(m_velocity);
}
void ComputeDivergence()
{
m_computeDivergence.SetVector("_Size", m_size);
m_computeDivergence.SetBuffer(0, "_Write", m_temp3f);
m_computeDivergence.SetBuffer(0, "_Velocity", m_velocity[READ]);
m_computeDivergence.SetBuffer(0, "_Obstacles", m_obstacles);
m_computeDivergence.Dispatch(0, (int)m_size.x/NUM_THREADS, (int)m_size.y/NUM_THREADS, (int)m_size.z/NUM_THREADS);
}
void ComputePressure()
{
m_computeJacobi.SetVector("_Size", m_size);
m_computeJacobi.SetBuffer(0, "_Divergence", m_temp3f);
m_computeJacobi.SetBuffer(0, "_Obstacles", m_obstacles);
for(int i = 0; i < m_iterations; i++)
{
m_computeJacobi.SetBuffer(0, "_Write", m_pressure[WRITE]);
m_computeJacobi.SetBuffer(0, "_Pressure", m_pressure[READ]);
m_computeJacobi.Dispatch(0, (int)m_size.x/NUM_THREADS, (int)m_size.y/NUM_THREADS, (int)m_size.z/NUM_THREADS);
Swap(m_pressure);
}
}
void ComputeProjection()
{
m_computeProjection.SetVector("_Size", m_size);
m_computeProjection.SetBuffer(0, "_Obstacles", m_obstacles);
m_computeProjection.SetBuffer(0, "_Pressure", m_pressure[READ]);
m_computeProjection.SetBuffer(0, "_Velocity", m_velocity[READ]);
m_computeProjection.SetBuffer(0, "_Write", m_velocity[WRITE]);
m_computeProjection.Dispatch(0, (int)m_size.x/NUM_THREADS, (int)m_size.y/NUM_THREADS, (int)m_size.z/NUM_THREADS);
Swap(m_velocity);
}
void Update ()
{
float dt = TIME_STEP;
//First off advect any buffers that contain physical quantities like density or temperature by the
//velocity field. Advection is what moves values around.
ApplyAdvection(dt, m_temperatureDissipation, 0.0f, m_temperature);
//Normal advection can cause smoothing of the advected field making the results look less interesting.
//BFECC is a method of advection that helps to prevents this smoothing at a extra performance cost but is less numerically stable.
//MacCormack does the same as BFECC but is more (not completely) numerically stable and is more costly
//You only really need to do this type of advection on visible fields, but you can do it on non visible ones if you want
if(m_denstyAdvectionType == ADVECTION.BFECC)
{
ApplyAdvection(dt, 1.0f, 0.0f, m_density, 1.0f); //advect forward into write buffer
ApplyAdvection(dt, 1.0f, 0.0f, m_density[READ], m_phi[PHI_N_HAT], -1.0f); //advect back into phi_n_hat buffer
ApplyAdvectionBFECC(dt, m_densityDissipation, 0.0f, m_density); //advect using BFECC
}
else if(m_denstyAdvectionType == ADVECTION.MACCORMACK)
{
ApplyAdvection(dt, 1.0f, 0.0f, m_density[READ], m_phi[PHI_N_1_HAT], 1.0f); //advect forward into phi_n_1_hat buffer
ApplyAdvection(dt, 1.0f, 0.0f, m_phi[PHI_N_1_HAT], m_phi[PHI_N_HAT], -1.0f); //advect back into phi_n_hat buffer
ApplyAdvectionMacCormack(dt, m_densityDissipation, 0.0f, m_density);
}
else
{
ApplyAdvection(dt, m_densityDissipation, 0.0f, m_density);
}
//The reaction advection looks better using normal for shorter lived fire (ie a hight decay rate) and
//looks better with BFECC or macCormack for longer lived fire (in my opinion)
if(m_reactionAdvectionType == ADVECTION.BFECC)
{
ApplyAdvection(dt, 1.0f, 0.0f, m_reaction, 1.0f); //advect forward into write buffer
ApplyAdvection(dt, 1.0f, 0.0f, m_reaction[READ], m_phi[PHI_N_HAT], -1.0f); //advect back into phi_n_hat buffer
ApplyAdvectionBFECC(dt, 1.0f, m_reactionDecay, m_reaction); //advect using BFECC
}
else if(m_reactionAdvectionType == ADVECTION.MACCORMACK)
{
ApplyAdvection(dt, 1.0f, 0.0f, m_reaction[READ], m_phi[PHI_N_1_HAT], 1.0f); //advect forward into phi_n_1_hat buffer
ApplyAdvection(dt, 1.0f, 0.0f, m_phi[PHI_N_1_HAT], m_phi[PHI_N_HAT], -1.0f); //advect back into phi_n_hat buffer
ApplyAdvectionMacCormack(dt, 1.0f, m_reactionDecay, m_reaction);
}
else
{
ApplyAdvection(dt, 1.0f, m_reactionDecay, m_reaction);
}
//The velocity field also advects its self.
ApplyAdvectionVelocity(dt);
//Apply the effect the sinking colder smoke has on the velocity field
ApplyBuoyancy(dt);
//Adds a certain amount of reaction (fire) and temperate
ApplyImpulse(dt, m_reactionAmount, m_reaction);
ApplyImpulse(dt, m_temperatureAmount, m_temperature);
//The smoke is formed when the reaction is extinguished. When the reaction amount
//falls below the extinguishment factor smoke is added
ApplyExtinguishmentImpulse(dt, m_densityAmount, m_density);
//The fuild sim math tends to remove the swirling movement of fluids.
//This step will try and add it back in
ComputeVorticityConfinement(dt);
//Compute the divergence of the velocity field. In fluid simulation the
//fluid is modelled as being incompressible meaning that the volume of the fluid
//does not change over time. The divergence is the amount the field has deviated from being divergence free
ComputeDivergence();
//This computes the pressure need return the fluid to a divergence free condition
ComputePressure();
//Subtract the pressure field from the velocity field enforcing the divergence free conditions
ComputeProjection();
//rotation of box not support because ray cast in shader uses a AABB intersection
transform.rotation = Quaternion.identity;
GetComponent<Renderer>().material.SetVector("_Translate", transform.localPosition);
GetComponent<Renderer>().material.SetVector("_Scale", transform.localScale);
GetComponent<Renderer>().material.SetBuffer("_Density", m_density[READ]);
GetComponent<Renderer>().material.SetBuffer("_Reaction", m_reaction[READ]);
GetComponent<Renderer>().material.SetVector("_Size", m_size);
}
void OnDestroy()
{
m_density[READ].Release();
m_density[WRITE].Release();
m_temperature[READ].Release();
m_temperature[WRITE].Release();
m_reaction[READ].Release();
m_reaction[WRITE].Release();
m_phi[PHI_N_1_HAT].Release();
m_phi[PHI_N_HAT].Release();
m_velocity[READ].Release();
m_velocity[WRITE].Release();
m_pressure[READ].Release();
m_pressure[WRITE].Release();
m_obstacles.Release();
m_temp3f.Release();
}
}
}

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 164869986c15313419bf6ec021c90430
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

@ -1,436 +0,0 @@
using UnityEngine;
using System.Collections;
namespace FluidSim3DProject
{
public class SmokeFluidSim : MonoBehaviour
{
//DONT CHANGE THESE
const int READ = 0;
const int WRITE = 1;
const int PHI_N_HAT = 0;
const int PHI_N_1_HAT = 1;
public enum ADVECTION { NORMAL = 1, BFECC = 2, MACCORMACK = 3 };
//You can change this but you must change the same value in all the compute shader's to the same
//Must be a pow2 number
const int NUM_THREADS = 8;
//You can change this or even use Time.DeltaTime but large time steps can cause numerical errors
const float TIME_STEP = 0.1f;
public ADVECTION m_advectionType = ADVECTION.NORMAL;
public int m_width = 128;
public int m_height = 128;
public int m_depth = 128;
public int m_iterations = 10;
public float m_vorticityStrength = 1.0f;
public float m_densityAmount = 1.0f;
public float m_densityDissipation = 0.999f;
public float m_densityBuoyancy = 1.0f;
public float m_densityWeight = 0.0125f;
public float m_temperatureAmount = 10.0f;
public float m_temperatureDissipation = 0.995f;
public float m_velocityDissipation = 0.995f;
public float m_inputRadius = 0.04f;
public Vector4 m_inputPos = new Vector4(0.5f,0.1f,0.5f,0.0f);
float m_ambientTemperature = 0.0f;
public ComputeShader m_applyImpulse, m_applyAdvect, m_computeVorticity;
public ComputeShader m_computeDivergence, m_computeJacobi, m_computeProjection;
public ComputeShader m_computeConfinement, m_computeObstacles, m_applyBuoyancy;
Vector4 m_size;
ComputeBuffer[] m_density, m_velocity, m_pressure, m_temperature, m_phi;
ComputeBuffer m_temp3f, m_obstacles;
// Ultracombos -------------------------------------------
[Header("Ultracombos Custom")]
public bool doUpdate = true;
public bool doDraw = true;
public float timeStepMultiplier = 5.0f;
public ComputeBuffer DensityBuffer { get { return m_density[READ]; } }
public ComputeBuffer VelocityBuffer { get { return m_velocity[READ]; } }
public ComputeBuffer TemperatureBuffer { get { return m_temperature[READ]; } }
public ComputeBuffer ObstacleBuffer { get { return m_obstacles; } }
public Vector4 GridSize { get { return transform.lossyScale; } }
public Vector4 GridRoot { get { return transform.position - transform.lossyScale * 0.5f; } }
public Vector4 GridDim { get { return m_size; } }
// Ultracombos -------------------------------------------
void Start ()
{
//Dimension sizes must be pow2 numbers
m_width = Mathf.ClosestPowerOfTwo(m_width);
m_height = Mathf.ClosestPowerOfTwo(m_height);
m_depth = Mathf.ClosestPowerOfTwo(m_depth);
//Put all dimension sizes in a vector for easy parsing to shader and also prevents user changing
//dimension sizes during play
m_size = new Vector4(m_width, m_height, m_depth, 0.0f);
//Create all the buffers needed
int SIZE = m_width*m_height*m_depth;
m_density = new ComputeBuffer[2];
m_density[READ] = new ComputeBuffer(SIZE, sizeof(float));
m_density[WRITE] = new ComputeBuffer(SIZE, sizeof(float));
m_temperature = new ComputeBuffer[2];
m_temperature[READ] = new ComputeBuffer(SIZE, sizeof(float));
m_temperature[WRITE] = new ComputeBuffer(SIZE, sizeof(float));
m_phi = new ComputeBuffer[2];
m_phi[READ] = new ComputeBuffer(SIZE, sizeof(float));
m_phi[WRITE] = new ComputeBuffer(SIZE, sizeof(float));
m_velocity = new ComputeBuffer[2];
m_velocity[READ] = new ComputeBuffer(SIZE, sizeof(float)*3);
m_velocity[WRITE] = new ComputeBuffer(SIZE, sizeof(float)*3);
m_pressure = new ComputeBuffer[2];
m_pressure[READ] = new ComputeBuffer(SIZE, sizeof(float));
m_pressure[WRITE] = new ComputeBuffer(SIZE, sizeof(float));
m_obstacles = new ComputeBuffer(SIZE, sizeof(float));
m_temp3f = new ComputeBuffer(SIZE, sizeof(float)*3);
//Any areas that are obstacles need to be masked of in the obstacle buffer
//At the moment is only the border around the edge of the buffers to enforce non-slip boundary conditions
ComputeObstacles();
}
void Swap(ComputeBuffer[] buffer)
{
ComputeBuffer tmp = buffer[READ];
buffer[READ] = buffer[WRITE];
buffer[WRITE] = tmp;
}
void ComputeObstacles()
{
m_computeObstacles.SetVector("_Size", m_size);
m_computeObstacles.SetBuffer(0, "_Write", m_obstacles);
m_computeObstacles.Dispatch(0, (int)m_size.x/NUM_THREADS, (int)m_size.y/NUM_THREADS, (int)m_size.z/NUM_THREADS);
}
void ApplyImpulse(float dt, float amount, ComputeBuffer[] buffer)
{
m_applyImpulse.SetVector("_Size", m_size);
m_applyImpulse.SetFloat("_Radius", m_inputRadius);
m_applyImpulse.SetFloat("_Amount", amount);
m_applyImpulse.SetFloat("_DeltaTime", dt);
m_applyImpulse.SetVector("_Pos", m_inputPos);
m_applyImpulse.SetBuffer(0, "_Read", buffer[READ]);
m_applyImpulse.SetBuffer(0, "_Write", buffer[WRITE]);
m_applyImpulse.Dispatch(0, (int)m_size.x/NUM_THREADS, (int)m_size.y/NUM_THREADS, (int)m_size.z/NUM_THREADS);
Swap(buffer);
}
void ApplyBuoyancy(float dt)
{
m_applyBuoyancy.SetVector("_Size", m_size);
m_applyBuoyancy.SetVector("_Up", new Vector4(0,1,0,0));
m_applyBuoyancy.SetFloat("_Buoyancy", m_densityBuoyancy);
m_applyBuoyancy.SetFloat("_AmbientTemperature", m_ambientTemperature);
m_applyBuoyancy.SetFloat("_Weight", m_densityWeight);
m_applyBuoyancy.SetFloat("_DeltaTime", dt);
m_applyBuoyancy.SetBuffer(0, "_Write", m_velocity[WRITE]);
m_applyBuoyancy.SetBuffer(0, "_Velocity", m_velocity[READ]);
m_applyBuoyancy.SetBuffer(0, "_Density", m_density[READ]);
m_applyBuoyancy.SetBuffer(0, "_Temperature", m_temperature[READ]);
m_applyBuoyancy.Dispatch(0, (int)m_size.x/NUM_THREADS, (int)m_size.y/NUM_THREADS, (int)m_size.z/NUM_THREADS);
Swap(m_velocity);
}
void ApplyAdvection(float dt, float dissipation, float decay, ComputeBuffer[] buffer, float forward = 1.0f)
{
m_applyAdvect.SetVector("_Size", m_size);
m_applyAdvect.SetFloat("_DeltaTime", dt);
m_applyAdvect.SetFloat("_Dissipate", dissipation);
m_applyAdvect.SetFloat("_Forward", forward);
m_applyAdvect.SetFloat("_Decay", decay);
m_applyAdvect.SetBuffer((int)ADVECTION.NORMAL, "_Read1f", buffer[READ]);
m_applyAdvect.SetBuffer((int)ADVECTION.NORMAL, "_Write1f", buffer[WRITE]);
m_applyAdvect.SetBuffer((int)ADVECTION.NORMAL, "_Velocity", m_velocity[READ]);
m_applyAdvect.SetBuffer((int)ADVECTION.NORMAL, "_Obstacles", m_obstacles);
m_applyAdvect.Dispatch((int)ADVECTION.NORMAL, (int)m_size.x/NUM_THREADS, (int)m_size.y/NUM_THREADS, (int)m_size.z/NUM_THREADS);
Swap(buffer);
}
void ApplyAdvection(float dt, float dissipation, float decay, ComputeBuffer read, ComputeBuffer write, float forward = 1.0f)
{
m_applyAdvect.SetVector("_Size", m_size);
m_applyAdvect.SetFloat("_DeltaTime", dt);
m_applyAdvect.SetFloat("_Dissipate", dissipation);
m_applyAdvect.SetFloat("_Forward", forward);
m_applyAdvect.SetFloat("_Decay", decay);
m_applyAdvect.SetBuffer((int)ADVECTION.NORMAL, "_Read1f", read);
m_applyAdvect.SetBuffer((int)ADVECTION.NORMAL, "_Write1f", write);
m_applyAdvect.SetBuffer((int)ADVECTION.NORMAL, "_Velocity", m_velocity[READ]);
m_applyAdvect.SetBuffer((int)ADVECTION.NORMAL, "_Obstacles", m_obstacles);
m_applyAdvect.Dispatch((int)ADVECTION.NORMAL, (int)m_size.x/NUM_THREADS, (int)m_size.y/NUM_THREADS, (int)m_size.z/NUM_THREADS);
}
void ApplyAdvectionBFECC(float dt, float dissipation, float decay, ComputeBuffer[] buffer)
{
m_applyAdvect.SetVector("_Size", m_size);
m_applyAdvect.SetFloat("_DeltaTime", dt);
m_applyAdvect.SetFloat("_Dissipate", dissipation);
m_applyAdvect.SetFloat("_Forward", 1.0f);
m_applyAdvect.SetFloat("_Decay", decay);
m_applyAdvect.SetBuffer((int)ADVECTION.BFECC, "_Read1f", buffer[READ]);
m_applyAdvect.SetBuffer((int)ADVECTION.BFECC, "_Write1f", buffer[WRITE]);
m_applyAdvect.SetBuffer((int)ADVECTION.BFECC, "_Phi_n_hat", m_phi[PHI_N_HAT]);
m_applyAdvect.SetBuffer((int)ADVECTION.BFECC, "_Velocity", m_velocity[READ]);
m_applyAdvect.SetBuffer((int)ADVECTION.BFECC, "_Obstacles", m_obstacles);
m_applyAdvect.Dispatch((int)ADVECTION.BFECC, (int)m_size.x/NUM_THREADS, (int)m_size.y/NUM_THREADS, (int)m_size.z/NUM_THREADS);
Swap(buffer);
}
void ApplyAdvectionMacCormack(float dt, float dissipation, float decay, ComputeBuffer[] buffer)
{
m_applyAdvect.SetVector("_Size", m_size);
m_applyAdvect.SetFloat("_DeltaTime", dt);
m_applyAdvect.SetFloat("_Dissipate", dissipation);
m_applyAdvect.SetFloat("_Forward", 1.0f);
m_applyAdvect.SetFloat("_Decay", decay);
m_applyAdvect.SetBuffer((int)ADVECTION.MACCORMACK, "_Read1f", buffer[READ]);
m_applyAdvect.SetBuffer((int)ADVECTION.MACCORMACK, "_Write1f", buffer[WRITE]);
m_applyAdvect.SetBuffer((int)ADVECTION.MACCORMACK, "_Phi_n_1_hat", m_phi[PHI_N_1_HAT]);
m_applyAdvect.SetBuffer((int)ADVECTION.MACCORMACK, "_Phi_n_hat", m_phi[PHI_N_HAT]);
m_applyAdvect.SetBuffer((int)ADVECTION.MACCORMACK, "_Velocity", m_velocity[READ]);
m_applyAdvect.SetBuffer((int)ADVECTION.MACCORMACK, "_Obstacles", m_obstacles);
m_applyAdvect.Dispatch((int)ADVECTION.MACCORMACK, (int)m_size.x/NUM_THREADS, (int)m_size.y/NUM_THREADS, (int)m_size.z/NUM_THREADS);
Swap(buffer);
}
void ApplyAdvectionVelocity(float dt)
{
m_applyAdvect.SetVector("_Size", m_size);
m_applyAdvect.SetFloat("_DeltaTime", dt);
m_applyAdvect.SetFloat("_Dissipate", m_velocityDissipation);
m_applyAdvect.SetFloat("_Forward", 1.0f);
m_applyAdvect.SetFloat("_Decay", 0.0f);
m_applyAdvect.SetBuffer(0, "_Read3f", m_velocity[READ]);
m_applyAdvect.SetBuffer(0, "_Write3f", m_velocity[WRITE]);
m_applyAdvect.SetBuffer(0, "_Velocity", m_velocity[READ]);
m_applyAdvect.SetBuffer(0, "_Obstacles", m_obstacles);
m_applyAdvect.Dispatch(0, (int)m_size.x/NUM_THREADS, (int)m_size.y/NUM_THREADS, (int)m_size.z/NUM_THREADS);
Swap(m_velocity);
}
void ComputeVorticityConfinement(float dt)
{
m_computeVorticity.SetVector("_Size", m_size);
m_computeVorticity.SetBuffer(0, "_Write", m_temp3f);
m_computeVorticity.SetBuffer(0, "_Velocity", m_velocity[READ]);
m_computeVorticity.Dispatch(0, (int)m_size.x/NUM_THREADS, (int)m_size.y/NUM_THREADS, (int)m_size.z/NUM_THREADS);
m_computeConfinement.SetVector("_Size", m_size);
m_computeConfinement.SetFloat("_DeltaTime", dt);
m_computeConfinement.SetFloat("_Epsilon", m_vorticityStrength);
m_computeConfinement.SetBuffer(0, "_Write", m_velocity[WRITE]);
m_computeConfinement.SetBuffer(0, "_Read", m_velocity[READ]);
m_computeConfinement.SetBuffer(0, "_Vorticity", m_temp3f);
m_computeConfinement.Dispatch(0, (int)m_size.x/NUM_THREADS, (int)m_size.y/NUM_THREADS, (int)m_size.z/NUM_THREADS);
Swap(m_velocity);
}
void ComputeDivergence()
{
m_computeDivergence.SetVector("_Size", m_size);
m_computeDivergence.SetBuffer(0, "_Write", m_temp3f);
m_computeDivergence.SetBuffer(0, "_Velocity", m_velocity[READ]);
m_computeDivergence.SetBuffer(0, "_Obstacles", m_obstacles);
m_computeDivergence.Dispatch(0, (int)m_size.x/NUM_THREADS, (int)m_size.y/NUM_THREADS, (int)m_size.z/NUM_THREADS);
}
void ComputePressure()
{
m_computeJacobi.SetVector("_Size", m_size);
m_computeJacobi.SetBuffer(0, "_Divergence", m_temp3f);
m_computeJacobi.SetBuffer(0, "_Obstacles", m_obstacles);
for(int i = 0; i < m_iterations; i++)
{
m_computeJacobi.SetBuffer(0, "_Write", m_pressure[WRITE]);
m_computeJacobi.SetBuffer(0, "_Pressure", m_pressure[READ]);
m_computeJacobi.Dispatch(0, (int)m_size.x/NUM_THREADS, (int)m_size.y/NUM_THREADS, (int)m_size.z/NUM_THREADS);
Swap(m_pressure);
}
}
void ComputeProjection()
{
m_computeProjection.SetVector("_Size", m_size);
m_computeProjection.SetBuffer(0, "_Obstacles", m_obstacles);
m_computeProjection.SetBuffer(0, "_Pressure", m_pressure[READ]);
m_computeProjection.SetBuffer(0, "_Velocity", m_velocity[READ]);
m_computeProjection.SetBuffer(0, "_Write", m_velocity[WRITE]);
m_computeProjection.Dispatch(0, (int)m_size.x/NUM_THREADS, (int)m_size.y/NUM_THREADS, (int)m_size.z/NUM_THREADS);
Swap(m_velocity);
}
private void FixedUpdate()
//void Update ()
{
GetComponent<MeshRenderer>().enabled = doDraw;
if (doUpdate == false)
return;
float dt = Time.fixedDeltaTime * timeStepMultiplier;
//float dt = TIME_STEP;
Simulation(dt);
}
void OnDestroy()
{
m_density[READ].Release();
m_density[WRITE].Release();
m_temperature[READ].Release();
m_temperature[WRITE].Release();
m_phi[PHI_N_1_HAT].Release();
m_phi[PHI_N_HAT].Release();
m_velocity[READ].Release();
m_velocity[WRITE].Release();
m_pressure[READ].Release();
m_pressure[WRITE].Release();
m_obstacles.Release();
m_temp3f.Release();
}
void Simulation(float dt)
{
//First off advect any buffers that contain physical quantities like density or temperature by the
//velocity field. Advection is what moves values around.
ApplyAdvection(dt, m_temperatureDissipation, 0.0f, m_temperature);
//Normal advection can cause smoothing of the advected field making the results look less interesting.
//BFECC is a method of advection that helps to prevents this smoothing at a extra performance cost but is less numerically stable.
//MacCormack does the same as BFECC but is more (not completely) numerically stable and is more costly
if (m_advectionType == ADVECTION.BFECC)
{
ApplyAdvection(dt, 1.0f, 0.0f, m_density, 1.0f); //advect forward into write buffer
ApplyAdvection(dt, 1.0f, 0.0f, m_density[READ], m_phi[PHI_N_HAT], -1.0f); //advect back into phi_n_hat buffer
ApplyAdvectionBFECC(dt, m_densityDissipation, 0.0f, m_density); //advect using BFECC
}
else if (m_advectionType == ADVECTION.MACCORMACK)
{
ApplyAdvection(dt, 1.0f, 0.0f, m_density[READ], m_phi[PHI_N_1_HAT], 1.0f); //advect forward into phi_n_1_hat buffer
ApplyAdvection(dt, 1.0f, 0.0f, m_phi[PHI_N_1_HAT], m_phi[PHI_N_HAT], -1.0f); //advect back into phi_n_hat buffer
ApplyAdvectionMacCormack(dt, m_densityDissipation, 0.0f, m_density);
}
else
{
ApplyAdvection(dt, m_densityDissipation, 0.0f, m_density);
}
//The velocity field also advects its self.
ApplyAdvectionVelocity(dt);
//Apply the effect the sinking colder smoke has on the velocity field
ApplyBuoyancy(dt);
//Adds a certain amount of density (the visible smoke) and temperate
ApplyImpulse(dt, m_densityAmount, m_density);
ApplyImpulse(dt, m_temperatureAmount, m_temperature);
//The fuild sim math tends to remove the swirling movement of fluids.
//This step will try and add it back in
ComputeVorticityConfinement(dt);
//Compute the divergence of the velocity field. In fluid simulation the
//fluid is modelled as being incompressible meaning that the volume of the fluid
//does not change over time. The divergence is the amount the field has deviated from being divergence free
ComputeDivergence();
//This computes the pressure need return the fluid to a divergence free condition
ComputePressure();
//Subtract the pressure field from the velocity field enforcing the divergence free conditions
ComputeProjection();
//rotation of box not support because ray cast in shader uses a AABB intersection
transform.rotation = Quaternion.identity;
GetComponent<Renderer>().material.SetVector("_Translate", transform.localPosition);
GetComponent<Renderer>().material.SetVector("_Scale", transform.localScale);
GetComponent<Renderer>().material.SetBuffer("_Density", m_density[READ]);
GetComponent<Renderer>().material.SetVector("_Size", m_size);
}
}
}

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: a924471615937564f81ebb1540cd8b36
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

@ -1,5 +0,0 @@
fileFormatVersion: 2
guid: 8fe3db169bedce248a2ab634d707f41c
folderAsset: yes
DefaultImporter:
userData:

@ -1,244 +0,0 @@
#define NUM_THREADS 8
float4 _Size;
float _DeltaTime, _Dissipate, _Decay, _Forward;
StructuredBuffer<float3> _Velocity;
StructuredBuffer<float> _Obstacles;
RWStructuredBuffer<float> _Write1f;
StructuredBuffer<float> _Read1f;
RWStructuredBuffer<float3> _Write3f;
StructuredBuffer<float3> _Read3f;
StructuredBuffer<float> _Phi_n_1_hat, _Phi_n_hat;
float3 GetAdvectedPosTexCoords(float3 pos, int idx)
{
pos -= _DeltaTime * _Forward * _Velocity[idx];
return pos;
}
float SampleBilinear(StructuredBuffer<float> buffer, float3 uv, float3 size)
{
int x = uv.x;
int y = uv.y;
int z = uv.z;
int X = size.x;
int XY = size.x*size.y;
float fx = uv.x-x;
float fy = uv.y-y;
float fz = uv.z-z;
int xp1 = min(size.x-1, x+1);
int yp1 = min(size.y-1, y+1);
int zp1 = min(size.z-1, z+1);
float x0 = buffer[x+y*X+z*XY] * (1.0f-fx) + buffer[xp1+y*X+z*XY] * fx;
float x1 = buffer[x+y*X+zp1*XY] * (1.0f-fx) + buffer[xp1+y*X+zp1*XY] * fx;
float x2 = buffer[x+yp1*X+z*XY] * (1.0f-fx) + buffer[xp1+yp1*X+z*XY] * fx;
float x3 = buffer[x+yp1*X+zp1*XY] * (1.0f-fx) + buffer[xp1+yp1*X+zp1*XY] * fx;
float z0 = x0 * (1.0f-fz) + x1 * fz;
float z1 = x2 * (1.0f-fz) + x3 * fz;
return z0 * (1.0f-fy) + z1 * fy;
}
float3 SampleBilinear(StructuredBuffer<float3> buffer, float3 uv, float3 size)
{
int x = uv.x;
int y = uv.y;
int z = uv.z;
int X = size.x;
int XY = size.x*size.y;
float fx = uv.x-x;
float fy = uv.y-y;
float fz = uv.z-z;
int xp1 = min(size.x-1, x+1);
int yp1 = min(size.y-1, y+1);
int zp1 = min(size.z-1, z+1);
float3 x0 = buffer[x+y*X+z*XY] * (1.0f-fx) + buffer[xp1+y*X+z*XY] * fx;
float3 x1 = buffer[x+y*X+zp1*XY] * (1.0f-fx) + buffer[xp1+y*X+zp1*XY] * fx;
float3 x2 = buffer[x+yp1*X+z*XY] * (1.0f-fx) + buffer[xp1+yp1*X+z*XY] * fx;
float3 x3 = buffer[x+yp1*X+zp1*XY] * (1.0f-fx) + buffer[xp1+yp1*X+zp1*XY] * fx;
float3 z0 = x0 * (1.0f-fz) + x1 * fz;
float3 z1 = x2 * (1.0f-fz) + x3 * fz;
return z0 * (1.0f-fy) + z1 * fy;
}
#pragma kernel AdvectVelocity
[numthreads(NUM_THREADS,NUM_THREADS,NUM_THREADS)]
void AdvectVelocity(uint3 id : SV_DispatchThreadID)
{
int idx = id.x + id.y*_Size.x + id.z*_Size.x*_Size.y;
if(_Obstacles[idx] > 0.1)
{
_Write3f[idx] = float3(0,0,0);
return;
}
float3 uv = GetAdvectedPosTexCoords(id, idx);
_Write3f[idx] = SampleBilinear(_Read3f, uv, _Size.xyz) * _Dissipate;
}
#pragma kernel Advect
[numthreads(NUM_THREADS,NUM_THREADS,NUM_THREADS)]
void Advect(uint3 id : SV_DispatchThreadID)
{
int idx = id.x + id.y*_Size.x + id.z*_Size.x*_Size.y;
if(_Obstacles[idx] > 0.1)
{
_Write1f[idx] = 0;
return;
}
float3 uv = GetAdvectedPosTexCoords(id, idx);
_Write1f[idx] = max(0, SampleBilinear(_Read1f, uv, _Size.xyz) * _Dissipate - _Decay);
}
#pragma kernel AdvectBFECC
[numthreads(NUM_THREADS,NUM_THREADS,NUM_THREADS)]
void AdvectBFECC(uint3 id : SV_DispatchThreadID)
{
int idx = id.x + id.y*_Size.x + id.z*_Size.x*_Size.y;
if(_Obstacles[idx] > 0.1)
{
_Write1f[idx] = 0;
return;
}
float3 uv = GetAdvectedPosTexCoords(id, idx);
float r;
float4 halfVolumeDim = _Size/2;
float3 diff = abs( halfVolumeDim.xyz - id );
// Must use regular semi-Lagrangian advection instead of BFECC at the volume boundaries
if( (diff.x > (halfVolumeDim.x-4)) || (diff.y > (halfVolumeDim.y-4)) || (diff.z > (halfVolumeDim.z-4)) )
{
r = SampleBilinear(_Read1f, uv, _Size.xyz);
}
else
{
r = 1.5f * SampleBilinear(_Read1f, uv, _Size.xyz) - 0.5f * SampleBilinear(_Phi_n_hat, uv, _Size.xyz);
}
_Write1f[idx] = max(0, r * _Dissipate - _Decay);
}
#pragma kernel AdvectMacCormack
[numthreads(NUM_THREADS,NUM_THREADS,NUM_THREADS)]
void AdvectMacCormack(uint3 id : SV_DispatchThreadID)
{
int idx = id.x + id.y*_Size.x + id.z*_Size.x*_Size.y;
if(_Obstacles[idx] > 0.1)
{
_Write1f[idx] = 0;
return;
}
float3 uv = GetAdvectedPosTexCoords(id, idx);
float r;
float4 halfVolumeDim = _Size/2;
float3 diff = abs( halfVolumeDim.xyz - id );
// Must use regular semi-Lagrangian advection instead of MacCormack at the volume boundaries
if( (diff.x > (halfVolumeDim.x-4)) || (diff.y > (halfVolumeDim.y-4)) || (diff.z > (halfVolumeDim.z-4)) )
{
r = SampleBilinear(_Read1f, uv, _Size.xyz);
}
else
{
int idx0 = (id.x-1) + (id.y-1)*_Size.x + (id.z-1)*_Size.x*_Size.y;
int idx1 = (id.x-1) + (id.y-1)*_Size.x + (id.z+1)*_Size.x*_Size.y;
int idx2 = (id.x-1) + (id.y+1)*_Size.x + (id.z-1)*_Size.x*_Size.y;
int idx3 = (id.x-1) + (id.y+1)*_Size.x + (id.z+1)*_Size.x*_Size.y;
int idx4 = (id.x+1) + (id.y-1)*_Size.x + (id.z-1)*_Size.x*_Size.y;
int idx5 = (id.x+1) + (id.y-1)*_Size.x + (id.z+1)*_Size.x*_Size.y;
int idx6 = (id.x+1) + (id.y+1)*_Size.x + (id.z-1)*_Size.x*_Size.y;
int idx7 = (id.x+1) + (id.y+1)*_Size.x + (id.z+1)*_Size.x*_Size.y;
float nodes[8];
nodes[0] = _Read1f[ idx0 ];
nodes[1] = _Read1f[ idx1 ];
nodes[2] = _Read1f[ idx2 ];
nodes[3] = _Read1f[ idx3 ];
nodes[4] = _Read1f[ idx4 ];
nodes[5] = _Read1f[ idx5 ];
nodes[6] = _Read1f[ idx6 ];
nodes[7] = _Read1f[ idx7 ];
float minPhi = min(min(min(min(min(min(min(nodes[0],nodes[1]),nodes[2]),nodes[3]),nodes[4]),nodes[5]),nodes[6]),nodes[7]);
float maxPhi = max(max(max(max(max(max(max(nodes[0],nodes[1]),nodes[2]),nodes[3]),nodes[4]),nodes[5]),nodes[6]),nodes[7]);
r = SampleBilinear(_Phi_n_1_hat, uv, _Size.xyz) + 0.5f * (_Read1f[idx] - _Phi_n_hat[idx]);
r = max(min(r, maxPhi), minPhi);
}
_Write1f[idx] = max(0, r * _Dissipate - _Decay);
}

@ -1,4 +0,0 @@
fileFormatVersion: 2
guid: 411cedf0db0a1904693c77b97afbf915
ComputeShaderImporter:
userData:

@ -1,47 +0,0 @@
#pragma kernel CSMain
#define NUM_THREADS 8
float4 _Size, _Up;
float _AmbientTemperature, _DeltaTime, _Buoyancy, _Weight;
RWStructuredBuffer<float3> _Write;
StructuredBuffer<float3> _Velocity;
StructuredBuffer<float> _Density, _Temperature;
[numthreads(NUM_THREADS,NUM_THREADS,NUM_THREADS)]
void CSMain (int3 id : SV_DispatchThreadID)
{
int idx = id.x + id.y*_Size.x + id.z*_Size.x*_Size.y;
float T = _Temperature[idx];
float D = _Density[idx];
float3 V = _Velocity[idx];
if(T > _AmbientTemperature)
V += (_DeltaTime * (T - _AmbientTemperature) * _Buoyancy - D * _Weight) * _Up.xyz;
_Write[idx] = V;
}

@ -1,4 +0,0 @@
fileFormatVersion: 2
guid: 0d7710a16db583e418df13bddb0be43d
ComputeShaderImporter:
userData:

@ -1,57 +0,0 @@
#define NUM_THREADS 8
float _Radius, _Amount, _DeltaTime, _Extinguishment;
float4 _Pos, _Size;
RWStructuredBuffer<float> _Write;
StructuredBuffer<float> _Read, _Reaction;
#pragma kernel GaussImpulse
[numthreads(NUM_THREADS,NUM_THREADS,NUM_THREADS)]
void GaussImpulse(uint3 id : SV_DispatchThreadID)
{
float3 pos = id/(_Size.xyz-1.0f) - _Pos.xyz;
float mag = pos.x*pos.x + pos.y*pos.y + pos.z*pos.z;
float rad2 = _Radius*_Radius;
float amount = exp(-mag/rad2) * _Amount * _DeltaTime;
int idx = id.x + id.y*_Size.x + id.z*_Size.x*_Size.y;
_Write[idx] = _Read[idx] + amount;
}
#pragma kernel ExtinguishmentImpluse
[numthreads(NUM_THREADS,NUM_THREADS,NUM_THREADS)]
void ExtinguishmentImpluse(uint3 id : SV_DispatchThreadID)
{
int idx = id.x + id.y*_Size.x + id.z*_Size.x*_Size.y;
float amount = 0.0;
float reaction = _Reaction[idx];
if(reaction > 0.0 && reaction < _Extinguishment)
amount = _Amount * reaction;
_Write[idx] = _Read[idx] + amount;
}

@ -1,4 +0,0 @@
fileFormatVersion: 2
guid: a080c25e6daeb0d4e88fced65f9959ce
ComputeShaderImporter:
userData:

@ -1,44 +0,0 @@
#pragma kernel CSMain
#define NUM_THREADS 8
float _DeltaTime, _Epsilon;
float4 _Size;
RWStructuredBuffer<float3> _Write;
StructuredBuffer<float3> _Vorticity, _Read;
[numthreads(NUM_THREADS,NUM_THREADS,NUM_THREADS)]
void CSMain (int3 id : SV_DispatchThreadID)
{
int idxL = max(0, id.x-1) + id.y*_Size.x + id.z*_Size.x*_Size.y;
int idxR = min(_Size.x-1, id.x+1) + id.y*_Size.x + id.z*_Size.x*_Size.y;
int idxB = id.x + max(0, id.y-1)*_Size.x + id.z*_Size.x*_Size.y;
int idxT = id.x + min(_Size.y-1, id.y+1)*_Size.x + id.z*_Size.x*_Size.y;
int idxD = id.x + id.y*_Size.x + max(0, id.z-1)*_Size.x*_Size.y;
int idxU = id.x + id.y*_Size.x + min(_Size.z-1, id.z+1)*_Size.x*_Size.y;
float omegaL = length(_Vorticity[ idxL ]);
float omegaR = length(_Vorticity[ idxR ]);
float omegaB = length(_Vorticity[ idxB ]);
float omegaT = length(_Vorticity[ idxT ]);
float omegaD = length(_Vorticity[ idxD ]);
float omegaU = length(_Vorticity[ idxU ]);
int idx = id.x + id.y*_Size.x + id.z*_Size.x*_Size.y;
float3 omega = _Vorticity[idx];
float3 eta = 0.5 * float3( omegaR - omegaL, omegaT - omegaB, omegaU - omegaD );
eta = normalize( eta + float3(0.001,0.001,0.001) );
float3 force = _DeltaTime * _Epsilon * float3( eta.y * omega.z - eta.z * omega.y, eta.z * omega.x - eta.x * omega.z, eta.x * omega.y - eta.y * omega.x );
_Write[idx] = _Read[idx] + force;
}

@ -1,4 +0,0 @@
fileFormatVersion: 2
guid: 4b0055f0edf774c4ea97ac8cd62e6158
ComputeShaderImporter:
userData:

@ -1,49 +0,0 @@
#pragma kernel CSMain
#define NUM_THREADS 8
float4 _Size;
RWStructuredBuffer<float3> _Write;
StructuredBuffer<float3> _Velocity;
StructuredBuffer<float> _Obstacles;
[numthreads(NUM_THREADS,NUM_THREADS,NUM_THREADS)]
void CSMain (int3 id : SV_DispatchThreadID)
{
int idxL = max(0, id.x-1) + id.y*_Size.x + id.z*_Size.x*_Size.y;
int idxR = min(_Size.x-1, id.x+1) + id.y*_Size.x + id.z*_Size.x*_Size.y;
int idxB = id.x + max(0, id.y-1)*_Size.x + id.z*_Size.x*_Size.y;
int idxT = id.x + min(_Size.y-1, id.y+1)*_Size.x + id.z*_Size.x*_Size.y;
int idxD = id.x + id.y*_Size.x + max(0, id.z-1)*_Size.x*_Size.y;
int idxU = id.x + id.y*_Size.x + min(_Size.z-1, id.z+1)*_Size.x*_Size.y;
float3 L = _Velocity[ idxL ];
float3 R = _Velocity[ idxR ];
float3 B = _Velocity[ idxB ];
float3 T = _Velocity[ idxT ];
float3 D = _Velocity[ idxD ];
float3 U = _Velocity[ idxU ];
float3 obstacleVelocity = float3(0,0,0);
if(_Obstacles[idxL] > 0.1) L = obstacleVelocity;
if(_Obstacles[idxR] > 0.1) R = obstacleVelocity;
if(_Obstacles[idxB] > 0.1) B = obstacleVelocity;
if(_Obstacles[idxT] > 0.1) T = obstacleVelocity;
if(_Obstacles[idxD] > 0.1) D = obstacleVelocity;
if(_Obstacles[idxU] > 0.1) U = obstacleVelocity;
float divergence = 0.5 * ( ( R.x - L.x ) + ( T.y - B.y ) + ( U.z - D.z ) );
int idx = id.x + id.y*_Size.x + id.z*_Size.x*_Size.y;
_Write[idx] = float3(divergence,0,0);
}

@ -1,4 +0,0 @@
fileFormatVersion: 2
guid: e25212f321912c44ab6d9430762d37b6
ComputeShaderImporter:
userData:

@ -1,65 +0,0 @@
#pragma kernel CSMain
#define NUM_THREADS 8
float4 _Size;
RWStructuredBuffer<float> _Write;
StructuredBuffer<float> _Pressure, _Obstacles;
StructuredBuffer<float3> _Divergence;
[numthreads(NUM_THREADS,NUM_THREADS,NUM_THREADS)]
void CSMain (int3 id : SV_DispatchThreadID)
{
int idxL = max(0, id.x-1) + id.y*_Size.x + id.z*_Size.x*_Size.y;
int idxR = min(_Size.x-1, id.x+1) + id.y*_Size.x + id.z*_Size.x*_Size.y;
int idxB = id.x + max(0, id.y-1)*_Size.x + id.z*_Size.x*_Size.y;
int idxT = id.x + min(_Size.y-1, id.y+1)*_Size.x + id.z*_Size.x*_Size.y;
int idxD = id.x + id.y*_Size.x + max(0, id.z-1)*_Size.x*_Size.y;
int idxU = id.x + id.y*_Size.x + min(_Size.z-1, id.z+1)*_Size.x*_Size.y;
float L = _Pressure[ idxL ];
float R = _Pressure[ idxR ];
float B = _Pressure[ idxB ];
float T = _Pressure[ idxT ];
float D = _Pressure[ idxD ];
float U = _Pressure[ idxU ];
int idx = id.x + id.y*_Size.x + id.z*_Size.x*_Size.y;
float C = _Pressure[idx];
float divergence = _Divergence[idx].r;
if(_Obstacles[idxL] > 0.1) L = C;
if(_Obstacles[idxR] > 0.1) R = C;
if(_Obstacles[idxB] > 0.1) B = C;
if(_Obstacles[idxT] > 0.1) T = C;
if(_Obstacles[idxD] > 0.1) D = C;
if(_Obstacles[idxU] > 0.1) U = C;
_Write[idx] = ( L + R + B + T + U + D - divergence ) / 6.0;
}

@ -1,4 +0,0 @@
fileFormatVersion: 2
guid: cebd12b982d79674aab2ed65879e49d0
ComputeShaderImporter:
userData:

@ -1,47 +0,0 @@
#pragma kernel CSMain
#define NUM_THREADS 8
float4 _Size;
RWStructuredBuffer<float> _Write;
[numthreads(NUM_THREADS,NUM_THREADS,NUM_THREADS)]
void CSMain (int3 id : SV_DispatchThreadID)
{
int idx = id.x + id.y*_Size.x + id.z*_Size.x*_Size.y;
float obstacle = 0;
if(id.x-1 < 0) obstacle = 1;
if(id.x+1 > (int)_Size.x-1) obstacle = 1;
if(id.y-1 < 0) obstacle = 1;
if(id.y+1 > (int)_Size.y-1) obstacle = 1;
if(id.z-1 < 0) obstacle = 1;
if(id.z+1 > (int)_Size.z-1) obstacle = 1;
_Write[idx] = obstacle;
}

@ -1,4 +0,0 @@
fileFormatVersion: 2
guid: 6a49b38e37bae7a4ab2903fbdde8e4ac
ComputeShaderImporter:
userData:

@ -1,76 +0,0 @@
#pragma kernel CSMain
#define NUM_THREADS 8
float4 _Size;
RWStructuredBuffer<float3> _Write;
StructuredBuffer<float> _Pressure, _Obstacles;
StructuredBuffer<float3> _Velocity;
[numthreads(NUM_THREADS,NUM_THREADS,NUM_THREADS)]
void CSMain (int3 id : SV_DispatchThreadID)
{
int idx = id.x + id.y*_Size.x + id.z*_Size.x*_Size.y;
if(_Obstacles[idx] > 0.1)
{
_Write[idx] = float3(0,0,0);
return;
}
int idxL = max(0, id.x-1) + id.y*_Size.x + id.z*_Size.x*_Size.y;
int idxR = min(_Size.x-1, id.x+1) + id.y*_Size.x + id.z*_Size.x*_Size.y;
int idxB = id.x + max(0, id.y-1)*_Size.x + id.z*_Size.x*_Size.y;
int idxT = id.x + min(_Size.y-1, id.y+1)*_Size.x + id.z*_Size.x*_Size.y;
int idxD = id.x + id.y*_Size.x + max(0, id.z-1)*_Size.x*_Size.y;
int idxU = id.x + id.y*_Size.x + min(_Size.z-1, id.z+1)*_Size.x*_Size.y;
float L = _Pressure[ idxL ];
float R = _Pressure[ idxR ];
float B = _Pressure[ idxB ];
float T = _Pressure[ idxT ];
float D = _Pressure[ idxD ];
float U = _Pressure[ idxU ];
float C = _Pressure[idx];
float3 mask = float3(1,1,1);
if(_Obstacles[idxL] > 0.1) { L = C; mask.x = 0; }
if(_Obstacles[idxR] > 0.1) { R = C; mask.x = 0; }
if(_Obstacles[idxB] > 0.1) { B = C; mask.y = 0; }
if(_Obstacles[idxT] > 0.1) { T = C; mask.y = 0; }
if(_Obstacles[idxD] > 0.1) { D = C; mask.z = 0; }
if(_Obstacles[idxU] > 0.1) { U = C; mask.z = 0; }
float3 v = _Velocity[idx] - float3( R - L, T - B, U - D ) * 0.5;
_Write[idx] = v * mask;
}

@ -1,4 +0,0 @@
fileFormatVersion: 2
guid: aa1de4528a2c0d24983dce181ecd63af
ComputeShaderImporter:
userData:

@ -1,37 +0,0 @@
#pragma kernel CSMain
#define NUM_THREADS 8
float4 _Size;
RWStructuredBuffer<float3> _Write;
StructuredBuffer<float3> _Velocity;
[numthreads(NUM_THREADS,NUM_THREADS,NUM_THREADS)]
void CSMain (int3 id : SV_DispatchThreadID)
{
int idxL = max(0, id.x-1) + id.y*_Size.x + id.z*_Size.x*_Size.y;
int idxR = min(_Size.x-1, id.x+1) + id.y*_Size.x + id.z*_Size.x*_Size.y;
int idxB = id.x + max(0, id.y-1)*_Size.x + id.z*_Size.x*_Size.y;
int idxT = id.x + min(_Size.y-1, id.y+1)*_Size.x + id.z*_Size.x*_Size.y;
int idxD = id.x + id.y*_Size.x + max(0, id.z-1)*_Size.x*_Size.y;
int idxU = id.x + id.y*_Size.x + min(_Size.z-1, id.z+1)*_Size.x*_Size.y;
float3 L = _Velocity[ idxL ];
float3 R = _Velocity[ idxR ];
float3 B = _Velocity[ idxB ];
float3 T = _Velocity[ idxT ];
float3 D = _Velocity[ idxD ];
float3 U = _Velocity[ idxU ];
float3 vorticity = 0.5 * float3( (( T.z - B.z ) - ( U.y - D.y )) , (( U.x - D.x ) - ( R.z - L.z )) , (( R.y - L.y ) - ( T.x - B.x )) );
int idx = id.x + id.y*_Size.x + id.z*_Size.x*_Size.y;
_Write[idx] = vorticity;
}

@ -1,4 +0,0 @@
fileFormatVersion: 2
guid: 62b5b102c778bbd4682f63bf0a9bd2fe
ComputeShaderImporter:
userData:

@ -1,193 +0,0 @@
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
Shader "3DFluidSim/FireRayCast"
{
Properties
{
_FireGradient("FireGradient", 2D) = "red" {}
_SmokeColor("SmokeGradient", Color) = (0,0,0,1)
_SmokeAbsorption("SmokeAbsorbtion", float) = 60.0
_FireAbsorption("FireAbsorbtion", float) = 40.0
}
SubShader
{
Tags { "Queue" = "Transparent" }
Pass
{
Cull front
Blend SrcAlpha OneMinusSrcAlpha
CGPROGRAM
#include "UnityCG.cginc"
#pragma target 5.0
#pragma vertex vert
#pragma fragment frag
#define NUM_SAMPLES 64
sampler2D _FireGradient;
float4 _SmokeColor;
float _SmokeAbsorption, _FireAbsorption;
uniform float3 _Translate, _Scale, _Size;
StructuredBuffer<float> _Density, _Reaction;
struct v2f
{
float4 pos : SV_POSITION;
float3 worldPos : TEXCOORD0;
};
v2f vert(appdata_base v)
{
v2f OUT;
OUT.pos = UnityObjectToClipPos(v.vertex);
OUT.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
return OUT;
}
struct Ray {
float3 origin;
float3 dir;
};
struct AABB {
float3 Min;
float3 Max;
};
//find intersection points of a ray with a box
bool intersectBox(Ray r, AABB aabb, out float t0, out float t1)
{
float3 invR = 1.0 / r.dir;
float3 tbot = invR * (aabb.Min-r.origin);
float3 ttop = invR * (aabb.Max-r.origin);
float3 tmin = min(ttop, tbot);
float3 tmax = max(ttop, tbot);
float2 t = max(tmin.xx, tmin.yz);
t0 = max(t.x, t.y);
t = min(tmax.xx, tmax.yz);
t1 = min(t.x, t.y);
return t0 <= t1;
}
float SampleBilinear(StructuredBuffer<float> buffer, float3 uv, float3 size)
{
uv = saturate(uv);
uv = uv * (size-1.0);
int x = uv.x;
int y = uv.y;
int z = uv.z;
int X = size.x;
int XY = size.x*size.y;
float fx = uv.x-x;
float fy = uv.y-y;
float fz = uv.z-z;
int xp1 = min(_Size.x-1, x+1);
int yp1 = min(_Size.y-1, y+1);
int zp1 = min(_Size.z-1, z+1);
float x0 = buffer[x+y*X+z*XY] * (1.0f-fx) + buffer[xp1+y*X+z*XY] * fx;
float x1 = buffer[x+y*X+zp1*XY] * (1.0f-fx) + buffer[xp1+y*X+zp1*XY] * fx;
float x2 = buffer[x+yp1*X+z*XY] * (1.0f-fx) + buffer[xp1+yp1*X+z*XY] * fx;
float x3 = buffer[x+yp1*X+zp1*XY] * (1.0f-fx) + buffer[xp1+yp1*X+zp1*XY] * fx;
float z0 = x0 * (1.0f-fz) + x1 * fz;
float z1 = x2 * (1.0f-fz) + x3 * fz;
return z0 * (1.0f-fy) + z1 * fy;
}
float4 frag(v2f IN) : COLOR
{
float3 pos = _WorldSpaceCameraPos;
Ray r;
r.origin = pos;
r.dir = normalize(IN.worldPos-pos);
AABB aabb;
aabb.Min = float3(-0.5,-0.5,-0.5)*_Scale + _Translate;
aabb.Max = float3(0.5,0.5,0.5)*_Scale + _Translate;
//figure out where ray from eye hit front of cube
float tnear, tfar;
intersectBox(r, aabb, tnear, tfar);
//if eye is in cube then start ray at eye
if (tnear < 0.0) tnear = 0.0;
float3 rayStart = r.origin + r.dir * tnear;
float3 rayStop = r.origin + r.dir * tfar;
//convert to texture space
rayStart -= _Translate;
rayStop -= _Translate;
rayStart = (rayStart + 0.5*_Scale)/_Scale;
rayStop = (rayStop + 0.5*_Scale)/_Scale;
float3 start = rayStart;
float dist = distance(rayStop, rayStart);
float stepSize = dist/float(NUM_SAMPLES);
float3 ds = normalize(rayStop-rayStart) * stepSize;
float fireAlpha = 1.0, smokeAlpha = 1.0;
for(int i=0; i < NUM_SAMPLES; i++, start += ds)
{
float D = SampleBilinear(_Density, start, _Size);
float R = SampleBilinear(_Reaction, start, _Size);
fireAlpha *= 1.0-saturate(R*stepSize*_FireAbsorption);
smokeAlpha *= 1.0-saturate(D*stepSize*_SmokeAbsorption);
if(fireAlpha <= 0.01 && smokeAlpha <= 0.01) break;
}
float4 smoke = _SmokeColor * (1.0-smokeAlpha);
float4 fire = tex2D(_FireGradient, float2(fireAlpha,0)) * (1.0-fireAlpha);
return fire + smoke;
}
ENDCG
}
}
}

@ -1,5 +0,0 @@
fileFormatVersion: 2
guid: ce7e14398ee00d84193a82fb0174f3f6
ShaderImporter:
defaultTextures: []
userData:

@ -1,183 +0,0 @@
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'
Shader "3DFluidSim/SmokeRayCast"
{
Properties
{
_SmokeColor("SmokeGradient", Color) = (0,0,0,1)
_SmokeAbsorption("SmokeAbsorbtion", float) = 60.0
}
SubShader
{
Tags { "Queue" = "Transparent" }
Pass
{
Cull front
Blend SrcAlpha OneMinusSrcAlpha
CGPROGRAM
#include "UnityCG.cginc"
#pragma target 5.0
#pragma vertex vert
#pragma fragment frag
#define NUM_SAMPLES 64
float4 _SmokeColor;
float _SmokeAbsorption;
uniform float3 _Translate, _Scale, _Size;
StructuredBuffer<float> _Density;
struct v2f
{
float4 pos : SV_POSITION;
float3 worldPos : TEXCOORD0;
};
v2f vert(appdata_base v)
{
v2f OUT;
OUT.pos = UnityObjectToClipPos(v.vertex);
OUT.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
return OUT;
}
struct Ray {
float3 origin;
float3 dir;
};
struct AABB {
float3 Min;
float3 Max;
};
//find intersection points of a ray with a box
bool intersectBox(Ray r, AABB aabb, out float t0, out float t1)
{
float3 invR = 1.0 / r.dir;
float3 tbot = invR * (aabb.Min-r.origin);
float3 ttop = invR * (aabb.Max-r.origin);
float3 tmin = min(ttop, tbot);
float3 tmax = max(ttop, tbot);
float2 t = max(tmin.xx, tmin.yz);
t0 = max(t.x, t.y);
t = min(tmax.xx, tmax.yz);
t1 = min(t.x, t.y);
return t0 <= t1;
}
float SampleBilinear(StructuredBuffer<float> buffer, float3 uv, float3 size)
{
uv = saturate(uv);
uv = uv * (size-1.0);
int x = uv.x;
int y = uv.y;
int z = uv.z;
int X = size.x;
int XY = size.x*size.y;
float fx = uv.x-x;
float fy = uv.y-y;
float fz = uv.z-z;
int xp1 = min(_Size.x-1, x+1);
int yp1 = min(_Size.y-1, y+1);
int zp1 = min(_Size.z-1, z+1);
float x0 = buffer[x+y*X+z*XY] * (1.0f-fx) + buffer[xp1+y*X+z*XY] * fx;
float x1 = buffer[x+y*X+zp1*XY] * (1.0f-fx) + buffer[xp1+y*X+zp1*XY] * fx;
float x2 = buffer[x+yp1*X+z*XY] * (1.0f-fx) + buffer[xp1+yp1*X+z*XY] * fx;
float x3 = buffer[x+yp1*X+zp1*XY] * (1.0f-fx) + buffer[xp1+yp1*X+zp1*XY] * fx;
float z0 = x0 * (1.0f-fz) + x1 * fz;
float z1 = x2 * (1.0f-fz) + x3 * fz;
return z0 * (1.0f-fy) + z1 * fy;
}
float4 frag(v2f IN) : COLOR
{
float3 pos = _WorldSpaceCameraPos;
Ray r;
r.origin = pos;
r.dir = normalize(IN.worldPos-pos);
AABB aabb;
aabb.Min = float3(-0.5,-0.5,-0.5)*_Scale + _Translate;
aabb.Max = float3(0.5,0.5,0.5)*_Scale + _Translate;
//figure out where ray from eye hit front of cube
float tnear, tfar;
intersectBox(r, aabb, tnear, tfar);
//if eye is in cube then start ray at eye
if (tnear < 0.0) tnear = 0.0;
float3 rayStart = r.origin + r.dir * tnear;
float3 rayStop = r.origin + r.dir * tfar;
//convert to texture space
rayStart -= _Translate;
rayStop -= _Translate;
rayStart = (rayStart + 0.5*_Scale)/_Scale;
rayStop = (rayStop + 0.5*_Scale)/_Scale;
float3 start = rayStart;
float dist = distance(rayStop, rayStart);
float stepSize = dist/float(NUM_SAMPLES);
float3 ds = normalize(rayStop-rayStart) * stepSize;
float alpha = 1.0;
for(int i=0; i < NUM_SAMPLES; i++, start += ds)
{
float D = SampleBilinear(_Density, start, _Size);
alpha *= 1.0-saturate(D*stepSize*_SmokeAbsorption);
if(alpha <= 0.01) break;
}
return _SmokeColor * (1-alpha);
}
ENDCG
}
}
}

@ -1,5 +0,0 @@
fileFormatVersion: 2
guid: edf7886cf7d957f4c8416e250df7367c
ShaderImporter:
defaultTextures: []
userData:

@ -1,399 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 8
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 3
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
--- !u!157 &4
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_TemporalCoherenceThreshold: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 9
m_Resolution: 1
m_BakeResolution: 50
m_TextureWidth: 1024
m_TextureHeight: 1024
m_AO: 1
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 0
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 1
m_BakeBackend: 0
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVRBounces: 2
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringMode: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ShowResolutionOverlay: 1
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 0
--- !u!196 &5
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666666
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &1470411171
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 100004, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1470411177}
- component: {fileID: 1470411176}
- component: {fileID: 1470411175}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!92 &1470411175
Behaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 9200000, guid: 9d4133d5d30b644bd87802a347eaccbe,
type: 2}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1470411171}
m_Enabled: 1
--- !u!20 &1470411176
Camera:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 2000000, guid: 9d4133d5d30b644bd87802a347eaccbe,
type: 2}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1470411171}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.42647058, g: 0.42647058, b: 0.42647058, a: 1}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 60
field of view: 40
orthographic: 0
orthographic size: 100
m_Depth: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294966527
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 0
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &1470411177
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 400004, guid: 9d4133d5d30b644bd87802a347eaccbe, type: 2}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1470411171}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1803253977
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1803253979}
- component: {fileID: 1803253978}
m_Layer: 0
m_Name: Directional light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &1803253978
Light:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1803253977}
m_Enabled: 1
serializedVersion: 8
m_Type: 1
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_CookieSize: 10
m_Shadows:
m_Type: 0
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_Lightmapping: 1
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &1803253979
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1803253977}
m_LocalRotation: {x: 0.40821794, y: -0.23456973, z: 0.10938166, w: 0.8754261}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2140950347
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 2140950351}
- component: {fileID: 2140950350}
- component: {fileID: 2140950349}
- component: {fileID: 2140950348}
m_Layer: 0
m_Name: Plane
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!23 &2140950348
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2140950347}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 0d538acbbf71af343b5efaa45bd9af35, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
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!64 &2140950349
MeshCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2140950347}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 0
m_CookingOptions: 14
m_SkinWidth: 0.01
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &2140950350
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2140950347}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &2140950351
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2140950347}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 64, y: 64, z: 64}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &2142477375
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_LocalPosition.y
value: 4.00099993
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_LocalPosition.z
value: 12
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_LocalScale.x
value: 4
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_LocalScale.z
value: 4
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_width
value: 64
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_depth
value: 64
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_advectionType
value: 2
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
m_IsPrefabParent: 0

@ -1,4 +0,0 @@
fileFormatVersion: 2
guid: 77228c5d076c6bc4fae6e505baf0f4f6
DefaultImporter:
userData:

@ -1,5 +0,0 @@
fileFormatVersion: 2
guid: c41114551fea2914095b31e0e66bfb2b
folderAsset: yes
DefaultImporter:
userData:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

@ -1,45 +0,0 @@
fileFormatVersion: 2
guid: ac2c4961e13090042b382bb1c186bc31
TextureImporter:
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spritePixelsToUnits: 100
alphaIsTransparency: 0
textureType: -1
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:

@ -1,10 +0,0 @@
fileFormatVersion: 2
guid: 5fc36e4bb6aa6c14ba128dca58463ede
folderAsset: yes
timeCreated: 1519705207
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -1,67 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FluidSimInputController : MonoBehaviour
{
[SerializeField]
FluidSim3DProject.SmokeFluidSim fluidSimulation;
public SmokeFluidSimUniforms uniforms;
List<Transform> children = new List<Transform>();
int child_index = 0;
void Start()
{
}
void Update()
{
children.Clear();
for (int i = 0; i < transform.childCount; i++)
{
var child = transform.GetChild(i);
if (child.gameObject.activeSelf)
children.Add(child);
}
Vector3 size = fluidSimulation.GridSize;
Vector3 root = fluidSimulation.GridRoot;
Vector3 inv_size = new Vector3(1.0f / size.x, 1.0f / size.y, 1.0f / size.z);
if (children.Count > 0)
{
child_index %= children.Count;
var trans = children[child_index];
Vector3 pos = Vector3.Scale(trans.position - root, inv_size);
pos.x = Mathf.Clamp01(pos.x);
pos.y = Mathf.Clamp01(pos.y);
pos.z = Mathf.Clamp01(pos.z);
fluidSimulation.m_inputPos = pos;
fluidSimulation.m_inputRadius = trans.lossyScale.x / size.x;
child_index++;
}
else
{
fluidSimulation.m_inputPos = Vector4.zero;
fluidSimulation.m_inputRadius = 0.0f;
}
{
fluidSimulation.m_vorticityStrength = uniforms.m_vorticityStrength;
fluidSimulation.m_densityAmount = uniforms.m_densityAmount;
fluidSimulation.m_densityDissipation = uniforms.m_densityDissipation;
fluidSimulation.m_densityBuoyancy = uniforms.m_densityBuoyancy;
fluidSimulation.m_densityWeight = uniforms.m_densityWeight;
fluidSimulation.m_temperatureAmount = uniforms.m_temperatureAmount;
fluidSimulation.m_temperatureDissipation = uniforms.m_temperatureDissipation;
fluidSimulation.m_velocityDissipation = uniforms.m_velocityDissipation;
}
}
}

@ -1,13 +0,0 @@
fileFormatVersion: 2
guid: efb50f560ef686940ab1bfb542387078
timeCreated: 1519705207
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -1,21 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b1ed87bff91722147827575923ba6b8a, type: 3}
m_Name: SmokeFluidSimUniforms
m_EditorClassIdentifier:
m_vorticityStrength: 1
m_densityAmount: 6.58
m_densityDissipation: 0.999
m_densityBuoyancy: 0.4
m_densityWeight: 0.0125
m_temperatureAmount: 0.9
m_temperatureDissipation: 0.995
m_velocityDissipation: 0.995

@ -1,10 +0,0 @@
fileFormatVersion: 2
guid: 4dcbc9a971de5974da304d60289ebe0f
timeCreated: 1519718721
licenseType: Free
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

@ -1,26 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(order = 1000, menuName = "UltraCombos/SmokeFluidSimUniforms", fileName = "SmokeFluidSimUniforms")]
public class SmokeFluidSimUniforms : ScriptableObject
{
[Header("FluidSimUniforms")]
[Range(0, 10)]
public float m_vorticityStrength = 1.0f;
[Range(0, 10)]
public float m_densityAmount = 1.0f;
[Range(0, 1)]
public float m_densityDissipation = 0.999f;
[Range(0, 10)]
public float m_densityBuoyancy = 1.0f;
[Range(0.0f, 0.1f)]
public float m_densityWeight = 0.0125f;
[Range(0, 50)]
public float m_temperatureAmount = 10.0f;
[Range(0, 1)]
public float m_temperatureDissipation = 0.995f;
[Range(0, 1)]
public float m_velocityDissipation = 0.995f;
}

@ -1,13 +0,0 @@
fileFormatVersion: 2
guid: b1ed87bff91722147827575923ba6b8a
timeCreated: 1519705207
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: a170ccfe16afc4e468c54ba020aca432
timeCreated: 1519717513
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 1b6317c1f4756a047afe40601d11fd0f
timeCreated: 1524209993
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -81,7 +81,7 @@ Material:
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Size: 0.0103885
- _Size: 0.01
- _SmoothnessTextureChannel: 0
- _SoftParticlesEnabled: 0
- _SoftParticlesFarFadeDistance: 1

@ -15,8 +15,8 @@ namespace UltraCombos.Frozen
DShowClip clip;
DShowMoviePlayer player;
[SerializeField]
KinectOpticalFlowMath kinect;
// [SerializeField]
// KinectOpticalFlowMath kinect;
[SerializeField]
float triggerRadius = 1.5f;
@ -162,31 +162,31 @@ namespace UltraCombos.Frozen
progress = Mathf.Max(progress - 0.001f, pause_progress);
}
#else
bool is_hit = false;
if (kinect.Valid)
{
var samples = kinect.Samples;
int max_sample = 500;
int inc = Mathf.Max(kinect.HomeCount / max_sample, 1);
for (int i = 0; i < kinect.HomeCount; i += inc)
{
float dist = new Vector2(samples[i].x - transform.position.x, samples[i].z - transform.position.z).magnitude;
if (dist < triggerRadius)
{
//Debug.Log("is_hit");
progress += 0.001f;
is_hit = true;
break;
}
}
}
if (is_hit == false)
{
progress = Mathf.Max(progress - 0.001f, pause_progress);
}
// bool is_hit = false;
// if (kinect.Valid)
// {
// var samples = kinect.Samples;
// int max_sample = 500;
// int inc = Mathf.Max(kinect.HomeCount / max_sample, 1);
// for (int i = 0; i < kinect.HomeCount; i += inc)
// {
// float dist = new Vector2(samples[i].x - transform.position.x, samples[i].z - transform.position.z).magnitude;
// if (dist < triggerRadius)
// {
// //Debug.Log("is_hit");
// progress += 0.001f;
// is_hit = true;
// break;
// }
// }
// }
// if (is_hit == false)
// {
// progress = Mathf.Max(progress - 0.001f, pause_progress);
// }
#endif
player.Frame = (uint)(player.TotalNumFrames * progress);
yield return null;

@ -38,8 +38,8 @@ namespace UltraCombos.Frozen
[SerializeField]
BlendedCosineGradient cosineGradient;
[SerializeField]
KinectOpticalFlow kinect;
// [SerializeField]
// KinectOpticalFlow kinect;
[SerializeField]
float nightKinectAmount = 30.0f;
@ -118,14 +118,14 @@ namespace UltraCombos.Frozen
rate = Mathf.Lerp(rate, target_rate, 0.02f);
uniform.rate = rate;
// uniform.rate = rate;
foreach (var mat in spaceMaterials)
mat.SetFloat("_Rate", rate);
//snowMaterial.SetFloat("_Size", Mathf.Lerp(0.0f, snowSize, rate));
snowMaterial.SetFloat("_Size", Mathf.Lerp(daySnowSize, nightSnowSize, rate));
cosineGradient.rate = rate;
kinect.kinectAmount = Mathf.Lerp(1.0f, nightKinectAmount, rate);
particleViewer.VertexCount = (int)(Mathf.Lerp(dayParticleRate, 1.0f, rate) * particleViewer.buffer.count);
// cosineGradient.rate = rate;
// kinect.kinectAmount = Mathf.Lerp(1.0f, nightKinectAmount, rate);
// particleViewer.VertexCount = (int)(Mathf.Lerp(dayParticleRate, 1.0f, rate) * particleViewer.buffer.count);
foreach (var chr in characters)
{

@ -1,120 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace UltraCombos.Frozen
{
public class SnowflakeParticleUpdater : MonoBehaviour
{
public bool reset = false;
[SerializeField] int fps = 30;
float stamp = 0.0f;
[Range(1, 1 << 20)]
public int maxParticles = 1 << 15;
public StructuredBuffer particleBuffer = null;
List<Particle> buffer_data = null;
public ComputeShader shader = null;
ComputeBuffer args_buffer = null;
public UniformStructuredBuffer uniformBuffer;
//public Klak.Chromatics.CosineGradient cosineGradient = null;
public BlendedCosineGradient cosineGradient = null;
bool is_initialized = false;
[SerializeField]
KinectOpticalFlow kinectOpticalFlow;
[SerializeField]
FluidSim3DProject.SmokeFluidSim smokeFluidSim;
[SerializeField]
ParticleViewerMesh particleViewerMesh;
[SerializeField]
[Range(0, 1)]
public float rate = 1.0f;
[SerializeField]
string debug;
private void Start()
{
particleViewerMesh.BufferCount = (int)(maxParticles * rate);
StartCoroutine(Initialize());
}
private void Update()
{
if (is_initialized == false)
return;
float time_step = 1.0f / fps;
if (Time.time - stamp < time_step)
return;
stamp = Time.time;
if (reset)
{
reset = false;
OnReset();
}
UpdateParticle(time_step);
}
private void OnDestroy()
{
Utilities.Release(ref args_buffer);
}
private void OnReset()
{
particleBuffer.SetData(buffer_data);
}
private IEnumerator Initialize()
{
{
args_buffer = shader.CreateIndirectComputeArgsBuffer(maxParticles, 1, 1);
}
{
buffer_data = new List<Particle>();
yield return Utilities.GetRandomParticleData(maxParticles, buffer_data);
}
is_initialized = true;
OnReset();
}
private void UpdateParticle(float time_step)
{
{
shader.SetFloat("timeStep", time_step);
shader.SetFloat("timeValue", Utilities.GetTimeValue());
shader.SetFloat("bufferCount", particleBuffer.count);
if (cosineGradient != null)
{
shader.SetVector("coeffsA", cosineGradient.coeffsA);
shader.SetVector("coeffsB", cosineGradient.coeffsB);
shader.SetVector("coeffsC", cosineGradient.coeffsC2);
shader.SetVector("coeffsD", cosineGradient.coeffsD2);
}
shader.SetVector("FluidGridDim", smokeFluidSim.GridDim);
shader.SetVector("FluidGridRoot", smokeFluidSim.GridRoot);
shader.SetVector("FluidGridSize", smokeFluidSim.GridSize);
shader.SetBuffer(0, particleBuffer.bufferName, particleBuffer.obj);
shader.SetBuffer(0, uniformBuffer.bufferName, uniformBuffer.obj);
shader.SetBuffer(0, "home_count_buffer", kinectOpticalFlow.HomeCountBuffer);
shader.SetBuffer(0, "home_position_buffer", kinectOpticalFlow.HomePositionBuffer);
shader.SetBuffer(0, "home_velocity_buffer", kinectOpticalFlow.HomeVelocityBuffer);
shader.SetBuffer(0, "fluid_velocity_buffer", smokeFluidSim.VelocityBuffer);
shader.DispatchIndirect(0, args_buffer);
}
}
}
}

@ -1,13 +0,0 @@
fileFormatVersion: 2
guid: 15ad9c9a8c81d2c4184b50d96a669c7d
timeCreated: 1519889674
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -1,10 +0,0 @@
fileFormatVersion: 2
guid: e88e267b1ead9ee4c9bdf8556f5a7490
folderAsset: yes
timeCreated: 1519717219
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -1,62 +0,0 @@
#pragma kernel CSMain
#define NUM_THREADS 8
RWStructuredBuffer<float4> KinectGridBuffer;
RWStructuredBuffer<float3> VelocityBuffer;
RWStructuredBuffer<float> TemperatureBuffer;
RWStructuredBuffer<float> ObstacleBuffer;
RWStructuredBuffer<float> DensityBuffer;
float4 FluidDim;
float timeStep;
float temperatureAmount;
float densityAmount;
float kinectAmount;
[numthreads(NUM_THREADS, NUM_THREADS, NUM_THREADS)]
void CSMain(uint3 id : SV_DispatchThreadID)
{
int idx = id.x + id.y*FluidDim.x + id.z*FluidDim.x*FluidDim.y;
float4 value = KinectGridBuffer[idx];
float3 vel = lerp(value.xyz, float3(0, 0, 0), 0.05f);
float obs = lerp(value.w, 0, 0.2f);
KinectGridBuffer[idx] = float4(vel, obs);
//KinectGridBuffer[idx] = float4(1, 0, 0, 1);
float obstacle = 0;
// boundary
{
if ((int)id.x - 1 < 0) obstacle = 1;
if ((int)id.x + 1 > (int)FluidDim.x - 1) obstacle = 1;
if ((int)id.y - 1 < 0) obstacle = 1;
if ((int)id.y + 1 > (int)FluidDim.y - 1) obstacle = 1;
if ((int)id.z - 1 < 0) obstacle = 1;
if ((int)id.z + 1 > (int)FluidDim.z - 1) obstacle = 1;
}
//
obstacle = max(obstacle, KinectGridBuffer[idx].w);
obstacle = saturate(obstacle);
//ObstacleBuffer[idx] = obstacle;
float3 velocity = VelocityBuffer[idx];
float density = DensityBuffer[idx];
//if (id.y == 1) density += 10.0f * timeStep;
density += KinectGridBuffer[idx].w * kinectAmount * densityAmount * timeStep * length(velocity);
density = max(density, 0);
//DensityBuffer[idx] = density;
float temperature = TemperatureBuffer[idx];
temperature += KinectGridBuffer[idx].w * kinectAmount * temperatureAmount * timeStep * length(velocity);
temperature = max(temperature, 0);
TemperatureBuffer[idx] = temperature;
velocity += KinectGridBuffer[idx].xyz * kinectAmount * 10.0;
VelocityBuffer[idx] = velocity;
}

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 5a8d2c045ee23f743a54f85301ca1c0b
timeCreated: 1505446406
licenseType: Free
ComputeShaderImporter:
currentAPIMask: 4
userData:
assetBundleName:
assetBundleVariant:

@ -1,10 +0,0 @@
fileFormatVersion: 2
guid: 56032ca3ec67ba3449b295b605a3b7be
folderAsset: yes
timeCreated: 1524647267
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -1,64 +0,0 @@
Shader "Hidden/Kinect2MotionDebug"
{
Properties
{
_Color("Color", Color) = (1,1,1,1)
}
SubShader
{
Tags{ "RenderType" = "Opaque" }
LOD 100
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma geometry geom
#pragma fragment frag
#include "UnityCG.cginc"
struct v2g
{
float4 vertex : SV_POSITION;
};
struct g2f
{
float4 vertex : SV_POSITION;
};
fixed4 _Color;
#ifdef SHADER_API_D3D11
StructuredBuffer<float4> ssbo;
#endif
v2g vert(appdata_base v, uint vid : SV_VertexID)
{
v2g o = (v2g)0;
#ifdef SHADER_API_D3D11
o.vertex = float4(ssbo[vid].xyz, 1);
#endif
return o;
}
[maxvertexcount(1)]
void geom(point v2g input[1], inout PointStream<g2f> OutputStream)
{
g2f o = (g2f)0;
o.vertex = UnityObjectToClipPos(input[0].vertex.xyz);
OutputStream.Append(o);
}
fixed4 frag(g2f i) : SV_Target
{
fixed4 col = fixed4(1, 1, 1, 1);
return col;
}
ENDCG
}
}
}

@ -1,10 +0,0 @@
fileFormatVersion: 2
guid: 6ffbbc1e44667e348b62c7f3ea93ae4b
timeCreated: 1525233718
licenseType: Free
ShaderImporter:
externalObjects: {}
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

@ -1,19 +0,0 @@
#pragma kernel CSMain
#include "UnityCG.cginc"
StructuredBuffer<float4> position_buffer;
StructuredBuffer<float4> velocity_buffer;
RWStructuredBuffer<float4> FinalPositionBuffer;
RWStructuredBuffer<float4> FinalVelocityBuffer;
int count;
[numthreads(512, 1, 1)]
void CSMain(uint3 id : SV_DispatchThreadID)
{
int final_index = 512 * 424 * count + id.x;
FinalPositionBuffer[final_index] = position_buffer[id.x];
FinalVelocityBuffer[final_index] = velocity_buffer[id.x];
}

@ -1,10 +0,0 @@
fileFormatVersion: 2
guid: 7a8ac615a5434b24d83dbec67effb820
timeCreated: 1524801314
licenseType: Free
ComputeShaderImporter:
externalObjects: {}
currentAPIMask: 4
userData:
assetBundleName:
assetBundleVariant:

@ -1,83 +0,0 @@
#define WIDTH 512
#define HEIGHT 424
#pragma kernel CSMain
#include "UnityCG.cginc"
RWStructuredBuffer<float4> kinect_motion_buffer;
RWStructuredBuffer<float4> position_buffer;
RWStructuredBuffer<float4> velocity_buffer;
Texture2D<float2> depth_texture;
Texture2D<float2> velocity_texture;
float4x4 kinect_matrix;
float clip;
float3 clip_box;
[numthreads(32, 32, 1)]
void CSMain(uint3 id : SV_DispatchThreadID)
{
int index = id.y * WIDTH + id.x;
int high = (int)(depth_texture[id.xy].y * 255.0);
int low = (int)(depth_texture[id.xy].x * 255.0);
float depth = (float)((high << 8) + low) * 0.001;
float2 vel = velocity_texture[id.xy].xy * 255.0 - 128.0;
float pre_depth = kinect_motion_buffer[index].z;
kinect_motion_buffer[index] = float4(vel, depth, pre_depth);
///////////////////////////////////
float2 img_size = float2(512.0, 424.0);
float fovy = 60.0;
float PI = UNITY_PI;
float focal = img_size.y / 2.0 / tan(fovy / 2.0 * PI / 180.0);
float2 vel2d = vel;
float2 f_pos = float2(id.xy) + 0.5;
float2 t_pos = f_pos + vel2d;
float f_depth = pre_depth;
float t_depth = depth;
float3 flip = float3(1.0, -1.0, -1.0);
float3 f_vec = float3((f_pos - 0.5 * img_size) / focal, -1.0) * flip;
float3 t_vec = float3((t_pos - 0.5 * img_size) / focal, -1.0) * flip;
float3 f_p3d = float3(f_vec * f_depth);
float3 t_p3d = float3(t_vec * t_depth);
float3 vel3d = t_p3d - f_p3d;
float depth_diff_threshold = 0.14;
float cam_dot_threshold = 0.955;
if (f_depth == 0.0 || t_depth == 0.0 || abs(f_depth - t_depth) > depth_diff_threshold)
{
f_p3d = float3(0, 0, 0);
vel3d = float3(0, 0, 0);
}
else if (abs(dot(normalize(vel3d), normalize(f_vec))) > cam_dot_threshold)
{
f_p3d = float3(0, 0, 0);
vel3d = float3(0, 0, 0);
}
float3 kpos = mul(kinect_matrix, float4(t_p3d, 1.0)).xyz;
float3 kvel = mul(kinect_matrix, float4(vel3d, 0.0)).xyz;
if ((kpos.x < -clip_box.x * 0.5 || kpos.x > clip_box.x * 0.5 ||
kpos.z < -clip_box.z * 0.5 || kpos.z > clip_box.z * 0.5 ||
kpos.y < 0.0 || kpos.y > clip_box.y) && clip > 0.5)
{
kpos = float3(0, 0, 0);
kvel = float3(0, 0, 0);
}
position_buffer[index] = float4(kpos, 1.0);
velocity_buffer[index] = float4(-kvel, 0.0);
}

@ -1,10 +0,0 @@
fileFormatVersion: 2
guid: bd9793649dc30c046875df07338824bb
timeCreated: 1524801314
licenseType: Free
ComputeShaderImporter:
externalObjects: {}
currentAPIMask: 4
userData:
assetBundleName:
assetBundleVariant:

@ -1,367 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Grpc.Core;
using System.Threading.Tasks;
namespace UltraCombos.Kinect2MotionTransmit
{
public class KinectGrpcServer : MonoBehaviour
{
public int port = 50051;
Server server;
[SerializeField]
ComputeShader shader;
public ComputeBuffer buffer;
[SerializeField]
ComputeShader collectShader;
[SerializeField]
bool clip = true;
class KinectBuffer
{
~KinectBuffer()
{
Release();
}
public void Release()
{
if (position != null)
{
position.Release();
position = null;
}
if (velocity != null)
{
velocity.Release();
velocity = null;
}
}
public ComputeBuffer position;
public ComputeBuffer velocity;
public object mutex = new object();
public DataRequest[] data_pool = new DataRequest[3];
public bool has_new_data = false;
public int READY = 0;
public int FRONT = 1;
public int BACK = 2;
public float fps = 30.0f;
public float stamp = 0.0f;
public Matrix4x4 matrix;
public Vector3 ClipBox;
}
List<KeyValuePair<string, KinectBuffer>> kinect_buffers = new List<KeyValuePair<string, KinectBuffer>>();
int final_count = 1;
ComputeBuffer final_position_buffer;
public ComputeBuffer FinalPositionBuffer { get { return final_position_buffer; } }
ComputeBuffer final_velocity_buffer;
public ComputeBuffer FinalVelocityBuffer { get { return final_velocity_buffer; } }
Texture2D depth_texture;
byte[] depth_data;
//Texture2D depth_low_texture;
//byte[] depth_low_data;
Texture2D velocity_texture;
byte[] velocity_data;
const int width = 512;
const int height = 424;
[SerializeField]
List<string> connectedDevices = new List<string>();
[SerializeField]
string debug;
[SerializeField]
bool debugDraw = false;
[SerializeField]
Shader debugShader = null;
private void Start()
{
buffer = new ComputeBuffer(width * height, sizeof(float) * 4);
Debug.LogFormat("Buffer is created by count {0} and stride {1}", buffer.count, buffer.stride);
depth_data = new byte[buffer.count ];
//depth_low_data = new byte[buffer.count / 2];
velocity_data = new byte[buffer.count];
depth_texture = new Texture2D(width, height, TextureFormat.BC5, false);
//depth_low_texture = new Texture2D(width, height, TextureFormat.BC4, false);
velocity_texture = new Texture2D(width, height, TextureFormat.BC5, false);
final_position_buffer = new ComputeBuffer(width * height, sizeof(float) * 4);
final_velocity_buffer = new ComputeBuffer(width * height, sizeof(float) * 4);
StartServer();
}
private void Update()
{
uint x, y, z;
shader.GetKernelThreadGroupSizes(0, out x, out y, out z);
int[] args = new int[3]
{
(int)Mathf.CeilToInt((float)width / x),
(int)Mathf.CeilToInt((float)height / y),
(int)Mathf.CeilToInt((float)1 / z)
};
connectedDevices.Clear();
debug = "";
foreach (var buf in kinect_buffers)
{
connectedDevices.Add(buf.Key);
debug += string.Format("{0} ", buf.Value.fps);
var kinect = buf.Value;
if (kinect.position == null)
kinect.position = new ComputeBuffer(width * height, sizeof(float) * 4);
if (kinect.velocity == null)
kinect.velocity = new ComputeBuffer(width * height, sizeof(float) * 4);
if (kinect.has_new_data)
{
lock (kinect.mutex)
{
Swap(ref kinect.FRONT, ref kinect.READY);
kinect.has_new_data = false;
}
DataRequest data = kinect.data_pool[kinect.READY];
Vector3 pos = new Vector3(data.PositionX, data.PositionY, -data.PositionZ);
#if false
Quaternion q = Quaternion.Euler(-data.RotationX, -data.RotationY, data.RotationZ);
#else
Quaternion q = Quaternion.Euler(0, 0, data.RotationZ);
q *= Quaternion.Euler(0, -data.RotationY, 0);
q *= Quaternion.Euler(-data.RotationX, 0, 0);
#endif
kinect.matrix = Matrix4x4.TRS(pos, q, Vector3.one);
kinect.ClipBox = new Vector3(data.ClipSizeX, data.ClipSizeY, data.ClipSizeZ);
data.DepthHighData.CopyTo(depth_data, 0);
//data.DepthLowData.CopyTo(depth_low_data, 0);
data.VelocityData.CopyTo(velocity_data, 0);
depth_texture.LoadRawTextureData(depth_data);
depth_texture.Apply();
//depth_low_texture.LoadRawTextureData(depth_low_data);
//depth_low_texture.Apply();
velocity_texture.LoadRawTextureData(velocity_data);
velocity_texture.Apply();
shader.SetTexture(0, "depth_texture", depth_texture);
//shader.SetTexture(0, "depth_low_texture", depth_low_texture);
shader.SetTexture(0, "velocity_texture", velocity_texture);
shader.SetBuffer(0, "kinect_motion_buffer", buffer);
shader.SetBuffer(0, "position_buffer", kinect.position);
shader.SetBuffer(0, "velocity_buffer", kinect.velocity);
shader.SetMatrix("kinect_matrix", kinect.matrix);
shader.SetVector("clip_box", kinect.ClipBox);
shader.SetFloat("clip", clip ? 1.0f : 0.0f);
shader.Dispatch(0, args[0], args[1], args[2]);
kinect.fps = Mathf.Lerp(kinect.fps, 1.0f / (Time.time - kinect.stamp), 0.02f);
kinect.stamp = Time.time;
}
}
}
private void FixedUpdate()
{
uint x, y, z;
collectShader.GetKernelThreadGroupSizes(0, out x, out y, out z);
int[] args = new int[3]
{
(int)Mathf.CeilToInt((float)(width * height) / x),
(int)Mathf.CeilToInt((float)1 / y),
(int)Mathf.CeilToInt((float)1 / z)
};
if (final_count < kinect_buffers.Count)
{
final_count = kinect_buffers.Count;
int buf_count = final_count * width * height;
final_position_buffer.Release();
final_position_buffer = new ComputeBuffer(buf_count, sizeof(float) * 4);
final_velocity_buffer.Release();
final_velocity_buffer = new ComputeBuffer(buf_count, sizeof(float) * 4);
}
int count = 0;
foreach (var buf in kinect_buffers)
{
if (buf.Value.position == null || buf.Value.velocity == null)
continue;
collectShader.SetInt("count", count++);
collectShader.SetBuffer(0, "position_buffer", buf.Value.position);
collectShader.SetBuffer(0, "velocity_buffer", buf.Value.velocity);
collectShader.SetBuffer(0, "FinalPositionBuffer", final_position_buffer);
collectShader.SetBuffer(0, "FinalVelocityBuffer", final_velocity_buffer);
collectShader.Dispatch(0, args[0], args[1], args[2]);
}
}
private void OnDestroy()
{
server.ShutdownAsync().Wait();
if (buffer != null)
{
buffer.Release();
buffer = null;
}
if (final_position_buffer != null)
{
final_position_buffer.Release();
final_position_buffer = null;
}
if (final_velocity_buffer != null)
{
final_velocity_buffer.Release();
final_velocity_buffer = null;
}
foreach (var buf in kinect_buffers)
{
buf.Value.Release();
}
}
private void StartServer()
{
try
{
var options = new List<ChannelOption> { new ChannelOption(ChannelOptions.MaxReceiveMessageLength, int.MaxValue) };
server = new Server(options)
{
Services = { Resource.BindService(new ResourceImpl(OnMessageReceived)) },
Ports = { new ServerPort("0.0.0.0", port, ServerCredentials.Insecure) }
};
server.Start();
Debug.Log("Start Server");
}
catch (System.Exception e)
{
Debug.LogError(e.Message);
}
}
private void OnMessageReceived(DataRequest data)
{
//Debug.Log(data.Name);
//Debug.LogFormat("message.Length: {0}", data.Content.Length);
KinectBuffer kinect = null;
foreach (var buf in kinect_buffers)
{
if (data.Name.Equals(buf.Key))
{
kinect = buf.Value;
}
}
if (kinect == null)
{
kinect = new KinectBuffer();
for (int i = 0; i < 3; i++)
kinect.data_pool[i] = new DataRequest();
kinect_buffers.Add(new KeyValuePair<string, KinectBuffer>(data.Name, kinect));
}
kinect.data_pool[kinect.BACK].MergeFrom(data);
lock (kinect.mutex)
{
Swap(ref kinect.BACK, ref kinect.FRONT);
kinect.has_new_data = true;
}
}
private static void Swap<T>(ref T a, ref T b)
{
T tmp = a;
a = b;
b = tmp;
}
private void OnDrawGizmosSelected()
{
var col = Gizmos.color;
float fov = 60.0f;
float aspect = 512.0f / 424.0f;
int count = 0;
foreach (var buf in kinect_buffers)
{
var kinect = buf.Value;
Gizmos.color = Color.HSVToRGB(count++ / 5.0f, 0.8f, 0.8f);
var mat = Gizmos.matrix;
Gizmos.matrix = transform.localToWorldMatrix;
Gizmos.matrix = Matrix4x4.identity;
Gizmos.DrawWireCube(new Vector3(0, kinect.ClipBox.y * 0.5f, 0), kinect.ClipBox);
Gizmos.matrix *= kinect.matrix;
Gizmos.DrawFrustum(Vector3.zero, fov, 10.0f, 0.0f, aspect);
Gizmos.matrix = mat;
}
Gizmos.color = col;
}
Material material = null;
private void OnRenderObject()
{
if (debugShader == null)
return;
if (debugDraw == false)
return;
if (material == null)
material = new Material(debugShader);
material.SetPass(0);
material.SetBuffer("ssbo", final_position_buffer);
Graphics.DrawProcedural(MeshTopology.Points, final_position_buffer.count, 1);
}
}
internal class ResourceImpl : Resource.ResourceBase
{
public ResourceImpl(MessageDelegate func = null)
{
if (func != null)
onMessageReceived += func;
}
public override Task<DataReply> SendData(DataRequest request, ServerCallContext context)
{
onMessageReceived.Invoke(request);
string res = string.Format("OK: DH({0}), DL({1}), V({2})", request.DepthHighData.Length, request.DepthLowData.Length, request.VelocityData.Length);
//Debug.Log(res);
return Task.FromResult(new DataReply { Result = res });
}
public delegate void MessageDelegate(DataRequest data);
public MessageDelegate onMessageReceived;
}
}

@ -1,18 +0,0 @@
fileFormatVersion: 2
guid: d47d55be359a57741a6fecbcc7efaf2b
timeCreated: 1524646292
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences:
- shader: {fileID: 7200000, guid: bd9793649dc30c046875df07338824bb, type: 3}
- collectShader: {fileID: 7200000, guid: 7a8ac615a5434b24d83dbec67effb820, type: 3}
- FinalPositionBuffer: {instanceID: 0}
- FinalVelocityBuffer: {instanceID: 0}
- debugShader: {fileID: 4800000, guid: 6ffbbc1e44667e348b62c7f3ea93ae4b, type: 3}
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -1,97 +0,0 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: UltraCombos.Kinect2MotionTransmit.proto
// </auto-generated>
#pragma warning disable 1591
#region Designer generated code
using grpc = global::Grpc.Core;
namespace UltraCombos.Kinect2MotionTransmit {
public static partial class Resource
{
static readonly string __ServiceName = "UltraCombos.Kinect2MotionTransmit.Resource";
static readonly grpc::Marshaller<global::UltraCombos.Kinect2MotionTransmit.DataRequest> __Marshaller_DataRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::UltraCombos.Kinect2MotionTransmit.DataRequest.Parser.ParseFrom);
static readonly grpc::Marshaller<global::UltraCombos.Kinect2MotionTransmit.DataReply> __Marshaller_DataReply = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::UltraCombos.Kinect2MotionTransmit.DataReply.Parser.ParseFrom);
static readonly grpc::Method<global::UltraCombos.Kinect2MotionTransmit.DataRequest, global::UltraCombos.Kinect2MotionTransmit.DataReply> __Method_SendData = new grpc::Method<global::UltraCombos.Kinect2MotionTransmit.DataRequest, global::UltraCombos.Kinect2MotionTransmit.DataReply>(
grpc::MethodType.Unary,
__ServiceName,
"SendData",
__Marshaller_DataRequest,
__Marshaller_DataReply);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{
get { return global::UltraCombos.Kinect2MotionTransmit.UltraCombosKinect2MotionTransmitReflection.Descriptor.Services[0]; }
}
/// <summary>Base class for server-side implementations of Resource</summary>
public abstract partial class ResourceBase
{
public virtual global::System.Threading.Tasks.Task<global::UltraCombos.Kinect2MotionTransmit.DataReply> SendData(global::UltraCombos.Kinect2MotionTransmit.DataRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
}
/// <summary>Client for Resource</summary>
public partial class ResourceClient : grpc::ClientBase<ResourceClient>
{
/// <summary>Creates a new client for Resource</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public ResourceClient(grpc::Channel channel) : base(channel)
{
}
/// <summary>Creates a new client for Resource that uses a custom <c>CallInvoker</c>.</summary>
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
public ResourceClient(grpc::CallInvoker callInvoker) : base(callInvoker)
{
}
/// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
protected ResourceClient() : base()
{
}
/// <summary>Protected constructor to allow creation of configured clients.</summary>
/// <param name="configuration">The client configuration.</param>
protected ResourceClient(ClientBaseConfiguration configuration) : base(configuration)
{
}
public virtual global::UltraCombos.Kinect2MotionTransmit.DataReply SendData(global::UltraCombos.Kinect2MotionTransmit.DataRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return SendData(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual global::UltraCombos.Kinect2MotionTransmit.DataReply SendData(global::UltraCombos.Kinect2MotionTransmit.DataRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_SendData, null, options, request);
}
public virtual grpc::AsyncUnaryCall<global::UltraCombos.Kinect2MotionTransmit.DataReply> SendDataAsync(global::UltraCombos.Kinect2MotionTransmit.DataRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return SendDataAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual grpc::AsyncUnaryCall<global::UltraCombos.Kinect2MotionTransmit.DataReply> SendDataAsync(global::UltraCombos.Kinect2MotionTransmit.DataRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_SendData, null, options, request);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override ResourceClient NewInstance(ClientBaseConfiguration configuration)
{
return new ResourceClient(configuration);
}
}
/// <summary>Creates service definition that can be registered with a server</summary>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static grpc::ServerServiceDefinition BindService(ResourceBase serviceImpl)
{
return grpc::ServerServiceDefinition.CreateBuilder()
.AddMethod(__Method_SendData, serviceImpl.SendData).Build();
}
}
}
#endregion

@ -1,13 +0,0 @@
fileFormatVersion: 2
guid: 6aaa626a29978c944b18c4334a0b06dc
timeCreated: 1524800781
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -1,650 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: UltraCombos.Kinect2MotionTransmit.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace UltraCombos.Kinect2MotionTransmit {
/// <summary>Holder for reflection information generated from UltraCombos.Kinect2MotionTransmit.proto</summary>
public static partial class UltraCombosKinect2MotionTransmitReflection {
#region Descriptor
/// <summary>File descriptor for UltraCombos.Kinect2MotionTransmit.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static UltraCombosKinect2MotionTransmitReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CidVbHRyYUNvbWJvcy5LaW5lY3QyTW90aW9uVHJhbnNtaXQucHJvdG8SIVVs",
"dHJhQ29tYm9zLktpbmVjdDJNb3Rpb25UcmFuc21pdCKeAgoLRGF0YVJlcXVl",
"c3QSDAoEbmFtZRgBIAEoCRIVCg1kZXB0aEhpZ2hEYXRhGAIgASgMEhQKDGRl",
"cHRoTG93RGF0YRgDIAEoDBIUCgx2ZWxvY2l0eURhdGEYBCABKAwSEQoJcG9z",
"aXRpb25YGAUgASgCEhEKCXBvc2l0aW9uWRgGIAEoAhIRCglwb3NpdGlvbloY",
"ByABKAISEQoJcm90YXRpb25YGAggASgCEhEKCXJvdGF0aW9uWRgJIAEoAhIR",
"Cglyb3RhdGlvbloYCiABKAISEQoJY2xpcFNpemVYGAsgASgCEhEKCWNsaXBT",
"aXplWRgMIAEoAhIRCgljbGlwU2l6ZVoYDSABKAISEwoLaW5mb3JtYXRpb24Y",
"DiABKAkiGwoJRGF0YVJlcGx5Eg4KBnJlc3VsdBgBIAEoCTJ2CghSZXNvdXJj",
"ZRJqCghTZW5kRGF0YRIuLlVsdHJhQ29tYm9zLktpbmVjdDJNb3Rpb25UcmFu",
"c21pdC5EYXRhUmVxdWVzdBosLlVsdHJhQ29tYm9zLktpbmVjdDJNb3Rpb25U",
"cmFuc21pdC5EYXRhUmVwbHkiAGIGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::UltraCombos.Kinect2MotionTransmit.DataRequest), global::UltraCombos.Kinect2MotionTransmit.DataRequest.Parser, new[]{ "Name", "DepthHighData", "DepthLowData", "VelocityData", "PositionX", "PositionY", "PositionZ", "RotationX", "RotationY", "RotationZ", "ClipSizeX", "ClipSizeY", "ClipSizeZ", "Information" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::UltraCombos.Kinect2MotionTransmit.DataReply), global::UltraCombos.Kinect2MotionTransmit.DataReply.Parser, new[]{ "Result" }, null, null, null)
}));
}
#endregion
}
#region Messages
public sealed partial class DataRequest : pb::IMessage<DataRequest> {
private static readonly pb::MessageParser<DataRequest> _parser = new pb::MessageParser<DataRequest>(() => new DataRequest());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<DataRequest> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::UltraCombos.Kinect2MotionTransmit.UltraCombosKinect2MotionTransmitReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DataRequest() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DataRequest(DataRequest other) : this() {
name_ = other.name_;
depthHighData_ = other.depthHighData_;
depthLowData_ = other.depthLowData_;
velocityData_ = other.velocityData_;
positionX_ = other.positionX_;
positionY_ = other.positionY_;
positionZ_ = other.positionZ_;
rotationX_ = other.rotationX_;
rotationY_ = other.rotationY_;
rotationZ_ = other.rotationZ_;
clipSizeX_ = other.clipSizeX_;
clipSizeY_ = other.clipSizeY_;
clipSizeZ_ = other.clipSizeZ_;
information_ = other.information_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DataRequest Clone() {
return new DataRequest(this);
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "depthHighData" field.</summary>
public const int DepthHighDataFieldNumber = 2;
private pb::ByteString depthHighData_ = pb::ByteString.Empty;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pb::ByteString DepthHighData {
get { return depthHighData_; }
set {
depthHighData_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "depthLowData" field.</summary>
public const int DepthLowDataFieldNumber = 3;
private pb::ByteString depthLowData_ = pb::ByteString.Empty;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pb::ByteString DepthLowData {
get { return depthLowData_; }
set {
depthLowData_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "velocityData" field.</summary>
public const int VelocityDataFieldNumber = 4;
private pb::ByteString velocityData_ = pb::ByteString.Empty;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pb::ByteString VelocityData {
get { return velocityData_; }
set {
velocityData_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "positionX" field.</summary>
public const int PositionXFieldNumber = 5;
private float positionX_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float PositionX {
get { return positionX_; }
set {
positionX_ = value;
}
}
/// <summary>Field number for the "positionY" field.</summary>
public const int PositionYFieldNumber = 6;
private float positionY_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float PositionY {
get { return positionY_; }
set {
positionY_ = value;
}
}
/// <summary>Field number for the "positionZ" field.</summary>
public const int PositionZFieldNumber = 7;
private float positionZ_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float PositionZ {
get { return positionZ_; }
set {
positionZ_ = value;
}
}
/// <summary>Field number for the "rotationX" field.</summary>
public const int RotationXFieldNumber = 8;
private float rotationX_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float RotationX {
get { return rotationX_; }
set {
rotationX_ = value;
}
}
/// <summary>Field number for the "rotationY" field.</summary>
public const int RotationYFieldNumber = 9;
private float rotationY_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float RotationY {
get { return rotationY_; }
set {
rotationY_ = value;
}
}
/// <summary>Field number for the "rotationZ" field.</summary>
public const int RotationZFieldNumber = 10;
private float rotationZ_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float RotationZ {
get { return rotationZ_; }
set {
rotationZ_ = value;
}
}
/// <summary>Field number for the "clipSizeX" field.</summary>
public const int ClipSizeXFieldNumber = 11;
private float clipSizeX_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float ClipSizeX {
get { return clipSizeX_; }
set {
clipSizeX_ = value;
}
}
/// <summary>Field number for the "clipSizeY" field.</summary>
public const int ClipSizeYFieldNumber = 12;
private float clipSizeY_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float ClipSizeY {
get { return clipSizeY_; }
set {
clipSizeY_ = value;
}
}
/// <summary>Field number for the "clipSizeZ" field.</summary>
public const int ClipSizeZFieldNumber = 13;
private float clipSizeZ_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float ClipSizeZ {
get { return clipSizeZ_; }
set {
clipSizeZ_ = value;
}
}
/// <summary>Field number for the "information" field.</summary>
public const int InformationFieldNumber = 14;
private string information_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Information {
get { return information_; }
set {
information_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as DataRequest);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(DataRequest other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Name != other.Name) return false;
if (DepthHighData != other.DepthHighData) return false;
if (DepthLowData != other.DepthLowData) return false;
if (VelocityData != other.VelocityData) return false;
if (PositionX != other.PositionX) return false;
if (PositionY != other.PositionY) return false;
if (PositionZ != other.PositionZ) return false;
if (RotationX != other.RotationX) return false;
if (RotationY != other.RotationY) return false;
if (RotationZ != other.RotationZ) return false;
if (ClipSizeX != other.ClipSizeX) return false;
if (ClipSizeY != other.ClipSizeY) return false;
if (ClipSizeZ != other.ClipSizeZ) return false;
if (Information != other.Information) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Name.Length != 0) hash ^= Name.GetHashCode();
if (DepthHighData.Length != 0) hash ^= DepthHighData.GetHashCode();
if (DepthLowData.Length != 0) hash ^= DepthLowData.GetHashCode();
if (VelocityData.Length != 0) hash ^= VelocityData.GetHashCode();
if (PositionX != 0F) hash ^= PositionX.GetHashCode();
if (PositionY != 0F) hash ^= PositionY.GetHashCode();
if (PositionZ != 0F) hash ^= PositionZ.GetHashCode();
if (RotationX != 0F) hash ^= RotationX.GetHashCode();
if (RotationY != 0F) hash ^= RotationY.GetHashCode();
if (RotationZ != 0F) hash ^= RotationZ.GetHashCode();
if (ClipSizeX != 0F) hash ^= ClipSizeX.GetHashCode();
if (ClipSizeY != 0F) hash ^= ClipSizeY.GetHashCode();
if (ClipSizeZ != 0F) hash ^= ClipSizeZ.GetHashCode();
if (Information.Length != 0) hash ^= Information.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Name);
}
if (DepthHighData.Length != 0) {
output.WriteRawTag(18);
output.WriteBytes(DepthHighData);
}
if (DepthLowData.Length != 0) {
output.WriteRawTag(26);
output.WriteBytes(DepthLowData);
}
if (VelocityData.Length != 0) {
output.WriteRawTag(34);
output.WriteBytes(VelocityData);
}
if (PositionX != 0F) {
output.WriteRawTag(45);
output.WriteFloat(PositionX);
}
if (PositionY != 0F) {
output.WriteRawTag(53);
output.WriteFloat(PositionY);
}
if (PositionZ != 0F) {
output.WriteRawTag(61);
output.WriteFloat(PositionZ);
}
if (RotationX != 0F) {
output.WriteRawTag(69);
output.WriteFloat(RotationX);
}
if (RotationY != 0F) {
output.WriteRawTag(77);
output.WriteFloat(RotationY);
}
if (RotationZ != 0F) {
output.WriteRawTag(85);
output.WriteFloat(RotationZ);
}
if (ClipSizeX != 0F) {
output.WriteRawTag(93);
output.WriteFloat(ClipSizeX);
}
if (ClipSizeY != 0F) {
output.WriteRawTag(101);
output.WriteFloat(ClipSizeY);
}
if (ClipSizeZ != 0F) {
output.WriteRawTag(109);
output.WriteFloat(ClipSizeZ);
}
if (Information.Length != 0) {
output.WriteRawTag(114);
output.WriteString(Information);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Name.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
}
if (DepthHighData.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeBytesSize(DepthHighData);
}
if (DepthLowData.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeBytesSize(DepthLowData);
}
if (VelocityData.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeBytesSize(VelocityData);
}
if (PositionX != 0F) {
size += 1 + 4;
}
if (PositionY != 0F) {
size += 1 + 4;
}
if (PositionZ != 0F) {
size += 1 + 4;
}
if (RotationX != 0F) {
size += 1 + 4;
}
if (RotationY != 0F) {
size += 1 + 4;
}
if (RotationZ != 0F) {
size += 1 + 4;
}
if (ClipSizeX != 0F) {
size += 1 + 4;
}
if (ClipSizeY != 0F) {
size += 1 + 4;
}
if (ClipSizeZ != 0F) {
size += 1 + 4;
}
if (Information.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Information);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(DataRequest other) {
if (other == null) {
return;
}
if (other.Name.Length != 0) {
Name = other.Name;
}
if (other.DepthHighData.Length != 0) {
DepthHighData = other.DepthHighData;
}
if (other.DepthLowData.Length != 0) {
DepthLowData = other.DepthLowData;
}
if (other.VelocityData.Length != 0) {
VelocityData = other.VelocityData;
}
if (other.PositionX != 0F) {
PositionX = other.PositionX;
}
if (other.PositionY != 0F) {
PositionY = other.PositionY;
}
if (other.PositionZ != 0F) {
PositionZ = other.PositionZ;
}
if (other.RotationX != 0F) {
RotationX = other.RotationX;
}
if (other.RotationY != 0F) {
RotationY = other.RotationY;
}
if (other.RotationZ != 0F) {
RotationZ = other.RotationZ;
}
if (other.ClipSizeX != 0F) {
ClipSizeX = other.ClipSizeX;
}
if (other.ClipSizeY != 0F) {
ClipSizeY = other.ClipSizeY;
}
if (other.ClipSizeZ != 0F) {
ClipSizeZ = other.ClipSizeZ;
}
if (other.Information.Length != 0) {
Information = other.Information;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
Name = input.ReadString();
break;
}
case 18: {
DepthHighData = input.ReadBytes();
break;
}
case 26: {
DepthLowData = input.ReadBytes();
break;
}
case 34: {
VelocityData = input.ReadBytes();
break;
}
case 45: {
PositionX = input.ReadFloat();
break;
}
case 53: {
PositionY = input.ReadFloat();
break;
}
case 61: {
PositionZ = input.ReadFloat();
break;
}
case 69: {
RotationX = input.ReadFloat();
break;
}
case 77: {
RotationY = input.ReadFloat();
break;
}
case 85: {
RotationZ = input.ReadFloat();
break;
}
case 93: {
ClipSizeX = input.ReadFloat();
break;
}
case 101: {
ClipSizeY = input.ReadFloat();
break;
}
case 109: {
ClipSizeZ = input.ReadFloat();
break;
}
case 114: {
Information = input.ReadString();
break;
}
}
}
}
}
public sealed partial class DataReply : pb::IMessage<DataReply> {
private static readonly pb::MessageParser<DataReply> _parser = new pb::MessageParser<DataReply>(() => new DataReply());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<DataReply> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::UltraCombos.Kinect2MotionTransmit.UltraCombosKinect2MotionTransmitReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DataReply() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DataReply(DataReply other) : this() {
result_ = other.result_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DataReply Clone() {
return new DataReply(this);
}
/// <summary>Field number for the "result" field.</summary>
public const int ResultFieldNumber = 1;
private string result_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Result {
get { return result_; }
set {
result_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as DataReply);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(DataReply other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Result != other.Result) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Result.Length != 0) hash ^= Result.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Result.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Result);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Result.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Result);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(DataReply other) {
if (other == null) {
return;
}
if (other.Result.Length != 0) {
Result = other.Result;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
Result = input.ReadString();
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

@ -1,13 +0,0 @@
fileFormatVersion: 2
guid: fd3f3cb7e4054474fbb709ccad276dc6
timeCreated: 1524800781
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -1,33 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!84 &8400000
RenderTexture:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Kinect2MotionTexture
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
m_Width: 1024
m_Height: 424
m_AntiAliasing: 1
m_DepthFormat: 0
m_ColorFormat: 11
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 0
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 2
m_VolumeDepth: 1

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: f9c2cef894c9cc54f807a92207bf6eda
timeCreated: 1508289246
licenseType: Free
NativeFormatImporter:
mainObjectFileID: 8400000
userData:
assetBundleName:
assetBundleVariant:

@ -1,33 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!84 &8400000
RenderTexture:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Kinect2MotionTexture1
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
m_Width: 1024
m_Height: 424
m_AntiAliasing: 1
m_DepthFormat: 0
m_ColorFormat: 11
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 0
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 2
m_VolumeDepth: 1

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 1276428e64b9c6444aaa6e9b476ebb1c
timeCreated: 1508289246
licenseType: Free
NativeFormatImporter:
mainObjectFileID: 8400000
userData:
assetBundleName:
assetBundleVariant:

@ -1,863 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 8
m_Fog: 0
m_FogColor: {r: 0.12068967, g: 0.12068967, b: 0.12068967, a: 1}
m_FogMode: 3
m_FogDensity: 0.15
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 0.5
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 2100000, guid: d8da8ee0c05959f40b595cff10460db1, type: 2}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.0156001905, g: 0.00680224, b: 0.003125133, a: 1}
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_TemporalCoherenceThreshold: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 9
m_Resolution: 2
m_BakeResolution: 40
m_TextureWidth: 1024
m_TextureHeight: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 0
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVRBounces: 2
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringMode: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ShowResolutionOverlay: 1
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &122028534
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 122028535}
- component: {fileID: 122028536}
m_Layer: 0
m_Name: KinectPositionBuffer
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &122028535
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 122028534}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 836938469}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &122028536
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 122028534}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: afa75a2a1fe8aff4ab1d6418df9d62dd, type: 3}
m_Name:
m_EditorClassIdentifier:
bufferName: KinectPositionBuffer
--- !u!1 &151858420
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 151858424}
- component: {fileID: 151858423}
- component: {fileID: 151858422}
- component: {fileID: 151858421}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &151858421
AudioListener:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 151858420}
m_Enabled: 1
--- !u!124 &151858422
Behaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 151858420}
m_Enabled: 1
--- !u!20 &151858423
Camera:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 151858420}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: 1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 0
m_AllowMSAA: 0
m_AllowDynamicResolution: 0
m_ForceIntoRT: 1
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &151858424
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 151858420}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1.5, z: -2.73}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &378400957 stripped
MonoBehaviour:
m_PrefabParentObject: {fileID: 11400000, guid: 0b40c0b4ea4208b4792d95085b850676,
type: 2}
m_PrefabInternal: {fileID: 1601115376}
m_Script: {fileID: 11500000, guid: a924471615937564f81ebb1540cd8b36, type: 3}
--- !u!4 &378400960 stripped
Transform:
m_PrefabParentObject: {fileID: 400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
m_PrefabInternal: {fileID: 1601115376}
--- !u!1 &386695295
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 386695297}
m_Layer: 0
m_Name: Simulation and Kinect
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &386695297
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 386695295}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 1.5}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 887356093}
- {fileID: 378400960}
- {fileID: 1205229744}
- {fileID: 836938469}
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &448166911
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 448166912}
- component: {fileID: 448166915}
- component: {fileID: 448166914}
- component: {fileID: 448166913}
m_Layer: 0
m_Name: Sphere (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &448166912
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 448166911}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 1.77, y: 0.9, z: 1.24}
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
m_Children: []
m_Father: {fileID: 1205229744}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &448166913
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 448166911}
m_Enabled: 0
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
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!135 &448166914
SphereCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 448166911}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!33 &448166915
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 448166911}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &759731729
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 759731730}
- component: {fileID: 759731733}
- component: {fileID: 759731732}
- component: {fileID: 759731731}
m_Layer: 0
m_Name: Sphere (2)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &759731730
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 759731729}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -1.16, y: 0.72, z: -1.9}
m_LocalScale: {x: 0.3, y: 0.3, z: 0.3}
m_Children: []
m_Father: {fileID: 1205229744}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &759731731
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 759731729}
m_Enabled: 0
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
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!135 &759731732
SphereCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 759731729}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!33 &759731733
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 759731729}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &836938468
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 836938469}
- component: {fileID: 836938470}
m_Layer: 0
m_Name: KinectOpticalFlow
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &836938469
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 836938468}
m_LocalRotation: {x: -0, y: -1, z: -0, w: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 122028535}
- {fileID: 1915304695}
m_Father: {fileID: 386695297}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: -180, z: 0}
--- !u!114 &836938470
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 836938468}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 639d7a6f2452c7d4cab5ffcb304b1d8c, type: 3}
m_Name:
m_EditorClassIdentifier:
server: {fileID: 887356094}
kinectBuffers:
- {fileID: 122028536}
- {fileID: 1915304696}
updateShader: {fileID: 7200000, guid: 514ebfeae1aec6342b486c73b1fbfa32, type: 3}
applyShader: {fileID: 7200000, guid: 5a8d2c045ee23f743a54f85301ca1c0b, type: 3}
flipX: 0
clipMin: {x: -0.85, y: 0.3, z: 0}
clipMax: {x: 0.71, y: 0.45, z: 1.63}
kinectAmount: 1
fluidSimulation: {fileID: 378400957}
debug: 0
colorize: 1
debugMaterial: {fileID: 2100000, guid: 95b4d9b25b7a7e3449627228b10d9009, type: 2}
--- !u!1 &887356092
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 887356093}
- component: {fileID: 887356094}
m_Layer: 0
m_Name: Kinect2MotionGrpc
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &887356093
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 887356092}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 386695297}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &887356094
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 887356092}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d47d55be359a57741a6fecbcc7efaf2b, type: 3}
m_Name:
m_EditorClassIdentifier:
port: 50051
shader: {fileID: 7200000, guid: bd9793649dc30c046875df07338824bb, type: 3}
collectShader: {fileID: 7200000, guid: 7a8ac615a5434b24d83dbec67effb820, type: 3}
clip: 1
connectedDevices: []
debug:
debugDraw: 1
debugShader: {fileID: 4800000, guid: 6ffbbc1e44667e348b62c7f3ea93ae4b, type: 3}
--- !u!1 &1042761671
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1042761672}
- component: {fileID: 1042761675}
- component: {fileID: 1042761674}
- component: {fileID: 1042761673}
m_Layer: 0
m_Name: Sphere
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1042761672
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1042761671}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0.5, z: 0}
m_LocalScale: {x: 0.2, y: 0.2, z: 0.2}
m_Children: []
m_Father: {fileID: 1205229744}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &1042761673
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1042761671}
m_Enabled: 0
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
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!135 &1042761674
SphereCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1042761671}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!33 &1042761675
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1042761671}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &1205229743
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1205229744}
- component: {fileID: 1205229745}
m_Layer: 0
m_Name: FluidSimInputController
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1205229744
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1205229743}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1042761672}
- {fileID: 448166912}
- {fileID: 759731730}
m_Father: {fileID: 386695297}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1205229745
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1205229743}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: efb50f560ef686940ab1bfb542387078, type: 3}
m_Name:
m_EditorClassIdentifier:
fluidSimulation: {fileID: 378400957}
uniforms: {fileID: 11400000, guid: 4dcbc9a971de5974da304d60289ebe0f, type: 2}
--- !u!1001 &1601115376
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 386695297}
m_Modifications:
- target: {fileID: 400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_LocalPosition.y
value: 4
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_LocalScale.x
value: 8
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_LocalScale.z
value: 8
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_width
value: 64
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_depth
value: 64
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_densityBuoyancy
value: 5
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_inputRadius
value: 0.0375
objectReference: {fileID: 0}
- target: {fileID: 400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_LocalScale.y
value: 8
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_height
value: 64
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_advectionType
value: 1
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: GroundSmoke
value: 1
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_vorticityStrength
value: 2
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_densityAmount
value: 1
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_densityDissipation
value: 0.992
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_densityWeight
value: 0.0125
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_temperatureAmount
value: 1
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_temperatureDissipation
value: 0.992
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_velocityDissipation
value: 0.998
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_inputPos.x
value: 0.35500002
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_inputPos.y
value: 0.09
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_inputPos.z
value: 0.2625
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: doDraw
value: 0
objectReference: {fileID: 0}
- target: {fileID: 100000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_Layer
value: 0
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: timeStepMultiplier
value: 5
objectReference: {fileID: 0}
- target: {fileID: 100000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2300000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 0b40c0b4ea4208b4792d95085b850676, type: 2}
m_IsPrefabParent: 0
--- !u!1 &1915304694
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1915304695}
- component: {fileID: 1915304696}
m_Layer: 0
m_Name: KinectVelocityBuffer
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1915304695
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1915304694}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 836938469}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1915304696
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1915304694}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: afa75a2a1fe8aff4ab1d6418df9d62dd, type: 3}
m_Name:
m_EditorClassIdentifier:
bufferName: KinectVelocityBuffer

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 62cc26f588699b142b504274675e6d6f
timeCreated: 1519717513
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -1,229 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace UltraCombos
{
public class KinectOpticalFlow : MonoBehaviour
{
const int width = 512;
const int height = 424;
const int POSITION = 0;
const int VELOCITY = 1;
public Kinect2MotionTransmit.KinectGrpcServer server;
[SerializeField]
List<StructuredBuffer> kinectBuffers = new List<StructuredBuffer>();
public ComputeBuffer PositionBuffer { get { return kinectBuffers[POSITION].obj; } }
public ComputeBuffer VelocityBuffer { get { return kinectBuffers[VELOCITY].obj; } }
[SerializeField]
ComputeShader updateShader;
[SerializeField]
ComputeShader applyShader;
ComputeBuffer clear_grid_buffer_args_buffer = null;
ComputeBuffer args_buffer = null;
public bool flipX = true;
public Vector3 clipMin = Vector3.one * -10;
public Vector3 clipMax = Vector3.one * 10;
public float kinectAmount = 1.0f;
[SerializeField]
FluidSim3DProject.SmokeFluidSim fluidSimulation;
ComputeBuffer kinect_grid_buffer;
public ComputeBuffer KinectGridBuffer { get { return kinect_grid_buffer; } }
int grid_width, grid_height, grid_depth;
[SerializeField, Header("Debug")]
bool debug = false;
[SerializeField]
bool colorize = false;
[SerializeField]
Material debugMaterial;
ComputeBuffer home_position_buffer;
public ComputeBuffer HomePositionBuffer { get { return home_position_buffer; } }
ComputeBuffer home_velocity_buffer;
public ComputeBuffer HomeVelocityBuffer { get { return home_velocity_buffer; } }
ComputeBuffer home_count_buffer;
public ComputeBuffer HomeCountBuffer { get { return home_count_buffer; } }
private void Start()
{
foreach (var buf in kinectBuffers)
buf.Allocate(width * height, sizeof(float) * 4);
{
grid_width = fluidSimulation.m_width;
grid_height = fluidSimulation.m_height;
grid_depth = fluidSimulation.m_depth;
int grid_count = grid_width * grid_height * grid_depth;
kinect_grid_buffer = new ComputeBuffer(grid_count, sizeof(float) * 4);
}
{
home_position_buffer = new ComputeBuffer(512 * 424, sizeof(float) * 4, ComputeBufferType.Append);
home_velocity_buffer = new ComputeBuffer(512 * 424, sizeof(float) * 4, ComputeBufferType.Append);
home_count_buffer = new ComputeBuffer(1, sizeof(int), ComputeBufferType.Raw);
}
}
private void FixedUpdate()
{
if (args_buffer == null)
{
args_buffer = updateShader.CreateIndirectComputeArgsBuffer(width * height, 1, 1);
}
if (server != null)
{
if (home_position_buffer.count != server.FinalPositionBuffer.count)
{
home_position_buffer.Release();
home_position_buffer = new ComputeBuffer(server.FinalPositionBuffer.count,
server.FinalPositionBuffer.stride, ComputeBufferType.Append);
}
if (home_velocity_buffer.count != server.FinalVelocityBuffer.count)
{
home_velocity_buffer.Release();
home_velocity_buffer = new ComputeBuffer(server.FinalVelocityBuffer.count,
server.FinalVelocityBuffer.stride, ComputeBufferType.Append);
}
foreach (var buf in kinectBuffers)
{
if (buf.count != server.FinalPositionBuffer.count)
{
buf.Release();
buf.Allocate(server.FinalVelocityBuffer.count, server.FinalVelocityBuffer.stride);
}
}
}
// update
{
var m = transform.localToWorldMatrix;
float[] mat_floats = new float[16]
{ m.m00, m.m01, m.m02, m.m03,
m.m10, m.m11, m.m12, m.m13,
m.m20, m.m21, m.m22, m.m23,
m.m30, m.m31, m.m32, m.m33};
updateShader.SetVector("ClipMin", clipMin);
updateShader.SetVector("ClipMax", clipMax);
updateShader.SetFloats("ModelMatrix", mat_floats);
updateShader.SetVector("FluidSize", fluidSimulation.GridSize);
updateShader.SetVector("FluidRoot", fluidSimulation.GridRoot);
updateShader.SetVector("FluidDim", fluidSimulation.GridDim);
updateShader.SetInt("flipX", flipX ? 1 : 0);
foreach (var buf in kinectBuffers)
updateShader.SetBuffer(0, buf.bufferName, buf.obj);
updateShader.SetBuffer(0, "KinectGridBuffer", kinect_grid_buffer);
updateShader.SetBuffer(0, "HomePositionBuffer", home_position_buffer);
updateShader.SetBuffer(0, "HomeVelocityBuffer", home_velocity_buffer);
if (server != null)
{
updateShader.SetBuffer(0, "FinalPositionBuffer", server.FinalPositionBuffer);
updateShader.SetBuffer(0, "FinalVelocityBuffer", server.FinalVelocityBuffer);
uint x, y, z;
updateShader.GetKernelThreadGroupSizes(0, out x, out y, out z);
int tgx = Mathf.CeilToInt((float)server.FinalPositionBuffer.count / x);
updateShader.Dispatch(0, tgx, 1, 1);
}
else
{
updateShader.DispatchIndirect(0, args_buffer);
}
}
{
ComputeBuffer.CopyCount(home_position_buffer, home_count_buffer, 0);
#if false
int home_count;
var data = new int[home_count_buffer.count];
home_count_buffer.GetData(data);
home_count = data[0];
Debug.LogFormat("home_count: {0}", home_count);
#endif
home_position_buffer.SetCounterValue(0);
home_velocity_buffer.SetCounterValue(0);
}
if (clear_grid_buffer_args_buffer == null)
{
Vector3Int dim = Vector3Int.FloorToInt(fluidSimulation.GridDim);
clear_grid_buffer_args_buffer = applyShader.CreateIndirectComputeArgsBuffer(dim.x, dim.y, dim.z);
}
{
applyShader.SetVector("FluidDim", fluidSimulation.GridDim);
applyShader.SetBuffer(0, "VelocityBuffer", fluidSimulation.VelocityBuffer);
applyShader.SetBuffer(0, "TemperatureBuffer", fluidSimulation.TemperatureBuffer);
applyShader.SetBuffer(0, "ObstacleBuffer", fluidSimulation.ObstacleBuffer);
applyShader.SetBuffer(0, "DensityBuffer", fluidSimulation.DensityBuffer);
applyShader.SetFloat("timeStep", Time.fixedDeltaTime);
applyShader.SetFloat("kinect_amount", kinectAmount);
applyShader.SetFloat("temperatureAmount", fluidSimulation.m_temperatureAmount);
applyShader.SetFloat("densityAmount", fluidSimulation.m_densityAmount);
applyShader.SetBuffer(0, "KinectGridBuffer", kinect_grid_buffer);
applyShader.DispatchIndirect(0, clear_grid_buffer_args_buffer);
}
}
private bool IsTextureValid(Texture2D tex)
{
bool res = false;
if (tex)
{
if (tex.width == 512 && tex.height == 424)
res = true;
}
return res;
}
private void OnRenderObject()
{
if (debug == false)
return;
if (Utilities.SkipCamera(Camera.current.name))
return;
debugMaterial.SetPass(0);
debugMaterial.SetInt("colorize", colorize ? 1 : 0);
foreach (var buf in kinectBuffers)
debugMaterial.SetBuffer(buf.bufferName, buf.obj);
Graphics.DrawProcedural(MeshTopology.Points, PositionBuffer.count);
}
private void OnDestroy()
{
clear_grid_buffer_args_buffer.Release();
args_buffer.Release();
KinectGridBuffer.Release();
home_position_buffer.Release();
home_velocity_buffer.Release();
home_count_buffer.Release();
}
}
}

@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 639d7a6f2452c7d4cab5ffcb304b1d8c
timeCreated: 1505354794
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -1,78 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: KinectOpticalFlowDebugMaterial
m_Shader: {fileID: 4800000, guid: a37a351249d5e2a418fb42311734b238, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GeomSize: 0.02
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Size: 3
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 95b4d9b25b7a7e3449627228b10d9009
timeCreated: 1505375720
licenseType: Free
NativeFormatImporter:
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

@ -1,94 +0,0 @@
Shader "Kinect/OpticalFlowDebugShader"
{
Properties
{
_Size("Size", Range(0, 100)) = 1
}
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 100
//Cull Off
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma geometry geom
#pragma fragment frag
#include "UnityCG.cginc"
#ifdef SHADER_API_D3D11
StructuredBuffer<float4> KinectPositionBuffer;
StructuredBuffer<float4> KinectVelocityBuffer;
#endif
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2g
{
//float4 vertex : SV_POSITION;
//float2 uv : TEXCOORD0;
uint id : BLENDINDICES;
//UNITY_FOG_COORDS(1)
};
struct g2f
{
float4 vertex : SV_POSITION;
float3 color : COLOR;
};
float _Size;
float colorize;
v2g vert(appdata_base v, uint vid : SV_VertexID)
{
v2g o = (v2g)0;
o.id = vid;
return o;
}
[maxvertexcount(2)]
void geom(point v2g input[1], inout LineStream<g2f> OutputStream)
{
#ifdef SHADER_API_D3D11
float4 position = KinectPositionBuffer[input[0].id];
float4 velocity = KinectVelocityBuffer[input[0].id];
#else
float4 position = float4(0, 0, 0, 1);
float4 velocity = float4(0, 0, 0, 0);
#endif
float3 c0 = float3(0, 1, 0);
float3 c1 = float3(1, 0, 0);
c0 = float3(237, 210, 152) / 255;
c1 = float3(3, 46, 82) / 255;
g2f o = (g2f)0;
o.vertex = UnityObjectToClipPos(position.xyz);
o.color = lerp(float3(0, 0, 0), c0, colorize);
OutputStream.Append(o);
o.vertex = UnityObjectToClipPos(position.xyz - velocity.xyz * _Size);
o.color = lerp(float3(0, 0, 0), c1, colorize);
OutputStream.Append(o);
OutputStream.RestartStrip();
}
fixed4 frag (g2f i) : SV_Target
{
fixed4 col = float4(i.color, 1.0f);
return col;
}
ENDCG
}
}
}

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: a37a351249d5e2a418fb42311734b238
timeCreated: 1505374746
licenseType: Free
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

@ -1,100 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace UltraCombos
{
public class KinectOpticalFlowMath : MonoBehaviour
{
[SerializeField]
KinectOpticalFlow kinect;
[SerializeField]
int fps = 15;
float step;
float stamp = 0.0f;
[SerializeField]
int maxSampleCount = 40000;
[SerializeField]
int countThreshold = 30;
int home_count;
Vector4[] position_samples = new Vector4[512 * 424 * 2];
//Vector4[] velocity_samples = new Vector4[512 * 424 * 2
public bool Valid { get { return home_count > countThreshold; } }
public int HomeCount { get { return home_count; } }
public Vector4[] Samples { get { return position_samples; } }
public bool doCalculate = false;
public Vector3 averagePositinon = Vector3.zero;
public float standardDeviation = -1.0f;
//public Vector3 averageVelocity = Vector3.zero;
[SerializeField]
string debug;
public string DebugString { get { return debug; } }
private void Start()
{
step = 1.0f / fps;
}
private void Update()
{
if (Time.time - stamp < step)
return;
stamp = Time.time;
var data = new int[kinect.HomeCountBuffer.count];
kinect.HomeCountBuffer.GetData(data);
home_count = data[0];
kinect.HomePositionBuffer.GetData(position_samples, 0, 0, home_count);
//kinect.HomeVelocityBuffer.GetData(velocity_samples, 0, 0, home_count);
if (doCalculate == false)
return;
averagePositinon = Vector3.zero;
//averageVelocity = Vector3.zero;
if (home_count > countThreshold)
{
float inc = Mathf.Max((float)home_count / maxSampleCount, 1.0f);
float div = 1.0f / home_count;
float avg_dist = 0.0f;
standardDeviation = 0.0f;
for (float k = 0; k < home_count; k += inc)
{
int i = (int)k;
var pos_smp = new Vector3(position_samples[i].x, position_samples[i].y, position_samples[i].z);
averagePositinon += pos_smp;
float dist = new Vector2(pos_smp.x - transform.position.x, pos_smp.z - transform.position.z).magnitude;
avg_dist += dist;
standardDeviation += Mathf.Pow(dist, 2.0f);
//var vel_smp = new Vector3(velocity_samples[i].x, velocity_samples[i].y, velocity_samples[i].z);
//averageVelocity += vel_smp;
}
averagePositinon.Scale(Vector4.one * div);
avg_dist *= div;
standardDeviation = Mathf.Sqrt(standardDeviation * div - avg_dist * avg_dist);
//averageVelocity.Scale(Vector4.one * div);
debug = string.Format("{0}, {1}({2}): {3}", home_count, averagePositinon, avg_dist, standardDeviation);
}
else
{
standardDeviation = -1.0f;
debug = "null";
}
}
}
}

@ -1,13 +0,0 @@
fileFormatVersion: 2
guid: c0e2f0c4ffce60f40a1fa79e4ec7955c
timeCreated: 1525522533
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -1,33 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!84 &8400000
RenderTexture:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: KinectRenderTexturePosition
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
m_Width: 512
m_Height: 424
m_AntiAliasing: 1
m_DepthFormat: 0
m_ColorFormat: 11
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 0
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 2
m_VolumeDepth: 1

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: da32e5550d217674aa980199f6a84db3
timeCreated: 1508289246
licenseType: Free
NativeFormatImporter:
mainObjectFileID: 8400000
userData:
assetBundleName:
assetBundleVariant:

@ -1,33 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!84 &8400000
RenderTexture:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: KinectRenderTextureVelocity
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
m_Width: 512
m_Height: 424
m_AntiAliasing: 1
m_DepthFormat: 0
m_ColorFormat: 11
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 0
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 2
m_VolumeDepth: 1

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 3d63e39cdb1f2e5419672e7560e22145
timeCreated: 1508289246
licenseType: Free
NativeFormatImporter:
mainObjectFileID: 8400000
userData:
assetBundleName:
assetBundleVariant:

@ -1,74 +0,0 @@
#define WIDTH 512
#define HEIGHT 424
#pragma kernel CSMain
#include "UnityCG.cginc"
RWStructuredBuffer<float4> KinectPositionBuffer;
RWStructuredBuffer<float4> KinectVelocityBuffer;
RWStructuredBuffer<float4> KinectGridBuffer;
RWStructuredBuffer<float4> FinalPositionBuffer;
RWStructuredBuffer<float4> FinalVelocityBuffer;
AppendStructuredBuffer<float4> HomePositionBuffer;
AppendStructuredBuffer<float4> HomeVelocityBuffer;
float4 ClipMin;
float4 ClipMax;
float4x4 ModelMatrix;
float4 FluidSize;
float4 FluidRoot;
float4 FluidDim;
int flipX;
int NumKinects;
[numthreads(512, 1, 1)]
void CSMain (uint3 id : SV_DispatchThreadID)
{
//uint2 tex_coord = uint2(id.x % WIDTH, id.x / WIDTH);
float4 pos = FinalPositionBuffer[id.x];
//pos.y *= -1;
pos.z *= -1;
pos.x = lerp(pos.x, -pos.x, flipX);
float pos_mag = length(pos.xyz);
{
pos = mul(pos, ModelMatrix);
float4 vel = FinalVelocityBuffer[id.x];
//vel = float4(0, 0, 0.01, 0);
//vel.y *= -1;
vel.z *= -1;
vel.x = lerp(vel.x, -vel.x, flipX);
float3 grid_pos = (pos.xyz - FluidRoot.xyz) / FluidSize.xyz;
int grid_index = -1;
if (grid_pos.x > 0 && grid_pos.x < 1 &&
grid_pos.y > 0 && grid_pos.y < 1 &&
grid_pos.z > 0 && grid_pos.z < 1 &&
pos_mag > 0.0f)// && length(pos) > 10.0f)
{
grid_pos *= FluidDim.xyz;
grid_index = (int)grid_pos.x + (int)grid_pos.y * FluidDim.x + (int)grid_pos.z * FluidDim.x * FluidDim.y;
KinectGridBuffer[grid_index] += float4(vel.xyz, 1);
if (pos_mag > 0.1f)// && pos.y < 0.5f)
{
//pos.y = 0.0f;
//vel.xyz = float3(0, 0, 0);
HomePositionBuffer.Append(float4(pos.xyz, 0));
HomeVelocityBuffer.Append(float4(vel.xyz, 0));
}
}
KinectPositionBuffer[id.x] = float4(pos.xyz, grid_index);
KinectVelocityBuffer[id.x] = float4((pos_mag == 0.0f) ? float3(0, 0, 0) : vel.xyz, 0);
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save