Gambas文档
编译和安装
错误消息
代码片段
待办事项
废弃的组件
教程
开发环境文档
开发者文档
名词解释
如何操作
说明
维基手册
维基搜索
维基许可协议
文档
应用程序仓库
语言概览
语言索引
主题
组件
gb
gb.args
gb.cairo
gb.chart
gb.clipper
gb.complex
gb.compress
gb.crypt
gb.data
gb.db
gb.db.form
gb.db.mysql
gb.db.odbc
gb.db.postgresql
gb.db.sqlite2
gb.db.sqlite3
gb.dbus
gb.dbus.trayicon
gb.debug
gb.desktop
gb.desktop.x11
gb.eval
gb.eval.highlight
gb.form
gb.form.dialog
gb.form.editor
gb.form.htmlview
gb.form.mdi
gb.form.print
gb.form.terminal
gb.gmp
gb.gsl
gb.gtk
gb.gtk3
gb.gtk3.opengl
gb.gtk3.webview
gb.gui
gb.gui.qt
gb.gui.qt.ext
gb.gui.trayicon
gb.gui.webview
gb.hash
gb.highlight
gb.image
gb.image.effect
gb.image.io
gb.inotify
gb.logging
gb.map
gb.media
gb.media.form
gb.mime
gb.mongodb
gb.mysql
gb.ncurses
gb.net
gb.net.curl
gb.net.pop3
gb.net.smtp
gb.opengl
Gl
gb.opengl.glsl
gb.opengl.glu
gb.opengl.sge
gb.openssl
gb.option
gb.pcre
gb.pdf
gb.poppler
gb.qt4
gb.qt4.ext
gb.qt4.opengl
gb.qt4.webkit
gb.qt4.webview
gb.qt5
gb.qt5.ext
gb.qt5.opengl
gb.qt5.webview
gb.qt6
gb.qt6.ext
gb.qt6.opengl
gb.qt6.webview
gb.report
gb.report2
gb.sdl
gb.sdl2
gb.sdl2.audio
gb.settings
gb.signal
gb.term
gb.test
gb.util
gb.util.web
gb.v4l
gb.vb
gb.web
gb.web.feed
gb.web.form
gb.web.gui
gb.xml
gb.xml.html
gb.xml.rpc
gb.xml.xslt
最近的修改

Gl.Materiali (gb.opengl)

Static Sub Materiali ( Face As Integer, Pname As Integer, Param As Integer )

Specify material parameters for the lighting model.

Parameters

face

Specifies which face or faces are being updated. Must be one of Gl.FRONT, Gl.BACK, or Gl.FRONT_AND_BACK.
pname

Specifies the single-valued material parameter of the face or faces that is being updated. Must be Gl.SHININESS.
param

Specifies the value that parameter Gl.SHININESS will be set to.

Parameters

face

Specifies which face or faces are being updated. Must be one of Gl.FRONT, Gl.BACK, or Gl.FRONT_AND_BACK.
pname

Specifies the material parameter of the face or faces that is being updated. Must be one of Gl.AMBIENT, Gl.DIFFUSE, Gl.SPECULAR, Gl.EMISSION, Gl.SHININESS, Gl.AMBIENT_AND_DIFFUSE, or Gl.COLOR_INDEXES.
params

Specifies a pointer to the value or values that pname will be set to.

Description

Gl.Material assigns values to material parameters. There are two matched sets of material parameters. One, the front-facing set, is used to shade points, lines, bitmaps, and all polygons (when two-sided lighting is disabled), or just front-facing polygons (when two-sided lighting is enabled). The other set, back-facing, is used to shade back-facing polygons only when two-sided lighting is enabled. Refer to the Gl.LightModel reference page for details concerning one- and two-sided lighting calculations.

Gl.Material takes three arguments. The first, face, specifies whether the Gl.FRONT materials, the Gl.BACK materials, or both Gl.FRONT_AND_BACK materials will be modified. The second, pname, specifies which of several parameters in one or both sets will be modified. The third, params, specifies what value or values will be assigned to the specified parameter.

Material parameters are used in the lighting equation that is optionally applied to each vertex. The equation is discussed in the Gl.LightModel reference page. The parameters that can be specified using Gl.Material, and their interpretations by the lighting equation, are as follows:
Gl.AMBIENT

params contains four integer or floating-point values that specify the ambient RGBA reflectance of the material. Integer values are mapped linearly such that the most positive representable value maps to 1.0, and the most negative representable value maps to -1.0 . Floating-point values are mapped directly. Neither integer nor floating-point values are clamped. The initial ambient reflectance for both front- and back-facing materials is (0.2, 0.2, 0.2, 1.0).
Gl.DIFFUSE

params contains four integer or floating-point values that specify the diffuse RGBA reflectance of the material. Integer values are mapped linearly such that the most positive representable value maps to 1.0, and the most negative representable value maps to -1.0 . Floating-point values are mapped directly. Neither integer nor floating-point values are clamped. The initial diffuse reflectance for both front- and back-facing materials is (0.8, 0.8, 0.8, 1.0).
Gl.SPECULAR

params contains four integer or floating-point values that specify the specular RGBA reflectance of the material. Integer values are mapped linearly such that the most positive representable value maps to 1.0, and the most negative representable value maps to -1.0 . Floating-point values are mapped directly. Neither integer nor floating-point values are clamped. The initial specular reflectance for both front- and back-facing materials is (0, 0, 0, 1).
Gl.EMISSION

params contains four integer or floating-point values that specify the RGBA emitted light intensity of the material. Integer values are mapped linearly such that the most positive representable value maps to 1.0, and the most negative representable value maps to -1.0 . Floating-point values are mapped directly. Neither integer nor floating-point values are clamped. The initial emission intensity for both front- and back-facing materials is (0, 0, 0, 1).
Gl.SHININESS

params is a single integer or floating-point value that specifies the RGBA specular exponent of the material. Integer and floating-point values are mapped directly. Only values in the range 0 128 are accepted. The initial specular exponent for both front- and back-facing materials is 0.
Gl.AMBIENT_AND_DIFFUSE

Equivalent to calling Gl.Material twice with the same parameter values, once with Gl.AMBIENT and once with Gl.DIFFUSE.
Gl.COLOR_INDEXES

params contains three integer or floating-point values specifying the color indices for ambient, diffuse, and specular lighting. These three values, and Gl.SHININESS, are the only material values used by the color index mode lighting equation. Refer to the Gl.LightModel reference page for a discussion of color index lighting.

Notes

The material parameters can be updated at any time. In particular, Gl.Material can be called between a call to Gl.Begin and the corresponding call to Gl.End. If only a single material parameter is to be changed per vertex, however, Gl.ColorMaterial is preferred over Gl.Material (see Gl.ColorMaterial).

While the ambient, diffuse, specular and emission material parameters all have alpha components, only the diffuse alpha component is used in the lighting computation.

Errors

Gl.INVALID_ENUM is generated if either face or pname is not an accepted value.

Gl.INVALID_VALUE is generated if a specular exponent outside the range 0 128 is specified.

Associated Gets

Gl.GetMaterial

See also

Gl.Light, Gl.LightModel

See original documentation on OpenGL website