From 1cada85e6bd7135905199e82d6606da246aa902a Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 15 Jan 2018 12:20:27 +0100 Subject: [PATCH] ShaderGenerator: fixes for combine alpha blending --- panda/src/pgraphnodes/shaderGenerator.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/panda/src/pgraphnodes/shaderGenerator.cxx b/panda/src/pgraphnodes/shaderGenerator.cxx index 6b83c3ef14..3546af732d 100644 --- a/panda/src/pgraphnodes/shaderGenerator.cxx +++ b/panda/src/pgraphnodes/shaderGenerator.cxx @@ -1444,7 +1444,7 @@ synthesize_shader(const RenderState *rs, const GeomVertexAnimationSpec &anim) { text << "\t result.rgb = "; text << combine_mode_as_string(tex, combine_rgb, false, i); text << ";\n\t result.a = "; - text << combine_mode_as_string(tex, combine_alpha, false, i); + text << combine_mode_as_string(tex, combine_alpha, true, i); text << ";\n"; } if (tex._flags & ShaderKey::TF_rgb_scale_2) { @@ -1667,6 +1667,7 @@ combine_source_as_string(const ShaderKey::TextureInfo &info, short num, bool alp csource << "saturate(1.0f - "; } switch (c_src) { + case TextureStage::CS_undefined: case TextureStage::CS_texture: csource << "tex" << texindex; break; @@ -1685,8 +1686,6 @@ combine_source_as_string(const ShaderKey::TextureInfo &info, short num, bool alp case TextureStage::CS_last_saved_result: csource << "last_saved_result"; break; - case TextureStage::CS_undefined: - break; } if (c_op == TextureStage::CO_one_minus_src_color || c_op == TextureStage::CO_one_minus_src_alpha) {