diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index a6d6496..4537052 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -104,7 +104,7 @@ serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: - serializedVersion: 2 + serializedVersion: 3 agentTypeID: 0 agentRadius: 0.5 agentHeight: 2 @@ -117,7 +117,7 @@ cellSize: 0.16666667 manualTileSize: 0 tileSize: 256 - accuratePlacement: 0 + buildHeightMesh: 0 maxJobWorkers: 0 preserveTilesOutsideBounds: 0 debug: @@ -164,9 +164,17 @@ m_projectionMatrixMode: 1 m_GateFitMode: 2 m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 m_SensorSize: {x: 36, y: 24} m_LensShift: {x: 0, y: 0} - m_FocalLength: 50 m_NormalizedViewPortRect: serializedVersion: 2 x: 0 @@ -203,6 +211,7 @@ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -10} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 @@ -222,10 +231,11 @@ schrodinger: {fileID: 7200000, guid: 979c7135e7e183e43bf950b33bf979d1, type: 3} visualization: {fileID: 7200000, guid: c949a119cc67aa347a6c6df53f77ffdf, type: 3} texture: {fileID: 0} - resolution: 256 + resolution: 512 speed: 1000 time: {fileID: 1078554324} elapsedTime: 0 + showTime: 0 --- !u!1 &380728026 GameObject: m_ObjectHideFlags: 0 @@ -303,6 +313,7 @@ m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 m_AdditionalShaderChannelsFlag: 0 + m_UpdateRectTransformForStandalone: 0 m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 @@ -316,6 +327,7 @@ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1078554323} m_Father: {fileID: 0} @@ -356,6 +368,7 @@ m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} m_Name: m_EditorClassIdentifier: + m_SendPointerHoverToParent: 1 m_HorizontalAxis: Horizontal m_VerticalAxis: Vertical m_SubmitButton: Submit @@ -388,6 +401,7 @@ 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_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 2 @@ -420,6 +434,7 @@ 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_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 380728030} m_RootOrder: 0 diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index a6d6496..4537052 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -104,7 +104,7 @@ serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: - serializedVersion: 2 + serializedVersion: 3 agentTypeID: 0 agentRadius: 0.5 agentHeight: 2 @@ -117,7 +117,7 @@ cellSize: 0.16666667 manualTileSize: 0 tileSize: 256 - accuratePlacement: 0 + buildHeightMesh: 0 maxJobWorkers: 0 preserveTilesOutsideBounds: 0 debug: @@ -164,9 +164,17 @@ m_projectionMatrixMode: 1 m_GateFitMode: 2 m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 m_SensorSize: {x: 36, y: 24} m_LensShift: {x: 0, y: 0} - m_FocalLength: 50 m_NormalizedViewPortRect: serializedVersion: 2 x: 0 @@ -203,6 +211,7 @@ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -10} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 @@ -222,10 +231,11 @@ schrodinger: {fileID: 7200000, guid: 979c7135e7e183e43bf950b33bf979d1, type: 3} visualization: {fileID: 7200000, guid: c949a119cc67aa347a6c6df53f77ffdf, type: 3} texture: {fileID: 0} - resolution: 256 + resolution: 512 speed: 1000 time: {fileID: 1078554324} elapsedTime: 0 + showTime: 0 --- !u!1 &380728026 GameObject: m_ObjectHideFlags: 0 @@ -303,6 +313,7 @@ m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 m_AdditionalShaderChannelsFlag: 0 + m_UpdateRectTransformForStandalone: 0 m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 @@ -316,6 +327,7 @@ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1078554323} m_Father: {fileID: 0} @@ -356,6 +368,7 @@ m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} m_Name: m_EditorClassIdentifier: + m_SendPointerHoverToParent: 1 m_HorizontalAxis: Horizontal m_VerticalAxis: Vertical m_SubmitButton: Submit @@ -388,6 +401,7 @@ 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_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 2 @@ -420,6 +434,7 @@ 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_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 380728030} m_RootOrder: 0 diff --git a/Assets/Scripts/Display.cs b/Assets/Scripts/Display.cs index b0dc5ba..7c0201d 100644 --- a/Assets/Scripts/Display.cs +++ b/Assets/Scripts/Display.cs @@ -12,6 +12,7 @@ public int speed = 100; public Text time; public int elapsedTime = 0; + public bool showTime = true; private void Start() { psi = new ComputeBuffer(resolution * resolution * 8, 8); @@ -27,7 +28,7 @@ visualization.SetInt("resolution", resolution); schrodinger.SetBuffer(kernel, "psi", psi); schrodinger.SetBuffer(kernel, "potential", potential); - schrodinger.Dispatch(kernel, 8, 8, 1); + schrodinger.Dispatch(kernel, resolution/32, resolution/32, 1); } private void Update() { @@ -36,13 +37,17 @@ schrodinger.SetBuffer(kernel, "psi", psi); schrodinger.SetBuffer(kernel, "potential", potential); for (int i = 0; i < speed; i++) { - schrodinger.Dispatch(kernel, 8, 8, 1); + schrodinger.Dispatch(kernel, resolution/32, resolution/32, 1); } elapsedTime += speed; - time.text = string.Format("time: {0} us", (float)elapsedTime / 200); visualization.SetBuffer(0, "psiIn", psi); visualization.SetTexture(0, "result", texture); - visualization.Dispatch(0, 8, 8, 1); + visualization.Dispatch(0, resolution/32, resolution/32, 1); + if (showTime) { + time.text = string.Format("time: {0} us", (float)elapsedTime / 200); + } else { + time.text = ""; + } } private void OnRenderImage(RenderTexture before, RenderTexture destination) { diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index a6d6496..4537052 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -104,7 +104,7 @@ serializedVersion: 2 m_ObjectHideFlags: 0 m_BuildSettings: - serializedVersion: 2 + serializedVersion: 3 agentTypeID: 0 agentRadius: 0.5 agentHeight: 2 @@ -117,7 +117,7 @@ cellSize: 0.16666667 manualTileSize: 0 tileSize: 256 - accuratePlacement: 0 + buildHeightMesh: 0 maxJobWorkers: 0 preserveTilesOutsideBounds: 0 debug: @@ -164,9 +164,17 @@ m_projectionMatrixMode: 1 m_GateFitMode: 2 m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 m_SensorSize: {x: 36, y: 24} m_LensShift: {x: 0, y: 0} - m_FocalLength: 50 m_NormalizedViewPortRect: serializedVersion: 2 x: 0 @@ -203,6 +211,7 @@ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: -10} m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 @@ -222,10 +231,11 @@ schrodinger: {fileID: 7200000, guid: 979c7135e7e183e43bf950b33bf979d1, type: 3} visualization: {fileID: 7200000, guid: c949a119cc67aa347a6c6df53f77ffdf, type: 3} texture: {fileID: 0} - resolution: 256 + resolution: 512 speed: 1000 time: {fileID: 1078554324} elapsedTime: 0 + showTime: 0 --- !u!1 &380728026 GameObject: m_ObjectHideFlags: 0 @@ -303,6 +313,7 @@ m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 m_AdditionalShaderChannelsFlag: 0 + m_UpdateRectTransformForStandalone: 0 m_SortingLayerID: 0 m_SortingOrder: 0 m_TargetDisplay: 0 @@ -316,6 +327,7 @@ m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1078554323} m_Father: {fileID: 0} @@ -356,6 +368,7 @@ m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} m_Name: m_EditorClassIdentifier: + m_SendPointerHoverToParent: 1 m_HorizontalAxis: Horizontal m_VerticalAxis: Vertical m_SubmitButton: Submit @@ -388,6 +401,7 @@ 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_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 2 @@ -420,6 +434,7 @@ 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_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 380728030} m_RootOrder: 0 diff --git a/Assets/Scripts/Display.cs b/Assets/Scripts/Display.cs index b0dc5ba..7c0201d 100644 --- a/Assets/Scripts/Display.cs +++ b/Assets/Scripts/Display.cs @@ -12,6 +12,7 @@ public int speed = 100; public Text time; public int elapsedTime = 0; + public bool showTime = true; private void Start() { psi = new ComputeBuffer(resolution * resolution * 8, 8); @@ -27,7 +28,7 @@ visualization.SetInt("resolution", resolution); schrodinger.SetBuffer(kernel, "psi", psi); schrodinger.SetBuffer(kernel, "potential", potential); - schrodinger.Dispatch(kernel, 8, 8, 1); + schrodinger.Dispatch(kernel, resolution/32, resolution/32, 1); } private void Update() { @@ -36,13 +37,17 @@ schrodinger.SetBuffer(kernel, "psi", psi); schrodinger.SetBuffer(kernel, "potential", potential); for (int i = 0; i < speed; i++) { - schrodinger.Dispatch(kernel, 8, 8, 1); + schrodinger.Dispatch(kernel, resolution/32, resolution/32, 1); } elapsedTime += speed; - time.text = string.Format("time: {0} us", (float)elapsedTime / 200); visualization.SetBuffer(0, "psiIn", psi); visualization.SetTexture(0, "result", texture); - visualization.Dispatch(0, 8, 8, 1); + visualization.Dispatch(0, resolution/32, resolution/32, 1); + if (showTime) { + time.text = string.Format("time: {0} us", (float)elapsedTime / 200); + } else { + time.text = ""; + } } private void OnRenderImage(RenderTexture before, RenderTexture destination) { diff --git a/Assets/Shaders/SchrodingerCompute.compute b/Assets/Shaders/SchrodingerCompute.compute index 91bf1cb..8c75e34 100644 --- a/Assets/Shaders/SchrodingerCompute.compute +++ b/Assets/Shaders/SchrodingerCompute.compute @@ -41,9 +41,6 @@ psi[id.x + resolution * id.y] = result; } -static const float mu = 0.5; -static const float sigma = 0.05; - [numthreads(32,32,1)] void initialize(uint3 id: SV_DispatchThreadID) { float x = (float) id.x / resolution; @@ -54,5 +51,5 @@ psi[id.x + resolution*id.y] = float2(0, 0); } // psi[id.x + resolution * id.y] = float2((sin(16*x*PI)) * sin(y * PI), 0) * 0.5; - potential[id.x + resolution * id.y] = 0; // exp(-(x-mu)*(x-mu) / (2*sigma*sigma)); + potential[id.x + resolution * id.y] = 0.1 * x + 0.1*y; // exp(-(x-mu)*(x-mu) / (2*sigma*sigma)); } \ No newline at end of file