'Sample Triangle Region from 2D Texture in Metal/Swift
To the best of my knowledge, texture sampler functions only allow sampling of coordinate points as oppose to regions across the texture. I instead need to sample the triangle region to then extract average colour. Is there a mechanism to do this efficiently on metal?
I have also looked into CoreImages, but masking an entire image especially given the triangle region being small is not ideal. Reducing of the rectangle of best fit speeds things up but I would imagine going the Metal way would be much faster, especially given that I want to do this for many triangular regions. Would really appreciate guidance on this front.
Thanks an enormous amount!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
