Adding depth sorting to new cache

This commit is contained in:
2026-11-01 22:17:40 +01:00
parent b8658b7186
commit 9b9f637842
14 changed files with 258 additions and 88 deletions
+4 -4
View File
@@ -32,10 +32,10 @@ impl Color
pub fn as_packed_u32(&self) -> u32
{
let mapped_r = (self.0 * 255.0) as u32;
let mapped_g = (self.1 * 255.0) as u32;
let mapped_b = (self.2 * 255.0) as u32;
let mapped_a = (self.3 * 255.0) as u32;
let mapped_r = (self.0 * 255.0).clamp(0., 255.0) as u32;
let mapped_g = (self.1 * 255.0).clamp(0., 255.0) as u32;
let mapped_b = (self.2 * 255.0).clamp(0., 255.0) as u32;
let mapped_a = (self.3 * 255.0).clamp(0., 255.0) as u32;
mapped_r | (mapped_g << 8) | (mapped_b << 16) | (mapped_a << 24)
}
}