How to use Vertex #18821
Answered
by
Henauxg
cherish-ltt
asked this question in
Q&A
How to use Vertex
#18821
-
When I run it, the error is as follows:
How to bind the |
Beta Was this translation helpful? Give feedback.
Answered by
Henauxg
Apr 12, 2025
Replies: 1 comment 12 replies
-
You are declaring a texture and a sampler in your rust code with #[texture(1)]
#[sampler(2)]
pub(crate) color_texture: Option<Handle<Image>>, You probably also want to declare these bindings in your WGSL shader code like this: // ...
struct VertexOutput {
@builtin(position) clip_position: vec4<f32>,
@location(0) uv: vec2<f32>,
};
@group(2) @binding(1) var texture: texture_2d<f32>;
@group(2) @binding(2) var texture_sampler: sampler;
// ... |
Beta Was this translation helpful? Give feedback.
12 replies
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Your imports in your shader are referencing
bevy_pbr
instead ofbevy_sprite
Use something like:
and
mesh2d_position_local_to_clip
instead ofmesh_position_local_to_clip