Fix more stuff in SMAA pass
Now it's no longer flipped for some reason, gamma correction soon to follow
This commit is contained in:
parent
37866a9470
commit
b5655efe0e
4 changed files with 6 additions and 5 deletions
|
@ -50,7 +50,6 @@ void SMAAPass::render(GFXCommandBuffer* command_buffer, RenderTarget& target) {
|
||||||
|
|
||||||
struct PushConstant {
|
struct PushConstant {
|
||||||
prism::float4 viewport;
|
prism::float4 viewport;
|
||||||
Matrix4x4 correction_matrix;
|
|
||||||
} pc;
|
} pc;
|
||||||
|
|
||||||
pc.viewport = prism::float4(1.0f / static_cast<float>(target.extent.width), 1.0f / static_cast<float>(target.extent.height), target.extent.width, target.extent.height);
|
pc.viewport = prism::float4(1.0f / static_cast<float>(target.extent.width), 1.0f / static_cast<float>(target.extent.height), target.extent.width, target.extent.height);
|
||||||
|
@ -149,7 +148,7 @@ void SMAAPass::create_pipelines() {
|
||||||
createInfo.render_pass = render_pass;
|
createInfo.render_pass = render_pass;
|
||||||
|
|
||||||
createInfo.shader_input.push_constants = {
|
createInfo.shader_input.push_constants = {
|
||||||
{sizeof(prism::float4) + sizeof(Matrix4x4), 0}
|
{sizeof(prism::float4), 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
createInfo.shader_input.bindings = {
|
createInfo.shader_input.bindings = {
|
||||||
|
|
|
@ -8,7 +8,8 @@ layout(location = 5) out vec2 outPixUV;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
outUV = vec2((gl_VertexIndex << 1) & 2, gl_VertexIndex & 2);
|
outUV = vec2((gl_VertexIndex << 1) & 2, gl_VertexIndex & 2);
|
||||||
gl_Position = correctionMatrix * vec4(outUV * 2.0 + -1.0, 0.0, 1.0);
|
gl_Position = vec4(outUV * 2.0 + -1.0, 0.0, 1.0);
|
||||||
|
outUV.y = 1.0 - outUV.y;
|
||||||
|
|
||||||
SMAABlendingWeightCalculationVS(outUV, outPixUV, outOffset);
|
SMAABlendingWeightCalculationVS(outUV, outPixUV, outOffset);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,8 @@ layout(location = 1) out vec4 outOffset[3];
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
outUV = vec2((gl_VertexIndex << 1) & 2, gl_VertexIndex & 2);
|
outUV = vec2((gl_VertexIndex << 1) & 2, gl_VertexIndex & 2);
|
||||||
gl_Position = correctionMatrix * vec4(outUV * 2.0 + -1.0, 0.0, 1.0);
|
gl_Position = vec4(outUV * 2.0 + -1.0, 0.0, 1.0);
|
||||||
|
outUV.y = 1.0 - outUV.y;
|
||||||
|
|
||||||
SMAAEdgeDetectionVS(outUV, outOffset);
|
SMAAEdgeDetectionVS(outUV, outOffset);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
#define SMAA_PRESET_ULTRA 1
|
#define SMAA_PRESET_ULTRA 1
|
||||||
#define SMAA_GLSL_4 1
|
#define SMAA_GLSL_4 1
|
||||||
#define SMAA_PREDICATION 1
|
#define SMAA_PREDICATION 1
|
||||||
|
#define SMAA_FLIP_Y 0
|
||||||
|
|
||||||
layout(push_constant) uniform PushConstant {
|
layout(push_constant) uniform PushConstant {
|
||||||
vec4 viewport;
|
vec4 viewport;
|
||||||
mat4 correctionMatrix;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#include "smaa.glsl"
|
#include "smaa.glsl"
|
||||||
|
|
Reference in a new issue