Results 1 to 8 of 8

Thread: Phongs illumination model

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2008
    Location
    New Delhi, India.
    Posts
    5

    Phongs illumination model

    hey...m tryin to implement phongs illumination and phongs shading model for any polygobal surface. I am facing probelms in calculating vector H and V from the vector 'N' ...please give me the mathematical tool to do so...

  2. #2
    Senior Member Regular Contributor
    Join Date
    Aug 2007
    Posts
    107

    Re: Phongs illumination model

    If I understand you correctly (rather, guess what you mean), you can not compute H (half-vector) and V (light direction) from N (normal). You obtain (one of) these vectors from your light source and then perform a dot product with the normal. What is your source of information? Maybe it explains what the H and V vectors are?!

  3. #3
    Junior Member Newbie
    Join Date
    Jun 2008
    Location
    New Delhi, India.
    Posts
    5

    Re: Phongs illumination model

    Hey lot of thanks Haan...actually m reading realted stuff from a book "Computer graphics using OpenGL" by Dr F.S.Hills...m a rookie in this field...and m not getting exact ingormation to how to perform this vector obtaining calculations or rather how to obtain one of these vectors from light source ...coz in this book theory has been emphasized rather then mathematical aspect ...and I have been asigned to implement phongs shading model by my proff. to be completed in next two weeks...so thats the matter...can u give some link or stuff (my mail id: "bhuvi988@rediffmail.com" ) in order to implement phong's illumination as well as fast phong's shading...lookin forwrd...

    Regards,
    Bhuvnesh Pratap Singh

  4. #4
    Senior Member Regular Contributor
    Join Date
    Aug 2007
    Posts
    107

    Re: Phongs illumination model

    The Phong-Blinn variant with halv-vectors is covered here
    http://www.lighthouse3d.com/opengl/g...hp?dirlightpix

    In this example, the light vectors are retrieved from standard OpenGL function calls in the shader program. If the example is too advanced you probably have to read up on OpenGL first.

    Once you have this example working it should be trivial to compute classical Phong shading (without the halv-vector).

  5. #5
    Junior Member Newbie
    Join Date
    Jun 2008
    Location
    New Delhi, India.
    Posts
    5

    Re: Phongs illumination model

    Hey Haan...

    Specifically my problem is that after setting up the light source say at point (1,1,1,1) should I calculate the L vector by subtracting the vertex's cordinates from this point fr every vertex of the mesh ??? & How can I calculate the V vector that signify the viewer's eye for every vertex ??? plz help

    Regards
    Bhuvnesh Pratap Singh

  6. #6
    Senior Member OpenGL Pro dletozeun's Avatar
    Join Date
    Jan 2006
    Location
    FRANCE
    Posts
    1,367

    Re: Phongs illumination model

    Do you use a shader to compute the Phong model?

  7. #7
    Junior Member Newbie
    Join Date
    Jun 2008
    Location
    New Delhi, India.
    Posts
    5

    Re: Phongs illumination model

    Naa...I simply want to calculate the light intensity per vertex acc. to Phongs illumination model thats it, and thats why I need those vectors...

  8. #8
    Senior Member OpenGL Pro dletozeun's Avatar
    Join Date
    Jan 2006
    Location
    FRANCE
    Posts
    1,367

    Re: Phongs illumination model

    I you do that per vertex it is not Phong shading but Gouraud shading. This is what the Opengl fixed pipeline already does...

Similar Threads

  1. Illumination problem
    By Jojovem in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-11-2009, 08:25 AM
  2. illumination
    By BeefBonanza in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 06-12-2009, 02:43 AM
  3. Phongs shading
    By Pratap in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 06-26-2008, 04:53 AM
  4. illumination value to color value
    By hawaii in forum OpenGL: General
    Replies: 1
    Last Post: 06-13-2008, 09:16 AM
  5. Change light model to global illumination
    By santyhamer in forum OpenGL: General
    Replies: 2
    Last Post: 09-27-2000, 02:39 AM

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