Jump to content

  • Log In with Google      Sign In   
  • Create Account


[Solved] Shining and specular lighting


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Roming22   Members   -  Reputation: 122

Like
Likes
Like

Posted 02 December 2003 - 01:50 AM

Hi, I have a red sphere that have a the highest specularity possible. But it doesn't make the ball "shine". The trouble is that the light is white and the specular spot appears red. So I think I've guessed the problem: the results of the lighing calculs are multiplied to the color of the texture, but in the case of the specularity I want it to be added. Can anyone tell me if I'am correct, and how to solve the problem? Thanks, Roming22 [edited by - Roming22 on December 11, 2003 8:16:26 AM]

Sponsor:

#2 James Trotter   Members   -  Reputation: 432

Like
Likes
Like

Posted 02 December 2003 - 02:53 AM

The specular colour is calculated together with the ambient, diffuse, and emissive terms, which means it''s calculated before texturing. This might make the specular light look "muted", or different.

But you can make OpenGL calculate it after it applies the texture by changing the light model:

glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);

To restore the default, where specular is calculated with the rest of the lighting:

glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SINGLE_COLOR);

This will give better specular highlights.

#3 Roming22   Members   -  Reputation: 122

Like
Likes
Like

Posted 02 December 2003 - 03:57 AM

OK, I had found the function, but I thought it was deprecated, as I got an error when compiling:

error C2065: ''GL_LIGHT_MODEL_COLOR_CONTROL'' : undeclared identifier
error C2065: ''GL_SEPARATE_SPECULAR_COLOR'' : undeclared identifier

I don''t have any error for the other openGL calls, so what''s the problem? Do I need a newer version of openGL? Could you post a link to it if the case?

Thanks for your help,

Roming22


#4 Roming22   Members   -  Reputation: 122

Like
Likes
Like

Posted 11 December 2003 - 01:17 AM

I needed the last glext.h file, found on the site web of SGI.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS