Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: help with another simple ligthing problem

  1. #1
    Member Contributor
    Join Date
    Jul 2008
    Posts
    52

    help with another simple ligthing problem

    Hi guys, continuing my work with lighting, now actually I have not a problem at all, but a doubt. Look at the image bellow:


    click for enlarge

    I did note OpenGL doesn't calculate if a object is in front of another, in order to receive light (if a objects shadows another). In this image, the light source is slightly up the truck but far behind it. The circulated plate is receiving light even standing hide from the light source, hide behind the truck in relation to the light source. If the plate is hidden from the light, why is it receiving light?

    Like I said, I did note Opengl doesn't do that by itself. How can I control that? Is there any "easy" way?

    Regards!

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

    Re: help with another simple ligthing problem

    Opengl does not do itseft any occlusion computations. What you see is just a gouraud shading artifact.

    read this at "2. Poor Tessellation Hurts Lighting" section.

  3. #3
    Senior Member Regular Contributor
    Join Date
    Dec 2007
    Location
    Brighton, UK
    Posts
    161

    Re: help with another simple ligthing problem

    OpenGL doesn't know if an object hides another. It only knows the spatial relation of the current vertex/fragment, light, camera and surface normal. No 'easy' way to control that, you need to check how to do shadows.

  4. #4
    Member Contributor
    Join Date
    Jul 2008
    Posts
    52

    Re: help with another simple ligthing problem

    I read 2. Poor Tessellation Hurts Lighting but I could not link that with my doubt.

    I don't want to use shadows, is complicated, is there another trick to do, such materials properties to that plate?

  5. #5
    Senior Member Regular Contributor
    Join Date
    Dec 2007
    Location
    Brighton, UK
    Posts
    161

    Re: help with another simple ligthing problem

    Even if you changed material properties for that plate, it would be view/light position dependent. So, to be short, no easy way to get out of this.

    If you don't intend to mess with shadows at this point, try to improve on other important things (e.g. shaders) that improve quality.

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

    Re: help with another simple ligthing problem

    It is not linked to shadows, this is just because fixed pipeline computes lighting per vertex and then interpolates color at each fragment.

    To solve this, you can use a fragment shader and use per pixel illumination like Phong model or not use a spot light.

    EDIT: Are to other part of your green object poor tesselated? Check also the normals you set

  7. #7
    Senior Member Regular Contributor
    Join Date
    Dec 2007
    Location
    Brighton, UK
    Posts
    161

    Re: help with another simple ligthing problem

    dletozeun, he said that the light comes from the back of the truck, and we see the front (you can see the ambient on the facing side of the truck), so it's probably a combined problem of shadowing & the interpolation artifact.

  8. #8
    Member Contributor
    Join Date
    Jul 2008
    Posts
    52

    Re: help with another simple ligthing problem

    Sorry, here is how it is:


    click to enlarge

    the scene is ugly, but it's all I need for while. After this I'll apply texture. I'd just want to get rid of these problems of shadows and lighting, it seems lighting is the most difficult part of rendering in rasterization. How I love ray tracing...

  9. #9
    Member Contributor
    Join Date
    Jul 2008
    Posts
    52

    Re: help with another simple ligthing problem

    I think in setting the sun at 12:00 PM.

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

    Re: help with another simple ligthing problem

    I am happy to see your beautiful truck, but that does help us if you don't emphasize the lighting bug, I don't see it here...

    In ray tracing, you don't have this problem, because all is done per pixel, but lighting is still complicated (depending on your needs)

    EDIT: babis is right. Try to put the light in front of the truck.

Page 1 of 2 12 LastLast

Similar Threads

  1. Ligthing problems
    By farrington in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 05-06-2013, 05:45 AM
  2. Simple problem
    By Joshhua5 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 01-04-2011, 05:30 AM
  3. Simple problem
    By starman in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 09-04-2007, 11:21 PM
  4. simple problem i cant fix
    By stichedleg in forum OpenGL: Windows
    Replies: 2
    Last Post: 12-12-2004, 12:23 PM
  5. Texture lighting VS vertex ligthing
    By Roderic (Ingenu) in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 06-28-2000, 07:24 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