Difference between revisions of "Material Data"

From Second Life Wiki
Jump to navigation Jump to search
(Corrected how alphas are treated in alpa blending (255 = full opaque in alpha blending land, 0 = fully transparent))
Line 82: Line 82:
;Alpha Mode
;Alpha Mode
:This controls the interpretation of the Alpha channel data in the Diffuse Map.  It can have one of four values:
:This controls the interpretation of the Alpha channel data in the Diffuse Map.  It can have one of four values:
:;Ignored:Alpha channel data is not used
:;None:Alpha channel data is not used
:;Transparency (blended):The value is a degree of transparency (255 = opaque, 0 = fully transparent)
:;Transparency (blended):The value is a degree of transparency (255 = opaque, 0 = fully transparent)
:;Alpha Mask (cutoff):The value (0...255) is compared to the Alpha Cutoff parameter (below); if the pixel is greater than the cutoff, it is fully opaque; if not, it is fully transparent.
:;Alpha Mask (cutoff):The value (0...255) is compared to the Alpha Cutoff parameter (below); if the pixel is greater than the cutoff, it is fully opaque; if not, it is fully transparent.

Revision as of 11:42, 16 January 2013

Warning!

The information in this page applies to the work being done in the STORM-1905 Normal & Specular Maps (aka Materials) Project. None of this will work until that has been completed and released - and until that time, it may be subject to change.


This page describes how the various parameters and texture data used to define a material in Second Life are interpreted for rendering. It is intended to help content creators and external tool developers to better understand how to create images to achieve good visual results.


There are as many as two colors and three images associated with a face.

Colors

Color
a solid color for the surface; not used if a Texture is also specified
Specular Color
this is a color that ‘tints’ any reflections from the face; see also Specular Map

Textures

Texture

Also called the Diffuse Map, this is an image that is displayed on the surface. The way the texture is applied to the face is controlled by

Positioning & Scaling Properties

Mapping
Default or Planar
Horizontal Repeats
number of repeats of the image over the surface (used only in default mapping)
Vertical Repeats
number of repeats of the image over the surface (used only in default mapping)
Rotation
clockwise degrees the image is rotated
Repeats Per Meter
number of repeats of the image per in-world meter of the surface (used only in planar mapping)
Horizontal Offset
distance in meters the image is shifted right on the surface
Vertical Offset
distance in meters the image is shifted up on the surface

Normal Map

An image whose color data encodes changes to the "normal" for each pixel on the surface. The normal is the direction that the pixel "faces" for the purpose of determining how it is illuminated by and reflects light sources (imagine that each pixel is turned on tiny pivots). See the Texture Channel Encoding table below.

The Alpha channel value of the Normal Map is used to encode how brightly the pixel reflects light: its Specular Exponent.

Positioning
The Normal Map has its own set of the same Positioning & Scaling Properties properties as the Texture.

Specular Map

This encodes the color of the light reflected by each pixel on the surface. See the Texture Channel Encoding table below.

The Alpha channel value of the Specular Map encodes how well the surrounding environment (the sky and other non-point-source illumination) is reflected from the pixel.

Positioning
The Specular Map has its own set of the same Positioning & Scaling Properties properties as the Texture.

Texture Channel Encoding

How the renderer will treat each color value in a texture image channel
Parameter Red Green Blue Alpha
Diffuse Map Red Green Blue selectable

see Alpha Mode

Normal Map Normal X Axis Normal Y Axis Normal Z Axis Specular Exponent
Specular Map Red Green Blue Environment Mask

Additional Parameters

Alpha Mode
This controls the interpretation of the Alpha channel data in the Diffuse Map. It can have one of four values:
None
Alpha channel data is not used
Transparency (blended)
The value is a degree of transparency (255 = opaque, 0 = fully transparent)
Alpha Mask (cutoff)
The value (0...255) is compared to the Alpha Cutoff parameter (below); if the pixel is greater than the cutoff, it is fully opaque; if not, it is fully transparent.
Emissive
The value is used to encode how brightly the pixel emits light (glows): 0 = no glow; 255 = full brightness
Alpha Cutoff
Used only when Alpha Mode is Alpha Test (see description of that mode above)
Specular Light Color
Tints the light reflected from the object; this value is combined with any value from the color for the pixel as specified in the Specular Map, if any.
Environment Intensity
Modulates the intensity of the environment on the surface as a whole. When an environment mask is present in the specular map, the environment mask is modulated by this to provide better control over the intensity of the environment that’s being reflected (some parts of the surface can reflect the environment more or less than others).
Glossiness
This controls the “glossiness”, or the roughness, of the reflected light on a surface. The lower this value is, the “rougher” the light reflectance is, while the higher the value the “sharper” the light reflectance is. When the normal map’s alpha channel is present, the specular exponent map contained in it is modulated by this parameter.