Upgrade vek version so that it actually uses the patch

This commit is contained in:
Imbris 2020-03-30 19:44:51 -04:00
parent aa59e8715d
commit b3791a2b4e
7 changed files with 53 additions and 20 deletions

37
Cargo.lock generated
View File

@ -1227,7 +1227,7 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c20f6684a8420df7c300a36bed7cb0b2387b2bc385d4940282399b5df0c08ebd"
dependencies = [
"vek",
"vek 0.9.12",
]
[[package]]
@ -4242,6 +4242,12 @@ version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5"
[[package]]
name = "static_assertions"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
[[package]]
name = "stb_truetype"
version = "0.3.1"
@ -4854,8 +4860,20 @@ dependencies = [
"num-integer",
"num-traits 0.1.43",
"rustc_version",
"static_assertions 0.2.5",
]
[[package]]
name = "vek"
version = "0.10.0"
source = "git+https://github.com/Imberflur/vek?branch=is_normalized#43bef0a9e953fbf6b00a073aef914c48b784c995"
dependencies = [
"approx 0.3.2",
"num-integer",
"num-traits 0.2.11",
"rustc_version",
"serde",
"static_assertions",
"static_assertions 1.1.0",
]
[[package]]
@ -4880,7 +4898,7 @@ dependencies = [
"num_cpus",
"specs",
"uvth",
"vek",
"vek 0.10.0",
"veloren-common",
]
@ -4913,7 +4931,7 @@ dependencies = [
"specs",
"specs-idvs",
"sum_type",
"vek",
"vek 0.10.0",
]
[[package]]
@ -4938,7 +4956,7 @@ dependencies = [
"specs",
"specs-idvs",
"uvth",
"vek",
"vek 0.10.0",
"veloren-common",
"veloren-world",
]
@ -4996,7 +5014,7 @@ dependencies = [
"specs-idvs",
"treeculler",
"uvth",
"vek",
"vek 0.10.0",
"veloren-client",
"veloren-common",
"veloren-server",
@ -5030,7 +5048,7 @@ dependencies = [
"roots",
"serde",
"serde_derive",
"vek",
"vek 0.10.0",
"veloren-common",
]
@ -5443,8 +5461,3 @@ name = "xml-rs"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "541b12c998c5b56aa2b4e6f18f03664eef9a4fd0a246a55594efae6cc2d964b5"
[[patch.unused]]
name = "vek"
version = "0.10.0"
source = "git+https://github.com/Imberflur/vek?branch=is_normalized#43bef0a9e953fbf6b00a073aef914c48b784c995"

View File

@ -13,6 +13,6 @@ image = "0.22.3"
num_cpus = "1.10.1"
log = "0.4.8"
specs = "0.15.1"
vek = { version = "0.9.9", features = ["serde"] }
vek = { version = "0.10.0", features = ["serde"] }
hashbrown = { version = "0.6.2", features = ["rayon", "serde", "nightly"] }
authc = { git = "https://gitlab.com/veloren/auth.git", rev = "65571ade0d954a0e0bd995fdb314854ff146ab97" }

View File

@ -11,7 +11,7 @@ no-assets = []
specs-idvs = { git = "https://gitlab.com/veloren/specs-idvs.git" }
specs = { version = "0.15.1", features = ["serde", "nightly", "storage-event-control"] }
vek = { version = "0.9.9", features = ["serde"] }
vek = { version = "0.10.0", features = ["serde"] }
dot_vox = "4.0.0"
image = "0.22.3"
mio = "0.6.19"

View File

@ -16,7 +16,7 @@ specs-idvs = { git = "https://gitlab.com/veloren/specs-idvs.git" }
log = "0.4.8"
specs = { version = "0.15.1", features = ["shred-derive"] }
vek = "0.9.9"
vek = "0.10.0"
uvth = "3.1.1"
lazy_static = "1.4.0"
scan_fmt = "0.2.4"

View File

@ -34,7 +34,7 @@ specs = "0.15.1"
specs-idvs = { git = "https://gitlab.com/veloren/specs-idvs.git" }
# Mathematics
vek = { version = "0.9.9", features = ["serde"] }
vek = { version = "0.10.0", features = ["serde"] }
# Controller
gilrs = { version = "0.7", features = ["serde"] }

View File

@ -57,10 +57,30 @@ impl Vert {
}
}
#[derive(Clone, Copy)]
struct VsOut(Rgba<f32>);
impl euc::Interpolate for VsOut {
#[inline(always)]
fn lerp2(a: Self, b: Self, x: f32, y: f32) -> Self {
//a * x + b * y
Self(a.0.map2(b.0, |a, b| a.mul_add(x, b * y)))
}
#[inline(always)]
fn lerp3(a: Self, b: Self, c: Self, x: f32, y: f32, z: f32) -> Self {
//a * x + b * y + c * z
Self(
a.0.map2(b.0.map2(c.0, |b, c| b.mul_add(y, c * z)), |a, bc| {
a.mul_add(x, bc)
}),
)
}
}
impl<'a> Pipeline for Voxel {
type Pixel = [u8; 4];
type Vertex = Vert;
type VsOut = Rgba<f32>;
type VsOut = VsOut;
#[inline(always)]
fn vert(
@ -75,12 +95,12 @@ impl<'a> Pipeline for Voxel {
let light = Rgba::from_opaque(Rgb::from(*ao_level as f32 / 4.0 + 0.25));
let color = light * srgba_to_linear(Rgba::from_opaque(*col));
let position = (self.mvp * Vec4::from_point(*pos)).xyz().into_array();
(position, color)
(position, VsOut(color))
}
#[inline(always)]
fn frag(&self, color: &Self::VsOut) -> Self::Pixel {
linear_to_srgba(*color)
linear_to_srgba(color.0)
.map(|e| (e * 255.0) as u8)
.into_array()
}

View File

@ -10,7 +10,7 @@ common = { package = "veloren-common", path = "../common" }
bitvec = "0.15.2"
image = "0.22.3"
itertools = "0.8.2"
vek = "0.9.9"
vek = "0.10.0"
noise = { version = "0.6.0", default-features = false }
num = "0.2.0"
ordered-float = "1.0"