Jump to content
  • Advertisement
Sign in to follow this  
lightpower

Wrong light Help me

This topic is 1221 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement


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

How do I create these shaders ? I am new in opengl. I've tried the manual but did not work for me.

Edited by lightpower

Share this post


Link to post
Share on other sites
View one of the billions of tutorials that exist online.
We don’t help people who don’t even begin to help themselves or know the very basics to using Google.


L. Spiro

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!