Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Achieving Metalic effect

  1. #1
    Intern Contributor
    Join Date
    Mar 2000
    Location
    Leiden, The Netherlands
    Posts
    59

    Achieving Metalic effect

    Hi all,

    here my second request, howto give a surface a metalic effect, but not as blinking as chrome.(like the metal of a CD-Deck)

    Thanx,

    Daniel.

  2. #2
    Member Regular Contributor
    Join Date
    Feb 2000
    Location
    milano, italy
    Posts
    282

    Re: Achieving Metalic effect

    same as before. use chroming approach.

    metallic appearance is primarily perceived from the shininess of a surface, in particular from the size of the specular highlights.
    moreover, metallic surfaces have a highlight color depending also on the material.
    dielectrics like plastic instead have the highlight color equal to that of the light shining on them.

    *normally*

    let's try to simulate a copper appearance.

    use a diffuse texture where the average color is about (0.8,0.51,0.33)

    the chrome texture has to be blended with the metallic specular color, about (1,0.7,0.6).

    the previous code will became something like:

    Code :
    glDepthFunc(GL_LEQUAL);
     
    glDisable(GL_TEXTURE_2D);
    glDisable(GL_BLEND);
    glDisable(GL_TEXTURE_GEN_S);
    glDisable(GL_TEXTURE_GEN_T);
     
    glColor3f(0.8,0.51,0.33);
     
    <render object>
     
    glEnable(GL_TEXTURE_2D);
    glEnable(GL_BLEND);
    glBlendFunc(GL_ONE,GL_ONE);
    glEnable(GL_TEXTURE_GEN_S);
    glEnable(GL_TEXTURE_GEN_T);
    glTexGeni(GL_S,GL_TEXTURE_GEN_MODE,GL_SPHERE_MAP);
    glTexGeni(GL_T,GL_TEXTURE_GEN_MODE,GL_SPHERE_MAP);
    glBindTexture(GL_TEXTURE_2D,texid_chrome);
     
    glColor3f(1,0.7,0.6);
     
    <render object>
    note that there is not a way to be sure that a particular metodology of rendering will show up a desired appearance.
    in computer graphics, quantities such as colors, lighting and the like have to be tested and optimized to achieve the best result.

    Dolo/\/\ightY


    [This message has been edited by dmy (edited 03-13-2000).]
    Dolo/\/\ightY

  3. #3
    Intern Contributor
    Join Date
    Mar 2000
    Location
    Leiden, The Netherlands
    Posts
    59

    Re: Achieving Metalic effect

    Again Tahnk you,

    regards,

    Daniel.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •