Results 1 to 10 of 11

Thread: [OpenGL] Is my lightning good enough?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    I'm guessing its going wrong somewhere. This is because up and downhill both always shade to dark. Hill that is facing camera should be lit up.

  2. #2
    But the light is at the position 0,-1,0. So the light (as far as I understand it) is faced along the negative Y axis. So in other words the light beams are going from the sky to the ground (perpendicular to the ground). The camera also looks down at some angle.

  3. #3
    The lighting on picture looks good for vertex lighting. It can be improved by increasing polygons and smoothing normals bu there always be some artifacts due to linear interpolation.
    Those are not noticeable with texture applied to the surface.

  4. #4
    I think the correctness can be judged if you render a sphere with same technique. It should show if the normals are correctly generated. Keep light in same position and show picture from 2 different angles...

  5. #5
    Thanks guys. I've applied texture and it looks good.

    @User137 Your idea is interesting, do you have perhaps a code for generating sphere?

  6. #6
    A really quick way to render a sphere is by using GLUT. Not sure if GLUT spheres have normals too.

    http://pyopengl.sourceforge.net/docu...ere.3GLUT.html
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  7. #7
    Thanks, I know that. The problem is that GLUT function will already generate normals, and for testing my normals calculations I need to generate them by my own having the sphere mesh

Tags for this Thread

Bookmarks

Posting Permissions

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