提交 52b9f5fe 编写于 作者: P Palana

Fix defaults for DrawMatrix

上级 12cc06b5
uniform float4x4 ViewProj;
uniform float4x4 color_matrix;
uniform float3 color_range_min;
uniform float3 color_range_max;
uniform float3 color_range_min = {0.0, 0.0, 0.0};
uniform float3 color_range_max = {1.0, 1.0, 1.0};
uniform texture2d image;
sampler_state def_sampler {
......
......@@ -822,9 +822,6 @@ static bool update_async_texture(struct obs_source *source,
return true;
}
static float const full_range_min[] = {0., 0., 0.};
static float const full_range_max[] = {1., 1., 1.};
static inline void obs_source_draw_texture(struct obs_source *source,
effect_t effect, float *color_matrix,
float const *color_range_min, float const *color_range_max)
......@@ -835,19 +832,19 @@ static inline void obs_source_draw_texture(struct obs_source *source,
if (source->async_convert_texrender)
tex = texrender_gettexture(source->async_convert_texrender);
if (color_matrix) {
if (color_range_min) {
size_t const size = sizeof(float) * 3;
if (!color_range_min)
color_range_min = full_range_min;
if (!color_range_max)
color_range_max = full_range_max;
param = effect_getparambyname(effect, "color_range_min");
effect_setval(effect, param, color_range_min, size);
}
if (color_range_max) {
size_t const size = sizeof(float) * 3;
param = effect_getparambyname(effect, "color_range_max");
effect_setval(effect, param, color_range_max, size);
}
if (color_matrix) {
param = effect_getparambyname(effect, "color_matrix");
effect_setval(effect, param, color_matrix, sizeof(float) * 16);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册