From 933dce44651eab2e884a9c9cf3332ec4a6ae5eb3 Mon Sep 17 00:00:00 2001 From: ccpHenry <153081976+ccpHenry@users.noreply.github.com> Date: Wed, 23 Sep 2026 13:35:45 +0000 Subject: [PATCH 1/2] Adding transparency options to colorMixers https://fenriscreations.atlassian.net/browse/EO-26334 --- trinity/Curves/Tr2CurveColorMixer.cpp | 24 +++++++++++++--------- trinity/Curves/Tr2CurveColorMixer.h | 1 + trinity/Curves/Tr2CurveColorMixer_Blue.cpp | 6 ++++++ 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/trinity/Curves/Tr2CurveColorMixer.cpp b/trinity/Curves/Tr2CurveColorMixer.cpp index ca199079c..1aa2e19b9 100644 --- a/trinity/Curves/Tr2CurveColorMixer.cpp +++ b/trinity/Curves/Tr2CurveColorMixer.cpp @@ -1,5 +1,3 @@ -// Copyright © 2023 CCP ehf. - #include "Tr2CurveColorMixer.h" Tr2CurveColorMixer::Tr2CurveColorMixer( IRoot* lockobj ) : @@ -9,7 +7,8 @@ Tr2CurveColorMixer::Tr2CurveColorMixer( IRoot* lockobj ) : m_color2( 0, 0, 0, 1 ), m_lerpValue( 0.f ), m_saturation( 1.f ), - m_brightness( 1.f ) + m_brightness( 1.f ), + m_alphaOverride( -1.f ) { } @@ -28,23 +27,27 @@ Color Tr2CurveColorMixer::GetValue( double time ) const { Color out = Lerp( m_color1, m_color2, m_lerpValue ); - if( m_saturation == 1.f ) + if( m_saturation != 1.f ) { - return out * m_brightness; + // color intensity + float i = ( out.r * 0.299f ) + ( out.g * 0.587f ) + ( out.b * 0.114f ); + + out = Lerp( Color( i, i, i, i ), out, max( 0.0f, m_saturation ) ); } - // color intensity - float i = ( out.r * 0.299f ) + ( out.g * 0.587f ) + ( out.b * 0.114f ); + out *= m_brightness; - out = Lerp( Color( i, i, i, i ), out, max( 0.0f, m_saturation ) ); + if( m_alphaOverride != -1.f ) + { + out.a = min( 1.f, max( 0.f, m_alphaOverride ) ); + } - return out * m_brightness; + return out; } Color* Tr2CurveColorMixer::Update( Color* in, Be::Time time ) { *in = m_currentValue = GetValue( TimeAsDouble( time ) ); - return in; } @@ -72,6 +75,7 @@ void Tr2CurveColorMixer::InvertLinearColor( Color* in, Color* out ) out->r = InvertLinearValue( in->r ); out->b = InvertLinearValue( in->b ); out->g = InvertLinearValue( in->g ); + out->a = in->a; } float Tr2CurveColorMixer::InvertLinearValue( float x ) diff --git a/trinity/Curves/Tr2CurveColorMixer.h b/trinity/Curves/Tr2CurveColorMixer.h index 87c790195..29e933a62 100644 --- a/trinity/Curves/Tr2CurveColorMixer.h +++ b/trinity/Curves/Tr2CurveColorMixer.h @@ -44,6 +44,7 @@ BLUE_CLASS( Tr2CurveColorMixer ) : float m_lerpValue; float m_saturation; float m_brightness; + float m_alphaOverride; }; TYPEDEF_BLUECLASS( Tr2CurveColorMixer ); \ No newline at end of file diff --git a/trinity/Curves/Tr2CurveColorMixer_Blue.cpp b/trinity/Curves/Tr2CurveColorMixer_Blue.cpp index 0f1282640..798b7aadb 100644 --- a/trinity/Curves/Tr2CurveColorMixer_Blue.cpp +++ b/trinity/Curves/Tr2CurveColorMixer_Blue.cpp @@ -48,6 +48,12 @@ const Be::ClassInfo* Tr2CurveColorMixer::ExposeToBlue() "[0:inf] 0=black 1=normal", Be::READWRITE | Be::PERSIST ) + MAP_ATTRIBUTE( + "alphaOverride", + m_alphaOverride, + "[-1: disabled] 0=transparent, 1=opaque. value is clamped [0:1]", + Be::READWRITE | Be::PERSIST ) + MAP_ATTRIBUTE( "currentValue", m_currentValue, From 07dc17952cda67fa0a2be5060064210cb9f08d8a Mon Sep 17 00:00:00 2001 From: ccpHenry <153081976+ccpHenry@users.noreply.github.com> Date: Mon, 28 Sep 2026 16:32:59 +0000 Subject: [PATCH 2/2] fixing a NL + copyright notice just in header --- trinity/Curves/Tr2CurveColorMixer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trinity/Curves/Tr2CurveColorMixer.h b/trinity/Curves/Tr2CurveColorMixer.h index 29e933a62..68dd1317c 100644 --- a/trinity/Curves/Tr2CurveColorMixer.h +++ b/trinity/Curves/Tr2CurveColorMixer.h @@ -1,4 +1,4 @@ -// Copyright © 2021 CCP ehf. +// Copyright © 2023 CCP ehf. #pragma once @@ -47,4 +47,4 @@ BLUE_CLASS( Tr2CurveColorMixer ) : float m_alphaOverride; }; -TYPEDEF_BLUECLASS( Tr2CurveColorMixer ); \ No newline at end of file +TYPEDEF_BLUECLASS( Tr2CurveColorMixer );