//metallic paint, by tek (evilsuperbrain.com) //note that you can control the ambient brightness of these textures using the #default setting. /* usage: pPigment - whatever pigment you want on your surface fMetallic - value from 0 (not metallic) to 1 (very metallic) fNoise - if you look closely at most metallic paint there's a very small swirly lumpy pattern, use a value of 1 to make this very noticeable and a value of 0 to turn it off. fGlitter - adjust the brightness/amount of glitter. 1 is quite realistic, 0 is turned off. */ #macro m_tMetallicMatte(pPigment, fMetallic, fNoise, fGlitter) //base metallic layer texture { pigment { pPigment } finish { diffuse (1-fMetallic) specular fMetallic roughness .1 metallic 1 } #if ( fNoise > 0 ) normal { granite fNoise/10 scale 0.01 } #end } #if ( fGlitter > 0 ) //glitter texture { pigment { rgbt 1 } finish { specular fGlitter roughness 0.005 } normal { granite 1 scale 0.01 } } #end #end #declare tGlossCoat = //gloss coating, this can be layered over anything to give a realistic glossy finish. texture { pigment { rgbt 1 } finish { reflection { 0.08, //adjust this to simulate other glossy materials (glass should be a low number, a mirror would be a high number) 1 //leave this, unless you want a dull looking material, in which case why are you using a gloss coating?! :) falloff 5 //this approximates fresnel reflections, without us needing to guess ior values. We simulate fresnel for different materials by adjusting the min reflection value. } conserve_energy specular 1 roughness .001 //tune this according to your scene, it won't look perfect because it ignores the reflection falloff. } } #macro m_tMetallicGloss(pPigment, fMetallic, fNoise, fGlitter) m_tMetallicMatte(pPigment, fMetallic, fNoise, fGlitter) texture { tGlossCoat } #end