puklaus's picture

Blending and lighting problems on ubuntu

Maybe just some stupid bugs that i cant see but heres the problem:

On ubuntu 8.04 (tested with mesa and ati official drivers):

When I draw png images with alpha (transclusent(?) images),
it will become darker than on xp.

Look at the picture I uploaded.

And second problem, on ubuntu, when I update lights position,
scene flickers. These works fine on xp.

In the zip file you can find sources, images and Release .exe.

blending.JPG28.11 KB
Opentk_testaus.rar338.11 KB


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

Thanks, I'm testing right now. You are using the drivers from the package manager, right? (That is, catalyst 8.3 if I remember correctly).

Edit: What happens if you move all GL calls from the constructor to the OnLoad method? (Override or hook the OnLoad event). The OpenGL context is not guaranteed to be available in the constructor (this may change in the future).

puklaus's picture

Yes, from package manager (it downloads them when i enable restricted drivers).

Oops I meant write setup GL calls to Onload, but if these calls are in the
OnLoad or even the render method, it doesnt fix the problem.

the Fiddler's picture

Ok, I'll reboot to ubuntu and check there.

puklaus's picture

Lighting problem solved!

GL.Lightv(LightName.Light0, LightParameter.Position, new float[] { x, y, z });

needs to be

GL.Lightv(LightName.Light0, LightParameter.Position, new float[] { x, y, z, 1 });

Did you tested blending? Is it dark at your machine too?

puklaus's picture

I changed images to non-alpha (black background) images and BlendFunc to

GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.One);

And using GL.Color4 maybe i get what i want.

I think this is the way to go, works with linux too.