mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Fix specular direction by correcting front face winding for Vulkan Y-flip
The projection matrix Y-flip (projectionMatrix[1][1] *= -1) reverses triangle winding from the GPU's perspective. With the default VK_FRONT_FACE_COUNTER_CLOCKWISE, gl_FrontFacing was inverted, causing all fragment shaders (M2, WMO, character) to flip normals on front faces instead of back faces, putting specular highlights on the wrong side of surfaces.
This commit is contained in:
parent
ef1e5abe8e
commit
ae3903561c
1 changed files with 2 additions and 2 deletions
|
|
@ -43,7 +43,7 @@ public:
|
|||
// Rasterization
|
||||
PipelineBuilder& setRasterization(VkPolygonMode polygonMode,
|
||||
VkCullModeFlags cullMode,
|
||||
VkFrontFace frontFace = VK_FRONT_FACE_COUNTER_CLOCKWISE);
|
||||
VkFrontFace frontFace = VK_FRONT_FACE_CLOCKWISE);
|
||||
|
||||
// Depth test/write
|
||||
PipelineBuilder& setDepthTest(bool enable, bool writeEnable,
|
||||
|
|
@ -92,7 +92,7 @@ private:
|
|||
VkBool32 primitiveRestart_ = VK_FALSE;
|
||||
VkPolygonMode polygonMode_ = VK_POLYGON_MODE_FILL;
|
||||
VkCullModeFlags cullMode_ = VK_CULL_MODE_NONE;
|
||||
VkFrontFace frontFace_ = VK_FRONT_FACE_COUNTER_CLOCKWISE;
|
||||
VkFrontFace frontFace_ = VK_FRONT_FACE_CLOCKWISE;
|
||||
bool depthTestEnable_ = false;
|
||||
bool depthWriteEnable_ = false;
|
||||
VkCompareOp depthCompareOp_ = VK_COMPARE_OP_LESS;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue