Results 1 to 3 of 3

Thread: Smooth shading failure - help

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2009
    Location
    Ohio
    Posts
    2

    Smooth shading failure - help

    We have a CAD program, GUI in 'C', graphics in OpenGL. When rendering our models they can be wireframe, shaded (flat), or shaded (smooth).

    Color for the shading is in a "resource" file and can be specified by changing the attribute *colorShade to what ever you desire.

    However, in the rendering, when you select "Smooth Shade" the model is ALWAYS rendered in "pink" even though the FLAT shading has been specified as dodgerBlue. How do I get something other than "pink" for the Smooth shading?
    Art Van Houten

  2. #2
    Junior Member Newbie
    Join Date
    Sep 2009
    Location
    Ohio
    Posts
    2

    Re: Smooth shading failure - help

    I found it -

    from: http://www.opengl.org/resources/faq/...cal/lights.htm

    Lighting does not work with the current color as set by glColor*(). It works with material colors. Set the material colors with glMaterial*(). Material colors can be made to track the current color with the color material feature. To use color material, call glEnable(GL_COLOR_MATERIAL). By default, this causes ambient and diffuse material colors to track the current color. You can specify which material color tracks the current color with a call to glColorMaterial().

    Adding glEnable(GL_COLOR_MATERIAL) fixed it.
    Art Van Houten

  3. #3
    Senior Member Regular Contributor
    Join Date
    Mar 2003
    Location
    Los Angeles
    Posts
    374

    Re: Smooth shading failure - help

    Thanks for reporting that back to us Art. Didn't know about GL_COLOR_MATERIAL. Could have used it in the past.
    Am I doing your homework for you?

Similar Threads

  1. Smooth Shading
    By Connection in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 10-19-2008, 11:58 AM
  2. OpenGL smooth shading
    By Ralf Euser in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 04-25-2007, 12:53 AM
  3. Smooth shading
    By TomPandolfi in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 02-22-2002, 05:18 PM
  4. when to use flat or smooth shading ???
    By tbjerman in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-22-2001, 11:26 PM
  5. no fog in smooth shading
    By Zerosignull in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 05-20-2000, 07:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean