Saturday, March 30, 2013

[OpenGL] glShadeModel

[Reference] The OpenGL SuperBible


"The other shading model that can be specified with glShadeModel is GL_FLAT for flat shading. Flat
shading means that no shading calculations are performed on the interior of primitives. Generally,
with flat shading, the color of the primitive's interior is the color that was specified for the last
vertex. The only exception is for a GL_POLYGON primitive, in which case the color is that of the first
vertex."

使用 glShadeModel() 可設定三角形或多邊形內部顏色的著色方式,有二個可使用的參數 GL_SMOOTH 和 GL_FLAT。
GL_SMOOTH 將三角形或多邊形的各個頂點的顏色加以計算,於其內部漸層著色。
GL_FLAT只取用三角形或多邊形單一頂點的顏色作為其內部的顏色。在三角形取最後一點的顏色,多邊形則取用第一點的顏色。

No comments:

Post a Comment

[Qt] 執行檔需要哪些 Dll?

 1. 使用 Qt  的 windeployqt.exe 工具 (在 C:\Qt\Qt5.14.1\5.14.1\msvc2017\bin\)。   a. 把執行檔 myProgram.exe 放在某個資料夾。   b. 在檔案總管這個資料夾按 Shift 和滑鼠右鍵,開啟 Po...