简体   繁体   中英

OpenGL - glBlendFunc

I've been trying to find some concrete maths behind the innerworkings of glBlendFunc.

Just to clarify, I know that the blending equation is:

srcChannels * srcFactor + dstChannels * dstFactor = channelsRendered.

my question is, are srcChannels, dstChannels and channelsRendered the 3-vector (r,g,b) or the 4-vector (r,g,b,a)?

since (0.2, 0.2, 0.2, 1.0) and (1.0, 1.0, 1.0, 0.2) should look the same, there may be room for ambiguity here.

glBlendFunc works on all four channels; glBlendFuncSeparate separates RGB from alpha.

The glBlendFunc reference page describes all the different blend modes and the operations applied to the different channels. glBlendFuncSeparate does the same including operations on the alpha channel.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM