diff --git a/Cargo.lock b/Cargo.lock index 0274d8ca78..854545ffb5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6211,6 +6211,8 @@ dependencies = [ "lazy_static", "native-dialog", "num 0.4.0", + "num-derive", + "num-traits", "num_cpus", "ordered-float 2.6.0", "profiling", @@ -6283,6 +6285,9 @@ dependencies = [ "egui", "egui_winit_platform", "lazy_static", + "strum", + "strum_macros", + "vek", "veloren-client", "veloren-common", "veloren-voxygen-dynlib", diff --git a/assets/voxygen/shaders/particle-vert.glsl b/assets/voxygen/shaders/particle-vert.glsl index 8f2a494079..1006fc5e7c 100644 --- a/assets/voxygen/shaders/particle-vert.glsl +++ b/assets/voxygen/shaders/particle-vert.glsl @@ -26,6 +26,7 @@ layout(location = 4) in float inst_entropy; layout(location = 5) in int inst_mode; layout(location = 6) in vec3 inst_dir; layout(location = 7) in vec3 inst_pos; +layout(location = 8) in vec3 inst_col; layout(location = 0) out vec3 f_pos; layout(location = 1) flat out vec3 f_norm; @@ -194,15 +195,20 @@ void main() { ); break; case FIRE: - f_reflect = 0.0; // Fire doesn't reflect light, it emits it + //f_reflect = 0.0; // Fire doesn't reflect light, it emits it attr = Attr( - linear_motion( - vec3(0.0), - vec3(rand2 * 0.1, rand3 * 0.1, 2.0 + rand4 * 1.0) - ), - vec3(1.0), - vec4(2, 1.5 + rand5 * 0.5, 0, start_end(1.0, 0.0)), - spin_in_axis(vec3(rand6, rand7, rand8), rand9 * 3) +// linear_motion( // Offset +// vec3(0.0), +// vec3(1.0 * 0.1, 1.0 * 0.1, 2.0 + 1.0 * 1.0) +// ), + vec3(0, 0, 1.0 * 5.0) + vec3( + sin(lifetime * 1.0 + 5.0) + sin(lifetime * 7.0 + 0.0) * 0.3, + sin(lifetime * 3.0 + 0.0) + sin(lifetime * 8.0 + 0.0) * 0.3, + sin(lifetime * 2.0 + 0.0) + sin(lifetime * 9.0 + 0.0) * 0.3 + ), + vec3(3.0), // Scale + vec4(inst_col, 1), // Colour + spin_in_axis(vec3(1,0,0),0) // Rotation ); break; case FIRE_BOWL: diff --git a/voxygen/Cargo.toml b/voxygen/Cargo.toml index 924be04100..dfa6fe47b5 100644 --- a/voxygen/Cargo.toml +++ b/voxygen/Cargo.toml @@ -104,6 +104,8 @@ image = {version = "0.23.12", default-features = false, features = ["ico", "png" lazy_static = "1.4.0" native-dialog = { version = "0.5.2", optional = true } num = "0.4" +num-traits = "0.2" +num-derive = "0.3" ordered-float = { version = "2.0.1", default-features = false } rand = "0.8" rayon = "1.5" diff --git a/voxygen/egui/Cargo.toml b/voxygen/egui/Cargo.toml index 6c59194d8c..0e1e25fbac 100644 --- a/voxygen/egui/Cargo.toml +++ b/voxygen/egui/Cargo.toml @@ -13,6 +13,9 @@ client = {package = "veloren-client", path = "../../client"} common = {package = "veloren-common", path = "../../common"} egui = "0.12" egui_winit_platform = "0.8" +strum = "0.21" +strum_macros = "0.21" +vek = "=0.14.1" voxygen-dynlib = {package = "veloren-voxygen-dynlib", path = "../dynlib", optional = true} # Hot Reloading diff --git a/voxygen/egui/src/lib.rs b/voxygen/egui/src/lib.rs index d851f714c3..0470c4f82d 100644 --- a/voxygen/egui/src/lib.rs +++ b/voxygen/egui/src/lib.rs @@ -14,8 +14,13 @@ use core::mem; use egui::{ plot::{Plot, Value}, widgets::plot::Curve, - CollapsingHeader, Color32, Grid, Label, ScrollArea, Slider, Ui, Window, + CollapsingHeader, Color32, Grid, Label, Pos2, Rect, ScrollArea, Sense, Slider, Stroke, Ui, + Vec2, Window, }; +use std::string::ToString; +use strum::IntoEnumIterator; +use strum_macros::{Display, EnumIter}; +use vek::Vec3; fn two_col_row(ui: &mut Ui, label: impl Into