bevyengine / bevyengine/bevy

Allow more control over draw calls related to `Mesh`

Open
#2,421 0 comments 0 reactions 0 assignees View on GitHub
A-Rendering C-Feature C-Usability
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## What problem does this solve or what need does it fill?

`Mesh` would be more loosely coupled with regard to the parts it has. Allowing for finer control over what gets drawn.

## What solution would you like?

I want to independently control how many vertices of a given vertex buffer should be drawn from the data itself. This could take the form of another component or a method on a `Mesh`. For example:

```rust
enum VertexDrawCount {
All, // Current behaviour
Amount(u32), // Only draw 0..n of vertices
}
```

## What alternative(s) have you considered?

Rewriting the `Mesh` component for my needs. However this is not great, as I lose the great interopability of such a fundamental type.

## Additional context

`Mesh` is currently tightly coupled with all its fields. The indices field dictates the amount of vertices that are to be rendered in a draw call. This coupling means that updating the amount of vertices to draw by assigning a new 'index' re-uploads data to the GPU that is superfluous. It might even re-upload the mesh if no bookeeping is done. This adds a lot of overhead for such a simple change in data.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.