The QGoochMaterial provides a material that implements the Gooch shading model, popular in CAD and CAM applications. 更多...
| 頭: | #include <QGoochMaterial> |
| qmake: | QT += 3dextras |
| Since: | Qt 5.7 |
| 繼承: | Qt3DRender::QMaterial |
| QGoochMaterial (Qt3DCore::QNode * parent = nullptr) | |
| float | alpha () const |
| float | beta () const |
| QColor | cool () const |
| QColor | diffuse () const |
| float | shininess () const |
| QColor | specular () const |
| QColor | warm () const |
| void | setAlpha (float alpha ) |
| void | setBeta (float beta ) |
| void | setCool (const QColor & cool ) |
| void | setDiffuse (const QColor & diffuse ) |
| void | setShininess (float shininess ) |
| void | setSpecular (const QColor & specular ) |
| void | setWarm (const QColor & warm ) |
| void | alphaChanged (float alpha ) |
| void | betaChanged (float beta ) |
| void | coolChanged (const QColor & cool ) |
| void | diffuseChanged (const QColor & diffuse ) |
| void | shininessChanged (float shininess ) |
| void | specularChanged (const QColor & specular ) |
| void | warmChanged (const QColor & warm ) |
| QGoochMaterial (QGoochMaterialPrivate & dd , Qt3DCore::QNode * parent = nullptr) |
The QGoochMaterial provides a material that implements the Gooch shading model, popular in CAD and CAM applications.
The Gooch lighting model uses both color and brightness to help show the curvature of 3D surfaces. This is often better than models such as Phong that rely purely upon changes in brightness. In situations such as in CAD and CAM applications where photorealism is not a goal, the Gooch shading model in conjunction with some kind of silhouette edge inking is a popular solution.
The Gooch lighting model is explained fully in the original Gooch paper . The Gooch model mixes a diffuse object color with a user-provided cool color and warm color to produce the end points of a color ramp that is used to shade the object based upon the cosine of the angle between the vector from the fragment to the light source and the fragment's normal vector. Optionally, a specular highlight can be added on top. The relative contributions to the cool and warm colors by the diffuse color are controlled by the alpha and beta properties respecitvely.
This material uses an effect with a single render pass approach and performs per fragment lighting. Techniques are provided for OpenGL 2, OpenGL 3 or above as well as OpenGL ES 2.
Holds the current alpha value. The start point of the color ramp used by the Gooch shader is calculated as {c = cool + alpha * diffuse}.
訪問函數:
| float | alpha () const |
| void | setAlpha (float alpha ) |
通知程序信號:
| void | alphaChanged (float alpha ) |
Holds the current beta value. The start point of the color ramp used by the Gooch shader is calculated as {c = warm + beta * diffuse}.
訪問函數:
| float | beta () const |
| void | setBeta (float beta ) |
通知程序信號:
| void | betaChanged (float beta ) |
Holds the current cool color.
訪問函數:
| QColor | cool () const |
| void | setCool (const QColor & cool ) |
通知程序信號:
| void | coolChanged (const QColor & cool ) |
Holds the current diffuse color.
訪問函數:
| QColor | diffuse () const |
| void | setDiffuse (const QColor & diffuse ) |
通知程序信號:
| void | diffuseChanged (const QColor & diffuse ) |
Holds the current shininess value. Higher values of shininess result in a smaller and brighter highlight.
訪問函數:
| float | shininess () const |
| void | setShininess (float shininess ) |
通知程序信號:
| void | shininessChanged (float shininess ) |
Holds the current specular color.
訪問函數:
| QColor | specular () const |
| void | setSpecular (const QColor & specular ) |
通知程序信號:
| void | specularChanged (const QColor & specular ) |
Holds the current warm color.
訪問函數:
| QColor | warm () const |
| void | setWarm (const QColor & warm ) |
通知程序信號:
| void | warmChanged (const QColor & warm ) |
Default constructs an instance of QGoochMaterial.
[protected]
QGoochMaterial::
QGoochMaterial
(
QGoochMaterialPrivate
&
dd
,
Qt3DCore::QNode
*
parent
= nullptr)
Copy constructor.