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

    Question [OpenGL] Is my lightning good enough?

    Hi guys. Recently I'am flooding the forum with posts, hope you don't mind ;-)

    I've finished calculating normals for my terrain mesh and I am wondering is the result displayed correctly?
    From the code side everything seems to be ok but...how many times everything seemed to be ok and it wasn't?

    So I am giving 3 screenshots. The first one shows normals calculated for each triangle. And I think it looks good.



    The second one has normals calculated per vertex:



    At the third image I've marked some regions which I don't like. And I am not sure is this a normal thing or do I calculate something quite not right? I mean the brighter spots, doesn't look so smooth...



    What do you think, is it ok or is it wrong? Can I improve it somehow? The quality of mesh does not helping here. I've rendered the mesh with 150 triangles, 300, 600, and 1200 and it looks almost the same regarding the triangle count.

    Thanks for your opinions

  2. #2
    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.

  3. #3
    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.

  4. #4
    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.

  5. #5
    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...

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

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

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
  •