Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Shininess

  1. #1
    Intern Contributor
    Join Date
    Apr 2002
    Location
    UK
    Posts
    50

    Shininess

    I'm rendering a nice looking car in my app and want it to look like the light is shining off the bodywork and windows (I'm not really interested in true reflections), I have played around with this but canít get any results.
    Can someone please tell me the steps I should use to get this kind of effect.

    Thanks

  2. #2
    Junior Member Regular Contributor
    Join Date
    Sep 2000
    Location
    Italy
    Posts
    124

    Re: Shininess

    You can blend a texture (representing a sky for example) over the reflective parts using sphere mapping.
    To obtain good results you need a good number of faces.
    bye!
    fz

  3. #3
    Intern Contributor
    Join Date
    Apr 2002
    Location
    UK
    Posts
    50

    Re: Shininess

    Thanks

    Is their no way to achieve this using the material and lighting settings?
    I only want it to look kind of shiny using the easiest method.

    I assumed GL_SHININESS would do something like what I want, but I cant get any results.

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Oct 2001
    Posts
    596

    Re: Shininess

    GL_SHININESS only controls how big the specular point should be. You should be able to se the difference when you change from 1 to 40 to 128 but only if you have set specular color in the material to something else than 0,0,0 that is the default.. (white should be fine)

    but to get reflection of the enviroonment (needed to get a real looking reflective material, like chrome objects and stuff) just apply spheremapping or reflectionmapping(cubemaps)

    /mikael

  5. #5
    Junior Member Regular Contributor
    Join Date
    Mar 2002
    Location
    Pori, Finland
    Posts
    191

    Re: Shininess

    I'm also using shine stuff in my model with sphere mapping, but would you happend to know how to 'move' the shine texture over my model witehout using glTranslate ot glRotate?
    By that I mean the effect that was in Kingpin if you can remember: when you just looked around the weapon shined nicely.

  6. #6
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,982

    Re: Shininess

    To get a good result with OpenGL's lighting system, you also need to tesselate your object into faily small triangles. This is because OpenGL calculate lighting per vertex, and not per pixel. The larger the shininess, the smaller the highlight, and the more you need to tesselate your object. If you can't tesselate your object as much as needed, a reflection texture is a very good solution.

  7. #7
    Intern Contributor
    Join Date
    Apr 2002
    Location
    UK
    Posts
    50

    Re: Shininess

    i dont really want the scenery to be reflected in the car. I just want it to look like the light is shining on a matt object. what i really would like is for the spots that would reflect the light directly to the camera to look brighter than the rest of the car.

  8. #8
    Advanced Member Frequent Contributor
    Join Date
    Oct 2001
    Posts
    596

    Re: Shininess

    the if you have a high tessellated object, specular would to it, else, you can do a map with a white dot on it ( white to black gradient from the middle and out) to simulate the light and get more accurat result.


    Edit:

    And to just move the light, rotate the texture matrix of the textureunit holding the light texture



    [This message has been edited by Mazy (edited 05-14-2002).]

  9. #9
    Intern Contributor
    Join Date
    Apr 2002
    Location
    UK
    Posts
    50

    Re: Shininess

    I have not experimented with tessellated objects and have no idea what they are.
    My car has around 5000 polys (I think they are all triangles but my app can deal with any number of points for a face) and a texture applied from one 32 bit TGA (for windows) and one 24 bit TGA for the rest of the car. At the moment my windows are completely transparent and I would like the light to shine on the windows when the angle is correct. Can this be done easly?

  10. #10
    Junior Member Newbie
    Join Date
    May 2002
    Posts
    10

    Re: Shininess

    If you want bright highlights on your objects,
    http://www.gametutorials.com has a tutorial on specular lighting... and its quite easy! That might be what you want.

Posting Permissions

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