Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i have multiple prob with "cargo run --example voronoise-pan" #6

Closed
syapk opened this issue Mar 27, 2023 · 3 comments
Closed

i have multiple prob with "cargo run --example voronoise-pan" #6

syapk opened this issue Mar 27, 2023 · 3 comments

Comments

@syapk
Copy link

syapk commented Mar 27, 2023

error[E0609]: no field time on type &mut CustomMaterial
--> libs\bevy_shader_utils\examples\voronoise-pan.rs:62:20
|
62 | material.1.time =
| ^^^^ unknown field
|
= note: available fields are: color

error[E0599]: no method named seconds_since_startup found for struct bevy::prelude::Res<'_, bevy::prelude::Time> in the current scope
--> libs\bevy_shader_utils\examples\voronoise-pan.rs:63:18
|
63 | time.seconds_since_startup() as f32;
| ^^^^^^^^^^^^^^^^^^^^^ method not found in Res<'_, Time>

error[E0308]: mismatched types
--> libs\bevy_shader_utils\examples\voronoise-pan.rs:85:19
|
85 | .push("VERTEX_UVS".to_string());
| ---- ^^^^^^^^^^^^^^^^^^^^^^^^ expected ShaderDefVal, found String
| |
| arguments to this method are incorrect
|
note: method defined here
--> C:\Users\Administrator.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\alloc\src\vec\mod.rs:1836:12
|
1836 | pub fn push(&mut self, value: T) {
| ^^^^
help: call Into::into on this expression to convert std::string::String into ShaderDefVal
|
85 | .push("VERTEX_UVS".to_string().into());
| +++++++

error[E0308]: mismatched types
--> libs\bevy_shader_utils\examples\voronoise-pan.rs:88:35
|
88 | fragment.shader_defs.push("VERTEX_UVS".to_string());
| ---- ^^^^^^^^^^^^^^^^^^^^^^^^ expected ShaderDefVal, found String
| |
| arguments to this method are incorrect
|
note: method defined here
--> C:\Users\Administrator.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\alloc\src\vec\mod.rs:1836:12
|
1836 | pub fn push(&mut self, value: T) {
| ^^^^
help: call Into::into on this expression to convert std::string::String into ShaderDefVal
|
88 | fragment.shader_defs.push("VERTEX_UVS".to_string().into());
| +++++++

@ChristopherBiscardi
Copy link
Contributor

Right now the primary problem with that example is that the shader defs MAX_CASCADES_PER_LIGHT and MAX_DIRECTIONAL_LIGHTS don't seem to be defined, even though they exist as constants inside of Bevy.

I don't yet understand exactly why that's the case.

error: expected expression, found '#'
    ┌─ wgsl:192:41
    │
192 │     cascades: array<DirectionalCascade, #{MAX_CASCADES_PER_LIGHT}>,
    │                                         ^ expected expression

@ChristopherBiscardi
Copy link
Contributor

That turned out to be very quick! The fix was this one: bevyengine/bevy#7375

@syapk
Copy link
Author

syapk commented Mar 28, 2023

Greats thanks !!

horttanainen pushed a commit to horttanainen/bevy-examples that referenced this issue Apr 1, 2023
closes rust-adventure#6

Apply fix from bevyengine/bevy#7375 to the
voronoise example.

* Also introduce a shield demo I'm still working on that uses depth
  prepass
* add a temporary debug fresnel function that is not really that
  different from the current
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants