I have been implementing simple 3D engine in OpenGL, mostly based on tutorials by Tom Dalling. I have implemented the Phong lightening model as described in his tutorial, but I see light artifacts on concave shaped objects (and also when using normal mapping). I came to a point, where i don´t know if my code is broken, or this is actually normal behaviour, and you need special handling for it.

I think that these artifacts could be happening, because the normals of concave object at same points head back into the point light source, not actually considering there is a solid object in between. I tried to do a little scetch of this situation in 2D (for diffuse component): Diffuse light on concave object

So I need to know, if this is a common problem of this light model, or my calculations are wrong.


1 Answer 1


That simple lighting does not know anything about other objects in scene, nor shadows they cast. It just does the lighting knowing the light position and surface normal (and eye position for specular). That's it. No occlusion info, no light refraction, no reflection, no anything, just lighting.

If you need object shadows, there are separate techniques for that (Shadow Mapping, Stencil Shadows, etc.) Some are less well suited for self-shadowing, some are better.

Does that answer your question?

  • \$\begingroup\$ Maybe add some hints about what techniques DO enable shadows. \$\endgroup\$ Commented Nov 24, 2014 at 6:22
  • \$\begingroup\$ I've added a part about that, but I'm still unsure what OP has in mind. \$\endgroup\$
    – Kromster
    Commented Nov 24, 2014 at 7:06
  • \$\begingroup\$ Sure, thank you. I just got to point where I stopped believing in my math skills and needed to know is it is just me, or this is ok, since no tutorial I found actually mentions this effect. \$\endgroup\$
    – user32569
    Commented Nov 24, 2014 at 9:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .