IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QGoochMaterial Class

The QGoochMaterial provides a material that implements the Gooch shading model, popular in CAD and CAM applications.

This class was introduced in Qt 5.7.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QGoochMaterial Class

  • Header: QGoochMaterial

  • Since: Qt 5.7

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS 3dextras)

    target_link_libraries(mytarget PRIVATE Qt6::3dextras)

  • qmake: QT += 3dextras

  • Inherits: Qt3DRender::QMaterial

  • Group: QGoochMaterial is part of qt3d-extras-materials

Detailed Description

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.

Property Documentation

 

alpha : float

Holds the current alpha value. The start point of the color ramp used by the Gooch shader is calculated as {c = cool + alpha * diffuse}.

Access functions:

  • float alpha() const

  • void setAlpha(float alpha)

Notifier signal:

  • void alphaChanged(float alpha)

beta : float

Holds the current beta value. The start point of the color ramp used by the Gooch shader is calculated as {c = warm + beta * diffuse}.

Access functions:

  • float beta() const

  • void setBeta(float beta)

Notifier signal:

  • void betaChanged(float beta)

cool : QColor

Holds the current cool color.

Access functions:

  • cool() const

  • void setCool(const &cool)

Notifier signal:

  • void coolChanged(const &cool)

diffuse : QColor

Holds the current diffuse color.

Access functions:

  • diffuse() const

  • void setDiffuse(const &diffuse)

Notifier signal:

  • void diffuseChanged(const &diffuse)

shininess : float

Holds the current shininess value. Higher values of shininess result in a smaller and brighter highlight.

Access functions:

  • float shininess() const

  • void setShininess(float shininess)

Notifier signal:

  • void shininessChanged(float shininess)

specular : QColor

Holds the current specular color.

Access functions:

  • specular() const

  • void setSpecular(const &specular)

Notifier signal:

  • void specularChanged(const &specular)

warm : QColor

Holds the current warm color.

Access functions:

  • warm() const

  • void setWarm(const &warm)

Notifier signal:

  • void warmChanged(const &warm)

Member Function Documentation

 

[explicit] QGoochMaterial::QGoochMaterial(Qt3DCore::QNode *parent = nullptr)

Constructs a new QGoochMaterial instance with parent object parent.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+