Mukund
07-09-2011, 04:59 AM
Hello Everyone,
I am new to shaders. I am going through some tutorials online. There is this tutorial about Toon Shaders:
TUTORIAL (http://www.lighthouse3d.com/tutorials/glsl-tutorial/toon-shader-version-ii/)
Now, it says:
In this section we will do the toon shader effect per fragment. In order to do that, we need to have access to the fragments normal per fragment. Hence the vertex shader only needs to write the normal into a varying variable, so that the fragment shader has access to the interpolated normal.
What I am confused is, we specify normals per vertex. But how can we get access to normals at fragments? Is there some interpolation done internally?
Could anyone please clarify this for me?
Thanks.
I am new to shaders. I am going through some tutorials online. There is this tutorial about Toon Shaders:
TUTORIAL (http://www.lighthouse3d.com/tutorials/glsl-tutorial/toon-shader-version-ii/)
Now, it says:
In this section we will do the toon shader effect per fragment. In order to do that, we need to have access to the fragments normal per fragment. Hence the vertex shader only needs to write the normal into a varying variable, so that the fragment shader has access to the interpolated normal.
What I am confused is, we specify normals per vertex. But how can we get access to normals at fragments? Is there some interpolation done internally?
Could anyone please clarify this for me?
Thanks.