diff --git a/editor/assets/effects/pipeline/post-process/color-grading.effect b/editor/assets/effects/pipeline/post-process/color-grading.effect index 88eefd6ee33..38195b66a06 100644 --- a/editor/assets/effects/pipeline/post-process/color-grading.effect +++ b/editor/assets/effects/pipeline/post-process/color-grading.effect @@ -8,6 +8,11 @@ CCEffect %{ pass: color-grading-nx1 rasterizerState: &rasterizerState cullMode: none + blendState: &blendState + targets: + - blend: false + blendSrc: one + blendDst: zero depthStencilState: &depthStencilState depthTest: false depthWrite: false @@ -16,6 +21,7 @@ CCEffect %{ pass: color-grading-8x8 rasterizerState: *rasterizerState depthStencilState: *depthStencilState + blendState: *blendState }% CCProgram ubo %{ @@ -35,8 +41,6 @@ CCProgram color-grading-vs %{ CCProgram color-grading-nx1-fs %{ precision highp float; - #include - #include #include in vec2 v_uv; @@ -58,20 +62,13 @@ CCProgram color-grading-nx1-fs %{ layout(location = 0) out vec4 fragColor; void main () { vec4 sceneColor = texture(sceneColorMap, v_uv); - // (Tone mapping + gamma correction) + Color grading - #if CC_USE_FLOAT_OUTPUT - sceneColor.rgb = HDRToLDR(sceneColor.rgb); - sceneColor.rgb = LinearToSRGB(sceneColor.rgb); - #endif vec3 gradeColor = ColorGrading(colorGradingMap, sceneColor.rgb); - fragColor = mix(sceneColor, vec4(gradeColor, sceneColor.a), contribute); + fragColor = mix(sceneColor, vec4(gradeColor, 1.0), contribute); } }% CCProgram color-grading-8x8-fs %{ precision highp float; - #include - #include #include in vec2 v_uv; #define EPS 0.000001 @@ -79,23 +76,18 @@ CCProgram color-grading-8x8-fs %{ #define SIZE 512.0 layout(location = 0) out vec4 fragColor; void main () { - vec4 origColor = texture(sceneColorMap, v_uv); - // (Tone mapping + gamma correction) + Color grading - #if CC_USE_FLOAT_OUTPUT - origColor.rgb = HDRToLDR(origColor.rgb); - origColor.rgb = LinearToSRGB(origColor.rgb); - #endif - float bValue = (origColor.b * 255.0) / 4.0; + vec3 orgColor = texture(sceneColorMap, v_uv).rgb; + float bValue = (orgColor.b * 255.0) / 4.0; vec2 mulB = clamp(floor(bValue) + vec2(0.0, 1.0), 0.0, 63.0); vec2 row = floor(mulB / 8.0 + EPS); vec4 row_col = vec4(row, mulB - row * 8.0); - vec4 lookup = origColor.ggrr * (63.0 / SIZE) + row_col * (TOTAL / SIZE) + (0.5 / SIZE); + vec4 lookup = orgColor.ggrr * (63.0 / SIZE) + row_col * (TOTAL / SIZE) + (0.5 / SIZE); float b1w = bValue - mulB.x; vec3 sampled1 = texture(colorGradingMap, lookup.zx).rgb; vec3 sampled2 = texture(colorGradingMap, lookup.wy).rgb; - fragColor = vec4(mix(origColor.rgb, mix(sampled1, sampled2, b1w), contribute), origColor.a); + fragColor = vec4(mix(orgColor, mix(sampled1, sampled2, b1w), contribute), 1.0); } }% diff --git a/editor/assets/effects/pipeline/post-process/fsr.effect b/editor/assets/effects/pipeline/post-process/fsr.effect index 1b0e5766334..5a088ede8c5 100644 --- a/editor/assets/effects/pipeline/post-process/fsr.effect +++ b/editor/assets/effects/pipeline/post-process/fsr.effect @@ -11,6 +11,11 @@ CCEffect %{ depthStencilState: depthTest: false depthWrite: false + blendState: + targets: + - blend: true + blendSrc: one + blendDst: zero - vert: vs frag: fs-rcas pass: post-process @@ -19,6 +24,11 @@ CCEffect %{ depthStencilState: depthTest: false depthWrite: false + blendState: + targets: + - blend: true + blendSrc: one + blendDst: zero }%