• Advertisement

Archived

This topic is now archived and is closed to further replies.

Volume shadows work! Some artifacts, though...

This topic is 5098 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, My volume shadows work. Because opengl uses gouraund shading (interpolation of vertexcolors through faces) some faces that are not facing the light get lit a bit by a vertex facing the light. These faces get entirely dark because of the shadows. This gives an incontinuity between the colors of a face facing the light and a face next to it that''s not facing the light. This can get very ugly. To prevent this each backfacing face has to be in 3 shadow volumes (it''s own and the lightfacing face behind it don''t count anymore). This works fine, but I still get artifacts...
                           ___
                       ___/ (this is the lightdirection pointing
                   ___/      to the left and downward)
           o     |/_
          / \
       2 /   \ 3
        /     \
o------o       o------o
   1             4
                               --- = face
                                o  = vertex

* Face 1 gets shadowed, since it''s in it''s own shadow volume,
  that of face 2 and of face 3.
* Face 2 doesn''t, because it''s only in face 3 its shadow and
  its own.
* So the gouraund interpolation (from the lit vertex (between
  face 2 and 3) still works over face 2).
 
There are some artifacts (in some cases face 1 is entirely lit aswell) And sometimes a shadow is cast from another object closer to the lightsource. This shadowvolume penetrates face2 so casts a shadow on it. This shadow becomes visible, because face 2 is gouraund interpolated. If opengl knew phong shading this problem wouldn''t exist at all, since the normals are interpolated over a face. Is there a way to do fast phong shading (i''m not talking about specular light, just interpolation of normals instead of colors)? Would be nice, cause i could integrate normalmapping aswell this way. Thanx, Marty

Share this post


Link to post
Share on other sites
Advertisement
what I explained the last time you posted this problem assumed that only the faces facing the light cast shadows. Having the back faces also cast shadows is unessecary.



| - My project website - | - email me - |

Share this post


Link to post
Share on other sites

  • Advertisement