Add glass pipeline for WMO windows with Fresnel-based transparency

Dedicated Vulkan pipeline with alpha blending AND depth writes so
windows look transparent at oblique angles without see-through artifacts.
Fresnel alpha ranges from 0.4 (grazing) to 0.95 (head-on) with sun
glint, reflections, and silver-lining specular.
This commit is contained in:
Kelsi 2026-02-23 00:43:14 -08:00
parent fb4ff46fe3
commit 1b16bcf71f
4 changed files with 99 additions and 16 deletions

View file

@ -310,6 +310,8 @@ private:
int32_t unlit;
int32_t isInterior;
float specularIntensity;
int32_t isWindow;
float pad[2]; // pad to 32 bytes
};
/**
@ -346,6 +348,7 @@ private:
bool alphaTest = false;
bool unlit = false;
bool isTransparent = false; // blendMode >= 2
bool isWindow = false; // F_SIDN or F_WINDOW material
// For multi-draw: store index ranges
struct DrawRange { uint32_t firstIndex; uint32_t indexCount; };
std::vector<DrawRange> draws;
@ -558,6 +561,7 @@ private:
// Vulkan pipelines
VkPipeline opaquePipeline_ = VK_NULL_HANDLE;
VkPipeline transparentPipeline_ = VK_NULL_HANDLE;
VkPipeline glassPipeline_ = VK_NULL_HANDLE; // alpha blend + depth write (windows)
VkPipeline wireframePipeline_ = VK_NULL_HANDLE;
VkPipelineLayout pipelineLayout_ = VK_NULL_HANDLE;