}\r
else\r
{\r
- switch(item.blend_mode)\r
- {\r
- case blend_mode::replace: \r
- ogl.blend_func_separate(GL_ONE, GL_ZERO, GL_ONE, GL_ONE);\r
- break;\r
- case blend_mode::normal:\r
- default:\r
- ogl.blend_func_separate(GL_ONE, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);\r
- break;\r
- }\r
+ ogl.blend_func_separate(GL_ONE, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); \r
}\r
\r
// Setup image-adjustements\r
\r
if(layer.front().blend_mode != blend_mode::normal && has_overlapping_items(layer))\r
{\r
- auto layer_draw_buffer = std::make_pair(0, create_device_buffer(4)); // int is fields flag\r
+ auto layer_draw_buffer = create_device_buffer(4); // int is fields flag\r
auto layer_blend_mode = layer.front().blend_mode;\r
\r
BOOST_FOREACH(auto& item, layer)\r
{\r
- if(layer_draw_buffer.first & item.transform.field_mode)\r
- item.blend_mode = blend_mode::normal; // Disable blending and just merge, it will be used when merging back into render stack.\r
- else\r
- {\r
- item.blend_mode = blend_mode::replace; // Target field is empty, no blending, just copy\r
- layer_draw_buffer.first |= item.transform.field_mode;\r
- }\r
-\r
- draw_item(std::move(item), *layer_draw_buffer.second, local_key_buffer, layer_key_buffer); \r
+ item.blend_mode = blend_mode::normal; // Disable blending and just merge.\r
+ draw_item(std::move(item), *layer_draw_buffer, local_key_buffer, layer_key_buffer); \r
}\r
\r
render_item item;\r
item.pix_desc.pix_fmt = pixel_format::bgra;\r
item.pix_desc.planes = list_of(pixel_format_desc::plane(channel_.get_format_desc().width, channel_.get_format_desc().height, 4));\r
- item.textures = list_of(layer_draw_buffer.second);\r
+ item.textures = list_of(layer_draw_buffer);\r
item.transform = frame_transform();\r
item.blend_mode = layer_blend_mode;\r
\r
" \n" \r
"vec4 blend(vec4 fore) \n"\r
"{ \n"\r
- " if(blend_mode == 29) // replace \n"\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 fore + (1.0-fore.a)*back; \n"\r