blending

Blending with GPUImage: How to control the position of the second image on top of the first

纵饮孤独 提交于 2019-12-11 23:34:49
问题 I use the following code to blend two images using GPUImage framework by Brad Larson. Is there a way to control the position of the topImage relatively to the baseImage? Now, it places topImage on the middle of baseImage. GPUImageMultiplyBlendFilter *overlayBlendFilter = [[GPUImageMultiplyBlendFilter alloc] init]; GPUImagePicture *pic1 = [[GPUImagePicture alloc] initWithImage:baseImage]; GPUImagePicture *pic2 = [[GPUImagePicture alloc] initWithImage:topImage]; [pic1 addTarget

What is the formula for extracting the src from a calculated blendmode?

一个人想着一个人 提交于 2019-12-11 08:47:58
问题 How does one go about using a alpha blending formula to achieve the src rgb color from the resultant of the 2 blended together 回答1: Well, you can just reorder the alpha blending equation Value = (1 − α ) · Value 0 + α · Value 1 However, there are four variables in that equation: α , Value , Value 0 and Value 1 . You need to know three of them to calculate the fourth. So in your case you know the resulting color, Value , the α and maybe Value 0 . You can then reorder the equation as follows: −

Blend negative value into framebuffer 0 opengl

不想你离开。 提交于 2019-12-11 06:45:34
问题 The program renders a bunch of things into an intermediate framebuffer that uses an unsigned normalized texture to store the data. The intermediate framebuffer is blended with the default framebuffer. The pixel shader used to render the intermediate for the blend with framebuffer 0 is the following: #version 300 es precision mediump float; out vec4 fragColor; in vec2 texCoords; uniform sampler2D textureToDraw; void main() { vec4 sampleColor = texture(textureToDraw, texCoords); fragColor =

iOS Sprite Kit why can't I repeat colorizeWithColor using white color?

ぐ巨炮叔叔 提交于 2019-12-09 15:28:31
问题 I'm experimenting with ways of selecting sprite nodes using methods other than scale. The one method that I like the most is colorize with white, which highlights the node visibly. However, I cannot seem to be able to replicate the colorize with white behavior more than once. Why can't I apply colorizeWithColor using white color more than once? These two method calls are identical, except for the color used. If I use red, gray, etc, the node responds by flashing for each touch. But If I use

ffmpeg screen blending mode makes transparent png pink

◇◆丶佛笑我妖孽 提交于 2019-12-09 05:50:53
问题 I have a sequence of PNG files with transparency - I'd like screen-blend them on top of a video ffmpeg -i video.mp4 -i "Images/%03d.png" -filter_complex "blend=all_mode='screen':all_opacity=0.7" output.mp4 the images are indeed merged on top of the video but with a pink overlay ?! I also tried to add "-vcodec png" and "-vcodec libx264" and to try a .mov video but got the same result. ffmpeg version N-58061-g5231eec Copyright (c) 2000-2013 the FFmpeg developers built on Nov 14 2013 05:35:15

Why doesn't alpha blending work in ortho?

时光总嘲笑我的痴心妄想 提交于 2019-12-08 05:23:00
问题 This is how I turn on ortho projection after drawing 3D objects: glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0,Screen_Width,Screen_Height,0,0,1); And this is how I turn on blending and draw textures in ortho after drawing 3D objects: glEnable(GL_TEXTURE_2D); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glColor4f(1,1,1,1); glBindTexture(GL_TEXTURE_2D,Texture1); glBegin(GL_QUADS); //draw 1st quad glEnd(); glBindTexture(GL_TEXTURE_2D,Texture2); glBegin(GL

How to draw a UILabel with a different blend mode in draw(_ rect: CGRect) in Swift

一曲冷凌霜 提交于 2019-12-07 18:08:59
问题 So I have a UILabel that is being drawn on top of a gradient image (that is a UIImageView ). It looks sorta like this: I'm trying to change the blendMode of the graphics context in the UILabel 's draw(_ rect: CGRect) function so that it draws the label but blended with the background with a softLight blending mode. Here is what I want it to look like: Here is the code I have in the draw(_ rect: CGRect) function: override func draw(_ rect: CGRect) { // Drawing code if let context =

iPhone OpenGL ES 2.0 blending with Cocos2D gives unexpected results

Deadly 提交于 2019-12-07 10:24:52
问题 I have very simple CCScene with ONLY 1 CCLayer containing: CCSprite for background with standard blending mode CCRenderTexture to draw paint brushes, with its sprite attached to root CCLayer above background sprite: _bgSprite = [CCSprite spriteWithFile:backgroundPath]; _renderTexture = [CCRenderTexture renderTextureWithWidth:self.contentSize.width height:self.contentSize.height]; [_renderTexture.sprite setBlendFunc:(ccBlendFunc){GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA}]; [self addChild:_bgSprite

Libgdx 3D Texture Transparency

最后都变了- 提交于 2019-12-07 10:20:41
问题 I'm having a problem with a texture on a cylinder. Basically it is a coin with a texture on it, I have done this before as demo but lost the code. Now the problem I'm facing is that I cant get the edge of the coin to be transparent anymore. The transparent parts of the png appear white on the cylinder, or even the box I tried. I enabled G20.GL_Blend, have the blending function with alpha_src and one_minus_alpha_src, enabled something like texture_2d. (Srry for the wrong variable names, only

Blending with HTML background in WebGL

扶醉桌前 提交于 2019-12-07 05:17:19
问题 I am drawing flat colors and textures into WebGL canvas. My colors and textures have varying alpha values and I want them to be blended correctly. I want to have transparent background (they should be blended with HTML content, which is under canvas). In WebGL, I use gl.clearColor(0, 0, 0, 0); gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA); gl.enable(gl.BLEND); It works correctly, when HTML background is black. But when I set a JPG pattern as a background of , I draw black triangle (alpha