Results 1 to 3 of 3

Thread: No cl_blend_equation_multiply?

  1. #1

    Default No cl_blend_equation_multiply?

    Code:
    enum CL_BlendEquation
    {
    	cl_blend_equation_add,
    	cl_blend_equation_subtract,
    	cl_blend_equation_reverse_subtract,
    	cl_blend_equation_min,
    	cl_blend_equation_max
    };
    Is this a possibility? Thanks!

  2. #2
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    OpenGL does not support equation multiply.

    See OpenGL Specification 3.3, Table 4.1

    (It might be possible that you can write a GLSL shader to perform the same effect using framebuffers - I do not know)

  3. #3

    Default

    If you just want to draw some sprites multiplied to the framebuffer content you may use the following code:

    Code:
    CL_BlendMode mode;
    mode.set_blend_equation(cl_blend_equation_add, cl_blend_equation_add);
    mode.set_blend_function(cl_blend_dest_color, cl_blend_one_minus_src_alpha, cl_blend_dest_color, cl_blend_one_minus_src_alpha);
    gc.set_blend_mode(mode);
    Note that in this case you should use sprites with premultiplied alpha (See 'import_desc' argument in CL_Sprite constructors).

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •