Skip to content

Commit

Permalink
draw more quads
Browse files Browse the repository at this point in the history
  • Loading branch information
Ravbug committed Jul 4, 2024
1 parent acf7d96 commit 9506c1b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion 09-BindlessTexturing/bindlesstexturing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ struct BindlessTexturing : public ExampleFramework {
commandBuffer->SetIndexBuffer(indexBuffer);
commandBuffer->SetFragmentSampler(sampler,0);
commandBuffer->SetFragmentTexture(heapStart, 1); // expose all the textures
commandBuffer->DrawIndexed(std::size(BasicObjects::Quad::indices));
commandBuffer->DrawIndexed(std::size(BasicObjects::Quad::indices), {.nInstances = 3});

commandBuffer->EndRendering();
commandBuffer->End();
Expand Down
10 changes: 9 additions & 1 deletion 09-BindlessTexturing/btex.vert
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@ layout(location = 1) in vec2 inUV;
layout(location = 0) out vec2 outUV;
layout(location = 1) out flat uint instance;

vec3 positions[] = {
vec3(-3,0,0),
vec3(0,0,0),
vec3(3,0,0)
};

void main(){

instance = gl_InstanceID;

gl_Position = ubo.viewProj * vec4(inPosition, 0, 1);
vec3 pos = vec3(inPosition, 0) + positions[gl_InstanceID];

gl_Position = ubo.viewProj * vec4(pos, 1);
outUV = inUV;
}

0 comments on commit 9506c1b

Please sign in to comment.