Questions tagged [glblendfunc]

The glBlendFunc function specifies pixel arithmetic for OpenGL rendering. Used to define how blend works.

glBlendFunc — specify pixel arithmetic

C Specification

void glBlendFunc( GLenum sfactor, GLenum dfactor); void glBlendFunci( GLuint buf, GLenum sfactor, GLenum dfactor); Parameters

buf For glBlendFunci, specifies the index of the draw buffer for which to set the blend function.

sfactor Specifies how the red, green, blue, and alpha source blending factors are computed. The initial value is GL_ONE.

dfactor Specifies how the red, green, blue, and alpha destination blending factors are computed. The following symbolic constants are accepted: GL_ZERO, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_DST_COLOR, GL_ONE_MINUS_DST_COLOR, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA. GL_CONSTANT_COLOR, GL_ONE_MINUS_CONSTANT_COLOR, GL_CONSTANT_ALPHA, and GL_ONE_MINUS_CONSTANT_ALPHA. The initial value is GL_ZERO.

Description

Pixels can be drawn using a function that blends the incoming (source) RGBA values with the RGBA values that are already in the frame buffer (the destination values). Blending is initially disabled. Use glEnable and glDisable with argument GL_BLEND to enable and disable blending.

glBlendFunc defines the operation of blending for all draw buffers when it is enabled. glBlendFunci defines the operation of blending for a single draw buffer specified by buf when enabled for that draw buffer. sfactor specifies which method is used to scale the source color components. dfactor specifies which method is used to scale the destination color components. Both parameters must be one of the following symbolic constants: GL_ZERO, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_DST_COLOR, GL_ONE_MINUS_DST_COLOR, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA, GL_CONSTANT_COLOR, GL_ONE_MINUS_CONSTANT_COLOR, GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA, GL_SRC_ALPHA_SATURATE, GL_SRC1_COLOR, GL_ONE_MINUS_SRC1_COLOR, GL_SRC1_ALPHA, and GL_ONE_MINUS_SRC1_ALPHA. The possible methods are described in the following table. Each method defines four scale factors, one each for red, green, blue, and alpha. In the table and in subsequent equations, first source, second source and destination color components are referred to as Rs0Gs0Bs0As0, Rs1Gs1Bs1As1 and RdGdBdAd, respectively.

53 questions
0
votes
1 answer

Trying to use GLB file in flutter

I am Created a 3D model and exported the file in the extension .GLB I like to use that file in flutter is there any way to use. And I have tried with this dependencies model_viewer_plus: ^1.5.0, babylon_dart 1.1.2 and babylonjs_viewer 1.2.1 this and…
Vasanthan Raj
  • 126
  • 1
  • 9
0
votes
0 answers

Three JS export GLFT model doesn't look like in Blender Rendered Mode

I'm newbie to both 3JS and Blender , when I export my model to .glb , then import it to my 3JS project . But somehow they are not the same. In Blender Rendered Mode it look so smooth but in 3JS , all the color , the mesh , ... so terrible, what did…
0
votes
2 answers

glBlendFunc and alpha blending

I'm writing a application where a user is allowed to toggle between different shaders, and combinations of them. Thus i want to draw the exact same scene a multiple time. In the end, all the passes should be combined into one single output. To…
Donny
  • 549
  • 2
  • 10
  • 24
0
votes
1 answer

SCADA using Javascript?

Supervisory Control and Data Acquisition There is a way to make SCADA using javascript? I can create assets using Solidworks, and other apps..
musuyaba
  • 20
  • 4
0
votes
2 answers

Custom glBlendFunc a lot slower than native

I'm trying to do my own custom glBlendFunc through fragment shaders, however, my solution is a lot slower than the native glBlendFunc, even when they do the exact blending function. I was wondering if anyone had any suggestion on how to do this in a…
ronag
  • 49,529
  • 25
  • 126
  • 221
0
votes
1 answer

Creating an OpenGL texture with alpha using NSBitmapImageRep

I am loading a PNG using: theImage = [NSBitmapImageRep imageRepWithContentsOfFile:imagePath]; from which I can successfully create a gl texture and render correctly without any transparency. However, when I switch blending on…
Seamus
  • 1,107
  • 10
  • 22
0
votes
0 answers

I have some 3d Assets in .bob file format. Is there any way to open them?

I have some 3d Assets in .bob file format. Is there any way to open them ? These .bob file format comes with texture maps and .bin files
0
votes
1 answer

Sceneform load my model without basecolor texture

First I test my model .gltf with sceneform 1.5 and it looks very good: But when I use sceneform 1.17.1 or 1.15, the color of the gltf model is gone and it looks like this: I tried .glb and it's no different. But I got some .glb models from the…
0
votes
1 answer

Xamarin IOS Opentk - BlendFunc with transparent textures

I'm trying to render some label textures with transparent background using OpenTK in Xamarin. At first the labels seemed display properly (see picture 1) but when the view rotated, the some label background are not transparent any more (see picture…
Heobien
  • 70
  • 1
  • 6
0
votes
1 answer

Cannot Upload .GLB to Wordpress Media Location

This is not a quick failure, I have spent a totally of 5 completely full days trying to figure this out. Initially I was limited by file size and then file type; in which I removed the Wordpress restrictions and am now "capable" of uploading my…
Chad Tattini
  • 15
  • 1
  • 5
0
votes
1 answer

How does the OpenGL Blend equation work?

opengl ver: opengl es 1.x platform: iphone The blending equation: (Rs Sr + Rd Dr, Gs Sg + Gd Dg, Bs Sb + Bd Db, As Sa + Ad Da) How does it work? I don't understand if I set both src and des to GL_ONE, and I have src color red (255,0,0) and des…
Leo
  • 385
  • 5
  • 17
0
votes
0 answers

Glowing particles opengl

My particles are not glowing. I searched on the internet that its been done with glBlendFunc(GL_SRC_ALPHA, GL_ONE); This piece of code changes my particles, but it is not glowing. Can anybody see what is wrong in my code? Here are the relevant…
M.Tlan
  • 33
  • 7
0
votes
0 answers

How to make transparent background of sprite in cocos2d-x

I'm going to extract the pictures from Heroes III def files. All pictures extracted as a bmp file with blue background. I want to use these pictures in my cocos2d-x project for demo purposes. How can I use program (GLBlendFunc or Shader?) to make…
kode cooper
  • 13
  • 1
  • 4
0
votes
1 answer

OpenGL ES 2.0 blending alpha limit

Is there a blending method in OpenGL ES 2.0 for setting a limit on the blended alpha value? I want to achieve an effect where textures get blended normally when drawn on top of each other, until an alpha limit is reached, at which point the blended…
Amendale
  • 317
  • 3
  • 19
0
votes
1 answer

how implement own blend function?

I want to implement the following blend function in my program which isn't using OpenGL. glBlendFunc(GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA); In the OpenGL realtime test Application I was able to blend with this function colors on a white background.…