The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
1answer
98 views

Basic terrain shader without using external texture

I have this: (Right now I have the height map in a x*x size 2D array and a 1D vector too.) What I am trying to achieve is something like this: Without using any textures, only plain colors. So ...
1
vote
0answers
93 views

How to setup a particular blend state where the alpha channel is additive?

I would like to set a blend state to be "additive" and do the following: Result.R = Source.R + Destination.R; Result.G = Source.G + Destination.G; Result.B = Source.B + Destination.B; Result.A = ...
5
votes
1answer
170 views

“Normal” Blend Mode with OpenGL Trouble

I've been having a lot of trouble trying to get a OpenGL blend function to work as I'd expect it to with like what I'd expect (or from any sensible image editing program). As an example, I'll use ...
0
votes
1answer
68 views

Algorithm for texture blending modification

Im currently writing a terrain editor for my game (for the record: no commercial intentions) and after having implemented the terrain morphing to my liking im now working on the texturing of said ...
2
votes
1answer
62 views

Additive blending problems

I'm trying to get the blend of two images to work without luck. I have a render target on which I have an object, then I want to render again the same object in same position but with different ...
0
votes
1answer
250 views

What is “ping pong” in the context of graphics rendering?

I have to render a scene, once per light, and blend the result of the various passes. I heard and read that one way to increase performances and render targets to use would be ping pong. I'm new to ...
2
votes
1answer
86 views

How to blend multiple normal maps?

I want to achieve a distortion effect which distorts the full screen. For that I spawn a couple of images with normal maps. I render their normal map part on some camera facing quads onto a ...
3
votes
1answer
211 views

Best way to blend colors in tile lighting? (XNA)

I have made a color, decent, recursive, fast tile lighting system in my game. It does everything I need except one thing: different colors are not blended at all: Here is my color blend code: ...
0
votes
1answer
60 views

Blending issue with framebuffer

I'm trying to get some particles to work properly - they should blend among themselves but not with the background color. For this I'm using additive blending, textures with premultipled alpha and set ...
1
vote
1answer
304 views

Best Way to Render Multiple Lights with Deferred Rendering and GLSL

So I've implemented deferred rendering in GLSL and OpenGL for my game engine. I want to blend together multiple lights, but the performance is a bit sub-par. How I'm doing it now is the following: ...
2
votes
0answers
95 views

2D Animation Blending [closed]

I have been researching on 2D Animation Blending technique similar to what Unity 4.3 has. I know how Animation blending in 3D works but I have no idea how it works in 2D. How does 2D Animation ...
1
vote
1answer
1k views

Procedural terrain - how to blend textures between dynamic meshes

I think I should structure this question better. I'm developing a procedural terrain structured with voxel chunks. Every chunk: contains a NxNxN voxel array generated with perlin noise 3d ...
0
votes
1answer
89 views

Blending and shadowmapping?

I am trying to implement shadow mapping, and currently I have 2 point lights and 1 global ambient light source and my rendering loop looks roughly like this (the details are not relevant): void ...
3
votes
2answers
277 views

Laser Beam End Points Problems

I am building a game in XNA that features colored laser beams in 3D space. The beams are defined as: Segment start position Segment end position Line width For rendering, I am using 3 quads: ...
2
votes
2answers
145 views

Replacing 4 additive sprite layers with a single shader. Just can't get it right

I'm using directx9 and have 4 textures I want to draw on top of each other. if I do this: PDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_SRCALPHA); ...
2
votes
1answer
275 views

What is this alpha blending result?

I'm having an exam soon and got a problem with one alpha blending exercise: BlendState BS3 { BlendEnable[0] = TRUE; SrcBlend[0] = ONE; SrcBlendAlpha[0] = ZERO; ...
3
votes
3answers
1k views

OpenGL additive blending not working as expected

I am trying to achieve additive blending with point sprites. When the sprites overlap, all I get is solid red, when I expect to get a smooth blend from red->yellow->white. My sprite texture has all ...
4
votes
2answers
714 views

blending with the foreground but not the background

