2022 Developer Survey is open! Take survey.

Questions tagged [alpha-blending]

Alpha blending is the process of combining a translucent foreground color with a background color, thereby producing a new blended color.

Filter by
Sorted by
Tagged with
1 vote
2 answers
29 views

Does OIT Rendering work for semi-transparent textures with opaque parts?

I'm Work ing on a minecraft-like game (in OpenGL with c++) and I'm tryping to Implement Transparency for Blocks like windows, ice, leafs and water. I've tried to implement Weighted Blended Order-...
user avatar
  • 43
0 votes
1 answer
13 views

Math function equivalence for deferred transparency blending

if one consider the following blending operation: color1*src_alpha blended with color2*(1-src_alpha) Where ...
user avatar
  • 27
0 votes
0 answers
14 views

After drawing the scene with the deferred shader, I want to draw an object to be alpha blended, but it doesn't work

After drawing the scene with the deferred shader, I want to draw an object to be alpha blended, but it doesn't work. This is the current drawing order ...
user avatar
0 votes
0 answers
43 views

Question about making alphamaps

I made an alpha map by picking terrain for texture splatting. Using only one texture was successful, but trying to use more than one texture caused a problem. The second alphamap has the data of the ...
user avatar
0 votes
1 answer
47 views

Rendering order objects with transparency?

I do not know if this question might have been asked before, but which method for rendering transparency is more efficient in terms of less lag?: Rendering the scene from front to back with respect ...
user avatar
0 votes
1 answer
26 views

Drawing multiple simulation ticks in a single render frame

I have a 2D fixed-timestep simulation (a bunch of moving sprites) that ticks several times per render frame. I would like to render the state of each tick, so that all the ticks between render frames ...
user avatar
2 votes
0 answers
45 views

OpenGL : Blending & feedback effect

I'm struggling on a simple project, as an example/sandbox, I'm rendering a small oscillating rectangle on my output. I'm not using glclearcolor() but instead, on ...
user avatar
  • 21
1 vote
0 answers
59 views

Blue color instead of alpha using Alpha Blending

I am testing rendering with alpha blending state according to this guide. The aim is to add snow on terrain grass texture. Finally, I got the wrong result -- the blue color fillings up all alpha = 0 ...
user avatar
1 vote
1 answer
506 views

How front-to-back blending works?

I would like to implement dual depth peeling in my engine. I read the original paper and examined the corresponding source code. I understand the algorithm, except how the blending works, especially ...
user avatar
  • 31
0 votes
1 answer
40 views

How to perform alpha blending on saved raw argb videos(a image and a video will also work) using direct3d9 , direct3d10 or direct3d11?

I'm trying to perform alpha blending on videos using direct3d11. I've wrote the code snippet below to achieve this. I've tried to read the video file out2.argb frame by frame and store it in the ...
user avatar
0 votes
0 answers
32 views

Strange deviations while implementing alpha compositing

I've been trying to create my own 2d renderer for my game (for learning purposes) and I'm trying to implement alpha compositing. The formula I'm using is very trivial, which is ...
user avatar
  • 59
2 votes
0 answers
52 views

How to apply a color transform to textures when using pre-multiplied alpha?

I'm trying to apply a color map to my textures. The map is a 4x4 matrix that adjusts the contribution of each RGBA channel returned from the fragment shader. My texture needs to use pre-multiplied ...
user avatar
  • 121
0 votes
1 answer
38 views

Transparency fog performance

Old games use Distance Fog to limit the draw distance and decrease the number of polygons drawn. This is usually done by lerping the color to the fog color. But what if this color is full ...
user avatar
  • 641
0 votes
1 answer
65 views

Unity Shader Blend like ugui Outline

Unity UGUI Outline it create fourfold vertexs, So I wirte shader to optimization ( vertex only create once ), And I want to Keep one pass . (one drawcall) There ...
user avatar
  • 109
2 votes
1 answer
375 views

Additive Blending and Gamma Correction

Should one do additive blending (aka lightmapping) in linear space? I tried doing it in linear space, and it became, well, linear and bland, losing that cool HDR-style bloomy effect. Is there some ...
user avatar
0 votes
0 answers
111 views

Part of the back side of a transparent object disappears

