3
$\begingroup$

In what way is a "cheat" when using smooth shading on a sphere approximation?

enter image description here

I'm not understanding how it's a cheat to use smooth shading on this?

Other questions that are lead after this may be: Why does it look better than the Gouraud Shaded Model and why is this not necessary generally applicable to any surface?

$\endgroup$
3
  • 1
    $\begingroup$ Are you asking this because someone else has declared it to be a cheat? If so, it might help to give the context of what they said, otherwise people can only guess what you are trying to find out. $\endgroup$ Commented Dec 8, 2018 at 23:26
  • $\begingroup$ Yes, someone else said it was like a "cheat". Basically this cheat is better looking than using a Gouraud shaded model. But my question is how and why? $\endgroup$
    – user9778
    Commented Dec 10, 2018 at 0:01
  • $\begingroup$ and why is this not necessary generally applicable to any surface? Is it because it's just a "cheat" made for sphere approximations? not any others? $\endgroup$
    – user9778
    Commented Dec 10, 2018 at 0:01

1 Answer 1

3
$\begingroup$

Sphere's don't have edges like the ones in that picture. The "silhouette" should be a circle. This is because the sphere was rendered as triangles and rasterized. Triangles can only approximate a sphere.

Compare this to ray casting for instance. Where we can directly test the intersection between a sphere and ray thus no need to approximate a sphere with other primitives.

What smooth shading lets us do is interpolate values across the face of a triangle to cheat and make something appear smoother. In reality a sphere (a uv sphere) would look like this:

enter image description here

There are two common ways to make the above sphere look smooth without adding anymore geometry. Both of which involve linearly interpolating values across the face of a triangle. Like barycentric interpolation. With barycentric interpolation, given values at 3 points (on a triangle) and a point we want to know the value for we can calculate a mix between the 3 values at the corners such that it smoothly varies across the face of the triangle.

enter image description here

In rasterization there are two popular ways to smooth shade. The later being used more often.

Gouraud: We calculate the post-lighting (shaded) color at each vertex and interpolate the color across the face of the triangle.

Phong: We calculate the shaded color at every pixel across the triangle, interpolating things like normals across the triangle.

EDIT: The difference between gouraud and phong is that gouraud assumes the color and light intensity change linearly with the normal. Whereas phong does not. For a simple light intensity = dot(normal, lightDir) = cos(angle between normal and lightDir) we can see the relationship between intensity and the normal is nonlinear. This can be well illustrated with the below image (see the seams on the specular highlight. This is the consequence of our linear interpolation):

enter image description here

$\endgroup$
6
  • $\begingroup$ So why does it look better than the Gouraud Shaded Model specifically? and why is this not necessary generally applicable to any surface? $\endgroup$
    – user9778
    Commented Dec 10, 2018 at 1:08
  • $\begingroup$ Is it because it's just a "cheat" made for sphere approximations? not any others? $\endgroup$
    – user9778
    Commented Dec 10, 2018 at 1:08
  • 1
    $\begingroup$ No, smooth shading works on many surfaces, not just spheres. It is very widely used. I'd call it a cheat because you are trying to draw a smooth surface without actually making the geometry smoother (more points). Of course, you only want to use it for things you want smooth (ie: any curved surface). $\endgroup$ Commented Dec 10, 2018 at 4:37
  • 1
    $\begingroup$ Also I've edited my post to illustrate the difference between gouraud and phong providing details of why phong is better for smooth surfaces. $\endgroup$ Commented Dec 10, 2018 at 4:46
  • $\begingroup$ Oh okay I understand. Thanks a lot for clearing it up! $\endgroup$
    – user9778
    Commented Dec 10, 2018 at 4:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.