Sign in to follow this  
lightpower

Wrong light Help me

Recommended Posts

lightpower    105
What is wrong with my light?
What should I do to get a light-Phong or some realistic?
 
float vec[4];
	SET_VEC4(vec, -10.7f, -posY, 0.4f, 1.0f);
	glLightfv(GL_LIGHT3, GL_POSITION, vec);

	SET_VEC4(vec, 0.9f, 0.9f, 0.9f, 1.0f);
	glLightfv(GL_LIGHT3, GL_DIFFUSE, vec);

	SET_VEC4(vec, 0.0f, 0.0f, 0.0f, 1.0f);
	glLightfv(GL_LIGHT3, GL_AMBIENT, vec);

	SET_VEC4(vec, 0.05f, 0.05f, 0.05f, 1.0f);
	glLightfv(GL_LIGHT3, GL_EMISSION, vec);

	SET_VEC4(vec, 0.003f, 0.003f, 0.003f, 1.0f);
	glLightfv(GL_LIGHT3, GL_SPECULAR, vec);

material

float m1_amb[] = { 0.0005f, 0.0005f, 0.0005f };
float m1_dif[] = { 0.5f, 0.5f, 0.5f };
float m1_spe[] = { 0.5f, 0.5f, 0.5f };
float m1_em[] = { 0.4f, 0.4f, 0.4f };
glMaterialfv(GL_FRONT, GL_AMBIENT, m1_amb);
glMaterialfv(GL_FRONT, GL_DIFFUSE, m1_dif);
glMaterialfv(GL_FRONT, GL_SPECULAR, m1_spe);
glMaterialfv(GL_FRONT, GL_EMISSION, m1_em);

yWeJfVZ.pngucrdrNK.png

Share this post


Link to post
Share on other sites
vstrakh    2455


What should I do to get a light-Phong or some realistic?

You should stop using fixed-function pipeline, and write shaders for per-pixel lighting.

FFP calculates light per-vertex, so quality depends mainly on geometry's good tesselation.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this