I did some blending and culling to get the image below. As you can see, it is messed up. On the right side of the image, only the front side of the mesh shows. On the left side of this image, it ...
user avatar
0 votes
1 answer
374 views

Alpha Blending in Software with Gamma Correction

How does one efficiently implement alpha blending, without botching gamma? Alpha blending is basically the following expression: ...
user avatar
1 vote
1 answer
238 views

How to create post-processing effects in Slick2D?

As I get closer and closer to the end of the feature development for my game and the beginning of the graphical overhaul, I keep thinking of ideas for graphical effects that would make my game even ...
user avatar
0 votes
1 answer
1k views

How to get rid of the white border/background on my png image?

I am making a game using pyGame; it is basically a space invader game, with a tank. As we can see, this tank image I have has white borders / a white background, which I really want to get rid of. I ...
user avatar
  • 103
0 votes
1 answer
2k views

HLSL Manual Alpha Blending

I'm trying to do alpha blending manually because I only want to apply alpha blending on certain pixels. Underlying is the texture I'm writing to. This is what I got so far, but it doesn't give the ...
user avatar
  • 193
1 vote
1 answer
1k views

Howto apply alpha value (Color) to a sprite in libgdx

Howto apply alpha to a sprite so it will work. With the following code, the sprite still is completely visible. Can someone help me ? ...
user avatar
0 votes
1 answer
433 views

Remove background from sprite sheet after splitting

I am using libgdx to implement a Parallax background. Now I need to show some animated object over the background. I downloaded a sprite sheet(with images of objects on white background), and split it ...
user avatar
0 votes
3 answers
3k views

How to achieve this additive blending effect in Unity shader?

I want to achieve something like this using blending I thought that it might be a simple additive shader but after using Blend One One or Blendop Add I get something like this
user avatar
  • 138
0 votes
2 answers
133 views

Alpha Blending older Images

I am working on re-writing an old game, and have faced some issues with the older images that were used, the first thing we done was convert all the old images and set the alpha channel on black ...
user avatar
  • 101
0 votes
1 answer
1k views

DX11: Alpha blending not working with textured quads

A bit novice on directx11. I am rendering some textured quads out of PNG files (with alpha transparency) and get some inconsistency with my alpha blending. I have a background changing color ...
user avatar
1 vote
1 answer
338 views

Show only some parts of a point cloud. OpenGl4

I am developing an opengl 4.0 app which is showing a point cloud. In the other hand, I have an array "pos" where I have some x,y,z positions: ...
user avatar
3 votes
0 answers
35 views

Blending Lights Into An Image Pulled From Memory (2d)

The circumstances to why I am forced to do things this way are a bit weird, without going into them, I have the following situation: I have a pointer that points to image data arranged in the form ...
user avatar
1 vote
1 answer
1k views

How can i make fade in/out of the alpha color of a material from black to none black?

This is script is attached to a black plane. I have a plane and i added to it a material and the plane is in black. When running the game the alpha color of the plane material is changing slowly. The ...
user avatar
0 votes
1 answer
261 views

HDR alpha blend

How do I blend two colors using SrcAlpha and OneMinusSrcAlpha when I have HDR range (rgb and a values can be > 1)? The typical formula for non-HDR is (src * srcAlpha) + (dst * (1.0 - srcAlpha)) but ...
user avatar
  • 117
0 votes
1 answer
392 views

DirectX 11 Sprite Alpha (Invalid? + Bad Quality)

I have a bug with a texture font. This is the texture file in photoshop: This is the result I am getting: The alpha from 0 and 1 shows weird artifacts as the final result, alongside the low quality ...
user avatar
1 vote
1 answer
252 views

How to blend the surface with HTML5 canvas?

I can simply blend the surface in GameMaker using these codes: ...
user avatar
1 vote
0 answers
41 views

Fallback for R32F alpha blending

I'm rendering an aggregation of value into an R32F format texture, using alpha blending to accomplish the sum operation. R32F alpha blending is not supported on all hardware. What kind of fallback ...
user avatar
3 votes
0 answers
2k views

Overlap transparent particles without blending? (Unity)

I'm trying to create a continuous output of light from an object (like the exhaust of a space ship), and I thought I'd use particles to achieve this. But I'm running into a problem with alpha blending....
user avatar
  • 331
0 votes
1 answer
205 views

Use an image as mask only where pixels are opaque

