Skip to content
Snippets Groups Projects
Verified Commit 505dc8b4 authored by Tobias Frisch's avatar Tobias Frisch
Browse files

Fixed rendering of particles causing validation layer mock up

parent 95d4cca0
No related branches found
No related tags found
1 merge request!103Added project wobble_bobble and refactored some parts of the framework
......@@ -8,7 +8,7 @@ void main() {
const float value = length(passPos);
if (value < 0.5f) {
outColor = vec4(1.0f - value, 0.0f, 0.0f, 1.0f);
outColor = vec4(1.0f, 0.0f, 0.0f, 1.0f - value * 2.0f);
} else {
discard;
}
......
......@@ -16,5 +16,5 @@ void main() {
float size = particles[gl_InstanceIndex].minimal.size;
passPos = vertexPos;
gl_Position = vec4(position + vec3(vertexPos * size, 0), 1);
gl_Position = vec4(position + vec3(vertexPos * size * 2.0f, 0), 1);
}
\ No newline at end of file
......@@ -247,6 +247,16 @@ int main(int argc, const char **argv) {
)
});
vkcv::DescriptorSetLayoutHandle gfxSetLayout = core.createDescriptorSetLayout(
gfxProgram.getReflectedDescriptors().at(0)
);
vkcv::DescriptorSetHandle gfxSet = core.createDescriptorSet(gfxSetLayout);
vkcv::DescriptorWrites writesGfx;
writesGfx.storageBufferWrites.push_back(vkcv::BufferDescriptorWrite(0, particles.getHandle()));
core.writeDescriptorSet(gfxSet, writesGfx);
vkcv::PassHandle gfxPass = core.createPass(passConfig);
vkcv::VertexLayout vertexLayout ({
......@@ -259,7 +269,7 @@ int main(int argc, const char **argv) {
gfxPipelineConfig.m_Height = windowHeight;
gfxPipelineConfig.m_PassHandle = gfxPass;
gfxPipelineConfig.m_VertexLayout = vertexLayout;
gfxPipelineConfig.m_DescriptorLayouts = { core.getDescriptorSetLayout(transformParticlesToGridLayouts[0]).vulkanHandle };
gfxPipelineConfig.m_DescriptorLayouts = { core.getDescriptorSetLayout(gfxSetLayout).vulkanHandle };
gfxPipelineConfig.m_UseDynamicViewport = true;
gfxPipelineConfig.m_blendMode = vkcv::BlendMode::Additive;
......@@ -288,7 +298,7 @@ int main(int argc, const char **argv) {
drawcalls.push_back(vkcv::DrawcallInfo(
triangleMesh,
{ vkcv::DescriptorSetUsage(0, core.getDescriptorSet(transformParticlesToGridSets[0]).vulkanHandle) },
{ vkcv::DescriptorSetUsage(0, core.getDescriptorSet(gfxSet).vulkanHandle) },
particles.getCount()
));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment