Results 1 to 3 of 3

Thread: Adding Chrome to a primmitive

  1. #1
    Member Contributor
    Join Date
    Mar 2000
    Location
    Leiden, The Netherlands
    Posts
    58

    Adding Chrome to a primmitive

    Hi All,

    does anyone know how to add chrome/metalic look to a primitive? Some sourcecode would help a lot

    Thanx,

    Daniel

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

    Re: Adding Chrome to a primmitive

    a way to achieve this is to make a second rendering pass.

    in the first, you draw your object.
    in the second you blend the chroming.

    your object must have normals (or something resembling)
    try this:

    Code :
     
    glDepthFunc(GL_LEQUAL);
     
    glDisable(GL_TEXTURE_2D);
    glDisable(GL_BLEND);
    glDisable(GL_TEXTURE_GEN_S);
    glDisable(GL_TEXTURE_GEN_T);
     
    <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);
     
    <render object>
    this should work.

    Dolo/\/\ightY
    Dolo/\/\ightY

  3. #3
    Member Contributor
    Join Date
    Mar 2000
    Location
    Leiden, The Netherlands
    Posts
    58

    Re: Adding Chrome to a primmitive

    Thank you ,

    Daniel.

Similar Threads

  1. Chrome map in OpenGL
    By vAC in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 12-23-2003, 05:38 AM
  2. that awesome chrome look
    By in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 11-17-2000, 02:44 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