3.8.7两个Effect图片重叠时变透明

节点大概是
A(effect图片实例1)
B(背景图)
C(effect图片实例2)

渲染时候,C和A重叠的部分,希望是正常展示完整的C,按理说A应该被B挡住了,但是如果AC的位置重叠,重叠的那部分现在展示的是B,就是C的一部分变透明了

effect开头是:

CCEffect %{
techniques:

  • name: opaque
    passes:
    • vert: vs:vert
      frag: unlit-fs:frag
      properties: &props
      mainColor: { value: [0.2, 0.4, 0.9, 1], editor: { type: color } }
      params: { value: [0.5, 0, 1, 0.6] }
      planetType : {value: [0.2, 0]}
      lightDir: { value: [0.5, 0.5, 1, 0] }
      blendState:
      targets:
      • blend: true
        blendSrc: src_alpha
        blendDst: one_minus_src_alpha
        blendSrcAlpha: src_alpha
        blendDstAlpha: one_minus_src_alpha
  • name: transparent
    passes:
    • vert: general-vs:vert # builtin header
      frag: unlit-fs:frag
      blendState:
      targets:
      • blend: true
        blendSrc: src_alpha
        blendDst: one_minus_src_alpha
        blendSrcAlpha: src_alpha
        blendDstAlpha: one_minus_src_alpha
        properties: *props
        }%

有没有大佬帮忙能看看

改混合模式,blendSrc: one
blendDst: zero

1赞

感谢大佬,能给个原因关键词吗,小弟ai一下学习学习

你看下混合模式,源因子和目标因子,不同的组合有不同的表现形式