By setting a fragments alpha to a value in between 0 and 1 we can render semi-transparent objects.
Unfortunately things arent that simple.
When working with semi-transparent objects the order in which we render them actually matters!
In this tutorial we add a limited blending capability to our point light system allowing them to be rendered with a nicer appearance.
Discard vs Alpha Blending:
Behind the scenes how the gpu handles alpha 0 vs discard is different.
When a fragment is discarded thats the end of the line and no further processing needs to occur for the fragment.
When not discarded and alpha is zero the pipeline proceeds as it normally would to the blending step.
Timestamps
00:00 Introduction to alpha blending
01:29 Transparency rendering order matters!
02:10 Depth buffer review
05:02 Coding start
05:57 Enable alpha blending
08:27 Rendering lights with blending
09:30 Sorting the light objects
13:10 Nicer light rendering
Further Reading
View File Changes
View Tutorial Branch
View playlist
Some other resources
Join the discord:
My github for this series -
Official Vulkan samples -
Vulkan and the Vulkan logo are registered trademarks of the Khronos Group Inc.
Источник: rutube.ru