shader_->set("has_local_key", local_key);\r
shader_->set("has_layer_key", layer_key);\r
shader_->set("pixel_format", item.pix_desc.pix_fmt); \r
+ shader_->set("opacity", item.transform.get_opacity()); \r
\r
// Setup blend_func\r
\r
switch(item.transform.get_blend_mode())\r
{\r
case image_transform::blend_mode::add: \r
- ogl.blend_func_separate(GL_ONE, GL_ONE, GL_ONE, GL_ONE);\r
+ ogl.blend_func_separate(GL_ONE, GL_ONE, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);\r
break;\r
case image_transform::blend_mode::replace: \r
ogl.blend_func_separate(GL_ONE, GL_ZERO, GL_ONE, GL_ONE);\r
break;\r
case image_transform::blend_mode::screen:\r
- ogl.blend_func_separate(GL_ONE, GL_ONE_MINUS_SRC_COLOR, GL_ONE, GL_ONE);\r
+ ogl.blend_func_separate(GL_ONE, GL_ONE_MINUS_SRC_COLOR, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);\r
+ case image_transform::blend_mode::normal:\r
default:\r
- ogl.blend_func_separate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE);\r
+ ogl.blend_func_separate(GL_ONE, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);\r
break;\r
}\r
}\r
\r
ogl.viewport(0, 0, background->width(), background->height());\r
\r
- GL(glColor4d(item.transform.get_gain(), item.transform.get_gain(), item.transform.get_gain(), item.transform.get_is_key() ? 1.0 : item.transform.get_opacity()));\r
+ GL(glColor4d(item.transform.get_gain(), item.transform.get_gain(), item.transform.get_gain(), item.transform.get_opacity()));\r
\r
auto m_p = item.transform.get_clip_translation();\r
auto m_s = item.transform.get_clip_scale();\r
\r
std::pair<int, std::shared_ptr<device_buffer>> local_key_buffer;\r
\r
- if(has_overlapping_items(layer, layer.front().transform.get_blend_mode()))\r
- {\r
- auto local_draw_buffer = create_device_buffer(4); \r
-\r
- int mode = 0;\r
- BOOST_FOREACH(auto& item, layer)\r
- {\r
- if(mode & item.mode)\r
- item.transform.set_blend_mode(image_transform::blend_mode::normal); // Disable blending, it will be used when merging back into render stack.\r
- else\r
- {\r
- item.transform.set_blend_mode(image_transform::blend_mode::replace); // Target field is empty, no blending\r
- mode |= item.mode;\r
- }\r
-\r
- draw_item(std::move(item), local_draw_buffer, local_key_buffer, layer_key_buffer); \r
- }\r
-\r
- kernel_.draw(channel_.ogl(), create_render_item(local_draw_buffer, layer.front().transform.get_blend_mode()), draw_buffer, nullptr, nullptr);\r
- }\r
- else // fast path\r
- {\r
+ //if(has_overlapping_items(layer, layer.front().transform.get_blend_mode()))\r
+ //{\r
+ // auto local_draw_buffer = create_device_buffer(4); \r
+\r
+ // auto local_blend_mode = layer.front().transform.get_blend_mode();\r
+\r
+ // int fields = 0;\r
+ // BOOST_FOREACH(auto& item, layer)\r
+ // {\r
+ // if(fields & item.mode)\r
+ // item.transform.set_blend_mode(image_transform::blend_mode::normal); // Disable blending, it will be used when merging back into render stack.\r
+ // else\r
+ // {\r
+ // item.transform.set_blend_mode(image_transform::blend_mode::replace); // Target field is empty, no blending, just copy\r
+ // fields |= item.mode;\r
+ // }\r
+\r
+ // draw_item(std::move(item), local_draw_buffer, local_key_buffer, layer_key_buffer); \r
+ // }\r
+\r
+ // kernel_.draw(channel_.ogl(), create_render_item(local_draw_buffer, local_blend_mode), draw_buffer, nullptr, nullptr);\r
+ //}\r
+ //else // fast path\r
+ //{\r
BOOST_FOREACH(auto& item, layer) \r
draw_item(std::move(item), draw_buffer, local_key_buffer, layer_key_buffer); \r
- } \r
+ //} \r
\r
CASPAR_ASSERT(local_key_buffer.first == 0 || local_key_buffer.first == core::video_mode::progressive);\r
\r
" return fore; \n"\r
" vec4 back = texture2D(background, gl_TexCoord[1].st).bgra; \n"\r
" fore.rgb = get_blend_color(back.rgb, fore.rgb); \n"\r
- " return vec4(mix(back.rgb, fore.rgb, fore.a), back.a + fore.a); \n"\r
- "} \n";\r
+ " return fore + (1.0-fore.a)*back; \n"\r
+ "} \n"; \r
}\r
\r
std::string get_simple_blend_color_func()\r
"{ \n"\r
" gl_TexCoord[0] = gl_MultiTexCoord0; \n"\r
" gl_TexCoord[1] = gl_MultiTexCoord1; \n"\r
- " gl_FrontColor = gl_Color; \n"\r
" gl_Position = ftransform(); \n"\r
"} \n";\r
}\r
"uniform int blend_mode; \n"\r
"uniform int pixel_format; \n"\r
" \n"\r
+ "uniform float opacity; \n"\r
"uniform bool levels; \n"\r
"uniform float min_input; \n"\r
"uniform float max_input; \n"\r
" if(csb) \n"\r
" color.rgb = ContrastSaturationBrightness(color.rgb, brt, sat, con); \n"\r
" if(has_local_key) \n"\r
- " color.a *= texture2D(local_key, gl_TexCoord[1].st).r; \n"\r
+ " color *= texture2D(local_key, gl_TexCoord[1].st).r; \n"\r
" if(has_layer_key) \n"\r
- " color.a *= texture2D(layer_key, gl_TexCoord[1].st).r; \n"\r
- " color *= gl_Color; \n"\r
+ " color *= texture2D(layer_key, gl_TexCoord[1].st).r; \n"\r
+ " color *= opacity; \n"\r
" color = blend(color); \n"\r
" gl_FragColor = color.bgra; \n"\r
"} \n";\r
\r
virtual safe_ptr<basic_frame> receive(int hints)\r
{\r
- if(current_frame_++ >= info_.duration)\r
+ if(++current_frame_ >= info_.duration)\r
return basic_frame::eof();\r
\r
auto dest = basic_frame::empty();\r
d_frame1->get_audio_transform().set_has_audio(false);\r
d_frame2->get_audio_transform().set_gain(delta2);\r
\r
- if(info_.type == transition::mix)\r
- {\r
- d_frame1->get_image_transform().set_opacity(delta1); \r
- d_frame2->get_image_transform().set_opacity(delta2);\r
+ //if(info_.type == transition::mix)\r
+ //{\r
+ // d_frame1->get_image_transform().set_opacity(delta1); \r
+ // d_frame2->get_image_transform().set_opacity(delta2);\r
\r
- s_frame1->get_image_transform().set_opacity(1.0-delta1); \r
- s_frame2->get_image_transform().set_opacity(1.0-delta2); \r
- }\r
- else if(info_.type == transition::slide)\r
+ // s_frame1->get_image_transform().set_opacity(1.0-delta1); \r
+ // s_frame2->get_image_transform().set_opacity(1.0-delta2); \r
+ //}\r
+ if(info_.type == transition::slide)\r
{\r
d_frame1->get_image_transform().set_fill_translation((-1.0+delta1)*dir, 0.0); \r
d_frame2->get_image_transform().set_fill_translation((-1.0+delta2)*dir, 0.0); \r
\r
\r
/* File created by MIDL compiler version 7.00.0555 */\r
-/* at Fri Jul 29 10:16:40 2011\r
+/* at Thu Aug 18 20:53:57 2011\r
*/\r
/* Compiler settings for interop\DeckLinkAPI.idl:\r
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 \r
\r
\r
/* File created by MIDL compiler version 7.00.0555 */\r
-/* at Fri Jul 29 10:16:40 2011\r
+/* at Thu Aug 18 20:53:57 2011\r
*/\r
/* Compiler settings for interop\DeckLinkAPI.idl:\r
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 \r
<?xml version="1.0" encoding="utf-8"?>\r
<configuration>\r
<paths>\r
- <media-path>L:\\casparcg\\_media\\</media-path>\r
+ <media-path>C:\Lokala Filer\server\branches\2.0.0.2\bin\_media</media-path>\r
<log-path>L:\\casparcg\\_log\\</log-path>\r
<data-path>L:\\casparcg\\_data\\</data-path>\r
<template-path>L:\\casparcg\\_templates\\</template-path>\r
<channel>\r
<video-mode>720p5000</video-mode>\r
<consumers>\r
- <decklink>\r
- <device>1</device>\r
- <low-latency>true</low-latency>\r
- <embedded-audio>true</embedded-audio>\r
- </decklink>\r
<screen>\r
- <device>1</device>\r
- <key-only>true</key-only>\r
+ <key-only>false</key-only>\r
</screen>\r
</consumers>\r
</channel>\r