<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Vasif Abdullayev on Medium]]></title>
        <description><![CDATA[Stories by Vasif Abdullayev on Medium]]></description>
        <link>https://medium.com/@mr-vasifabdullayev?source=rss-6ba70e3458a9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*avG6OiIkPBPRLI1qQz-z-g.png</url>
            <title>Stories by Vasif Abdullayev on Medium</title>
            <link>https://medium.com/@mr-vasifabdullayev?source=rss-6ba70e3458a9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 11:05:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mr-vasifabdullayev/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Multiple Object Rendering in Vulkan]]></title>
            <link>https://mr-vasifabdullayev.medium.com/multiple-object-rendering-in-vulkan-3d07aa583cec?source=rss-6ba70e3458a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d07aa583cec</guid>
            <category><![CDATA[vulkan]]></category>
            <category><![CDATA[3d]]></category>
            <category><![CDATA[rendering]]></category>
            <category><![CDATA[computer-graphics]]></category>
            <category><![CDATA[cplusplus]]></category>
            <dc:creator><![CDATA[Vasif Abdullayev]]></dc:creator>
            <pubDate>Mon, 16 Nov 2020 13:59:25 GMT</pubDate>
            <atom:updated>2020-11-20T14:00:51.178Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qyaRLwNsBrrpX3KKaodGBg.jpeg" /></figure><p>If you are learning directly Vulkan with less experience with other APIs or without any graphics APIs experience, it can be very complicated. And sometimes don’t seeing the ‘full picture’ of rendering with Vulkan, can cause headache even while adding simple features like multiple different object rendering with Vulkan(not instancing). I saw some people struggle with it, didn’t see any tutorial about it and decided to write something about it. In a very simple way.</p><ol><li><strong>Descriptor Set Layout</strong></li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a7990280eba283c6ba07b91c88b1a759/href">https://medium.com/media/a7990280eba283c6ba07b91c88b1a759/href</a></iframe><p>Now, look carefully to the function parameters. I define two seperate descritptor set layouts, for each model. If your models share same shader bindings (in correct order), then you can use the same descriptor set layout, but if they differs, then you must use seperate descriptor set layout. Here’s the function code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6a97319e5a25a5334674bc9bb0b101da/href">https://medium.com/media/6a97319e5a25a5334674bc9bb0b101da/href</a></iframe><p>I’m using three uniform buffers in my shaders. One is for model-view-projection matrix in vertex shader, and the others is for fragment shader (albedo and normal maps).</p><blockquote><strong><em>Create different descriptor set layouts for each model.</em></strong></blockquote><p><strong>2.Graphics Pipelines</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4f223b4124c6753b7a0095536b400163/href">https://medium.com/media/4f223b4124c6753b7a0095536b400163/href</a></iframe><p>I define two seperate graphics pipelines for each model.</p><p>You must create different graphics pipelines for each shader model. Creating the graphics pipeline for each model is the standart graphics pipeline creation procedure. Only things differs that, you pass different shader files and essentially, different descriptor set layouts which we talked about, above. According to descriptor set layout information, we can create pipeline for according shader models.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7246628749758dc4ef224357897a696e/href">https://medium.com/media/7246628749758dc4ef224357897a696e/href</a></iframe><p>That’s it in here. We’re creating to different graphics pipelines and pipeline layouts for each model.</p><blockquote><strong><em>Create different pipeline layouts and pipelines for each model.</em></strong></blockquote><p><strong>3.Descriptor Pool</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ac21338994f297eec5f97c7ed5df5ca5/href">https://medium.com/media/ac21338994f297eec5f97c7ed5df5ca5/href</a></iframe><p>I create two different descriptor pools for each models. Here’s the function:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e67093b05bac48833275941a4ca2e86c/href">https://medium.com/media/e67093b05bac48833275941a4ca2e86c/href</a></iframe><p>My shaders for each model, uses same uniform bindings, so I can create them with the same <em>VkDescriptorPoolSize</em>’s. Be careful on that. Create them according to your shader uniform bindings.</p><blockquote><strong><em>Create different descriptor pools for each model.</em></strong></blockquote><p><strong>4.Descriptor Sets</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/05dcdf73b4937ba260d4c649c94de003/href">https://medium.com/media/05dcdf73b4937ba260d4c649c94de003/href</a></iframe><p>Here, I create two different descriptor sets for each model. You can see from parameter names that, I pass uniform buffers for shader (uniform and 2 texture buffer-&gt;albedo and normal map) and descriptor pools.</p><p>Function:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f4c22e64da13b312ca70d7dd6fde78f2/href">https://medium.com/media/f4c22e64da13b312ca70d7dd6fde78f2/href</a></iframe><blockquote><strong><em>Create different descriptor sets for each model.</em></strong></blockquote><p><strong>5.Command Buffer</strong></p><p>After these, you can now render objects on the screen. In vkCmd functions, you just need only pass buffers (vertex, index buffers are seperate for each model) and Vulkan objects which you created seperately for each model.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/21c2278ea991bde60f0503cfa4e0a4cd/href">https://medium.com/media/21c2278ea991bde60f0503cfa4e0a4cd/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d07aa583cec" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>