Vulkan Samples 阅读 -- PBR(一): PBR Basics & PBR IBL & Textured PBR with IBL

PBR Basics

prepare

  • loadAssets: 加载模型
  • prepareUniformBuffers
    • createBuffer: 包括模型和PBR使用的参数
    • updateUniformBuffers
    • updateLights
  • setupDescriptorSetLayout
    • VkPushConstantRange: 常量里面设置了材质信息
  • preparePipelines:
  • setupDescriptorSets
  • buildCommandBuffers
    • 正常操作
    • 常量在这里输入

render

  • draw
  • updateLights

shader

  • shader是PBR的基础代码

小结

   本节主要讲PBR的基础知识, 没有vulkan管线的特殊设置. 可以忽略本节.

PBR IBL

prepare

  • loadAssets:
    • 加载skybox cube
    • 加载模型
    • 加载 HDR(cube map)
  • generateBRDFLUT: 生成PBR FLUT sampler
    • Sampler
      • vkCreateImage
      • vkGetImageMemoryRequirements-vkAllocateMemory-vkBindImageMemory
      • vkCreateImageView
      • vkCreateSampler
    • renderpass
      • vkCreateRenderPass
      • vkCreateFramebuffer
      • vkCreateDescriptorSetLayout
      • vkCreateDescriptorPool
      • vkAllocateDescriptorSets
      • vkCreatePipelineLayout
      • vkCreateGraphicsPipelines
      • vkCmdBeginRenderPass
      • vkCmdSetViewport
      • vkCmdSetScissor
      • vkCmdBindPipeline
      • vkCmdDraw
      • vkCmdEndRenderPass
      • flushCommandBuffer
    • vkQueueWaitIdle
    • destroy
      • vkDestroyPipeline
      • vkDestroyPipelineLayout
      • vkDestroyRenderPass
      • vkDestroyFramebuffer
      • vkDestroyDescriptorSetLayout
      • vkDestroyDescriptorPool
  • generateIrradianceCube 生成cube
    • vkCreateImage: Array中包括6个image, 图像64X64, mipmap=log2(64)+1
    • vkGetImageMemoryRequirements-vkAllocateMemory-vkBindImageMemory
    • vkCreateImageView: layerCount = 6
    • vkCreateSampler:
    • vkCreateRenderPass:创建用于渲染IrradianceCube的pass
    • Offfscreen framebuffer
      • vkCreateImage
      • vkGetImageMemoryRequirements-vkAllocateMemory-vkBindImageMemory
      • vkCreateImageView
      • vkCreateFramebuffer
      • createCommandBuffer
      • setImageLayout
      • flushCommandBuffer
    • vkCreateDescriptorSetLayout
    • vkCreateDescriptorPool
    • vkUpdateDescriptorSets
    • vkCreatePipelineLayout
    • vkCreateGraphicsPipelines
    • createCommandBuffer
    • vkCmdSetViewport
    • vkCmdSetScissor
    • setImageLayout
    • 渲染cub么个面的mipmap
      • vkCmdSetViewport
      • vkCmdBeginRenderPass
      • vkCmdPushConstants
      • vkCmdBindPipeline
      • vkCmdBindDescriptorSets
      • draw
      • vkCmdEndRenderPass
      • setImageLayout
      • vkCmdCopyImage
      • setImageLayout
    • setImageLayout
    • flushCommandBuffer
    • vkDestroyRenderPass
    • vkDestroyFramebuffer
    • vkFreeMemory
    • vkDestroyImageView
    • vkDestroyImage
    • vkDestroyDescriptorPool
    • vkDestroyDescriptorSetLayout
    • vkDestroyPipeline
    • vkDestroyPipelineLayout
  • generatePrefilteredCube: 生成Pre-filtered cube map, 生成管线设置与IrradianceCub类似
    • vkCreateImage
    • vkGetImageMemoryRequirements- vkAllocateMemory -vkBindImageMemory
    • vkCreateImageViewvkCreateSampler
    • vkCreateRenderPass
    • Offfscreen framebuffer
      • vkCreateImage
      • vkGetImageMemoryRequirements-vkAllocateMemory-vkBindImageMemory
      • vkCreateImageView
      • vkCreateFramebuffer
      • createCommandBuffer
      • setImageLayout
      • flushCommandBuffer
    • vkCreateDescriptorSetLayout
    • vkCreateDescriptorPool
    • vkAllocateDescriptorSets
    • vkUpdateDescriptorSets
    • vkCreatePipelineLayout
    • vkCreateGraphicsPipelines
    • createCommandBuffer
    • vkCmdSetViewport
    • vkCmdSetScissor
    • setImageLayout
    • loop
      • vkCmdSetViewport
      • vkCmdBeginRenderPass
      • vkCmdPushConstants
      • vkCmdBindPipeline
      • vkCmdBindDescriptorSets
      • draw
      • vkCmdEndRenderPass
      • setImageLayout
      • vkCmdCopyImage
      • setImageLayout
    • setImageLayout
    • flushCommandBuffer
    • vkDestroyRenderPass
    • vkDestroyFramebuffer
    • vkFreeMemory
    • vkDestroyImageView
    • vkDestroyImage
    • vkDestroyDescriptorPool
    • vkDestroyDescriptorSetLayout
    • vkDestroyPipeline
    • vkDestroyPipelineLayout
  • prepareUniformBuffers
    • createBuffer
    • updateUniformBuffers
    • updateParams:灯光
  • setupDescriptors
    • vkCreateDescriptorSetLayout
    • Descriptor sets
      • vkUpdateDescriptorSets: 模型
      • vkUpdateDescriptorSets: Sky box
  • preparePipelines:
    • vkCreatePipelineLayout
    • vkCreateGraphicsPipelines: Skybox pipeline
    • vkCreateGraphicsPipelines: PBR pipeline
  • buildCommandBuffers
    • 正常操作
    • 常量在这里输入

