Skip to main content
add links
Source Link
Notabene
  • 6.1k
  • 1
  • 33
  • 40

You have to set up material.
Enable material:

glEnable(GL_COLOR_MATERIAL);

Set ambient and diffuse to read from what you set in glColor:

glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);

Setup specular. For complete specular you have to have defined specular reflective color and shinines.

float specReflection[] = { 0.8f, 0.8f, 0.8f, 1.0f };
glMaterialfv(GL_FRONT, GL_SPECULAR, specReflection)
glMateriali(GL_FRONT, GL_SHININESS, 56);

Shinines is between 1 - 128. Bigger value = more bright.

You can find more help on these links:
http://www.falloutsoftware.com/tutorials/gl/gl8.htm
http://www.ozone3d.net/tutorials/glsl_lighting_phong.php

You have to set up material.
Enable material:

glEnable(GL_COLOR_MATERIAL);

Set ambient and diffuse to read from what you set in glColor:

glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);

Setup specular. For complete specular you have to have defined specular reflective color and shinines.

float specReflection[] = { 0.8f, 0.8f, 0.8f, 1.0f };
glMaterialfv(GL_FRONT, GL_SPECULAR, specReflection)
glMateriali(GL_FRONT, GL_SHININESS, 56);

Shinines is between 1 - 128. Bigger value = more bright.

You have to set up material.
Enable material:

glEnable(GL_COLOR_MATERIAL);

Set ambient and diffuse to read from what you set in glColor:

glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);

Setup specular. For complete specular you have to have defined specular reflective color and shinines.

float specReflection[] = { 0.8f, 0.8f, 0.8f, 1.0f };
glMaterialfv(GL_FRONT, GL_SPECULAR, specReflection)
glMateriali(GL_FRONT, GL_SHININESS, 56);

Shinines is between 1 - 128. Bigger value = more bright.

You can find more help on these links:
http://www.falloutsoftware.com/tutorials/gl/gl8.htm
http://www.ozone3d.net/tutorials/glsl_lighting_phong.php

Source Link
Notabene
  • 6.1k
  • 1
  • 33
  • 40

You have to set up material.
Enable material:

glEnable(GL_COLOR_MATERIAL);

Set ambient and diffuse to read from what you set in glColor:

glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);

Setup specular. For complete specular you have to have defined specular reflective color and shinines.

float specReflection[] = { 0.8f, 0.8f, 0.8f, 1.0f };
glMaterialfv(GL_FRONT, GL_SPECULAR, specReflection)
glMateriali(GL_FRONT, GL_SHININESS, 56);

Shinines is between 1 - 128. Bigger value = more bright.