GLPaint白色背景 [英] GLPaint with white background

查看:100
本文介绍了GLPaint白色背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过逆向工程GLPaint在白色背景上绘制.我已经遍历了kSaturation,kLuminosity和glBlendFunc的每种组合,并且几乎可以想到画笔组合的每种组合(黑底白字,白底黑字,反面白字,别名/无别名等),但是没有t偶然发现了想要的效果.

I'm trying draw on a white background by reverse engineering GLPaint. I've gone through every combination of kSaturation, kLuminosity and glBlendFunc, AND just about every combination I can think of for brush texture (black on white, white on black, white on trans, alias/no alias, etc), but haven't stumbled upon the desired effect.

我能达到的最好效果是使用反白变圆,以及glBlendFunc(GL_ SRC_ ALPHA,GL_ ONE_ MINUS_ SRC_ ALPHA),但这仍然给我带来沉闷的色彩和半反色外部位被解释为黑色(即带黑色边缘的暗绿色,而不是带透明边缘的鲜绿色).好像它仍然假设我在黑色背景上.

The best I've been able to achieve is with a white-on-trans circle, with glBlendFunc (GL_ SRC_ ALPHA, GL_ ONE_ MINUS_ SRC_ ALPHA), but this still gives me a dull colour, and the semi-trans outer bits are interpreted as black (i.e. dull green with black edges, instead of vibrant green with transparent edges). It's as though it still assumes I'm on a black background.

有什么建议吗?


(来源: straandlooper.com )


(source: straandlooper.com)

推荐答案

我相信这是您希望它在White上可以使用的功能: glBlendFunc(GL_ONE,GL_ONE_MINUS_SRC_ALPHA);

I believe this is what you want for it to work on White: glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);

然后使用一个白色的'Particle.png'圆圈,使其逐渐透明(您的最佳"示例).

Then use a white 'Particle.png' circle that feathers out to transparency (your 'best' example).

这应该得到预期的结果.

This should give in the desired result.

这篇关于GLPaint白色背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