GUI elements and lighting

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
l0calh05t
Posts: 68
Joined: Wed Apr 07, 2004 7:08 pm

GUI elements and lighting

Post by l0calh05t »

Dunno, maybe it's supposed to be this way but GUI elements are affected by lighting (same thing with 2D images drawn directly as for example a mouse cursor)

If it helps, I use OpenGL and I don't know if this happens with DirectX, as i can't use it. Oh, and it doesn't happen with software rendering.

by doing

driver->setMaterial(nolight);
before drawing the gui elements etc., i can prevent this, but it does seem wierd
Raw data for raw nerves

My main PC: Athlon XP 2800+, 512MB RAM, ATI Radeon 9700 Pro 128MB, Win2k SP4
My secondary PC: Pentium III 500 Mhz, 256MB RAM, TNT2 64, Gentoo Linux
l0calh05t
Posts: 68
Joined: Wed Apr 07, 2004 7:08 pm

Post by l0calh05t »

did no one else experience this or is this already known?
Raw data for raw nerves

My main PC: Athlon XP 2800+, 512MB RAM, ATI Radeon 9700 Pro 128MB, Win2k SP4
My secondary PC: Pentium III 500 Mhz, 256MB RAM, TNT2 64, Gentoo Linux
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

Quite normal I think. They are drawn by the same engine like any other 3d-object. Or is there another explanation :) ?
l0calh05t
Posts: 68
Joined: Wed Apr 07, 2004 7:08 pm

Post by l0calh05t »

bal wrote:Quite normal I think. They are drawn by the same engine like any other 3d-object. Or is there another explanation :) ?
Yeah, but shouldn't lighting be automatically deactivated for the gui?
Raw data for raw nerves

My main PC: Athlon XP 2800+, 512MB RAM, ATI Radeon 9700 Pro 128MB, Win2k SP4
My secondary PC: Pentium III 500 Mhz, 256MB RAM, TNT2 64, Gentoo Linux
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

Never effected me. Are you sure you haven't got a slight transparancy on the elements? If it is doing that then it definatly isn't normal and is a bug, I'm not sure how the GUI is represented in a 3D engine but even if it is just a billboard attached to the camera at the right point so it looks like a 2D image blitted over the screen then it would have the lighting flag disabled so the lighting wouldn't effect it.
l0calh05t
Posts: 68
Joined: Wed Apr 07, 2004 7:08 pm

Post by l0calh05t »

nope, no transparency is set, I had 50% transparency at the beginning as I noticed it so I turned transparency off to see if it is the transparency causing the problem, but it wasn't.
Raw data for raw nerves

My main PC: Athlon XP 2800+, 512MB RAM, ATI Radeon 9700 Pro 128MB, Win2k SP4
My secondary PC: Pentium III 500 Mhz, 256MB RAM, TNT2 64, Gentoo Linux
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

Can you post a screenshot? I might have seen it myself if I see the effect in a picture. As they say, a picture is worth a 1000 words.
l0calh05t
Posts: 68
Joined: Wed Apr 07, 2004 7:08 pm

Post by l0calh05t »

Compare the first two screen shots (both OpenGL):

http://www.8ung.at/splugs/screen1.jpg
http://www.8ung.at/splugs/screen2.jpg

Another screenshot (DirectX8):

http://www.8ung.at/splugs/screen3.jpg

Apparently the bug only occurs in OpenGL, and seems to be located in the draw2dimage function, as this is also used by the GUI elements.
Raw data for raw nerves

My main PC: Athlon XP 2800+, 512MB RAM, ATI Radeon 9700 Pro 128MB, Win2k SP4
My secondary PC: Pentium III 500 Mhz, 256MB RAM, TNT2 64, Gentoo Linux
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

You're right there, definatly not transparency. It seems a fairly isolated problem, I wondered if it were a specific device. The tech demo loads lighting from the BSP file, does it show the same problems? I couldn't see any on my computer, I wonder if it's a problem with a certain make of video cards?
l0calh05t
Posts: 68
Joined: Wed Apr 07, 2004 7:08 pm

Post by l0calh05t »

Tyn wrote:You're right there, definatly not transparency. It seems a fairly isolated problem, I wondered if it were a specific device. The tech demo loads lighting from the BSP file, does it show the same problems? I couldn't see any on my computer, I wonder if it's a problem with a certain make of video cards?
Perhaps. I own an ATI Radeon 9700 Pro. Possibly the error lies in my graphic card's opengl implementation.
Raw data for raw nerves

My main PC: Athlon XP 2800+, 512MB RAM, ATI Radeon 9700 Pro 128MB, Win2k SP4
My secondary PC: Pentium III 500 Mhz, 256MB RAM, TNT2 64, Gentoo Linux
Robomaniac
Posts: 602
Joined: Sat Aug 23, 2003 2:03 am
Location: Pottstown, PA
Contact:

Post by Robomaniac »

I had this problem on my GeForce4 GO! and my GeForce2
The Robomaniac
Project Head / Lead Programmer
Centaur Force
l0calh05t
Posts: 68
Joined: Wed Apr 07, 2004 7:08 pm

Post by l0calh05t »

Robomaniac wrote:I had this problem on my GeForce4 GO! and my GeForce2
in that case it possibly is not an error but rather something that isn't clearly defined in the OpenGL specs (if or if not camera-space 2d images should be rendered with or without light)
Raw data for raw nerves

My main PC: Athlon XP 2800+, 512MB RAM, ATI Radeon 9700 Pro 128MB, Win2k SP4
My secondary PC: Pentium III 500 Mhz, 256MB RAM, TNT2 64, Gentoo Linux
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Hm strange. I'm nearly sure that the lighting is turned off everywhere for 2d stuff. Maybe it is a problem with the driver you are using.
l0calh05t
Posts: 68
Joined: Wed Apr 07, 2004 7:08 pm

Post by l0calh05t »

niko wrote:Hm strange. I'm nearly sure that the lighting is turned off everywhere for 2d stuff. Maybe it is a problem with the driver you are using.
Yeah, I just checked, it draw2dimage (which in this case seems to be the buggy function) calls setRenderStates2dMode which disables lighting using glDisable(GL_LIGHTING) unless ERM_2D is already set, but if it were it would cause the images to be diplayed using the wrong projection and transformation matrices, which is not the case. Very wierd...

EDIT: It gets even wierder: if you set a material with lighting turned off the OpenGL driver also calls glDisable(GL_LIGHTING); ...

EDIT2: The error also occurs when using a Geforce 4 MX
Raw data for raw nerves

My main PC: Athlon XP 2800+, 512MB RAM, ATI Radeon 9700 Pro 128MB, Win2k SP4
My secondary PC: Pentium III 500 Mhz, 256MB RAM, TNT2 64, Gentoo Linux
Post Reply