Answer the question
In order to leave comments, you need to log in
What is the meaning of dot product in Cel Shading?
I can not understand the principles of the implementation of Cel Shading.
To implement Cel Shading, the scalar product between the normal of the surface (polygon) and the light source is calculated.
The scalar product, in turn, depends on the length of the normal vector, the vector to the light source and the angle between them.
Let's say why the distance to the light source (the length of the vector) is used is understandable, but what kind of light beam falling on the surface (polygon) is used to calculate the angle?
And what is the length of the polygon normal vector, what does it depend on?
Answer the question
In order to leave comments, you need to log in
I will answer to the point.
A normal always has a length of 1. Sometimes it is actually a vector perpendicular to the polygon - if we want to light a flat polygon as a plane. Sometimes we want to create the impression of a curved surface from flat polygons and therefore we make (for example, by interpolation or a special texture, the so-called normal map) a continuous field of normals.
A ray vector is a unit vector (or whatever length you want) from the light source to the point you're working with. (Well, or vice versa, depending on how the formula is written.)
If the length of the ray vector is also 1, then the result will be [−1…1]. If it is less than 0 (if the normal is external, and the beam comes from the light source), then we have a coefficient, how many times the actual illumination is less than that provided by the light source. If more, the surface is in its own shadow. (The calculation of drop shadows is a separate and complicated issue.)
It has nothing to do with goal shading, it's generally a lighting base.
To implement Cel Shading, the scalar product between the normal of the surface (polygon) and the light source is calculated.
which ray of light falling on the surface (polygon) is used to calculate the angle?
what is the length of the polygon normal vector, what does it depend on?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question