Skip to content

Commit

Permalink
linear color movement
Browse files Browse the repository at this point in the history
  • Loading branch information
exeldro committed Jun 14, 2021
1 parent 1ca84b8 commit a8049d2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions move-value-filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1097,10 +1097,14 @@ void move_value_tick(void *data, float seconds)
vec4_from_rgba(&color_from,
(uint32_t)obs_data_get_int(
item, S_SETTING_FROM));
gs_float3_srgb_nonlinear_to_linear(
color_from.ptr);
struct vec4 color_to;
vec4_from_rgba(&color_to,
(uint32_t)obs_data_get_int(
item, S_SETTING_TO));
gs_float3_srgb_nonlinear_to_linear(
color_to.ptr);
struct vec4 color;
color.w = (1.0f - t) * color_from.w +
t * color_to.w;
Expand All @@ -1110,6 +1114,7 @@ void move_value_tick(void *data, float seconds)
t * color_to.y;
color.z = (1.0f - t) * color_from.z +
t * color_to.z;
gs_float3_srgb_nonlinear_to_linear(color.ptr);
const long long value_int =
vec4_to_rgba(&color);
obs_data_set_int(ss, setting_name, value_int);
Expand Down

0 comments on commit a8049d2

Please sign in to comment.