[SOLVED] Separate blend functions for color and alpha via a custom shader (.effect)

Hi.

I took a deep dive into the Cocos code and it looks like it supports custom blend functions for color vs alpha. I’m trying to set up these values through a Cocos Creator shader definition file (.effects).

How do I accomplish this?
If not through the shader, can I somehow change these settings as part of the draw call?

Thanks.

I’ve figured it out by looking at gizmo shader/effects definition. For the curious:

%{
  techniques: [
    {
      ...
      passes: [
        {
          ...
          blendEq: add
          blendSrc: srcAlpha
          blendDst: oneMinusSrcAlpha
          blendAlphaEq: add
          blendSrcAlpha: one
          blendDstAlpha: oneMinusSrcAlpha
        }
      ]
    }
  ]
1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.