Skip to main content
GameDev.net gamedev.net
🔒 Locked

black pixels

Started by ms75214 Jun 26, 2012 at 12:34 AM 2 replies 950+ views
Original Post
ms75214
ms75214
Anyone know what causes the black pixels in the plane here?

http://postimage.org/image/izp2rjc4t/
ApochPiQ
ApochPiQ
How is it being rendered? Could be a lot of things, although some form of z-fighting is a likely candidate.
szecs
szecs
Is it a mesh? It seems that 2 normals on the wing are flipped (pointing inwards instead of outwards of the model). Or they are zero. That ruins lighting.
How do you calculate normals? Or are they exported with the mesh? Maybe it's an error in the model and not in your program.
ms75214
ms75214

How is it being rendered? Could be a lot of things, although some form of z-fighting is a likely candidate.



it's something with lighting.

here's my lighting func

void light2(void)
{

glEnable(GL_LIGHTING);
GLfloat LightAmbient[]= { 0, 0, 0, 1.0f };
GLfloat LightDiffuse[]= { 1.04, 1.04, 1.04, 1.0f };
GLfloat LightGlobal[]= { .105, .205, .205, 1.0f };

GLfloat LightPosition[]= { 0.0f,0.0f, 10.0f, 1.0f };
glLightfv(GL_LIGHT1, GL_AMBIENT, LightAmbient);
glLightfv(GL_LIGHT1, GL_DIFFUSE, LightDiffuse);
glLightfv(GL_LIGHT1, GL_POSITION,LightPosition);
glEnable(GL_LIGHT1);

glLightModelfv(GL_LIGHT_MODEL_AMBIENT, LightGlobal);

}

i'm terrible at lighting.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.