Graphics - Pass

Introduction of some graphics concepts, personal excerpts or sorting, as the entry quotes of personal articles;

Pass

The process of transforming a set of Mesh/Parameter input into Pixel Output is called a Pass; multiple Pass means inputting a set of Mesh/Parameter on the screen and Draw multiple times;

In Unity's Shaderlab, we often use the Pass{} keyword to declare multiple passes with different RenderStates for the same material to achieve some effects, but in UE4, there is no support for multiple passes at the shader/material level; although there is a Layer , But it cannot achieve the superposition of the calculation results of different ShadingModel / RenderState, but the calculation results of the MaterialParameter are mixed;

There are many application scenarios for multi-pass, such as external expansion model stroke; the first Pass is used for normal rendering, the second Pass is set with BackfaceCull, DepthLess's RenderState, and then the vertices are offset along the normal direction in VS; We also often use multiple passes when rendering translucent objects. For example, translucent objects generally do not write Depth, which will cause the interior and back of the model to be drawn, causing the display to be out of order; to solve this The method is to write only Depth in the first Pass without rendering any pixels, and then set the RenderState to DepthLEqual in the second Pass, so that we can use DepthTest to filter out the interior and back that we don't want to render; in fact, Multiple Passes are equivalent to different materials for the same Mesh ;


Guess you like

Origin blog.csdn.net/DoomGT/article/details/114992682