There seems to be no corresponding function in the engine for the HueShift, because its a material function that is made of other functions, of course…
So i tried looking for the RotateAboutAxis function and gives me this super weird and obscure function that seems to need a material:
UMaterialExpressionRotateAboutAxis()
What should be my course of action in this situation?
What do you need the function to change in C++? Are you planning on hue shifting a UTexture or FVector? Are you tying to get the same functionality out of the material editor and into a game world ready function?
Thanks.
Basically, i use the hue shift instead of a 3 Per Instance Custom Data to change the color of my Units.
So i start with a color Green and hue shift with just 1 PICD. That seems to me that it is better in performance, 1 PICD vs 3 PICD.
But the problem is that i need to calculate the hue shift outside so that i SetCustomDataValue() in C++ with the right colors. You get me ?
I tried that but never get accurate values.
The hue shift requires a color input and then the hue shift float value.
What would the LinearRGBToHSV values correspond to?
In my case my hue shift has a Green input: 0, 1, 0
So a float of 0.65 shift, would turn it into a reddish color .
So what would be the corresponding input color and hue shift that would match the LinearRGBToHSV?
This is quite confusing for my adhd brain.
Now sometimes in my project i need to reverse and instead of getting the Target Color after the hueshift, I need to get the hueshift between 2 colors.
Idk if this is even possible. I tried a lot, but all i get is weird results.
FLinearColor ReferenceColor = FLinearColor::Green;
FLinearColor ResultColor = UCampaignBlueprintFunctionLibrary::GetColorFromHueShift(0.65, ReferenceColor);
//got the result color that in this case is a reddish color from the hueshift 0.65
float Hue2 = UCampaignBlueprintFunctionLibrary::GetHueShiftBetweenColors(ResultColor, ReferenceColor);
//now im trying to get that hueshift given only the 2 colors. here the output should be 0.65. Though im getting 0.35