QGoochMaterial

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

Inheritance diagram of PySide2.Qt3DExtras.Qt3DExtras.QGoochMaterial

Synopsis

Functions

Slots

Signals

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.

class PySide2.Qt3DExtras.Qt3DExtras.QGoochMaterial([parent=None])

Constructs a new QGoochMaterial instance with parent object parent .

PySide2.Qt3DExtras.Qt3DExtras.QGoochMaterial.alpha()
Return type:

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}.

PySide2.Qt3DExtras.Qt3DExtras.QGoochMaterial.alphaChanged(alpha)
Parameters:

alpha – float

PySide2.Qt3DExtras.Qt3DExtras.QGoochMaterial.beta()
Return type:

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}.

PySide2.Qt3DExtras.Qt3DExtras.QGoochMaterial.betaChanged(beta)
Parameters:

beta – float

PySide2.Qt3DExtras.Qt3DExtras.QGoochMaterial.cool()
Return type:

PySide2.QtGui.QColor

Holds the current cool color.

PySide2.Qt3DExtras.Qt3DExtras.QGoochMaterial.coolChanged(cool)
Parameters:

coolPySide2.QtGui.QColor

PySide2.Qt3DExtras.Qt3DExtras.QGoochMaterial.diffuse()
Return type:

PySide2.QtGui.QColor

Holds the current diffuse color.

PySide2.Qt3DExtras.Qt3DExtras.QGoochMaterial.diffuseChanged(diffuse)
Parameters:

diffusePySide2.QtGui.QColor

PySide2.Qt3DExtras.Qt3DExtras.QGoochMaterial.setAlpha(alpha)
Parameters:

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}.

PySide2.Qt3DExtras.Qt3DExtras.QGoochMaterial.setBeta(beta)
Parameters:

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}.

PySide2.Qt3DExtras.Qt3DExtras.QGoochMaterial.setCool(cool)
Parameters:

coolPySide2.QtGui.QColor

Holds the current cool color.

PySide2.Qt3DExtras.Qt3DExtras.QGoochMaterial.setDiffuse(diffuse)
Parameters:

diffusePySide2.QtGui.QColor

Holds the current diffuse color.

PySide2.Qt3DExtras.Qt3DExtras.QGoochMaterial.setShininess(shininess)
Parameters:

shininess – float

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

PySide2.Qt3DExtras.Qt3DExtras.QGoochMaterial.setSpecular(specular)
Parameters:

specularPySide2.QtGui.QColor

Holds the current specular color.

PySide2.Qt3DExtras.Qt3DExtras.QGoochMaterial.setWarm(warm)
Parameters:

warmPySide2.QtGui.QColor

Holds the current warm color.

PySide2.Qt3DExtras.Qt3DExtras.QGoochMaterial.shininess()
Return type:

float

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

PySide2.Qt3DExtras.Qt3DExtras.QGoochMaterial.shininessChanged(shininess)
Parameters:

shininess – float

PySide2.Qt3DExtras.Qt3DExtras.QGoochMaterial.specular()
Return type:

PySide2.QtGui.QColor

Holds the current specular color.

PySide2.Qt3DExtras.Qt3DExtras.QGoochMaterial.specularChanged(specular)
Parameters:

specularPySide2.QtGui.QColor

PySide2.Qt3DExtras.Qt3DExtras.QGoochMaterial.warm()
Return type:

PySide2.QtGui.QColor

Holds the current warm color.

PySide2.Qt3DExtras.Qt3DExtras.QGoochMaterial.warmChanged(warm)
Parameters:

warmPySide2.QtGui.QColor