PDA

View Full Version : blending



08-21-2006, 12:15 AM
I'm creating a billboard using blending. The problem is there is a white outline around my blended image. Its almost correct but not quite.

Apply the image to a clear polygon.

When I use the opengl profiler program on the mac to look at the texture memory I don't see the white outline. No white outline in the photoshop file. The photoshop file has a transparency layer that seems to work.

If I set glMaterial to 0s it makes the white a gray. Set clear color to zero and did not change it...

//glMaterial set all 0s..
//transparent polygon

glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glDepthMask(GL_FALSE);

//draw stuff

glDisable(GL_BLEND);
glDepthMask( GL_TRUE );

Komat
08-21-2006, 02:50 AM
What color is contained in the image in the regions that are removed by the transparency layer in the photoshop? Because of the bilinear filtering there may be pixels at the boundaries of the image that contain color which is mix between pixel that is visible in the photoshop and pixel that is invisible in the phototshop. Such pixels will have partially transparent alpha so they will be visible and may cause such outline.

08-21-2006, 09:55 AM
I'll have to check.

I created the file in photoshop elements 2.0 . When I made the new file I chose RGB and for the contents to be "transparent". It does not tell me there is a color.

Though, if I goto graphic converter and I click the dropper tool on the transparent background its giving 255,255,255. According to graphics converter the file is ARGB 32 bit and 8 bit alpha. 512 x 512 .

Hmm, if I select show alpha mask channel in graphic converter, then I get what looks like a bit mask. Where the tree is its black and the background is white. Its 8 bits. I suppose I can have gray in the alpha channel?

I read in the psd file into my program through Quicktime and then a GWorld conversion.

08-21-2006, 10:32 AM
I fixed it.


When I went into graphic converter I selected Alpha Channel Show Mask. Then I Magic Penned the transparency color. The resulting selection had a 1 pixel border of near white around the image. So, I enlarged the selection and deleted it. The white border is now gone.

Funny, I did a Guassian blur on the alpha channel for fun. It makes the edges look like they glow in open gl.