Skip to content

Commit 60dd592

Browse files
author
DGriffin91
committed
Update galaxy_of_universes.rs shader to use shortened glam vec functions
1 parent 4b71435 commit 60dd592

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

shaders/src/galaxy_of_universes.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//! ```
1111
1212
use shared::*;
13-
use spirv_std::glam::{Mat2, Vec2, Vec3, Vec3Swizzles, Vec4};
13+
use spirv_std::glam::{vec3, Mat2, Vec2, Vec3, Vec3Swizzles, Vec4};
1414

1515
// Note: This cfg is incorrect on its surface, it really should be "are we compiling with std", but
1616
// we tie #[no_std] above to the same condition, so it's fine.
@@ -40,7 +40,7 @@ impl Inputs {
4040
while i < 90 {
4141
let mut p: Vec3 = s * uv.extend(0.0);
4242
p = (ma.transpose() * p.xy()).extend(p.z);
43-
p += Vec3::new(0.22, 0.3, s - 1.5 - (self.time * 0.13).sin() * 0.1);
43+
p += vec3(0.22, 0.3, s - 1.5 - (self.time * 0.13).sin() * 0.1);
4444
{
4545
let mut i = 0;
4646
while i < 8 {
@@ -60,7 +60,7 @@ impl Inputs {
6060
v2 *= smoothstep(0.5, 0.0, len);
6161
v3 *= smoothstep(0.9, 0.0, len);
6262

63-
let col: Vec3 = Vec3::new(
63+
let col: Vec3 = vec3(
6464
v3 * (1.5 + (self.time * 0.2).sin() * 0.4),
6565
(v1 + v3) * 0.3,
6666
v2,

0 commit comments

Comments
 (0)