Skip to content

Commit

Permalink
Merge pull request #81 from alphastrata/typos
Browse files Browse the repository at this point in the history
Typos
alphastrata authored Dec 22, 2023
2 parents ea5bb24 + 8e268b3 commit c1abaae
Showing 3 changed files with 820 additions and 628 deletions.
1,429 changes: 807 additions & 622 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ toml = "0.8.6"
bevy_editor_pls = "0.6.0" # Required for Might

[build-dependencies]
reqwest = "0.11" # Required for Might
reqwest = "0.11.*"
tokio = { version = "1", features = ["full"] } # Required for Might
glob = "0.3.1"

17 changes: 12 additions & 5 deletions bevy-shaders-cheatsheet.md
Original file line number Diff line number Diff line change
@@ -345,19 +345,26 @@ struct Geometry {
}
```

which you cal call like this `testing(&uv)`.

- You may be tempted to do multipart assignments on the rhs, like this:
`O += 0.2 / (abs(length(I = p / (r + r - p).y) * 80.0 - i) + 40.0 / r.y) ` but, this `I = `... is INVALID, you will see this a lot in shadertoy, in particular when fancy [shader-wizards are attempting to not summon Cthulu by exceeding the 300char limit](https://www.shadertoy.com/view/msjXRK), but in `.wgsl` land you gotta do the assignment outside.

- ` vec3 u = 1.-(--f)*f*f*f*-f;` Note, the `--` is not legal in wgsl, so don't do it instead do:
`O += 0.2 / (abs(length(I = p / (r + r - p).y) * 80.0 - i) + 40.0 / r.y)` but, this
`I = `
... is INVALID, you will see this a lot in shadertoy, in particular when fancy [shader-wizards are attempting to not summon Cthulhu by exceeding the 300char limit](https://www.shadertoy.com/view/msjXRK), but in `.wgsl` land you gotta do the assignment outside.

- ` vec3 u = 1.-(--f)*f*f*f*-f;` _Note, the `--` is not legal in wgsl_, so don't do it instead do:

```rust
f -= vec3<f32>(1.0, 1.0, 1.0); // Decrement each component of the vector by 1
var u: vec3<f32> = 1.0 - f * f * f * f * -f;
```

-- single inlined if/else's with an assignment i.e, `let functionSign: f32 = if mp.dist < 0.0 { -1.0 } else { 1.0 };`, are not allowed, you need to do this instead:
-- single inlined if/else's with an assignment i.e,

```rust
let functionSign: f32 = if mp.dist < 0.0 { -1.0 } else { 1.0 };
```

are not allowed, you need to do this instead:

```rust
var functionSign: f32;

0 comments on commit c1abaae

Please sign in to comment.