We are into a game where to build our tile map, we carve on an image with a mask (At first the whole map is an image, and we create holes on it with tiles to create the map and le the background show. ...
user avatar
  • 1,075
3 votes
0 answers
549 views

Enabling OpenGL lighting seems to disable blending

I have the following code to set up for some 2D drawing using OpenTK. I originally wrote it without any lighting considerations, but later added the lighting block. This version of the code uses ...
user avatar
0 votes
1 answer
882 views

Layers in PixiJS

I am using the PixiJS framework to create a 2D RPG Game. How can I create a PIXI.Container with a transparent background which I can render on top of my main stage ...
user avatar
1 vote
0 answers
62 views

Controllable color blending?

I'm relatively new to color blending in DirectX, and I'm hoping there is a relatively simple answer to this question. I am targeting Direct10.1. What I am trying to achieve is colour blending of two ...
user avatar
  • 181
1 vote
1 answer
841 views

Change the alpha blending color of scaled textures

It looks like semitransparent pixels are blended with while color when textures are drawn scaled. It is very noticeable and looks ugly when textures are drawn on dark background. ...
user avatar
0 votes
1 answer
2k views

C++ Additive Blending Algorithm 2d Game

I was wondering if anyone could shed any light on whats going wrong with my additive blending here, I think I'm nearly there, currently my outcome is black squares. I have tried using both the formula'...
user avatar
3 votes
0 answers
403 views

Smoothly fitting texture tiles using alpha gradient on edges

I'm trying to draw a background texture with tiles that I'll rotate and mirror to create a maze. Here is a sample tile: As you can see, I use an alpha gradient on the borders. If I'd use a sharp ...
user avatar
  • 193
2 votes
1 answer
100 views

Can I use a BlendState object to emulate a draw call's blending color?

I'm working on a lighting system for a tile-based game. What I want to do is draw my tiles to the screen, then draw a single Texture2D object (my light map) over top of them. However, doing it in ...
user avatar
0 votes
0 answers
161 views

LWJGL 3 - Random Sprites Don't Blend

Some of my sprites don't "Blend" in with tiles behind them Z-wise. glEnable(GL_DEPTH_TEST); Depth testing is enabled and works. ...
user avatar
  • 1,106
0 votes
0 answers
121 views

ETC1 texture opacity

I'm using the cocos2d-x engine and want to support etc1 on android devices for my game. For ETC1 i'm using the mali compression tool, and GLSL. Everything is working, but I can't change the opacity ...
user avatar
1 vote
0 answers
116 views

Alpha blending is too smooth

I got the exercise to create a color map from a heightfield and given normals with alpha blending. Therefore I have to blend 4 textures (deep-flat, deep-steep, high-flat, high-steep) depending on the ...
user avatar
0 votes
1 answer
153 views

OpenGL Blending Format

In OpenGL, is there a format for a texture in glTexImage2D that prevents blending, or do you have to disable it using glDisable(GL_BLEND). Reason for use is that I would like to store additional data ...
user avatar
3 votes
1 answer
726 views

DirectX11 Equivalent of OpenGL code

I am currently porting parts of my engine over to D3D11 from OpenGL and was trying to figure out how I would accomplish the following blending functions in D3D11. ...
user avatar
  • 113
1 vote
1 answer
80 views

Pack four alpha maps into one

I have read an article about texture splatting that says: Because the alphamap only has to be in a single channel of a texture, we can pack up to four alphamaps into a single texture – one in red,...
user avatar
1 vote
1 answer
1k views

Unity3D setting blend mode in shader using vertex data

I'm porting a game from iOS / Obj-C / OpenGL ES 2.0 to Unity. I have a procedural mesh script that generates a batch of quads that need to blend together to create a game board. Some of the quads ...
user avatar
  • 1,891
1 vote
0 answers
671 views

DirectX 11 GenerateMips only works with premultiplied alpha?

The GenerateMips method in the ID3D11DeviceContext allows generation of mipmaps at runtime, which is fine for fully opaque textures. However, when this method is used with transparent textures that do ...
user avatar
0 votes
1 answer
355 views

Artefacts when drawing textures

I am working on a level-based android game. The level is constructed of many blocks, all drawn with the same texture. Until now I didn't have any problems with drawing the different textures next to ...
user avatar
  • 155