TransparentFragmentShader3DVulkan
Package: Libraries.Game.Graphics.Shaders.Vulkan.Fragment · Inherits from: Libraries.Game.Graphics.Shaders.Shader, Libraries.Language.Object
TransparentFragmentShader3DVulkan colors see-through models, such as glass and alpha-blended materials. It is a forward shader: drawn after the deferred lighting and water, over the lit image, back to front. It reads the model's material as the default 3D fragment shader does, lights it with every light (no shadows are received yet) and the light from the sky, and blends it by its alpha: the texture's alpha times the material's (or the model's color's) alpha. Reflections and glints aren't faded with the alpha, so clear glass still shines. It compares its distance with the G-buffer's position, so models in front hide it. The painter fills its push constants: the instance address, 18 unused numbers, then the forward scene data (the sky's rotation and whether there is a sky), as for water.
Example Code
use Libraries.Game.Graphics.Shaders.Vulkan.Fragment.TransparentFragmentShader3DVulkan
TransparentFragmentShader3DVulkan shader
Variables
text DEFAULT_NAME