Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Graphics 通过一个例子理解小尺度古劳德着色_Graphics_Interpolation_Linear Interpolation_Phong_Gouraud - Fatal编程技术网

Graphics 通过一个例子理解小尺度古劳德着色

Graphics 通过一个例子理解小尺度古劳德着色,graphics,interpolation,linear-interpolation,phong,gouraud,Graphics,Interpolation,Linear Interpolation,Phong,Gouraud,我在上计算机图形学课程,刚刚通过了关于Phong和Gouraud着色的讲座。我真的不明白他们在说什么,所以我转向教科书寻求澄清,并找到了一个可行的例子,可能对我有所帮助。我想和大家讨论一下这个例子 这个例子说: During triangle rasterization we are using Gouraud interpolation of colors across a triangle to determine the colors of pixels.The triangle we

我在上计算机图形学课程,刚刚通过了关于Phong和Gouraud着色的讲座。我真的不明白他们在说什么,所以我转向教科书寻求澄清,并找到了一个可行的例子,可能对我有所帮助。我想和大家讨论一下这个例子

这个例子说:

During triangle rasterization we are using Gouraud interpolation 
of colors across a triangle to determine the colors of pixels.The triangle we are 
rendering has vertices A, B, and C, with screen-space coordinates A = (30,10), 
B = (30,50), and C = (60, 30).
顶点具有以下RGB颜色:

Ac = (25, 160, 30)
Bc = (25, 110, 30)
Cc = (25, 115, 30)
点(a)(30,30)和点(b)(45,30)的RGB颜色是什么

对于(a)

我讲的是A和B的R和B值-它们是相同的,然后,因为30正好在10和50之间。。。取G的A和B颜色值的平均值

所以(2513530)是点的颜色值。我将在下一个问题中使用这个值,所以我们称它为M点

对于(b)

我们只有一个点,y坐标是30,点M在(30,30)。既然(30,30)和(60,30)有相同的R和B值。。。我假设(45,30)一个也一样。同样,我们只是平均G值,因为45正好在30和60之间

所以答案是(25,125,30)


所以我的问题是-这是正确的吗?如果是这样的话——这就是所谓的插值——这种……平均值吗?Phong着色与此有何不同?

古劳德正在进行强度之间的插值,速度更快。Phong在法线之间进行插值,这比较昂贵,但可以获得更好的质量,更平滑。你没有间断。要获得相同质量的古罗,需要更大的采样率