wiki:material

Version 8 (modified by necro, 6 years ago) (diff)

--

Material Definition

namematerial name
diffuseRGBA diffuse color multiplier
if the alpha component is below 1 material is considered as transparent
Axmaterial reflectance (fresnel f0 coefficient)
common materials have values around 0.04
Diamond 0.17, Ruby 0.077, Glass 0.04, Aluminium 0.92, Chromium 0.55
NOTE: material shader for metallic materials is WIP
Aynot used
mroughness, 0 = mirror, 1 = matte material
for matte materials there is an approximated oren-nayar model
tex_diffusepath to diffuse texture (format DXT1), colors from this texture are multiplied by diffuse.RGB
tex_normalpath to normal texture (format BC5/3dc2/ATI2)
tex_envpath to roughness texture (format BC4/ATI1), m is multiplied by the values from this texture (in 0..1 range)
tex_reflectancepath to reflectance texture (format BC4/ATI1), Ax is multiplied by the values from this texture (in 0..1 range)
tex_opacitypath to opacity texture (format BC4/ATI1)

Note: Ax, Ay and m can be written as whole numbers, in which case the value is treated as in range 0..255 and is divided by 255 before use. They can be also written as decimal numbers in range 0.0 .. 1.0

Coefficients

Ax-Coefficient

The Ax coefficient influences the reflectance of the material. Small values behave like concrete materials and bigger values like metalic materials. The following examples show the effect of several Ax values. All examples were created with "diffuse" : "1.0, 1.0, 1.0, 1.0" and "m" : "127".

Ax = 0.0Ax = 0.25Ax = 0.5Ax = 0.75Ax = 1.0
https://lh4.googleusercontent.com/-TeFdZJMyhrQ/Uk2P0oTjkCI/AAAAAAAADGw/F8xb1xv4gFI/s315-no/ax00.gifhttps://lh6.googleusercontent.com/-Hy2_ndRnecY/Uk2P0srL6eI/AAAAAAAADGs/bbA8YVK4CKw/s322-no/ax025.gifhttps://lh4.googleusercontent.com/-duN9Fwq_7IQ/Uk2P0SYGU-I/AAAAAAAADG0/-CladUmmCF0/s322-no/ax05.gifhttps://lh4.googleusercontent.com/-ZEIf20n2VzI/Uk2P185H8iI/AAAAAAAADG8/PGP8cO-Xz5I/s316-no/ax075.gifhttps://lh3.googleusercontent.com/-bsMuq48qVwQ/Uk2P2nnMVHI/AAAAAAAADHE/H_8aWYX3jxo/s302-no/ax10.gif

m-Coefficient

The m coefficient influences the mirror reflectance of the material. The bigger the value, the more matte the material will be. The smaller the value, the more mirroring the material will be. The following examples show the effect of several m values. All examples were created with "diffuse" : "1.0, 1.0, 1.0, 1.0" and "Ax" : "7".

m = 0.0m = 0.01m = 0.25m = 0.5m = 0.75m = 1.0
https://lh4.googleusercontent.com/-d9imaUD02Ys/Uk2WhGCEYWI/AAAAAAAADHc/Jsftzf_oeb8/s312-no/m00.gifhttps://lh3.googleusercontent.com/-LbcVpR9x-Rg/Uk2XCfe16hI/AAAAAAAADHw/7iaI2R5DGeQ/s294-no/m001.gifhttps://lh4.googleusercontent.com/-9nO-PRGVNYU/Uk2XOPRLZhI/AAAAAAAADIE/XIWYZLDZYqE/s292-no/m025.gifhttps://lh5.googleusercontent.com/-sByQyTJkj0w/Uk2XTSOhryI/AAAAAAAADIY/gbSKOTonMFA/s287-no/m05.gifhttps://lh4.googleusercontent.com/-QgFNCTF9xb0/Uk2XYk4_dlI/AAAAAAAADIs/e6jmR4OM90M/s278-no/m075.gifhttps://lh4.googleusercontent.com/-zQDw60py0Rc/Uk2XdrUdH2I/AAAAAAAADJA/l8dHnZDVun4/s281-no/m10.gif

Texture Channels

Outerra supports several texture channels to define materials. For setting them up the used mesh needs to be UV unwrapped. This means to unproject the 3D mesh on 2D plane. This can be done automatically or manually by almost each 3D-software.

tex_diffuse

The diffuse texture contains the basic colors of a mesh. So its one of the most important textures a mesh can use. The following example shows the sample sphere rendered with a matte material ("Ax" : 0.0 and "m" = 1.0).

