obs-filters: Remove unused key_rgb shader variable
Variable was never used. Clean up both C++ and shader code.
This commit is contained in:
parent
dde6257bd9
commit
493648c6d2
@ -35,7 +35,6 @@ struct chroma_key_filter_data {
|
|||||||
|
|
||||||
gs_eparam_t *pixel_size_param;
|
gs_eparam_t *pixel_size_param;
|
||||||
gs_eparam_t *chroma_param;
|
gs_eparam_t *chroma_param;
|
||||||
gs_eparam_t *key_rgb_param;
|
|
||||||
gs_eparam_t *similarity_param;
|
gs_eparam_t *similarity_param;
|
||||||
gs_eparam_t *smoothness_param;
|
gs_eparam_t *smoothness_param;
|
||||||
gs_eparam_t *spill_param;
|
gs_eparam_t *spill_param;
|
||||||
@ -45,7 +44,6 @@ struct chroma_key_filter_data {
|
|||||||
float brightness;
|
float brightness;
|
||||||
float gamma;
|
float gamma;
|
||||||
|
|
||||||
struct vec4 key_rgb;
|
|
||||||
struct vec2 chroma;
|
struct vec2 chroma;
|
||||||
float similarity;
|
float similarity;
|
||||||
float smoothness;
|
float smoothness;
|
||||||
@ -97,6 +95,7 @@ static inline void chroma_settings_update(
|
|||||||
SETTING_KEY_COLOR);
|
SETTING_KEY_COLOR);
|
||||||
const char *key_type = obs_data_get_string(settings,
|
const char *key_type = obs_data_get_string(settings,
|
||||||
SETTING_COLOR_TYPE);
|
SETTING_COLOR_TYPE);
|
||||||
|
struct vec4 key_rgb;
|
||||||
struct vec4 key_color_v4;
|
struct vec4 key_color_v4;
|
||||||
struct matrix4 yuv_mat_m4;
|
struct matrix4 yuv_mat_m4;
|
||||||
|
|
||||||
@ -107,10 +106,10 @@ static inline void chroma_settings_update(
|
|||||||
else if (strcmp(key_type, "magenta") == 0)
|
else if (strcmp(key_type, "magenta") == 0)
|
||||||
key_color = 0xFF00FF;
|
key_color = 0xFF00FF;
|
||||||
|
|
||||||
vec4_from_rgba(&filter->key_rgb, key_color | 0xFF000000);
|
vec4_from_rgba(&key_rgb, key_color | 0xFF000000);
|
||||||
|
|
||||||
memcpy(&yuv_mat_m4, yuv_mat, sizeof(yuv_mat));
|
memcpy(&yuv_mat_m4, yuv_mat, sizeof(yuv_mat));
|
||||||
vec4_transform(&key_color_v4, &filter->key_rgb, &yuv_mat_m4);
|
vec4_transform(&key_color_v4, &key_rgb, &yuv_mat_m4);
|
||||||
vec2_set(&filter->chroma, key_color_v4.y, key_color_v4.z);
|
vec2_set(&filter->chroma, key_color_v4.y, key_color_v4.z);
|
||||||
|
|
||||||
filter->similarity = (float)similarity / 1000.0f;
|
filter->similarity = (float)similarity / 1000.0f;
|
||||||
@ -161,8 +160,6 @@ static void *chroma_key_create(obs_data_t *settings, obs_source_t *context)
|
|||||||
filter->effect, "gamma");
|
filter->effect, "gamma");
|
||||||
filter->chroma_param = gs_effect_get_param_by_name(
|
filter->chroma_param = gs_effect_get_param_by_name(
|
||||||
filter->effect, "chroma_key");
|
filter->effect, "chroma_key");
|
||||||
filter->key_rgb_param = gs_effect_get_param_by_name(
|
|
||||||
filter->effect, "key_rgb");
|
|
||||||
filter->pixel_size_param = gs_effect_get_param_by_name(
|
filter->pixel_size_param = gs_effect_get_param_by_name(
|
||||||
filter->effect, "pixel_size");
|
filter->effect, "pixel_size");
|
||||||
filter->similarity_param = gs_effect_get_param_by_name(
|
filter->similarity_param = gs_effect_get_param_by_name(
|
||||||
@ -205,7 +202,6 @@ static void chroma_key_render(void *data, gs_effect_t *effect)
|
|||||||
gs_effect_set_float(filter->brightness_param, filter->brightness);
|
gs_effect_set_float(filter->brightness_param, filter->brightness);
|
||||||
gs_effect_set_float(filter->gamma_param, filter->gamma);
|
gs_effect_set_float(filter->gamma_param, filter->gamma);
|
||||||
gs_effect_set_vec2(filter->chroma_param, &filter->chroma);
|
gs_effect_set_vec2(filter->chroma_param, &filter->chroma);
|
||||||
gs_effect_set_vec4(filter->key_rgb_param, &filter->key_rgb);
|
|
||||||
gs_effect_set_vec2(filter->pixel_size_param, &pixel_size);
|
gs_effect_set_vec2(filter->pixel_size_param, &pixel_size);
|
||||||
gs_effect_set_float(filter->similarity_param, filter->similarity);
|
gs_effect_set_float(filter->similarity_param, filter->similarity);
|
||||||
gs_effect_set_float(filter->smoothness_param, filter->smoothness);
|
gs_effect_set_float(filter->smoothness_param, filter->smoothness);
|
||||||
|
@ -12,7 +12,6 @@ uniform float brightness;
|
|||||||
uniform float gamma;
|
uniform float gamma;
|
||||||
|
|
||||||
uniform float2 chroma_key;
|
uniform float2 chroma_key;
|
||||||
uniform float4 key_rgb;
|
|
||||||
uniform float2 pixel_size;
|
uniform float2 pixel_size;
|
||||||
uniform float similarity;
|
uniform float similarity;
|
||||||
uniform float smoothness;
|
uniform float smoothness;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user