From 453f93a9729518b0b014f5190ed4c548b2facea3 Mon Sep 17 00:00:00 2001 From: rezaali Date: Thu, 30 Sep 2021 11:56:59 -0700 Subject: [PATCH] updated installation with neck extension and Christiens presets --- Assets/Parameters/Colors.json | 86 +++++++++++++------------- Assets/Parameters/Controls.json | 25 +++++--- Assets/Parameters/Line Material.json | 14 ++--- Assets/Parameters/Particles.json | 26 ++++---- Assets/Parameters/Post Processing.json | 6 +- Source/Renderer/Renderer+Camera.swift | 6 +- Source/Renderer/Renderer.swift | 2 + 7 files changed, 90 insertions(+), 75 deletions(-) diff --git a/Assets/Parameters/Colors.json b/Assets/Parameters/Colors.json index 5f76914..61e4a2f 100644 --- a/Assets/Parameters/Colors.json +++ b/Assets/Parameters/Colors.json @@ -6,12 +6,12 @@ "maxZ" : 1, "minZ" : 0, "label" : "Oxygen", - "w" : 1, - "x" : 0, + "w" : 0.27000001072883606, + "x" : 0.66516727209091187, "maxY" : 1, - "y" : 0.74782496690750122, + "y" : 0.29094472527503967, "minY" : 0, - "z" : 1, + "z" : 0.36585527658462524, "maxX" : 1, "controlType" : "colorpicker", "minX" : 0, @@ -25,12 +25,12 @@ "maxZ" : 1, "minZ" : 0, "label" : "Carbon", - "w" : 1, - "x" : 1, + "w" : 0.82996171712875366, + "x" : 0.25635722279548645, "maxY" : 1, - "y" : 0.57810515165328979, + "y" : 0.26412564516067505, "minY" : 0, - "z" : 0, + "z" : 0.26412564516067505, "maxX" : 1, "controlType" : "colorpicker", "minX" : 0, @@ -44,12 +44,12 @@ "maxZ" : 1, "minZ" : 0, "label" : "Hydrogen", - "w" : 1, - "x" : 0.9994240403175354, + "w" : 0.52157491445541382, + "x" : 0.53011739253997803, "maxY" : 1, - "y" : 0.98555368185043335, + "y" : 1, "minY" : 0, - "z" : 0, + "z" : 0.96349895000457764, "maxX" : 1, "controlType" : "colorpicker", "minX" : 0, @@ -63,12 +63,12 @@ "maxZ" : 1, "minZ" : 0, "label" : "Nitrogen", - "w" : 1, - "x" : 0.55634254217147827, + "w" : 0.7735668420791626, + "x" : 0.0066434973850846291, "maxY" : 1, - "y" : 0.97934550046920776, + "y" : 0.081282258033752441, "minY" : 0, - "z" : 0, + "z" : 0.91214883327484131, "maxX" : 1, "controlType" : "colorpicker", "minX" : 0, @@ -82,12 +82,12 @@ "maxZ" : 1, "minZ" : 0, "label" : "Calcium", - "w" : 1, - "x" : 0, + "w" : 0.83461815118789673, + "x" : 0.15118715167045593, "maxY" : 1, - "y" : 0.97680455446243286, + "y" : 0.71803975105285645, "minY" : 0, - "z" : 0, + "z" : 0.1135757640004158, "maxX" : 1, "controlType" : "colorpicker", "minX" : 0, @@ -102,11 +102,11 @@ "minZ" : 0, "label" : "Phosphorus", "w" : 1, - "x" : 0, + "x" : 1, "maxY" : 1, - "y" : 0.98106676340103149, + "y" : 0.57810515165328979, "minY" : 0, - "z" : 0.57369142770767212, + "z" : 0, "maxX" : 1, "controlType" : "colorpicker", "minX" : 0, @@ -121,9 +121,9 @@ "minZ" : 0, "label" : "Potassium", "w" : 1, - "x" : 0, + "x" : 0.5818830132484436, "maxY" : 1, - "y" : 0.99143940210342407, + "y" : 0.21569153666496277, "minY" : 0, "z" : 1, "maxX" : 1, @@ -140,11 +140,11 @@ "minZ" : 0, "label" : "Sulfur", "w" : 1, - "x" : 0, + "x" : 0.9994240403175354, "maxY" : 1, - "y" : 0.58980089426040649, + "y" : 0.98555368185043335, "minY" : 0, - "z" : 1, + "z" : 0, "maxX" : 1, "controlType" : "colorpicker", "minX" : 0, @@ -178,11 +178,11 @@ "minZ" : 0, "label" : "Chlorine", "w" : 1, - "x" : 1, + "x" : 0, "maxY" : 1, - "y" : 0.25279238820075989, + "y" : 0.98106676340103149, "minY" : 0, - "z" : 1, + "z" : 0.57369142770767212, "maxX" : 1, "controlType" : "colorpicker", "minX" : 0, @@ -197,11 +197,11 @@ "minZ" : 0, "label" : "Magnesium", "w" : 1, - "x" : 1, + "x" : 0.84465640783309937, "maxY" : 1, - "y" : 0.18573886156082153, + "y" : 0.51457053422927856, "minY" : 0, - "z" : 0.5733950138092041, + "z" : 1, "maxX" : 1, "controlType" : "colorpicker", "minX" : 0, @@ -235,11 +235,11 @@ "minZ" : 0, "label" : "Fluorine", "w" : 1, - "x" : 1, + "x" : 0.45009386539459229, "maxY" : 1, - "y" : 0.83234566450119019, + "y" : 0.98132258653640747, "minY" : 0, - "z" : 0.47320586442947388, + "z" : 0.47430306673049927, "maxX" : 1, "controlType" : "colorpicker", "minX" : 0, @@ -368,11 +368,11 @@ "minZ" : 0, "label" : "Lead", "w" : 1, - "x" : 0.47684186697006226, + "x" : 0.47563493251800537, "maxY" : 1, - "y" : 0.50480759143829346, + "y" : 0.4756467342376709, "minY" : 0, - "z" : 1, + "z" : 0.47564041614532471, "maxX" : 1, "controlType" : "colorpicker", "minX" : 0, @@ -387,11 +387,11 @@ "minZ" : 0, "label" : "Copper", "w" : 1, - "x" : 0.84465640783309937, + "x" : 0.5787474513053894, "maxY" : 1, - "y" : 0.51457053422927856, + "y" : 0.3215198814868927, "minY" : 0, - "z" : 1, + "z" : 0, "maxX" : 1, "controlType" : "colorpicker", "minX" : 0, diff --git a/Assets/Parameters/Controls.json b/Assets/Parameters/Controls.json index 0e2bdd3..2fdaaa7 100644 --- a/Assets/Parameters/Controls.json +++ b/Assets/Parameters/Controls.json @@ -7,11 +7,11 @@ "minZ" : 0, "label" : "Background", "w" : 1, - "x" : 0.96071082353591919, + "x" : 0, "maxY" : 1, - "y" : 0.96082574129104614, + "y" : 0, "minY" : 0, - "z" : 0.96067172288894653, + "z" : 0, "maxX" : 1, "controlType" : "colorpicker", "minX" : 0, @@ -45,17 +45,16 @@ "base" : { "controlType" : "toggle", "label" : "Fullscreen", - "value" : true + "value" : false } }, { "type" : "string", "base" : { "label" : "Video Input", - "value" : "FaceTime HD ", + "value" : "BRIO 4K Stream Edition", "options" : [ - "FaceTime HD ", - "Logitech BRIO" + "BRIO 4K Stream Edition" ], "controlType" : "dropdown" } @@ -157,6 +156,16 @@ "label" : "Camera Offset", "minY" : 0 } + }, + { + "type" : "float", + "base" : { + "label" : "Hip Extension", + "value" : 5.648226261138916, + "min" : 0, + "controlType" : "slider", + "max" : 500 + } } ] -} +} \ No newline at end of file diff --git a/Assets/Parameters/Line Material.json b/Assets/Parameters/Line Material.json index 9d663b8..1206eea 100644 --- a/Assets/Parameters/Line Material.json +++ b/Assets/Parameters/Line Material.json @@ -25,12 +25,12 @@ "maxZ" : 1, "minZ" : 0, "label" : "Resolution", - "w" : 2, - "x" : 3360, + "w" : 1, + "x" : 1920, "maxY" : 1, - "y" : 2100, + "y" : 1080, "minY" : 0, - "z" : 1.6000000238418579, + "z" : 1.7777777910232544, "maxX" : 1, "controlType" : "none", "minX" : 0, @@ -58,7 +58,7 @@ "type" : "float3", "base" : { "controlType" : "none", - "x" : 0.66274160146713257, + "x" : 0.73637962341308594, "maxX" : 1, "y" : 0, "maxY" : 1, @@ -76,7 +76,7 @@ "controlType" : "none", "x" : 0, "maxX" : 1, - "y" : 0.41421350836753845, + "y" : 0.41421353816986084, "maxY" : 1, "minX" : 0, "z" : 0, @@ -95,7 +95,7 @@ "y" : 0, "maxY" : 1, "minX" : 0, - "z" : -0.99999994039535522, + "z" : -1, "minZ" : 0, "label" : "Camera Forward", "minY" : 0, diff --git a/Assets/Parameters/Particles.json b/Assets/Parameters/Particles.json index 41287f6..c0348a1 100644 --- a/Assets/Parameters/Particles.json +++ b/Assets/Parameters/Particles.json @@ -4,7 +4,7 @@ "type" : "int", "base" : { "label" : "Count", - "value" : 262144, + "value" : 1048576, "min" : 0, "controlType" : "none", "max" : 100 @@ -14,7 +14,7 @@ "type" : "float", "base" : { "label" : "Time", - "value" : 5078.23046875, + "value" : 263434.59375, "min" : 0, "controlType" : "none", "max" : 1 @@ -24,7 +24,7 @@ "type" : "float", "base" : { "label" : "Point Size", - "value" : 3, + "value" : 3.0033783912658691, "min" : 0, "controlType" : "slider", "max" : 32 @@ -35,7 +35,7 @@ "base" : { "maxX" : 1, "controlType" : "none", - "x" : 1682.8878173828125, + "x" : 1539.0621337890625, "y" : 828.42706298828125, "maxY" : 1, "minX" : 0, @@ -47,7 +47,7 @@ "type" : "float", "base" : { "label" : "Curl Scale", - "value" : 0.012500000186264515, + "value" : 0.0020560596603900194, "min" : 0, "controlType" : "slider", "max" : 0.05000000074505806 @@ -57,7 +57,7 @@ "type" : "float", "base" : { "label" : "Curl Speed", - "value" : 0.25, + "value" : 0.039977476000785828, "min" : 0, "controlType" : "slider", "max" : 1 @@ -67,7 +67,7 @@ "type" : "float", "base" : { "label" : "Curl", - "value" : 0.17499999701976776, + "value" : 0.39963400363922119, "min" : 0, "controlType" : "slider", "max" : 1 @@ -87,7 +87,7 @@ "type" : "float", "base" : { "label" : "Stream", - "value" : 0.125, + "value" : 0.89771604537963867, "min" : 0, "controlType" : "slider", "max" : 1 @@ -97,7 +97,7 @@ "type" : "float", "base" : { "label" : "Damping", - "value" : 0.050185032188892365, + "value" : 0.40299481153488159, "min" : 0, "controlType" : "slider", "max" : 1 @@ -127,7 +127,7 @@ "type" : "float", "base" : { "label" : "Delta Time", - "value" : 0.017614960670471191, + "value" : 0.033730983734130859, "min" : 0, "controlType" : "none", "max" : 1 @@ -137,7 +137,7 @@ "type" : "int", "base" : { "label" : "Points", - "value" : 19, + "value" : 9, "min" : 0, "controlType" : "none", "max" : 100 @@ -147,11 +147,11 @@ "type" : "int", "base" : { "label" : "Lines", - "value" : 21, + "value" : 4, "min" : 0, "controlType" : "none", "max" : 100 } } ] -} +} \ No newline at end of file diff --git a/Assets/Parameters/Post Processing.json b/Assets/Parameters/Post Processing.json index 9c9079a..94131e2 100644 --- a/Assets/Parameters/Post Processing.json +++ b/Assets/Parameters/Post Processing.json @@ -5,8 +5,8 @@ "base" : { "maxX" : 1, "controlType" : "none", - "x" : 3620, - "y" : 1782, + "x" : 1189, + "y" : 640, "maxY" : 1, "minX" : 0, "label" : "Resolution", @@ -17,7 +17,7 @@ "type" : "float", "base" : { "label" : "Time", - "value" : 5078.23046875, + "value" : 263434.59375, "min" : 0, "controlType" : "none", "max" : 1 diff --git a/Source/Renderer/Renderer+Camera.swift b/Source/Renderer/Renderer+Camera.swift index 64369ac..9968502 100644 --- a/Source/Renderer/Renderer+Camera.swift +++ b/Source/Renderer/Renderer+Camera.swift @@ -175,8 +175,12 @@ extension Renderer { } if neckMesh.visible, noseMesh.visible { + let down = neckMesh.position + let up = noseMesh.position + let dir = simd_normalize(down - up) * neckExtension.value + lines.append(neckMesh.position) - lines.append(noseMesh.position) + lines.append(noseMesh.position - dir) } if neckMesh.visible, rightShoulderMesh.visible { diff --git a/Source/Renderer/Renderer.swift b/Source/Renderer/Renderer.swift index 8c91336..6634f0a 100644 --- a/Source/Renderer/Renderer.swift +++ b/Source/Renderer/Renderer.swift @@ -208,6 +208,7 @@ class Renderer: Forge.Renderer, MaterialDelegate, AVCaptureVideoDataOutputSample }() var hipExtension = FloatParameter("Hip Extension", 0.0, 0.0, 500.0, .slider) + var neckExtension = FloatParameter("Neck Extension", 0.0, 0.0, 500.0, .slider) var fakePose = BoolParameter("Fake Pose", false, .toggle) @@ -360,6 +361,7 @@ class Renderer: Forge.Renderer, MaterialDelegate, AVCaptureVideoDataOutputSample params.append(showParticles) params.append(cameraOffset) params.append(hipExtension) + params.append(neckExtension) return params }()