Texture Brush (Drawing Application ) Using Metal

前端 未结 1 1513
太阳男子
太阳男子 2021-01-07 15:35

I am trying to implement a metal-backed drawing application where brushstrokes are drawn on an MTKView by textured square repeatedly along a finger position.

I am

相关标签:
1条回答
  • 2021-01-07 16:34

    I think you need to draw the brush squares to a separate texture, initially cleared to transparent, without blending. Then draw that whole texture to your view with blending.

    If you draw the brush squares directly to the view, then they will accumulate. After you draw square 1, it's part of the image. Metal can no longer distinguish it from anything else that was already there. So, when you draw square 2 overlapping it, it will blend with what's already there, including square 1.

    0 讨论(0)
提交回复
热议问题