bevyengine / bevyengine/bevy

use custom material 2d, with same logic draw part of texture, get different result with wgpu.

Open
#14,992 0 comments 1 reaction 0 assignees View on GitHub
A-Rendering C-Bug S-Needs-Investigation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## Bevy version

0.14.1

- the Rust version you're using (you can get this by running `cargo --version`)
cargo 1.80.1 (376290515 2024-07-16)

```ignore
AdapterInfo { name: "AMD Radeon RX 6650 XT (RADV NAVI23)", vendor: 4098, device: 29679, device_type: DiscreteGp
u, driver: "radv", driver_info: "Mesa 24.1.6-arch1.1", backend: Vulkan }

```

## What you did

I have a tilemap texture, size (8, 2), I want draw the tile (0,0)
![tilemap](https://github.com/user-attachments/assets/5826a4bf-e41b-453e-8612-2975a8623a1e)

the fragment logic is
```wgsl
@fragment
fn fragment(in: VertexOut) -> @location(0) vec4 {
var uv = in.uv / vec2f(8.0, 2.0);
return textureSample(texture, texture_sampler, uv);
}
```

## What went wrong

In Bevy, there is a buggy one pixel line in the right
![bevy_one_line_buggy](https://github.com/user-attachments/assets/c5e6208d-b2f0-4f2a-af49-103578b8ee18)

In Wgpu, it's perfect
![wgpu_perfect](https://github.com/user-attachments/assets/3395665b-b1cf-476f-8163-15e5d2a5d37c)

## Additional information
[bevy project](https://github.com/alexniver/bevy_tilemap)
[wgpu project](https://github.com/alexniver/wgpu_tilemap)

Contributor guide

Open the contributing guide

Research direction

Start with the linked bevy_tilemap reproduction and compare its custom material and WGSL fragment logic with the linked wgpu_tilemap project. Reproduce the tile (0,0) rendering on Bevy 0.14.1, then trace the texture sampling or material path until the one-pixel line is explained and eliminated.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.