Changes between Version 9 and Version 10 of material


Ignore:
Timestamp:
Aug 8, 2014, 2:13:39 PM (4 years ago)
Author:
angrypig
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • material

    v9 v10  
    22== Material Definition ==
    33
    4 ||'''name'''||material name ||
    5 ||'''diffuse'''||RGBA diffuse color multiplier\\ if the alpha component is below 1 material is considered as transparent||
    6 ||'''Ax'''||material 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||
    7 ||'''Ay'''||not used||
    8 ||'''m'''||roughness, 0 = mirror, 1 = matte material\\for matte materials there is an approximated oren-nayar model||
    9 ||'''tex_diffuse'''||path to diffuse texture '''(format DXT1)''', colors from this texture are multiplied by diffuse.RGB||
    10 ||'''tex_normal'''||path to normal texture '''(format BC5/3dc2/ATI2)'''||
    11 ||'''tex_env'''||path to roughness texture '''(format BC4/ATI1)''', m is multiplied by the values from this texture (in 0..1 range)||
    12 ||'''tex_reflectance'''||path to reflectance texture '''(format BC4/ATI1)''', Ax is multiplied by the values from this texture (in 0..1 range)||
    13 ||'''tex_opacity'''||path to opacity texture '''(format BC4/ATI1)'''||
     4example material:
     5{{{
     6    "name" : "example",                          // material name
     7    "color" : "1.0,1.0,1.0,1.0",                 // albedo multiplier
     8    "f0" : ".04",                                // F0 reflection coefficient for fresnel equation, range 0-1
     9    "roughness" : "1.0",                         // roughness parameter range 0-1, 0 - mirror, 1 - matte
     10    "no_light" : false,                          // if false lights are not computed for this material
     11    "alpha_masked" : false,                      // true means it's alpha masked geometry pixels below 0.5 are discarded
     12    "tex_albedo" : "m210_body_color.dds",        // albedo texture must be DXT1 format
     13    "tex_normal" : "m210_body_normal.dds",       // normal texture must be DXT5/3dc2/ATI2 format
     14    "tex_roughness" : "m210_body_specular.dds",  // roughness texture (usually negative specular map) must be in BC4/ATI1 format
     15    "tex_opacity" : "",                          // opacity texture must be in BC4/ATI1 format
     16    "tex_reflectance" : "",                      // F0 reflection map must be in BC4/ATI1 format
     17    "tex_environment" : ""                       // local environment map (not used yet) must be in DXT1 format
     18}}}
    1419
    15 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
     20== Textures notes==
    1621
    17 == Coefficients ==
    18 === Ax-Coefficient===
    19 The Ax coefficient influences the reflectance of the material. Small values behave like concrete materials and bigger values like metalic materials.
    20 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"}}}.
     22If texture is not defined it is always replaced by small texture with default values:
     23albedo: 255,255,255 / 1.0,1.0,1.0
     24normal: 127,127 / 0.5,0.5
     25roughness: 255 / 1.0
     26opacity: 255 / 1.0
     27reflectance: 255 / 1.0
    2128
    22 ||=Ax = 0.0=||=Ax = 0.25=||=Ax = 0.5=||=Ax = 0.75=||=Ax = 1.0=||
    23 ||[[Image(https://lh4.googleusercontent.com/-TeFdZJMyhrQ/Uk2P0oTjkCI/AAAAAAAADGw/F8xb1xv4gFI/s315-no/ax00.gif, 180px, align=center, title="Ax = 0.0")]]||[[Image(https://lh6.googleusercontent.com/-Hy2_ndRnecY/Uk2P0srL6eI/AAAAAAAADGs/bbA8YVK4CKw/s322-no/ax025.gif, 180px, align=center, title="Ax = 0.25")]]||[[Image(https://lh4.googleusercontent.com/-duN9Fwq_7IQ/Uk2P0SYGU-I/AAAAAAAADG0/-CladUmmCF0/s322-no/ax05.gif, 180px, align=center, title="Ax = 0.5")]]||[[Image(https://lh4.googleusercontent.com/-ZEIf20n2VzI/Uk2P185H8iI/AAAAAAAADG8/PGP8cO-Xz5I/s316-no/ax075.gif, 180px, align=center, title="Ax = 0.75")]]||[[Image(https://lh3.googleusercontent.com/-bsMuq48qVwQ/Uk2P2nnMVHI/AAAAAAAADHE/H_8aWYX3jxo/s302-no/ax10.gif, 180px, align=center, title="Ax = 1.0")]]||
     29=== Color space sRGB/Linear===
    2430
    25 === m-Coefficient===
    26 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.
    27 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"}}}.
    28 ||=m = 0.0=||=m = 0.01=||=m = 0.25=||=m = 0.5=||=m = 0.75=||=m = 1.0=||
    29 ||[[Image(https://lh4.googleusercontent.com/-d9imaUD02Ys/Uk2WhGCEYWI/AAAAAAAADHc/Jsftzf_oeb8/s312-no/m00.gif, 180px, align=center, title="m = 0.0")]]||[[Image(https://lh3.googleusercontent.com/-LbcVpR9x-Rg/Uk2XCfe16hI/AAAAAAAADHw/7iaI2R5DGeQ/s294-no/m001.gif, 180px, align=center, title="m = 0.01")]]||[[Image(https://lh4.googleusercontent.com/-9nO-PRGVNYU/Uk2XOPRLZhI/AAAAAAAADIE/XIWYZLDZYqE/s292-no/m025.gif, 180px, align=center, title="m = 0.25")]]||[[Image(https://lh5.googleusercontent.com/-sByQyTJkj0w/Uk2XTSOhryI/AAAAAAAADIY/gbSKOTonMFA/s287-no/m05.gif, 180px, align=center, title="Ax = 0.5")]]||[[Image(https://lh4.googleusercontent.com/-QgFNCTF9xb0/Uk2XYk4_dlI/AAAAAAAADIs/e6jmR4OM90M/s278-no/m075.gif, 180px, align=center, title="m = 0.75")]]||[[Image(https://lh4.googleusercontent.com/-zQDw60py0Rc/Uk2XdrUdH2I/AAAAAAAADJA/l8dHnZDVun4/s281-no/m10.gif, 180px, align=center, title="m = 1.0")]]||
     31Albedo textures have to be in sRGB space, on GPU it's converted to linear space automatically. Other textures are expected in linear space it's very important for visual quality.
    3032
    31 == Texture Channels ==
    32 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.
    33 === tex_diffuse ===
    34 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}}}).
     33== Material parameters==
    3534
    36 ||=tex_diffuse=||=Format=||=Diffuse texture disabled=||=Diffuse texture enabled=||
    37 ||[[Image(https://lh5.googleusercontent.com/-ROtFA3OBVwM/UlFc0wKhfeI/AAAAAAAADNg/wyK9Vtc1FPY/s180-no/panel2diffweb.png, 180px, align=center, title="Diffuse Texture")]]||'''BC1/DXT1'''||[[Image(https://lh5.googleusercontent.com/-hUCORLiBwyA/UlFg21aOBuI/AAAAAAAADN8/nBIWzVyQ8WU/s257-no/tex_dif2.gif, 180px, align=center, title="Without diffuse texture")]]||[[Image(https://lh5.googleusercontent.com/-Jk7U3Jt_cOc/UlFg29kJc6I/AAAAAAAADOA/g5wLeFXe2cI/s236-no/tex_dif1.gif, 180px, align=center, title="With diffuse texture")]]||
     35=== Albedo===
    3836
    39 === tex_normal ===
    40 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}}}).
     37Defines material diffuse color. Final albedo value is computed by: rgb = color * tex_albedo.
    4138
    42 ||=tex_normal=||=Format=||=Normal texture disabled=||=Normal texture enabled=||=Normal + Diffuse texture enabled=||
    43 ||[[Image(https://lh5.googleusercontent.com/-C5gscKEDdFE/UlFk7HBwyWI/AAAAAAAADOc/GDGV1dNewMQ/s180-no/panel2nrmweb.png, 180px, align=center, title="Normal Texture")]]||'''BC5/ATI2'''||[[Image(https://lh5.googleusercontent.com/-hUCORLiBwyA/UlFg21aOBuI/AAAAAAAADN8/nBIWzVyQ8WU/s257-no/tex_dif2.gif, 180px, align=center, title="Without normal texture")]]||[[Image(https://lh3.googleusercontent.com/-Ed7XSAZSgmk/UlFnGgwyh3I/AAAAAAAADO0/UbZX0OM2ij0/s180-no/tex_nrm1.jpg, 180px, align=center, title="With normal texture")]][[Image(https://lh5.googleusercontent.com/-3kHTj7j_4Ls/UlFnLFDsSZI/AAAAAAAADO8/QYsX5OvmEhk/s236-no/tex_nrm1.gif, 180px, align=center, title="With normal texture")]]||[[Image(https://lh3.googleusercontent.com/-Ljhku951cJ0/UlFpQDpVkbI/AAAAAAAADPY/AhOo53gdc0o/w666-h667-no/tex_nrm2.jpg, 180px, align=center, title="With normal + diffuse texture")]][[Image(https://lh5.googleusercontent.com/-PaqzSJIlesk/UlFpNsVnS7I/AAAAAAAADPQ/tYnBZm5CSnM/s190-no/tex_nrm2.gif, 180px, align=center, title="With normal + diffuse texture")]]||
     39=== Roughness===
    4440
    45  
    46 === tex_env ===
    47 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.
     41Defines material roughness. Final roughness value is computed by: r = roughness * tex_roughness
    4842
    49 ||=tex_env=||=Format=||=Ax = 0.0=||=Ax = 0.5=||=Ax = 1.0=||
    50 ||[[Image(https://lh6.googleusercontent.com/-9DGrnVJhiSM/UlFVxCvTI3I/AAAAAAAADMg/cYxXyAVbwJ0/s832-no/env.png, 180px, align=center, title="Ax = 0.0")]]||'''BC4/ATI1'''||[[Image(https://lh5.googleusercontent.com/-G_Bb2vLayAo/UlFVJwjJYLI/AAAAAAAADMY/xMu-REgIipk/s331-no/env00.gif, 180px, align=center, title="Ax = 0.0")]]||[[Image(https://lh5.googleusercontent.com/-v6tC9Q9F3BQ/UlFVJ3UKhXI/AAAAAAAADMU/k90txDucQPE/s248-no/env05.gif, 180px, align=center, title="Ax = 0.5")]]||[[Image(https://lh6.googleusercontent.com/-jGPvjnunYUU/UlFYYEmi4BI/AAAAAAAADM4/wkl5W2iXTe0/s231-no/env10.gif, 180px, align=center, title="Ax = 1.0")]]||
     43=== F0 (reflectance) coeficient===
    5144
    52 === tex_reflectance ===
    53 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.
     45F0 defines material characteristics, basically it means how much light is reflected from the material and how much light is reflected as diffuse. For standard dielectric materials it's usually 0.04 (4%) and it means 4% light is reflected from the material if we are looking at surface perpendicularly.
     46Final F0 value is computed by equation F0 = f0 * tex_reflectance;
    5447
    55 ||=tex_reflectance=||=Format=||=m = 0.01=||=m = 0.5=||=m = 1.0=||
    56 ||[[Image(https://lh6.googleusercontent.com/-HC6Nrrld4Fo/UlF5rE0TZrI/AAAAAAAADQM/eiXzvCS4v5I/s180-no/refweb.png, 180px, align=center, title="Reflectance texture")]]||'''BC4/ATI1'''||[[Image(https://lh4.googleusercontent.com/-yclybq018j8/UlF5q6vCjhI/AAAAAAAADQI/4gi3wIkWcYM/s335-no/tex_ref001.gif, 180px, align=center, title="Reflectance texture m = 0.01")]]||[[Image(https://lh3.googleusercontent.com/-q0Z73mRoXrg/UlF5qmVth_I/AAAAAAAADQE/lvZ2OvylIig/s255-no/tex_ref05.gif, 180px, align=center, title="Reflectance texture m = 0.5")]]||[[Image(https://lh5.googleusercontent.com/-ZdW9o571qgw/UlF5qr4VhWI/AAAAAAAADP8/p6wKquK786E/s220-no/tex_ref10.gif, 180px, align=center, title="Reflectance texture m = 1.0")]]||
     48Example F0 values:
     49{{{
     50    Quartz         0.045593921
     51    ice            0.017908907
     52    Water          0.020373188
     53    Alcohol        0.01995505
     54    Glass          0.04
     55    Milk           0.022181983
     56    Ruby           0.077271957
     57    Crystal        0.111111111
     58    Diamond        0.171968833
     59    Skin           0.028
     60}}}
    5761
    58 See [[material_database|material database]] for examples.
     62== material examples ==
    5963
    60 == References ==
    61  * [=#point1 [1]] [https://docs.google.com/file/d/0B2opjgFY-gdiaHRBX2JfQjhWTms/edit?usp=sharing matsphere.necro.otx]
     64[[Image(http://i.minus.com/ibd6upj4T0ETXm.jpg, 800px)]]
     65
     66=== useful links (mandatory reading) ===
     67[http://seblagarde.wordpress.com/2011/08/17/feeding-a-physical-based-lighting-mode/][[BR]]
     68[http://seblagarde.wordpress.com/2012/04/30/dontnod-specular-and-glossiness-chart/]