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 16

Thread: Phong-Shading vs. PerPixel-Lightning vs. Gouraud-Shading

  1. #1
    Junior Member Regular Contributor
    Join Date
    Feb 2000
    Posts
    211

    Phong-Shading vs. PerPixel-Lightning vs. Gouraud-Shading

    Does anyone know any good way for realizing a better lightning-algorythm than the orig. grouraud-shading, support by OpenGL ?
    IŽlike to use phong- or perpixel-lightning, but until now i donŽt have found any good explanation for coding this. All stuff i found was mostly unreadable and ver slow !
    If anyone has a sourcecode for one of these algorythms, please send it to me !

    DjSnow
    DJSnow

  2. #2
    Advanced Member Frequent Contributor cass's Avatar
    Join Date
    Feb 2000
    Location
    Austin, TX, USA
    Posts
    913

    Re: Phong-Shading vs. PerPixel-Lightning vs. Gouraud-Shading

    Can you be specific about what techniques for per-pixel lighting you've tried, and where you've found information so far?

    What specifically are you trying to do, and how slow is "ver slow"? :-)
    Cass Everitt -- cass@xyzw.us

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Location
    London
    Posts
    503

    Re: Phong-Shading vs. PerPixel-Lightning vs. Gouraud-Shading

    On current consumer hardware, if you want per-pixel lighting at interactive frame rates then you have to use lightmaps - precalculated luminance textures that are blended onto your polys. This is how Quake etc do it; it's pretty fast with multitexture hardware. But having to pregenerate the maps is a bit cheesy.

    Still, changes are afoot - the PixelFusion boards due out this year will support realtime programmable per-pixel shading models including Phong and Torrance-Sparrow. I think it'll be priced for the pro market initially, but should come down rapidly.

    I believe there are cards already out there that can do dot-product per pixel, but I couldn't tell you what the performance or interfaces are like.

  4. #4
    Intern Contributor
    Join Date
    Feb 2000
    Location
    Italy
    Posts
    77

    Re: Phong-Shading vs. PerPixel-Lightning vs. Gouraud-Shading

    I tried some kind of specular hilight simulation, by applying a texture with sphere mapped coordinates generation.
    The result is very nice, and the overhead is recalculating the highlight each time you move the affected light source.
    By having an hilight map, you can use multitexturing to gain optimal performance.
    I found this tecnique described in the SIGGRAPH course notes of... maybe 96-97?
    --
    Paolo M.

  5. #5
    Junior Member Regular Contributor
    Join Date
    Feb 2000
    Location
    Caracas/Venezuela
    Posts
    182

    Re: Phong-Shading vs. PerPixel-Lightning vs. Gouraud-Shading

    Check out this link. This is the most amazing dynamic lighting algor I have seen in current consumer hardware: http://www.opengl.org/News/Special/o.../perpixel.html

  6. #6
    Junior Member Newbie
    Join Date
    Feb 2000
    Location
    Mexico
    Posts
    21

    Re: Phong-Shading vs. PerPixel-Lightning vs. Gouraud-Shading

    Also check these pages
    http://www.pseudonymz.demon.co.uk/genoth.html

    i Found it today on the OpenGL news called
    "Supposedly useful stuff for OpenGL Game Developers"

  7. #7
    Junior Member Regular Contributor
    Join Date
    Feb 2000
    Posts
    211

    Re: Phong-Shading vs. PerPixel-Lightning vs. Gouraud-Shading

    Yes, Coco, i saw this article - but there is no source included. And i saw the same "technique" in an NVIDIA-developer demo.
    The objects looks like the same, too !
    I think, the man, who posted this articel to opengl.org ripped it off the NVidia-demos.
    DJSnow

  8. #8
    Advanced Member Frequent Contributor cass's Avatar
    Join Date
    Feb 2000
    Location
    Austin, TX, USA
    Posts
    913

    Re: Phong-Shading vs. PerPixel-Lightning vs. Gouraud-Shading

    Yes, Coco, i saw this article - but there is no source included. And i saw the same
    "technique" in an NVIDIA-developer demo.
    What you saw in the NVIDIA-developer demo requires a GeForce. The demo I did does not require a GeForce, but it takes 26 passes to achieve its results.

    The objects looks like the same, too !
    I think, the man, who posted this articel to opengl.org ripped it off the NVidia-demos.
    It's SUPPOSED to look like the nvidia GeForce demo for the very purpose of illustrating that you can do (actually approximate) per-pixel lighting WITHOUT special OpenGL extensions. If you don't have the fill-rate to support 26 passes, though, it's gonna crawl. The look of the demo may be "ripped off", but the technique implementing it is certainly not.

    Look at the source for the OIM article that is referenced if you want to understand one way of doing per-pixel lighting in unextended opengl. The technique in the demo is an extension and generalization of that technique.
    Cass Everitt -- cass@xyzw.us

  9. #9
    Junior Member Regular Contributor
    Join Date
    Feb 2000
    Posts
    211

    Re: Phong-Shading vs. PerPixel-Lightning vs. Gouraud-Shading

    Cass: uh, sorry ! thanx for this "lightning"
    DJSnow

  10. #10
    Intern Contributor
    Join Date
    Feb 2000
    Location
    San Diego Ca, USA
    Posts
    50

    Re: Phong-Shading vs. PerPixel-Lightning vs. Gouraud-Shading

    hey Cass where is the original article..
    Orthogonal Illumination Mapping (OIM)

    the link on the page Coco mentioned is dead

Posting Permissions

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