You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 18, 2022. It is now read-only.
I am trying to create my own rendering pass. Main purpose of this pass is to render tile-map, using predefined texture for tiles. This is the main idea, how, i believe, this task shall be accomplished:
Vertex shader shall receive simple point attributes, which shall have following info:
center of tile in the world. (vec3)
offset of tile piece on the provided texture (uvec2)
size of tile on the texture (uvec2)
Geometry shader shall produce desired tile with center from vertex shader and with size, controlled by uniform variable. And pass offset and slice size to fragment shader then. (for example, I create six triangles with shared point in the center of the tile -- hex tile);
Fragment shader shall retreive desired texture piece and put it on the framebuffer.
To accomplish this, somewhere internally in the deep of my code, I prepare three arrays:
Vec [x, y, z, x, y z....] with size = amount_of_tiles * 3 * size_of_float
Vec [x,y, x, y, ...] with size = amount_of_tiles * 2 * size_of_u32
Vec [w, h, w, h, ...] with size = amount_of_tiles * 2 * size_of_u32
And try to create all three buffers with call
factory
.create_buffer_immutable(
&tile_coords_array, // Vec<f32> or Vec<u32>
buffer::Role::Vertex,
Bind::empty()
)
As a result I can see perfecly aligned tiles(so position attribute is passed to shader corretly), but it seems that other attributes are not passed at all.
Hello!
I am trying to create my own rendering pass. Main purpose of this pass is to render tile-map, using predefined texture for tiles. This is the main idea, how, i believe, this task shall be accomplished:
To accomplish this, somewhere internally in the deep of my code, I prepare three arrays:
And try to create all three buffers with call
And then each apply call I do
and then binding those buffers with:
As a result I can see perfecly aligned tiles(so position attribute is passed to shader corretly), but it seems that other attributes are not passed at all.
I build effect with:
So I want to clear this out:
The text was updated successfully, but these errors were encountered: