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)'''|| |
| 4 | example 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 | }}} |
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"}}}. |
| 22 | If texture is not defined it is always replaced by small texture with default values: |
| 23 | albedo: 255,255,255 / 1.0,1.0,1.0 |
| 24 | normal: 127,127 / 0.5,0.5 |
| 25 | roughness: 255 / 1.0 |
| 26 | opacity: 255 / 1.0 |
| 27 | reflectance: 255 / 1.0 |
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=== |
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")]]|| |
| 31 | Albedo 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. |
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=== |
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=== |