I want to draw some very-semi-transparent objects on top of my scene and have them blend nicely with the other pixels in the scene, but not blend with the background; if I draw a semi-transparent ...
1
vote
0answers
57 views

Glowing Effect and Blending [duplicate]

I am using C++ and SDL and I am trying to get lines with a glowing effect as provided by the image of the game Defcon on the continental outlines. How could I achieve this glow and blend of the ...
2
votes
1answer
108 views

Independent blending with DXGI_FORMAT_R16G16_SINT

I'm implementing direct volume rendering engine with volume bricking, but I'm stuck with this problem: For each volume brick I render to color render target [CRT] (for visualization) and to data ...
0
votes
1answer
271 views

How can I draw a small bitmap on a larger bitmap at a particular position? (Canvas / SurfaceView)

I'm building a game that requires additive blending of colours for certain bitmaps. Say I have 4 different types object, there are maybe ten of each type on the screen with each type having a ...
1
vote
0answers
107 views

How to put OpenGL in a state for drawing blended, colored, nontextured polys?

Using OpenGL1.1 (sadly) I'm trying to draw a cube, which is colored and alpha blended. It is instead showing up as opaque black. Even without including alpha in the color it still shows up as opaque ...
0
votes
1answer
332 views

Incorrect colour blending when using a pixel shader with XNA

I'm using XNA 4.0 to create a 2D game and while implementing a layer tinting pixel shader I noticed that when the texture's alpha value is anything between 1 or 0 the end result is different than ...
4
votes
1answer
226 views

Premultiplied Alpha And Alpha Testing

I have a shader that is supposed to work with either alpha blending or alpha testing, but the color values being passed in are premultiplied alpha values. Is there an easy/standard way to have it ...
5
votes
1answer
504 views

What are the rest of the blending functions used for?

In general, I know of five ways to make use of blending functions (these are for OpenGL, but replace glBlendFunc() with SetRenderState(D3DRS_SRCBLEND) and SetRenderState(D3DRS_DESTBLEND) for DirectX): ...
1
vote
1answer
99 views

Drawing sprites messes up my model in XNA4

I have a model which draws correctly in XNA4. However if I try to add a background image (or any sprite), the rendering of my model is messed up. There are two problems with the rendering model is ...
0
votes
1answer
43 views

How to linearly blend between multiple points, deviating from a default point?

I have a set of 3D points that I need to "blend" between. Lets say I have points [A,B,C] and I have the amount I want to blend each as [0.5, 0.2, 0.8], how can I blend between these points with the ...
1
vote
1answer
108 views

How to linearly “blend” between multiple 3D points?

I have a set of 3D points that I need to "blend" between. Lets say I have points [A,B,C] and I have the amount I want to blend each as [0.5, 0.2, 0.8], how can I blend between these points with the ...
4
votes
2answers
964 views

Blending textures together, texture fade over / fade in

What is the best way to render a texture overlapping effect? Like in this example: I want either the grass to fade in to the snow texture, or the other way around. No rough edges. Somehow make ...
1
vote
1answer
175 views

Artifacts when draw particles with some alpha

I want to draw in my game some particles. But when I draw one particle above another particle, alpha channel from this above "clear" previous drawed particle. I set in OpenGL blend in this way: ...
2
votes
1answer
459 views

Blending colors on Surfaces in PyGame?

So I'm making a game in Python and PyGame. I have aliens and blocks that each adopt one of several colors; rather than make several copies of them in different colors, I plan on making the sprite ...
0
votes
1answer
241 views

Rendering two textures with blending and alpha test

What I am looking for is the following: I have a circle on a square image, alpha is 0 at the corners and also a square shadow, alpha is 0 everywhere else I would like to have as final result a ...
0
votes
1answer
1k views

Making a surface transparent from blackness of texture

I am making a "halo" shader in unity using GLSL. And I've come to a roadblock. What I need to do is take a texture, like the following, and make it transparent according to the darkness of it. And I ...
2
votes
1answer
2k views

Understanding how OpenGL blending works

I am attempting to understand how OpenGL (ES) blending works. I am finding it difficult to understand the documentation and how the results of glBlendFunc and glBlendEquation effect the final pixel ...
2
votes
1answer
221 views