render

  • draw

shader

  • shader: IBL资源渲染算法以及PBR相关算法

小结

   本节主要讲IBL的Vulkan实现, 非常适合重复阅读, 可以加深理解Vulkan管线资源的创建, 传输, 以及销毁的过程.

Textured PBR with IBL

prepare

  • loadAssets:
    • 加载skybox cube
    • 加载模型
    • 加载 HDR(cube map)
    • 加载材质纹理
  • generateBRDFLUT: 生成PBR FLUT sampler
    • Sampler
      • vkCreateImage
      • vkGetImageMemoryRequirements-vkAllocateMemory-vkBindImageMemory
      • vkCreateImageView
      • vkCreateSampler
    • renderpass
      • vkCreateRenderPass
      • vkCreateFramebuffer
      • vkCreateDescriptorSetLayout
      • vkCreateDescriptorPool
      • vkAllocateDescriptorSets
      • vkCreatePipelineLayout
      • vkCreateGraphicsPipelines
      • vkCmdBeginRenderPass
      • vkCmdSetViewport
      • vkCmdSetScissor
      • vkCmdBindPipeline
      • vkCmdDraw
      • vkCmdEndRenderPass
      • flushCommandBuffer
    • vkQueueWaitIdle
    • destroy
      • vkDestroyPipeline
      • vkDestroyPipelineLayout
      • vkDestroyRenderPass
      • vkDestroyFramebuffer
      • vkDestroyDescriptorSetLayout
      • vkDestroyDescriptorPool
  • generateIrradianceCube 生成cube
    • vkCreateImage: Array中包括6个image, 图像64X64, mipmap=log2(64)+1
    • vkGetImageMemoryRequirements-vkAllocateMemory-vkBindImageMemory
    • vkCreateImageView: layerCount = 6
    • vkCreateSampler:
    • vkCreateRenderPass:创建用于渲染IrradianceCube的pass
    • Offfscreen framebuffer
      • vkCreateImage
      • vkGetImageMemoryRequirements-vkAllocateMemory-vkBindImageMemory
      • vkCreateImageView
      • vkCreateFramebuffer
      • createCommandBuffer
      • setImageLayout
      • flushCommandBuffer
    • vkCreateDescriptorSetLayout
    • vkCreateDescriptorPool
    • vkUpdateDescriptorSets
    • vkCreatePipelineLayout
    • vkCreateGraphicsPipelines
    • createCommandBuffer
    • vkCmdSetViewport
    • vkCmdSetScissor
    • setImageLayout
    • 渲染cub么个面的mipmap
      • vkCmdSetViewport
      • vkCmdBeginRenderPass
      • vkCmdPushConstants
      • vkCmdBindPipeline
      • vkCmdBindDescriptorSets
      • draw
      • vkCmdEndRenderPass
      • setImageLayout
      • vkCmdCopyImage
      • setImageLayout
    • setImageLayout
    • flushCommandBuffer
    • vkDestroyRenderPass
    • vkDestroyFramebuffer
    • vkFreeMemory
    • vkDestroyImageView
    • vkDestroyImage
    • vkDestroyDescriptorPool
    • vkDestroyDescriptorSetLayout
    • vkDestroyPipeline
    • vkDestroyPipelineLayout
  • generatePrefilteredCube: 生成Pre-filtered cube map, 生成管线设置与IrradianceCub类似
    • vkCreateImage
    • vkGetImageMemoryRequirements- vkAllocateMemory -vkBindImageMemory
    • vkCreateImageViewvkCreateSampler
    • vkCreateRenderPass
    • Offfscreen framebuffer
      • vkCreateImage
      • vkGetImageMemoryRequirements-vkAllocateMemory-vkBindImageMemory
      • vkCreateImageView
      • vkCreateFramebuffer
      • createCommandBuffer
      • setImageLayout
      • flushCommandBuffer
    • vkCreateDescriptorSetLayout
    • vkCreateDescriptorPool
    • vkAllocateDescriptorSets
    • vkUpdateDescriptorSets
    • vkCreatePipelineLayout
    • vkCreateGraphicsPipelines
    • createCommandBuffer
    • vkCmdSetViewport
    • vkCmdSetScissor
    • setImageLayout
    • loop
      • vkCmdSetViewport
      • vkCmdBeginRenderPass
      • vkCmdPushConstants
      • vkCmdBindPipeline
      • vkCmdBindDescriptorSets
      • draw
      • vkCmdEndRenderPass
      • setImageLayout
      • vkCmdCopyImage
      • setImageLayout
    • setImageLayout
    • flushCommandBuffer
    • vkDestroyRenderPass
    • vkDestroyFramebuffer
    • vkFreeMemory
    • vkDestroyImageView
    • vkDestroyImage
    • vkDestroyDescriptorPool
    • vkDestroyDescriptorSetLayout
    • vkDestroyPipeline
    • vkDestroyPipelineLayout
  • prepareUniformBuffers
    • createBuffer
    • updateUniformBuffers
    • updateParams:灯光
  • setupDescriptors
    • vkCreateDescriptorSetLayout
    • Descriptor sets
      • vkUpdateDescriptorSets: 模型,包括材质的Descriptor
      • vkUpdateDescriptorSets: Sky box
  • preparePipelines:
    • vkCreatePipelineLayout
    • vkCreateGraphicsPipelines: Skybox pipeline
    • vkCreateGraphicsPipelines: PBR pipeline
  • buildCommandBuffers
    • 正常操作
    • 常量在这里输入

render

  • draw
  • updateUniformBuffers

shader

  • shader: IBL资源渲染算法以及PBR材质渲染相关算法

小结

   本节主要讲PBR材质在IBL下的渲染方法, 与上一节相比,只是增加了材质信息(只有shader 发生变化).

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值