Merge pull request #77520 from allenwp/subtract-blend-mode-fix

Fixed Subtract blend mode of Forward+ and Mobile renderers
This commit is contained in:
Rémi Verschelde 2023-05-26 18:15:47 +02:00
commit 8267dbbebe
No known key found for this signature in database
GPG Key ID: C3336907360768E1
4 changed files with 8 additions and 8 deletions

View File

@ -32,8 +32,8 @@
[codeblock]
var attachment = RDPipelineColorBlendStateAttachment.new()
attachment.enable_blend = true
attachment.alpha_blend_op = RenderingDevice.BLEND_OP_SUBTRACT
attachment.color_blend_op = RenderingDevice.BLEND_OP_SUBTRACT
attachment.alpha_blend_op = RenderingDevice.BLEND_OP_REVERSE_SUBTRACT
attachment.color_blend_op = RenderingDevice.BLEND_OP_REVERSE_SUBTRACT
attachment.src_color_blend_factor = RenderingDevice.BLEND_FACTOR_SRC_ALPHA
attachment.dst_color_blend_factor = RenderingDevice.BLEND_FACTOR_ONE
attachment.src_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_SRC_ALPHA

View File

@ -207,8 +207,8 @@ void SceneShaderForwardClustered::ShaderData::set_code(const String &p_code) {
} break;
case BLEND_MODE_SUB: {
blend_attachment.enable_blend = true;
blend_attachment.alpha_blend_op = RD::BLEND_OP_SUBTRACT;
blend_attachment.color_blend_op = RD::BLEND_OP_SUBTRACT;
blend_attachment.alpha_blend_op = RD::BLEND_OP_REVERSE_SUBTRACT;
blend_attachment.color_blend_op = RD::BLEND_OP_REVERSE_SUBTRACT;
blend_attachment.src_color_blend_factor = RD::BLEND_FACTOR_SRC_ALPHA;
blend_attachment.dst_color_blend_factor = RD::BLEND_FACTOR_ONE;
blend_attachment.src_alpha_blend_factor = RD::BLEND_FACTOR_SRC_ALPHA;

View File

@ -218,8 +218,8 @@ void SceneShaderForwardMobile::ShaderData::set_code(const String &p_code) {
} break;
case BLEND_MODE_SUB: {
blend_attachment.enable_blend = true;
blend_attachment.alpha_blend_op = RD::BLEND_OP_SUBTRACT;
blend_attachment.color_blend_op = RD::BLEND_OP_SUBTRACT;
blend_attachment.alpha_blend_op = RD::BLEND_OP_REVERSE_SUBTRACT;
blend_attachment.color_blend_op = RD::BLEND_OP_REVERSE_SUBTRACT;
blend_attachment.src_color_blend_factor = RD::BLEND_FACTOR_SRC_ALPHA;
blend_attachment.dst_color_blend_factor = RD::BLEND_FACTOR_ONE;
blend_attachment.src_alpha_blend_factor = RD::BLEND_FACTOR_SRC_ALPHA;

View File

@ -2121,8 +2121,8 @@ void RendererCanvasRenderRD::CanvasShaderData::set_code(const String &p_code) {
} break;
case BLEND_MODE_SUB: {
attachment.enable_blend = true;
attachment.alpha_blend_op = RD::BLEND_OP_SUBTRACT;
attachment.color_blend_op = RD::BLEND_OP_SUBTRACT;
attachment.alpha_blend_op = RD::BLEND_OP_REVERSE_SUBTRACT;
attachment.color_blend_op = RD::BLEND_OP_REVERSE_SUBTRACT;
attachment.src_color_blend_factor = RD::BLEND_FACTOR_SRC_ALPHA;
attachment.dst_color_blend_factor = RD::BLEND_FACTOR_ONE;
attachment.src_alpha_blend_factor = RD::BLEND_FACTOR_SRC_ALPHA;