Simple, wierd lighting problem

Started by
0 comments, last by hplus0603 19 years, 7 months ago
Hey all, ive been working on this terrain editor, and i tryed to add a light to the scene, and for some reason it looks like a spotlight, ive worked with lights before, and they worked fine, ive tryed both diffuse and ambient, which, to my understanding should equally light everything in the world, so how come it appears to look like a spotlight?

	float	Direction[]={0.0, 1.0, 1.0, 1.0};
	float	Color[]=	{1.0, 1.0, 1.0};
	glLightfv(GL_LIGHT0, GL_POSITION, Direction);
	glLightfv(GL_LIGHT0, GL_AMBIENT, Color);
	glEnable(GL_LIGHT0);

---------------------------------------------think outside the quadLogic GamesI realized I stay on the pc too long when my wireless mouse died after replacing the batteries...twice
Advertisement
I can think of a few cases:

- you're not specifying the spot cut-off to be 180 (for an OMNI light)
- you have a range for the light, which happens to fall off where the mesh goes dark
- you're using another light than you think you're using

However, the most likely causes of problems are:

1) your light position should have the 0 _LAST_ if you want it to be directional
2) your color needs four values, else the last value of the light color (RGBA) will be whatever random gunk is on the stack following your array

enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement