OpenGL transparent effects displayed quite awful on Meego
Asked Answered
L

2

5

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?

Listen answered 21/7, 2011 at 15:52 Comment(3)
Do you do any sorting of the transparent objects? See opengl.org/wiki/Transparency_SortingAntagonist
Did you set the glBlendFunc up correctly?Terraqueous
freeglut and openglut are just the windowing framework, changing those will not have any effect on your OpenGL rendering.Miss
H
6

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.

Hyland answered 21/7, 2011 at 16:32 Comment(1)
What ended up being the problem?Hyland
M
1

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).

Miss answered 22/7, 2011 at 8:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.