发明名称 Exchanging data between vertex shaders and fragment shaders on a graphics processing unit
摘要 It is desirable for a fragment shader to have access to non-interpolated values for each vertex of the primitive in which the fragment is located. For example, a fragment shader may use the distortion of the primitive with respect to an original state of the primitive as part of the function the fragment shader performs. Due to the specification of fragment shaders and vertex shaders, fragments shaders receive only interpolated values, and thus cannot receive non-interpolated values of, for example, one solution to this problem would be to modify the processing engine for the shader language, and the shader specifications themselves, so that a fragment shader can receive non-interpolated values from the vertices of the primitive on which the fragment is located. Desirable values to receive would be at least the vertex coordinates. Another solution is to specify and use varyings in a manner that pass data to a fragment shader that permit the fragment shader to reconstruct the non-interpolated values. One way to achieve this is to a. allocate varyings and assign them indices, b. assign indices to the vertices and c. have each a shader contribute only to those varyings having the same index as the vertex being processed, and otherwise contribute a null value, such as 0, to the varyings with other indices. In this manner, when the interpolated value for the indexed varying is received by the fragment shader, the indexed varying contains the contribution of only one vertex, scaled by an interpolation parameter. Another indexed varying can be used to pass the interpolation parameter, allowing the original value for the vertex to be computed by the fragment shader.
申请公布号 US9123151(B2) 申请公布日期 2015.09.01
申请号 US200812185998 申请日期 2008.08.05
申请人 AUTODESK, INC. 发明人 Stewart Ian;Laflamme Dominic;Cabot Eric
分类号 G06T15/50;G06T15/00;G09G5/00;G06T1/60 主分类号 G06T15/50
代理机构 Artegis Law Group, LLP 代理人 Artegis Law Group, LLP
主权项 1. A non-transitory computer-readable medium storing instructions that, when executed by a processor, cause the processor to implement: a vertex shader having an output for providing output data generated for a vertex in a mesh; and a fragment shader having an input for receiving input data corresponding to the output data from the vertex shader, wherein the fragment shader can determine, based on the input data, original values associated with each vertex prior to the vertex being processed by the vertex shader, each vertex defining a primitive that contains a fragment being processed by the fragment shader.
地址 San Rafael CA US