diff --git a/Assets/Scenes/Scene2.shade b/Assets/Scenes/Scene2.shade index 4b3d5118..564c78c4 100644 --- a/Assets/Scenes/Scene2.shade +++ b/Assets/Scenes/Scene2.shade @@ -166,7 +166,7 @@ Maximum Speed: 6 Minimum Size: 0 Maximum Size: 0.5 - Angular Ranges And Offset: {x: 0.699999988, y: 0.469999999, z: 0, w: 0} + Angular Ranges And Offset: {x: 6.19999981, y: 1.10000002, z: 0, w: 0.100000001} Rotation Speed: 0 Texture Asset ID: 63456868 IsActive: true diff --git a/Assets/Shaders/ParticleEmit_CS.glsl b/Assets/Shaders/ParticleEmit_CS.glsl index c9e6cc8b..444af6db 100644 --- a/Assets/Shaders/ParticleEmit_CS.glsl +++ b/Assets/Shaders/ParticleEmit_CS.glsl @@ -137,9 +137,24 @@ void main() rand(seed) * angularRangesAndOffsets.y + angularRangesAndOffsets.w); // Set its velocity - particle.velocity.xyz = vec3 (cos(eulerAngles.x) * cos(eulerAngles.y), - sin(eulerAngles.x) * cos(eulerAngles.y), - sin(eulerAngles.y)); + // particle.velocity.xyz = vec3 (cos(eulerAngles.x) * cos(eulerAngles.y), + // sin(eulerAngles.x) * cos(eulerAngles.y), + // sin(eulerAngles.y)); + + float bank = eulerAngles.y; + float cb = cos(bank); + float sb = sin(bank); + float ch = cos (eulerAngles.x); + float sh = sin (eulerAngles.x); + float cp = cos (0.0f); + float sp = sin (0.0f); + + particle.velocity.xyz = mat3 ( + (ch * cb + sh * sp * sb), (sb * cp), (-sh * cb + ch * sp * sb), + (-ch * sb + sh * sp * cb), (cb * cp), ( sb * sh + ch * sp * cb), + (sh * cp), (-sp), (ch * cp) + ) * vec3 (1.0f, 0.0f, 0.0f); + particle.velocity *= map (rand (seed), 0.0f, 1.0f, minSpeed.x, maxSpeed.x); @@ -162,7 +177,7 @@ void main() particle.orientationSpeedDecay = vec4 (0.0f); - particle.acceleration = vec4 (0.01f); + particle.acceleration = vec4 (0.0f, -0.058f, 0.0f, 0.0f); inputParticles.data[index] = particle; diff --git a/Assets/Shaders/ParticleEmit_CS.shshaderb b/Assets/Shaders/ParticleEmit_CS.shshaderb index 6f340a27..f0d78240 100644 Binary files a/Assets/Shaders/ParticleEmit_CS.shshaderb and b/Assets/Shaders/ParticleEmit_CS.shshaderb differ diff --git a/Assets/Shaders/ParticleUpdate_CS.glsl b/Assets/Shaders/ParticleUpdate_CS.glsl index 762ff01a..59b126c2 100644 --- a/Assets/Shaders/ParticleUpdate_CS.glsl +++ b/Assets/Shaders/ParticleUpdate_CS.glsl @@ -120,6 +120,7 @@ void main() { // update position from velocity particle.position += particle.velocity * genericDataBuffer.data.dt; + particle.velocity += particle.acceleration; particle.life -= genericDataBuffer.data.dt; if (particle.life < 0.0f || particle.scaleAndDecay.x < 0.0f || particle.scaleAndDecay.y < 0.0f) diff --git a/Assets/Shaders/ParticleUpdate_CS.shshaderb b/Assets/Shaders/ParticleUpdate_CS.shshaderb index d36fa560..d9fd3754 100644 Binary files a/Assets/Shaders/ParticleUpdate_CS.shshaderb and b/Assets/Shaders/ParticleUpdate_CS.shshaderb differ diff --git a/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHEditorComponentView.hpp b/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHEditorComponentView.hpp index a46d76c4..4e150e10 100644 --- a/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHEditorComponentView.hpp +++ b/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHEditorComponentView.hpp @@ -831,7 +831,7 @@ namespace SHADE SHEditorWidgets::DragFloat("Min Size", [comp = component]() {return comp->GetMinSize(); }, [comp = component](float val) {comp->SetMinSize(val); }); SHEditorWidgets::DragFloat("Max Size", [comp = component]() {return comp->GetMaxSize(); }, [comp = component](float val) {comp->SetMaxSize(val); }); - SHEditorWidgets::DragVec4("Angles and Offsets", {"yaw", "pitch", "yaw off", "pitch off"}, + SHEditorWidgets::DragVec4("Angles and Offsets", {"yaw", "bank", "yaw off", "bank off"}, [comp = component]() { return comp->GetAngularRangesAndOffsets();