Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenGL transparent effects displayed quite awful on Meego

we've been creating several half-transparent 3D cubes in a scene by OpenGL which displays very good on Windows 7 and Fedora 15, but become quite awful on Meego system.

This is what it looks like on my Fedora 15 system:

This is what it looks like on my Fedora 15 system.

This is what it looks like on Meego. The color of the line has been changed by us, otherwise the cubes you see would be more pathetic:

This is what it looks like on Meego. The color of the line has been changed by us, otherwise the cubes you see would be more pathetic.

The effects are implemented by just using the normal glColor4f function, and made to be transparent just by setting the value of alpha. How could it be like that?

Both freeglut and openglut have been tried on the Meego system and failed to display any better.

I've even tried to use an engine like irrlicht to implement this instead but there would be nothing but black on the screen when the zBuffer argument of beginScene method was set to be false (and normal when it's true, but that would not be what we want).

This should not be the problem of the display card or the driver, because we've seen a 3D game with a transparent ball involved on the very same netbook and system.

We failed to find the reason here. Could any one give any help on why this would be happening please?

like image 548
lastland Avatar asked Jul 21 '11 15:07

lastland


2 Answers

It sounds as if you may be relying on default settings (or behavior), which may be different between platforms.

Are you explicitly setting any of OpenGL's blend properties, such as glBlendFunc? If you are, it may help to post the relevant code that does this.

One of the comments mentioned sorting your transparent objects. If you aren't, that's something you might want to consider to achieve more accurate results. In either case, that behavior should be the same from platform to platform so I would have guessed that's not your issue.

Edit:

One other thought. Are you setting glCullFace? It could be that your transparent faces are being culled because of your vertex winding.

like image 68
luke Avatar answered Nov 09 '22 07:11

luke


Both freeglut and openglut have been tried on the Meego system and failed to display any better.

Those are just simple windowing frameworks and have no effect whatsoever on the OpenGL execution.

Somewhere in your blending code you're messing up. From the looks of the correct rendering I'd say your blend function there is glBlendFunc(GL_ONE, GL_ONE), while on Meego it's something like glBlendFunc(GL_SRC_ALPHA, GL_ONE).

like image 28
datenwolf Avatar answered Nov 09 '22 07:11

datenwolf