geom/doc/salome/gui/GEOM/input/material.doc

173 lines
7.7 KiB
Plaintext
Raw Normal View History

2012-08-09 13:58:02 +06:00
/*!
2013-12-18 20:23:59 +06:00
\page material_page Material
2012-08-09 13:58:02 +06:00
2013-04-17 22:05:53 +06:00
<ul>
<li>\ref material_general_description_anchor "General Description"</li>
<li>\ref material_opengl_model_anchor "OpenGL lighting model" </li>
2013-04-17 22:05:53 +06:00
<li>\ref material_lib_anchor "Materials library"</li>
<li>\ref material_anchor "Material properties"</li>
</ul>
2012-08-09 13:58:02 +06:00
2013-04-17 22:05:53 +06:00
\anchor material_general_description_anchor <h2>General description</h2>
2012-08-09 13:58:02 +06:00
\note The functionality related to the material properties is
2013-04-17 22:05:53 +06:00
\b experimental, so it might work not as expected. The behavior might
2012-08-09 13:58:02 +06:00
be changed in the future versions of SALOME Geometry module.
2013-04-17 22:05:53 +06:00
You can change the material properties of the selected shape(s) in
2013-12-18 20:23:59 +06:00
the context menu dialog. The layout of context menu can be customized via
2013-04-17 22:05:53 +06:00
"Show predefined materials in popup menu" preferences option.
2013-02-12 17:35:16 +06:00
If this option is switched off, only "Material properties" item will
2013-04-17 22:05:53 +06:00
be shown in the popup menu. If this option is on (by default), "Material
2013-12-18 20:23:59 +06:00
properties" item in the popup menu will open a sub-menu with a list of predefined
2013-04-17 22:05:53 +06:00
materials:
2013-02-12 17:35:16 +06:00
2013-04-17 22:05:53 +06:00
\image html hide_predef_material.png
<center><em>"Show predefined materials in popup menu" option is switched off</em></center>
2012-08-09 13:58:02 +06:00
2013-04-17 22:05:53 +06:00
\n\image html show_predef_material.png
<center><em>"Show predefined materials in popup menu" option is switched on</em></center>
2012-08-09 13:58:02 +06:00
2013-04-17 22:05:53 +06:00
The \b Custom item from this list allows defining \ref material_anchor "Material properties",
including the creation of a custom material.
2012-08-09 13:58:02 +06:00
2013-04-17 22:05:53 +06:00
It is also possible to define custom materials in the
\ref material_lib_anchor "Materials library" dialog
available from the main menu via <b>Tools > Materials library </b>.
2013-02-12 17:35:16 +06:00
2013-04-17 22:05:53 +06:00
\note This functionality works in both OCC and VTK 3D
viewers. However, due to the differences between underlying API
of OCC and VTK libraries, the behavior of the functionality related to
2012-08-09 13:58:02 +06:00
the materials is different:
2013-04-17 22:05:53 +06:00
- shape presentation in OCC and VTK viewers is not fully identical;
- some material attributes can affect the presentation in a different way.
2012-08-09 13:58:02 +06:00
2013-12-18 20:23:59 +06:00
\anchor material_opengl_model_anchor <h2>OpenGL lighting model</h2>
2012-08-09 13:58:02 +06:00
2013-12-18 20:23:59 +06:00
The material is specified by several attributes of the lighting
2012-08-09 13:58:02 +06:00
model. More details can be found in the documentation related to the
2013-04-17 22:05:53 +06:00
OpenGL programming, for example, here: http://www.glprogramming.com/red/chapter05.html.
2012-08-09 13:58:02 +06:00
In the OpenGL lighting model, the light in a scene comes from several
light sources; the light sources have an effect only when there are
surfaces that absorb and reflect light. Each surface is assumed to be
composed of a material with various properties. A material might emit
2013-12-18 20:23:59 +06:00
its own light (like headlights of a vehicle), it might scatter
2012-08-09 13:58:02 +06:00
some incoming light in all directions, and it might reflect a
portion of the incoming light in a preferential direction like a
mirror or other shiny surface.
The OpenGL lighting model considers the lighting to be divided into
four independent components: emissive, ambient, diffuse, and
specular. All four components are computed independently and then
added together.
2013-04-17 22:05:53 +06:00
- The \b Ambient illumination is the light that has been scattered so much by the
2012-08-09 13:58:02 +06:00
environment that its direction is impossible to determine - it seems
to come from all directions. Backlighting in a room has a large
ambient component, since most of the light that reaches your eye has
first bounced off many surfaces. A spotlight outdoors has a tiny
ambient component; most of the light travels in the same direction,
and since you're outdoors, very little of the light reaches your eye
after bouncing off other objects. When ambient light strikes a
surface, it is scattered equally in all directions.
2013-04-17 22:05:53 +06:00
- The \b Diffuse component is the light that comes from one direction, so
2012-08-09 13:58:02 +06:00
it is brighter if it comes squarely down on a surface than if it barely
glances off the surface. Once it hits a surface, however, it's
scattered equally in all directions, so it appears equally bright, no
matter where the eye is located. Any light coming from a particular
position or direction probably has a diffuse component.
2013-04-17 22:05:53 +06:00
- The \b Specular light comes from a particular direction, and it
2012-08-09 13:58:02 +06:00
tends to bounce off the surface in a preferred direction. A
well-collimated laser beam bouncing off a high-quality mirror produces
specular reflection by almost 100 percent. Shiny metal or plastic has a
high specular component, and chalk or carpet has almost none. You can
think of specularity as shininess.
2013-04-17 22:05:53 +06:00
- The \b Emissive color simulates light originating from an object.
In the OpenGL lighting model, the emissive color of a surface adds
intensity to the object, but is unaffected by any light sources. Also,
the emissive color does not introduce any additional light into the
overall scene.
2012-08-09 13:58:02 +06:00
Although a light source delivers a single distribution of frequencies,
the ambient, diffuse, and specular components might be different. For
example, if you have a white light in a room with red walls, the
scattered light tends to be red, although the light directly striking
objects is white. OpenGL allows you to set the red, green, and blue
values for each component of light independently.
2013-04-17 22:05:53 +06:00
\anchor material_lib_anchor <h2>Materials library</h2>
2012-08-09 13:58:02 +06:00
2013-04-17 22:05:53 +06:00
\image html materials_library.png
The dialog consists of two parts:
2012-08-09 13:58:02 +06:00
2013-04-17 22:05:53 +06:00
<ul>
<li>The list to the left shows all available material models, both
predefined and custom.
2012-08-09 13:58:02 +06:00
- <b>[Current]</b> item in the list corresponds to the material model
currently assigned to the selected shape(s). This model can be
freely modified by the user.
- <b>Global</b> material models are shown in blue color in the list;
these are the models predefined by the SALOME Geometry module. The user
is not allowed to modify the global models.
- <b>User</b> materials are shown in black color in the list. These
models are specified by the user and can be modified at any moment.
2013-04-17 22:05:53 +06:00
</li>
2012-08-09 13:58:02 +06:00
2013-12-18 20:23:59 +06:00
<li>The widgets to the right allow modifying different properties of the material model:
2013-04-17 22:05:53 +06:00
- \b Ambient color and coefficient (floating point value between 0 and 1)
- \b Diffuse color and coefficient (floating point value between 0 and 1)
- \b Specular color and coefficient (floating point value between 0 and 1)
- \b Emissive color and coefficient (floating point value between 0
and 1). Note: this attribute is applicable only for the OCC viewer;
it simulates light originating from an object.
- \b Shininess
- \b Type of material model: \em physical or \em artificial.
</li>
2012-08-09 13:58:02 +06:00
2013-04-17 22:05:53 +06:00
<li>The buttons <b>Add material</b> and <b>Remove material</b> in the
lower part of the dialog box can be used to create or remove custom
material models. The same commands are also available via the context
menu in the materials list. <b>Rename material</b> command can be used
to change the name of material model.</li>
</ul>
\anchor material_anchor <h2>Material properties</h2>
\image html material.png
2013-02-12 17:35:16 +06:00
2013-04-17 22:05:53 +06:00
In addition to the functionality of <b>Materials library</b>, this
2013-12-18 20:23:59 +06:00
dialog provides objects selection mechanism and \b Color property.
2013-02-12 17:35:16 +06:00
2013-04-17 22:05:53 +06:00
If the material model is specified as a \em physical (\em Gold,
for example), the shape color (more precisely its \em ambient color)
cannot be modified. If you assign a physical material model to the
shape, the "Color" menu item will not be available in the popup menu.
2013-02-12 17:35:16 +06:00
If the model is non-physical (\em artificial), the color can be changed
2013-12-18 20:23:59 +06:00
to any appropriate one, only other attributes will be constant. In the
2013-02-12 17:35:16 +06:00
dialog box you will be able to modify the color of the shape via the
2013-04-17 22:05:53 +06:00
"Color" button. "Ambient color" button will be disabled to signalize
2013-02-12 17:35:16 +06:00
that this attribute of the model is ignored. Also, it will be possible
to modify the color of the shape via the
\ref color_page "corresponding popup menu command".
2012-08-09 13:58:02 +06:00
<b>Examples:</b>
\image html material_OCC.png
2013-04-17 22:05:53 +06:00
<center><em>Various materials in OCC viewer</em></center>
2012-08-09 13:58:02 +06:00
2013-04-17 22:05:53 +06:00
\n\image html material_VTK.png
<center><em>Various materials in VTK viewer</em></center>
2012-08-09 13:58:02 +06:00
The default material model is specified via the preferences of Geometry
module.
*/