tex_diffuseFormatDiffuse texture disabledDiffuse texture enabled
https://lh5.googleusercontent.com/-ROtFA3OBVwM/UlFc0wKhfeI/AAAAAAAADNg/wyK9Vtc1FPY/s180-no/panel2diffweb.pngBC1/DXT1https://lh5.googleusercontent.com/-hUCORLiBwyA/UlFg21aOBuI/AAAAAAAADN8/nBIWzVyQ8WU/s257-no/tex_dif2.gifhttps://lh5.googleusercontent.com/-Jk7U3Jt_cOc/UlFg29kJc6I/AAAAAAAADOA/g5wLeFXe2cI/s236-no/tex_dif1.gif

tex_normal

The normal texture is the most important texture a mesh can contain. It is possible to create the illusion of incredible amount of details on the mesh. This texture stores information about the normals per pixel. Then the shader computes the angle between each normal and the light vector and shades the color by multiplying it with this factor. This creates the illusion of detail although the surface is actually flat. The following example shows the sample sphere rendered with a matte material ("Ax" : 0.0 and "m" = 1.0).

tex_normalFormatNormal texture disabledNormal texture enabledNormal + Diffuse texture enabled
https://lh5.googleusercontent.com/-C5gscKEDdFE/UlFk7HBwyWI/AAAAAAAADOc/GDGV1dNewMQ/s180-no/panel2nrmweb.pngBC5/ATI2https://lh5.googleusercontent.com/-hUCORLiBwyA/UlFg21aOBuI/AAAAAAAADN8/nBIWzVyQ8WU/s257-no/tex_dif2.gifhttps://lh3.googleusercontent.com/-Ed7XSAZSgmk/UlFnGgwyh3I/AAAAAAAADO0/UbZX0OM2ij0/s180-no/tex_nrm1.jpghttps://lh5.googleusercontent.com/-3kHTj7j_4Ls/UlFnLFDsSZI/AAAAAAAADO8/QYsX5OvmEhk/s236-no/tex_nrm1.gifhttps://lh3.googleusercontent.com/-Ljhku951cJ0/UlFpQDpVkbI/AAAAAAAADPY/AhOo53gdc0o/w666-h667-no/tex_nrm2.jpghttps://lh5.googleusercontent.com/-PaqzSJIlesk/UlFpNsVnS7I/AAAAAAAADPQ/tYnBZm5CSnM/s190-no/tex_nrm2.gif

tex_env

The env texture controls the reflectance. The darker the input, the more reflective the material will be. So this texture could also be called roughness-map and can be used for simulating rust on metalic surfaces. The following examples were using a diffuse channel of "diffuse" : "1.0,1.0,1.0,1.0" and "m" : 1.0. The m value multiplies the strength of the env texture.

tex_envFormatAx = 0.0Ax = 0.5Ax = 1.0
https://lh6.googleusercontent.com/-9DGrnVJhiSM/UlFVxCvTI3I/AAAAAAAADMg/cYxXyAVbwJ0/s832-no/env.pngBC4/ATI1https://lh5.googleusercontent.com/-G_Bb2vLayAo/UlFVJwjJYLI/AAAAAAAADMY/xMu-REgIipk/s331-no/env00.gifhttps://lh5.googleusercontent.com/-v6tC9Q9F3BQ/UlFVJ3UKhXI/AAAAAAAADMU/k90txDucQPE/s248-no/env05.gifhttps://lh6.googleusercontent.com/-jGPvjnunYUU/UlFYYEmi4BI/AAAAAAAADM4/wkl5W2iXTe0/s231-no/env10.gif

tex_reflectance

The reflectance texture can be used to control the reflectance of a material. But unlike the env texture brighter values make the material more reflective than darker ones. The following examples were using a diffuse channel of "diffuse" : "1.0,1.0,1.0,1.0" and "Ax" : 1.0. The m value multiplies the strength of the env texture.

tex_reflectanceFormatm = 0.01m = 0.5m = 1.0
https://lh6.googleusercontent.com/-HC6Nrrld4Fo/UlF5rE0TZrI/AAAAAAAADQM/eiXzvCS4v5I/s180-no/refweb.pngBC4/ATI1https://lh4.googleusercontent.com/-yclybq018j8/UlF5q6vCjhI/AAAAAAAADQI/4gi3wIkWcYM/s335-no/tex_ref001.gifhttps://lh3.googleusercontent.com/-q0Z73mRoXrg/UlF5qmVth_I/AAAAAAAADQE/lvZ2OvylIig/s255-no/tex_ref05.gifhttps://lh5.googleusercontent.com/-ZdW9o571qgw/UlF5qr4VhWI/AAAAAAAADP8/p6wKquK786E/s220-no/tex_ref10.gif

See material database for examples.

References