Blending Two different animations

I'm sure there are articles around on this but I'm not really sure what they are called. animation blending tends to give me the blend between two different complete animation such as walk and run. ...
3
votes
0answers
492 views

AlphaToCoverage + Alpha Blending = Artifacts

I'm experiencing a strange problem using OpenGL SampleAlphaToCoverage mode. There are rendering artifacts when using alpha-blending on pixels that have been rendered using alpha-to-coverage - and I ...
1
vote
1answer
272 views

Why can't a blendShader sample anything but the current coordinate of the background image?

In Flash, you can set a DisplayObject's blendShader property to a pixel shader (flash.shaders.Shader class). The mechanism is nice, because Flash automatically provides your Shader with two input ...
9
votes
2answers
1k views

How to properly implement alpha blending in a complex 3D scene?

I know this question might sound a bit easy to answer but It's driving me crazy. There are too many possible situations that a good alpha blending mechanism should handle, and for each Algorithm I can ...
0
votes
2answers
655 views

XNA Subtract blending function doesn't work

I wanted to subtract a white image with black circle background from a picture to get a lighting circle here is the white image So I wrote this code spriteBatch.Begin(SpriteSortMode.Deferred, new ...
5
votes
2answers
476 views

How to draw efficiently large number of objects with alpha blending?

In a 3D game i have large no. of trees with alpha value. What is the efficient way to draw all? What i tried is Taking every tree as a object and draw according to its z value and using billboarding. ...
28
votes
5answers
9k views

How can I achieve a good fire effect with alpha blending and particles?

Using the following setting for the OpenGL particle effect: SRC: GL_SRC_ALPHA DST: GL_ONE Creates an additive blend, which looks spectacular on a black background but terrible on brighter colours, ...
3
votes
1answer
2k views

What is the AlphaToCoverage blend state useful for?

Alright, just finished most of my early UI stuff and I wanted the windows to have some transparency. So I expanded my application to initialize and bind blend states so that my UI shader could ...
3
votes
3answers
3k views

Alpha blending not rendering properly XNA 4.0

I'm trying to render a tree made out of 2 rectangles intersecting in the center at a 90degree angle. The texture has an alpha channel but which ever rectangle gets rendered second causes a weird ...
5
votes
2answers
686 views

Where can I find a good tutorial to replicate Game Maker's surfaces and blend modes in XNA?

I know Game Maker's surfaces exist in XNA (It's more the othe way around, XNA's surfaces exist in Game Maker), same thing for blend modes, since (I think) they both use DirectX. This is the question: ...
1
vote
1answer
637 views

How can I implement “cut outs” for lighting in OpenGL?

So, I'm working with OpenGL (I'm not exactly sure of the version), and I want to do an old-style lighting setup by essentially drawing a black rectangle over the screen, and drawing white circles over ...
9
votes
1answer
9k views

Blend Modes in Cocos2D with glBlendFunc

We've been trying to replicate the most common blending modes that are available in Photoshop and Quartz 2D, but we've only come up with 3 and that's after some long searching online. For anyone ...
8
votes
1answer
188 views

How to dynamically animate a part of a 3d model towards something

I'm curious about how this sort of animation is typically done code-wise. A few examples: A character picks something up - only hand is animated towards the target ...
0
votes
1answer
443 views

How can I make a 32-bit render target with a 16-bit alpha channel in Direct3D?

I want to create a render target that is 32-bit, with 16 bits each for alpha and luminance. The closest surface formats I can find in the DirectX SDK are: D3DFMT_A8L8 // 16-bit, 8 bits each for ...
3
votes
2answers
2k views

blending alpha textures in gluOrtho2D

i'm doing a simple game/application with some minimal 2d graphics: png textures and ploygons with standard glVertex calls my setting: glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(0, w, ...
9
votes
2answers
6k views

How do I use depth testing and texture transparency together in my 2.5D world?

Note: I've already found an answer (which I will post after this question) - I was just wondering if I was doing it right, or if there is a better way. I'm making a "2.5D" isometric game using OpenGL ...