摘要 |
A method for calculating attributes of a 3-D graphic with a vertex shader. The 3-D graphic includes a plurality of triangular primitives, each of which contains three vertexes and each of the vertexes having a plurality of attributes including position attributes. The method includes calculating a triangular transform and related position attributes corresponding to the triangular primitive with a transform program consisting of a couple of instructions of the vertex shader, determining whether the triangular transform is visible or not according to the position attributes of three vertexes of the triangular transform, and calculating remaining attributes of the triangular transform if the triangular transform is visible or not calculating the remaining attributes of the triangular transform and culling the triangular transform if the triangular transform is invisible.
|