Thread: OpenGL normal mapping.

  1. #1
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,071

    OpenGL normal mapping.

    Well, i'm slightly lost with this normal mapping business. Does anyone know of any tutorials on implementing it with OpenGL?

    thanx,
    -psychopath
    M.Eng Computer Engineering Candidate
    B.Sc Computer Science

    Robotics and graphics enthusiast.

  2. #2
    Registered User linuxdude's Avatar
    Join Date
    Mar 2003
    Location
    Louisiana
    Posts
    926

  3. #3
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,071
    yea, I was looking at that a few nights ago. It dosn't help that much though. It shows how to create a normal map, But I need to know how to add the normal mapping code in OGL.

    -psychopath
    M.Eng Computer Engineering Candidate
    B.Sc Computer Science

    Robotics and graphics enthusiast.

  4. #4
    Registered User
    Join Date
    Mar 2003
    Posts
    580
    You need to do it using OpenGL shaders.

    From reading through some of your various posts and problems, I've gathered that you're relatively amateur (i.e you were the kid who was loading the terrain data from file each graphics frame and wondering why it was going slow), so I pose this question to you: do you really need to implement shaders to get perfect lighting (which is what I assume you are doing), and are you ready for that type of work? Dealing with shaders is typically considered a more advanced/difficult level of graphics programming.

    OpenGL lighting is pretty good in itself (just pass a normal for each triangle/surface you render).

    If you just use Gouraud shading using regular OpenGL lighting you get very realistic results on densely tesselated models (models where each polygon's surface isn't too big). It's faster for the computer from the computational point of view and easier to implement.
    Last edited by Darkness; 01-26-2005 at 03:03 PM.
    See you in 13

  5. #5
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,071
    >>From reading through some of your various posts and problems, I've gathered that you're relatively amateur (i.e you were the kid who was loading the terrain data from file each graphics frame and wondering why it was going slow)<<
    well, yes i'm still learning, but iv'e learned alot since then. You can learn the most from your mistakes.

    Also, iv'e downloaded examples from ATI (although they seem to be ATI card specific), and i'm going to take some time and break down the source code and see how it all works to try and avoid running into problems.

    >>If you just use Gouraud shading using regular OpenGL lighting you get very realistic results on densely tesselated models (models where each polygon's surface isn't too big). It's faster for the computer from the computational point of view and easier to implement.<<
    Yes, but the fewer polys the better, as it puts less stress on the vid-card.

    -psychopath
    Last edited by psychopath; 01-26-2005 at 04:41 PM.
    M.Eng Computer Engineering Candidate
    B.Sc Computer Science

    Robotics and graphics enthusiast.

  6. #6
    Registered User
    Join Date
    Mar 2003
    Posts
    580
    You're completely right about learning from mistakes, and I wasn't trying to be a jerk, only just trying to point out the fact that you're inexperienced, which is okay (we were all there). It's a lot better to set your goals onto something easier and actually accomplish it than it is to develop fabulous goals and take the chance of getting discouraged if you don't obtain the fabulous goals. That is how most people stop game programming. Heck, maybe you really can implement the per pixel lighting with gl shaders without much difficulty, but don't be afraid to work with something easier first (which is still what I strongly suggest). I would also like to point out that John Carmack, probably the most well known graphics programmer, started out programming some really gay crap before he did anything cool...he developed various gay algorithms such as side scrolling and surface caching, all of which were new, but actually very simple techniques, and he later went on to harder stuff.

    Also, about the speed thing, you've got the right idea that processing more polygons takes longer, but the thing is just using goraud shading is MUCH faster than doing anything in a shader that is done per fragment (per pixel).


    http://en.wikipedia.org/wiki/Surface_caching

    EDIT:
    and before anybody throws a hormone fit, I wasn't disrespecting Carmack, only trying to support the argument that it's perfectly okay to start out with relatively easy stuff, and that you don't absolutely *have* to do something overly complex in order to become a very good coder.
    Last edited by Darkness; 01-26-2005 at 05:49 PM.
    See you in 13

  7. #7
    napKINfolk.com napkin111's Avatar
    Join Date
    Apr 2002
    Posts
    310
    Quote Originally Posted by Darkness
    ...he developed various gay algorithms such as side scrolling and surface caching, all of which were new, but actually very simple techniques, and he later went on to harder stuff.
    Hmm, excuse my hormone fit and lack of posts for the last year and a half, but I don't think you realize how revolutionary it was to run Mario on a PC. If you're at all interested in Carmack or Romero's rise to power, I suggest "Masters of Doom".

    To to OP, I'd suggest "OpenGL Game Programming", its only $50 and it's a great book to teach you the basics of OGL.
    "The best way to get answers is to just keep working the problem, recognizing when you are stalled, and directing the search pattern.....Don’t just wait for The Right Thing to strike you – try everything you think might even be in the right direction, so you can collect clues about the nature of the problem."
    -John Carmack

  8. #8
    Registered User
    Join Date
    Mar 2003
    Posts
    580
    You're missing the point napkin
    See you in 13

  9. #9
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,071
    >>OpenGL Game Programming<<
    I have "Beginning OpenGL Game Programming"....great book, really helped.

    -psychopath
    M.Eng Computer Engineering Candidate
    B.Sc Computer Science

    Robotics and graphics enthusiast.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Texture mapping anomaly opengl
    By Shakti in forum Game Programming
    Replies: 1
    Last Post: 04-11-2009, 02:09 AM
  2. OpenGL texture mapping with texCoordArray
    By nempo in forum Game Programming
    Replies: 1
    Last Post: 08-24-2008, 04:00 AM
  3. OpenGL Shadow Mapping Issues
    By animeaholic in forum Game Programming
    Replies: 0
    Last Post: 06-05-2007, 09:49 AM
  4. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  5. HUGE fps jump
    By DavidP in forum Game Programming
    Replies: 23
    Last Post: 07-01-2004, 10:36 AM