Use gl_FrontFacing to determine mirrored surface side, enable clipping (Refs #190)

This commit is contained in:
saschawillems 2016-07-06 21:13:24 +02:00
parent becdc7c9dc
commit 876f5714eb
7 changed files with 18 additions and 23 deletions

View file

@ -789,14 +789,15 @@ public:
VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, pipelineCache, 1, &pipelineCreateInfo, nullptr, &pipelines.debug));
// Flip culling
rasterizationState.cullMode = VK_CULL_MODE_BACK_BIT;
// Mirror
shaderStages[0] = loadShader(getAssetPath() + "shaders/offscreen/mirror.vert.spv", VK_SHADER_STAGE_VERTEX_BIT);
shaderStages[1] = loadShader(getAssetPath() + "shaders/offscreen/mirror.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT);
rasterizationState.cullMode = VK_CULL_MODE_NONE;
VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, pipelineCache, 1, &pipelineCreateInfo, nullptr, &pipelines.mirror));
// Flip culling
rasterizationState.cullMode = VK_CULL_MODE_BACK_BIT;
// Phong shading pipelines
pipelineCreateInfo.layout = pipelineLayouts.shaded;
// Scene