Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17625

Strange deviations while implementing alpha compositing

$
0
0

I've been trying to create my own 2d renderer (for learning purposes) and I'm trying to implement alpha compositing. The formula I'm using is very trivial, which is `color = alpha * src + (1 - alpha) * dest`.

Everything seemed to be going and looking well until I started comparing it to existing 2d canvas implementations. I've tested my canvas against OpenGL, the JS canvas, and a BufferedImage in Java, and they have all been getting slightly different results to the formula I use.

For example, let's say I have a background with a red value of 1, and …


Viewing all articles
Browse latest Browse all 17625

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>