From 6c8750768b64da06fb51be70602844abd7ba9811 Mon Sep 17 00:00:00 2001 From: SpoodyTheOne Date: Sun, 4 Feb 2024 00:39:58 +0100 Subject: [PATCH 1/4] Added random vel to blood --- Assets/Scripts/BloodComputeShader.cs | 2 ++ Assets/Scripts/ComputeShaders/BloodCompute.compute | 7 ++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Assets/Scripts/BloodComputeShader.cs b/Assets/Scripts/BloodComputeShader.cs index 79a8d0a..c042516 100644 --- a/Assets/Scripts/BloodComputeShader.cs +++ b/Assets/Scripts/BloodComputeShader.cs @@ -264,6 +264,8 @@ public class BloodComputeShader : MonoBehaviour bloodCompute.SetVector("particleInitPos", loc); bloodCompute.SetInt("particlesToInitialize", found); + bloodCompute.SetVector("initialVelocity",Random.insideUnitCircle); + ComputeHelper.Dispatch(bloodCompute, amount, 1, 1, InitDustKernel); activeParticles += found; diff --git a/Assets/Scripts/ComputeShaders/BloodCompute.compute b/Assets/Scripts/ComputeShaders/BloodCompute.compute index 2679463..91ef7fc 100644 --- a/Assets/Scripts/ComputeShaders/BloodCompute.compute +++ b/Assets/Scripts/ComputeShaders/BloodCompute.compute @@ -15,11 +15,8 @@ RWStructuredBuffer freeParticles; uint numParticles; uint particlesToInitialize; float3 particleInitPos; +float3 initialVelocity; float deltaTime; -// float3 attractPos; -// float3 xAxis; -// float attractRadius; -// float attractForce; float3 mop1Pos; float3 mop2Pos; @@ -84,7 +81,7 @@ void InitDust (uint3 id : SV_DispatchThreadID) randState = hash(randState); nvel.xy *= scaleToRange01(randState); - particles[i].velocity = nvel; + particles[i].velocity = initialVelocity + nvel; particles[i].position = particleInitPos; particles[i].position.z = 0.01; From 4f12551e8f9cf82ef1db895105bf0cd558c0b1e8 Mon Sep 17 00:00:00 2001 From: SpoodyTheOne Date: Sun, 4 Feb 2024 00:41:24 +0100 Subject: [PATCH 2/4] Bood --- Assets/Scenes/Bloody Mary.unity | 2 +- Assets/Scripts/BloodComputeShader.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Scenes/Bloody Mary.unity b/Assets/Scenes/Bloody Mary.unity index b0a9a83..18426db 100644 --- a/Assets/Scenes/Bloody Mary.unity +++ b/Assets/Scenes/Bloody Mary.unity @@ -1300,7 +1300,7 @@ MonoBehaviour: m_EditorClassIdentifier: numParticles: 1000000 bloodCompute: {fileID: 7200000, guid: 99867deda8cf464cd87542adcc3c08f2, type: 3} - mesh: {fileID: 6466198060863859617, guid: 803eb7ed90ad4b9388c2563597bd6db2, type: 3} + mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} instancedMaterial: {fileID: 2100000, guid: 0d09c46ae354e8c49b2688cc4325b256, type: 2} size: 0.05 scoreMult: 1 diff --git a/Assets/Scripts/BloodComputeShader.cs b/Assets/Scripts/BloodComputeShader.cs index c042516..f7a03b1 100644 --- a/Assets/Scripts/BloodComputeShader.cs +++ b/Assets/Scripts/BloodComputeShader.cs @@ -264,7 +264,7 @@ public class BloodComputeShader : MonoBehaviour bloodCompute.SetVector("particleInitPos", loc); bloodCompute.SetInt("particlesToInitialize", found); - bloodCompute.SetVector("initialVelocity",Random.insideUnitCircle); + bloodCompute.SetVector("initialVelocity",Random.insideUnitCircle * power); ComputeHelper.Dispatch(bloodCompute, amount, 1, 1, InitDustKernel); From a50a807939a6d4150f6770dae22401ca480f8176 Mon Sep 17 00:00:00 2001 From: SpoodyTheOne Date: Sun, 4 Feb 2024 00:48:43 +0100 Subject: [PATCH 3/4] Better blood and fixed upgrades --- Assets/Scripts/BloodComputeShader.cs | 6 ++++-- Assets/Scripts/ComputeShaders/BloodCompute.compute | 5 ++++- Assets/Scripts/Upgrader.cs | 4 +++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/BloodComputeShader.cs b/Assets/Scripts/BloodComputeShader.cs index f7a03b1..73bfad3 100644 --- a/Assets/Scripts/BloodComputeShader.cs +++ b/Assets/Scripts/BloodComputeShader.cs @@ -260,11 +260,13 @@ public class BloodComputeShader : MonoBehaviour // Test for race conditions // yield return new WaitForSeconds(1.0f); - bloodCompute.SetFloat("particleVel", power); + bloodCompute.SetFloat("particleVel", power/4.0f); bloodCompute.SetVector("particleInitPos", loc); bloodCompute.SetInt("particlesToInitialize", found); - bloodCompute.SetVector("initialVelocity",Random.insideUnitCircle * power); + Vector3 pow = Random.insideUnitSphere * power; + pow.z = Mathf.Abs(pow.z); + bloodCompute.SetVector("initialVelocity",pow); ComputeHelper.Dispatch(bloodCompute, amount, 1, 1, InitDustKernel); diff --git a/Assets/Scripts/ComputeShaders/BloodCompute.compute b/Assets/Scripts/ComputeShaders/BloodCompute.compute index 91ef7fc..b6dd556 100644 --- a/Assets/Scripts/ComputeShaders/BloodCompute.compute +++ b/Assets/Scripts/ComputeShaders/BloodCompute.compute @@ -80,8 +80,11 @@ void InitDust (uint3 id : SV_DispatchThreadID) randState = hash(randState); nvel.xy *= scaleToRange01(randState); + + randState = hash(randState); + float3 iv = initialVelocity * scaleToRange01(randState); - particles[i].velocity = initialVelocity + nvel; + particles[i].velocity = iv + nvel; particles[i].position = particleInitPos; particles[i].position.z = 0.01; diff --git a/Assets/Scripts/Upgrader.cs b/Assets/Scripts/Upgrader.cs index d32c783..5d30aad 100644 --- a/Assets/Scripts/Upgrader.cs +++ b/Assets/Scripts/Upgrader.cs @@ -108,6 +108,8 @@ public class Upgrader : MonoBehaviour // Update is called once per frame void Update() { + bool upgrade = canUpgrade(); + if (canUpgrade()) { @@ -205,7 +207,7 @@ public class Upgrader : MonoBehaviour Player1Cursor.localPosition = Player1Input.look.normalized * (125 - 12); Player2Cursor.localPosition = Player2Input.look.normalized * (125 - 12); - prevCouldUpgrade = canUpgrade(); + prevCouldUpgrade = upgrade; } /// Increases mop radius by 10% From 8c3f17dccd5d29956318b6ed8616358bad32e12a Mon Sep 17 00:00:00 2001 From: BOT Alex <44818698+MagicBOTAlex@users.noreply.github.com> Date: Sun, 4 Feb 2024 01:25:04 +0100 Subject: [PATCH 4/4] Update CameraRig.prefab --- Assets/Prefabs/CameraRig.prefab | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Prefabs/CameraRig.prefab b/Assets/Prefabs/CameraRig.prefab index f765955..0798d41 100644 --- a/Assets/Prefabs/CameraRig.prefab +++ b/Assets/Prefabs/CameraRig.prefab @@ -187,8 +187,8 @@ MonoBehaviour: m_EditorClassIdentifier: Wave: 0 difficulty: 1 - difficultyIncreasePerWave: 0.25 - difficultyMultiplyDecreasePerWave: 0.1 + difficultyIncreasePerWave: 1 + difficultyMultiplyDecreasePerWave: 0.05 WaveTime: 20 enemyDifficulties: [] SpawnRadius: 22.6