Alternative hook method of cartoon rendering

xiaoxiao2021-03-06  47

According to the example of the cartoon rendering in D3D8, it is in the hook, and the triangle is used to realize the effect of the black side. For a few models, it will produce a very rough or even an unacceptable edge effect. Another commonly used hook rendering is a line that calculates the angle of the normal and rays proximity PI, then rendering the line, the drawback of this method is too low. My method needs to use Stencil Buffer, and implement step clusters are: 1. Open Stencil Buffer, set to always, then add 1 2, then render the original Figure 3, then change the configuration of Stencil Buffer, and set to Only by or equal to 0, add a Vertex Shader, and its role is to stretch each vertex to its normal direction a little 5, set the color of the material to black, set the map to D3DTOP_SELECTARG1 6, the same The model rendering the second time, the effect of the black hook is adjusted to adjust the width of the border of the how by adjusting the amount stretched in the normal direction in the normal direction. Rendering:

转载请注明原文地址:https://www.9cbs.com/read-55829.html

New Post(0)