From b7ffef733893d13fb1164f1366e15b1e0ddc1bbb Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 29 Jan 2026 19:20:51 +0100 Subject: [PATCH] pgraph: Fix ColorBlendAttrib alpha settings not hashed/compared --- panda/src/pgraph/colorBlendAttrib.cxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/panda/src/pgraph/colorBlendAttrib.cxx b/panda/src/pgraph/colorBlendAttrib.cxx index 51b2798137..bd43121a85 100644 --- a/panda/src/pgraph/colorBlendAttrib.cxx +++ b/panda/src/pgraph/colorBlendAttrib.cxx @@ -131,6 +131,18 @@ compare_to_impl(const RenderAttrib *other) const { return (int)_b - (int)ta->_b; } + if (_alpha_mode != ta->_alpha_mode) { + return (int)_alpha_mode - (int)ta->_alpha_mode; + } + + if (_alpha_a != ta->_alpha_a) { + return (int)_alpha_a - (int)ta->_alpha_a; + } + + if (_alpha_b != ta->_alpha_b) { + return (int)_alpha_b - (int)ta->_alpha_b; + } + return _color.compare_to(ta->_color); } @@ -146,6 +158,9 @@ get_hash_impl() const { hash = int_hash::add_hash(hash, (int)_mode); hash = int_hash::add_hash(hash, (int)_a); hash = int_hash::add_hash(hash, (int)_b); + hash = int_hash::add_hash(hash, (int)_alpha_mode); + hash = int_hash::add_hash(hash, (int)_alpha_a); + hash = int_hash::add_hash(hash, (int)_alpha_b); hash = _color.add_hash(hash); return hash;