您的位置:首页 > 移动开发 > Cocos引擎

cocos2dx去掉黑色背景----ccBlendFunc的使用

2014-06-10 01:07 453 查看
// 黑暗中的带背景图片纹理的光圈~

// ccBlendFunc tmp_oBlendFunc = {GL_DST_COLOR, GL_ZERO};

// 黑暗中的黄色光圈(前面表示upper,后面表示lower)~

// ccBlendFunc tmp_oBlendFunc = {GL_ONE, GL_ZERO};

// 黑暗中的黄色光圈(前面表示upper,后面表示lower)~

// ccBlendFunc tmp_oBlendFunc = {GL_DST_ALPHA, GL_ZERO};

// 默认的 blend 配置~

// ccBlendFunc tmp_oBlendFunc = {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA};

// premultiplied~

// ccBlendFunc tmp_oBlendFunc = {GL_ONE, GL_ONE_MINUS_SRC_ALPHA};

// 仅背景图片有所显示~

// ccBlendFunc tmp_oBlendFunc = {GL_ZERO, GL_ONE};

// 黄色光圈区域亮度加强(2倍的强度)~

// ccBlendFunc tmp_oBlendFunc = {GL_DST_COLOR, GL_SRC_COLOR};

// 正片叠底~

// ccBlendFunc tmp_oBlendFunc = {GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA};

// 类似柔光:黄色光圈区域亮度加强,其他地方也不会显示为纯黑(接近我想要的想过了)~

// ccBlendFunc tmp_oBlendFunc = {GL_DST_COLOR, GL_ONE};

// Screen~

// ccBlendFunc tmp_oBlendFunc = {GL_ONE_MINUS_DST_COLOR, GL_ONE};

// Linear Dodge~

// ccBlendFunc tmp_oBlendFunc = {GL_ONE, GL_ONE};

// 很类似柔光效果,这个也最接近我的需求了~

ccBlendFunc tmp_oBlendFunc = {GL_SRC_ALPHA, GL_ONE};

// GL_ONE_MINUS_SRC_ALPHA 注定是不行的(光晕中心会被模糊掉)~

// ccBlendFunc tmp_oBlendFunc = {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA};

// 标准的正片叠底~

// ccBlendFunc tmp_oBlendFunc = {GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA};

// 下面两种是差不多的~

// ccBlendFunc tmp_oBlendFunc = {GL_ZERO, GL_SRC_COLOR};

// ccBlendFunc tmp_oBlendFunc = {GL_DST_COLOR, GL_ZERO};

以下可以用于cocos2dx去掉黑色背景:
ccBlendFunc tmp_oBlendFunc = {GL_ONE_MINUS_DST_COLOR, GL_ONE};
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: