// Does not support SSLT yet. // Does support blurred reflections. // Based on code by Roland Melkert, now in "materials_ldc_shadowno.inc" #version 3.7; //=====LDraw materials==================================================================================================== #declare ldColorCount=70; #declare ldColor=array[ldColorCount][5] { // {index, r, g, b, a} {0,0.019608,0.07451,0.113725,1}, {1,0,0.333333,0.74902,1}, {2,0.145098,0.478431,0.243137,1}, {3,0,0.513726,0.560784,1}, {4,0.788235,0.101961,0.035294,1}, {5,0.784314,0.439216,0.627451,1}, {6,0.345098,0.223529,0.152941,1}, {7,0.607843,0.631373,0.615686,1}, {8,0.427451,0.431373,0.360784,1}, {9,0.705882,0.823529,0.890196,1}, {10,0.294118,0.623529,0.290196,1}, {11,0.333333,0.647059,0.686275,1}, {12,0.94902,0.439216,0.368627,1}, {13,0.988235,0.592157,0.67451,1}, {14,0.94902,0.803922,0.215686,1}, {15,1,1,1,1}, {18,0.984314,0.901961,0.588235,1}, {19,0.894118,0.803922,0.619608,1}, {20,0.788235,0.792157,0.886275,1}, {25,0.996078,0.541176,0.094118,1}, {26,0.572549,0.223529,0.470588,1}, {27,0.733333,0.913725,0.043137,1}, {28,0.584314,0.541176,0.45098,1}, {32,0,0,0,0.823529}, {33,0,0.12549,0.627451,0.501961}, {34,0.137255,0.470588,0.254902,0.501961}, {35,0.337255,0.901961,0.27451,0.501961}, {36,0.788235,0.101961,0.035294,0.501961}, {37,0.87451,0.4,0.584314,0.501961}, {38,1,0.501961,0.05098,0.501961}, {39,0.756863,0.87451,0.941176,0.501961}, {40,0.388235,0.372549,0.321569,0.501961}, {41,0.333333,0.603922,0.717647,0.501961}, {42,0.752941,1,0,0.501961}, {43,0.682353,0.913725,0.937255,0.501961}, {44,0.588235,0.439216,0.623529,0.501961}, {45,0.988235,0.592157,0.67451,0.501961}, {46,0.960784,0.803922,0.184314,0.501961}, {47,0.988235,0.988235,0.988235,0.501961}, {57,0.941176,0.560784,0.109804,0.501961}, {60,0.392157,0.352941,0.298039,1}, {70,0.345098,0.164706,0.070588,1}, {71,0.627451,0.647059,0.662745,1}, {72,0.423529,0.431373,0.407843,1}, {74,0.45098,0.862745,0.631373,1}, {77,0.996078,0.8,0.811765,1}, {80,0.647059,0.662745,0.705882,1}, {82,0.858824,0.67451,0.203922,1}, {87,0.427451,0.431373,0.360784,1}, {110,0.262745,0.329412,0.639216,1}, {134,0.588235,0.290196,0.152941,1}, {256,0.129412,0.129412,0.129412,1}, {258,0.082353,0.276471,0.178431,1}, {272,0.05098,0.196078,0.356863,1}, {277,0.392157,0.386275,0.688235,1}, {288,0.094118,0.27451,0.196078,1}, {320,0.447059,0.054902,0.058824,1}, {324,0.768627,0,0.14902,1}, {334,0.733333,0.647059,0.239216,1}, {354,0.245098,0.35098,0.198039,1}, {366,0.980392,0.611765,0.109804,1}, {379,0.34902,0.443137,0.517647,1}, {382,0.778431,0.717647,0.415686,1}, {383,0.878431,0.878431,0.878431,1}, {484,0.662745,0.333333,0,1}, {487,0.778431,0.717647,0.415686,1}, {492,0.94902,0.621569,0.292157,1}, {493,0.396078,0.403922,0.380392,1}, {494,0.815686,0.815686,0.815686,1}, {503,0.901961,0.890196,0.854902,1} } #macro getColorIndex(ldCode) #local result=-1; #local i=0; #while (result=-1 & i }; result #else #local result=pigment { srgb }; result #end #end #if (Use_BlurRef = true) #include "blurred_reflection.inc" #macro ldrawBuildTex(basePigment, baseNormal, baseFinish, baseBlur, pngIdx) #if (pngIdx<0) BlurredReflectionSingleNormals(basePigment, baseFinish, baseNormal, baseBlur) #else texture { pigment { uv_mapping image_map { png getPngName(pngIdx) getPngMapType(pngIdx) interpolate 2 } getPngWarp(pngIdx) } } texture { BlurredReflectionSingleNormals(basePigment, baseFinish, baseNormal, baseBlur) } #end #end #else #macro ldrawBuildTex(basePigment, baseNormal, baseFinish, baseBlur, pngIdx) #if (pngIdx<0) pigment { basePigment } normal { baseNormal } finish { baseFinish } #else #local texPigment= pigment { uv_mapping image_map { png getPngName(pngIdx) getPngMapType(pngIdx) interpolate 2 } getPngWarp(pngIdx) } #local result = texture { pigment { basePigment } normal { baseNormal } finish { baseFinish } } texture { pigment { texPigment } } result #end #end #end #macro ldrawBuildMat(ldCode, tex, iorValue) texture { tex } #local idx=getColorIndex(ldCode); // SSLT and blurred reflections require ior in every material, so remove this condition for them // #if (ldColor[idx][4]<1.0) interior { ior iorValue fade_power 1 fade_distance 1 fade_color } // #end #end //-----Main tex/mat macros------------------------------------------------------------------------------------------------ #macro ldrawTexPlasticABS(ldCode, pngIdx, forMat) ldrawBuildTex(ldrawPigment(getColorIndex(ldCode), forMat), ldrawPlasticABSNor, ldrawPlasticABSFin, ldrawPlasticABSBlur, pngIdx) #end #macro ldrawMatPlasticABS(ldCode, tex) ldrawBuildMat(ldCode, tex, ldrawPlasticABSIor) #end #macro ldrawTexPlasticPoly(ldCode, pngIdx, forMat) ldrawBuildTex(ldrawPigment(getColorIndex(ldCode), forMat), ldrawPlasticPolyNor, ldrawPlasticPolyFin, ldrawPlasticPolyBlur, pngIdx) #end #macro ldrawMatPlasticPoly(ldCode, tex) ldrawBuildMat(ldCode, tex, ldrawPlasticPolyIor) #end #macro ldrawTexRubber(ldCode, pngIdx, forMat) ldrawBuildTex(ldrawPigment(getColorIndex(ldCode), forMat), ldrawRubberNor, ldrawRubberFin, ldrawRubberBlur, pngIdx) #end #macro ldrawMatRubber(ldCode, tex) ldrawBuildMat(ldCode, tex, ldrawRubberIor) #end #macro ldrawTexMetal(ldCode, pngIdx, forMat) ldrawBuildTex(ldrawPigment(getColorIndex(ldCode), forMat), ldrawMetalNor, ldrawMetalFin, ldrawMetalBlur, pngIdx) #end #macro ldrawMatMetal(ldCode, tex) ldrawBuildMat(ldCode, tex, ldrawMetalIor) #end #macro ldrawTexMatteMetal(ldCode, pngIdx, forMat) ldrawBuildTex(ldrawPigment(getColorIndex(ldCode), forMat), ldrawMatteMetalNor, ldrawMatteMetalFin, ldrawMatteMetalBlur, pngIdx) #end #macro ldrawMatMatteMetal(ldCode, tex) ldrawBuildMat(ldCode, tex, ldrawMatteMetalIor) #end #macro ldrawTexChrome(ldCode, pngIdx, forMat) ldrawBuildTex(ldrawPigment(getColorIndex(ldCode), forMat), ldrawChromeNor, ldrawChromeFin, ldrawChromeBlur, pngIdx) #end #macro ldrawMatChrome(ldCode, tex) ldrawBuildMat(ldCode, tex, ldrawChromeIor) #end #macro ldrawTexPearl(ldCode, pngIdx, forMat) ldrawBuildTex(ldrawPigment(getColorIndex(ldCode), forMat), ldrawPearlNor, ldrawPearlFin, ldrawPearlBlur, pngIdx) #end #macro ldrawMatPearl(ldCode, tex) ldrawBuildMat(ldCode, tex, ldrawPearlIor) #end //-----Tex/mat defines---------------------------------------------------------------------------------------------------- #declare ldTex0=texture { ldrawTexPlasticABS(0, -1, false) } #declare ldMat0=material { ldrawMatPlasticABS(0, texture { ldrawTexPlasticABS(0, -1, true) }) } #declare ldTex1=texture { ldrawTexPlasticABS(1, -1, false) } #declare ldMat1=material { ldrawMatPlasticABS(1, texture { ldrawTexPlasticABS(1, -1, true) }) } #declare ldTex2=texture { ldrawTexPlasticABS(2, -1, false) } #declare ldMat2=material { ldrawMatPlasticABS(2, texture { ldrawTexPlasticABS(2, -1, true) }) } #declare ldTex3=texture { ldrawTexPlasticABS(3, -1, false) } #declare ldMat3=material { ldrawMatPlasticABS(3, texture { ldrawTexPlasticABS(3, -1, true) }) } #declare ldTex4=texture { ldrawTexPlasticABS(4, -1, false) } #declare ldMat4=material { ldrawMatPlasticABS(4, texture { ldrawTexPlasticABS(4, -1, true) }) } #declare ldTex5=texture { ldrawTexPlasticABS(5, -1, false) } #declare ldMat5=material { ldrawMatPlasticABS(5, texture { ldrawTexPlasticABS(5, -1, true) }) } #declare ldTex6=texture { ldrawTexPlasticABS(6, -1, false) } #declare ldMat6=material { ldrawMatPlasticABS(6, texture { ldrawTexPlasticABS(6, -1, true) }) } #declare ldTex7=texture { ldrawTexPlasticABS(7, -1, false) } #declare ldMat7=material { ldrawMatPlasticABS(7, texture { ldrawTexPlasticABS(7, -1, true) }) } #declare ldTex8=texture { ldrawTexPlasticABS(8, -1, false) } #declare ldMat8=material { ldrawMatPlasticABS(8, texture { ldrawTexPlasticABS(8, -1, true) }) } #declare ldTex9=texture { ldrawTexPlasticABS(9, -1, false) } #declare ldMat9=material { ldrawMatPlasticABS(9, texture { ldrawTexPlasticABS(9, -1, true) }) } #declare ldTex10=texture { ldrawTexPlasticABS(10, -1, false) } #declare ldMat10=material { ldrawMatPlasticABS(10, texture { ldrawTexPlasticABS(10, -1, true) }) } #declare ldTex11=texture { ldrawTexPlasticABS(11, -1, false) } #declare ldMat11=material { ldrawMatPlasticABS(11, texture { ldrawTexPlasticABS(11, -1, true) }) } #declare ldTex12=texture { ldrawTexPlasticABS(12, -1, false) } #declare ldMat12=material { ldrawMatPlasticABS(12, texture { ldrawTexPlasticABS(12, -1, true) }) } #declare ldTex13=texture { ldrawTexPlasticABS(13, -1, false) } #declare ldMat13=material { ldrawMatPlasticABS(13, texture { ldrawTexPlasticABS(13, -1, true) }) } #declare ldTex14=texture { ldrawTexPlasticABS(14, -1, false) } #declare ldMat14=material { ldrawMatPlasticABS(14, texture { ldrawTexPlasticABS(14, -1, true) }) } #declare ldTex15=texture { ldrawTexPlasticABS(15, -1, false) } #declare ldMat15=material { ldrawMatPlasticABS(15, texture { ldrawTexPlasticABS(15, -1, true) }) } #declare ldTex18=texture { ldrawTexPlasticABS(18, -1, false) } #declare ldMat18=material { ldrawMatPlasticABS(18, texture { ldrawTexPlasticABS(18, -1, true) }) } #declare ldTex19=texture { ldrawTexPlasticABS(19, -1, false) } #declare ldMat19=material { ldrawMatPlasticABS(19, texture { ldrawTexPlasticABS(19, -1, true) }) } #declare ldTex20=texture { ldrawTexPlasticABS(20, -1, false) } #declare ldMat20=material { ldrawMatPlasticABS(20, texture { ldrawTexPlasticABS(20, -1, true) }) } #declare ldTex25=texture { ldrawTexPlasticABS(25, -1, false) } #declare ldMat25=material { ldrawMatPlasticABS(25, texture { ldrawTexPlasticABS(25, -1, true) }) } #declare ldTex26=texture { ldrawTexPlasticABS(26, -1, false) } #declare ldMat26=material { ldrawMatPlasticABS(26, texture { ldrawTexPlasticABS(26, -1, true) }) } #declare ldTex27=texture { ldrawTexPlasticABS(27, -1, false) } #declare ldMat27=material { ldrawMatPlasticABS(27, texture { ldrawTexPlasticABS(27, -1, true) }) } #declare ldTex28=texture { ldrawTexPlasticABS(28, -1, false) } #declare ldMat28=material { ldrawMatPlasticABS(28, texture { ldrawTexPlasticABS(28, -1, true) }) } #declare ldTex32=texture { ldrawTexPlasticABS(32, -1, false) } #declare ldMat32=material { ldrawMatPlasticABS(32, texture { ldrawTexPlasticABS(32, -1, true) }) } #declare ldTex33=texture { ldrawTexPlasticPoly(33, -1, false) } #declare ldMat33=material { ldrawMatPlasticPoly(33, texture { ldrawTexPlasticPoly(33, -1, true) }) } #declare ldTex34=texture { ldrawTexPlasticPoly(34, -1, false) } #declare ldMat34=material { ldrawMatPlasticPoly(34, texture { ldrawTexPlasticPoly(34, -1, true) }) } #declare ldTex35=texture { ldrawTexPlasticPoly(35, -1, false) } #declare ldMat35=material { ldrawMatPlasticPoly(35, texture { ldrawTexPlasticPoly(35, -1, true) }) } #declare ldTex36=texture { ldrawTexPlasticPoly(36, -1, false) } #declare ldMat36=material { ldrawMatPlasticPoly(36, texture { ldrawTexPlasticPoly(36, -1, true) }) } #declare ldTex37=texture { ldrawTexPlasticPoly(37, -1, false) } #declare ldMat37=material { ldrawMatPlasticPoly(37, texture { ldrawTexPlasticPoly(37, -1, true) }) } #declare ldTex38=texture { ldrawTexPlasticPoly(38, -1, false) } #declare ldMat38=material { ldrawMatPlasticPoly(38, texture { ldrawTexPlasticPoly(38, -1, true) }) } #declare ldTex39=texture { ldrawTexPlasticPoly(39, -1, false) } #declare ldMat39=material { ldrawMatPlasticPoly(39, texture { ldrawTexPlasticPoly(39, -1, true) }) } #declare ldTex40=texture { ldrawTexPlasticPoly(40, -1, false) } #declare ldMat40=material { ldrawMatPlasticPoly(40, texture { ldrawTexPlasticPoly(40, -1, true) }) } #declare ldTex41=texture { ldrawTexPlasticPoly(41, -1, false) } #declare ldMat41=material { ldrawMatPlasticPoly(41, texture { ldrawTexPlasticPoly(41, -1, true) }) } #declare ldTex42=texture { ldrawTexPlasticPoly(42, -1, false) } #declare ldMat42=material { ldrawMatPlasticPoly(42, texture { ldrawTexPlasticPoly(42, -1, true) }) } #declare ldTex43=texture { ldrawTexPlasticPoly(43, -1, false) } #declare ldMat43=material { ldrawMatPlasticPoly(43, texture { ldrawTexPlasticPoly(43, -1, true) }) } #declare ldTex44=texture { ldrawTexPlasticPoly(44, -1, false) } #declare ldMat44=material { ldrawMatPlasticPoly(44, texture { ldrawTexPlasticPoly(44, -1, true) }) } #declare ldTex45=texture { ldrawTexPlasticPoly(45, -1, false) } #declare ldMat45=material { ldrawMatPlasticPoly(45, texture { ldrawTexPlasticPoly(45, -1, true) }) } #declare ldTex46=texture { ldrawTexPlasticPoly(46, -1, false) } #declare ldMat46=material { ldrawMatPlasticPoly(46, texture { ldrawTexPlasticPoly(46, -1, true) }) } #declare ldTex47=texture { ldrawTexPlasticPoly(47, -1, false) } #declare ldMat47=material { ldrawMatPlasticPoly(47, texture { ldrawTexPlasticPoly(47, -1, true) }) } #declare ldTex57=texture { ldrawTexPlasticPoly(57, -1, false) } #declare ldMat57=material { ldrawMatPlasticPoly(57, texture { ldrawTexPlasticPoly(57, -1, true) }) } #declare ldTex60=texture { ldrawTexChrome(60, -1, false) } #declare ldMat60=material { ldrawMatChrome(60, texture { ldrawTexChrome(60, -1, true) }) } #declare ldTex70=texture { ldrawTexPlasticABS(70, -1, false) } #declare ldMat70=material { ldrawMatPlasticABS(70, texture { ldrawTexPlasticABS(70, -1, true) }) } #declare ldTex71=texture { ldrawTexPlasticABS(71, -1, false) } #declare ldMat71=material { ldrawMatPlasticABS(71, texture { ldrawTexPlasticABS(71, -1, true) }) } #declare ldTex72=texture { ldrawTexPlasticABS(72, -1, false) } #declare ldMat72=material { ldrawMatPlasticABS(72, texture { ldrawTexPlasticABS(72, -1, true) }) } #declare ldTex74=texture { ldrawTexPlasticABS(74, -1, false) } #declare ldMat74=material { ldrawMatPlasticABS(74, texture { ldrawTexPlasticABS(74, -1, true) }) } #declare ldTex77=texture { ldrawTexPlasticABS(77, -1, false) } #declare ldMat77=material { ldrawMatPlasticABS(77, texture { ldrawTexPlasticABS(77, -1, true) }) } #declare ldTex80=texture { ldrawTexMetal(80, -1, false) } #declare ldMat80=material { ldrawMatMetal(80, texture { ldrawTexMetal(80, -1, true) }) } #declare ldTex82=texture { ldrawTexMetal(82, -1, false) } #declare ldMat82=material { ldrawMatMetal(82, texture { ldrawTexMetal(82, -1, true) }) } #declare ldTex87=texture { ldrawTexMetal(87, -1, false) } #declare ldMat87=material { ldrawMatMetal(87, texture { ldrawTexMetal(87, -1, true) }) } #declare ldTex110=texture { ldrawTexPlasticABS(110, -1, false) } #declare ldMat110=material { ldrawMatPlasticABS(110, texture { ldrawTexPlasticABS(110, -1, true) }) } #declare ldTex134=texture { ldrawTexPearl(134, -1, false) } #declare ldMat134=material { ldrawMatPearl(134, texture { ldrawTexPearl(134, -1, true) }) } #declare ldTex256=texture { ldrawTexRubber(256, -1, false) } #declare ldMat256=material { ldrawMatRubber(256, texture { ldrawTexRubber(256, -1, true) }) } #declare ldTex258=texture { ldrawTexPlasticABS(258, -1, false) } #declare ldMat258=material { ldrawMatPlasticABS(258, texture { ldrawTexPlasticABS(258, -1, true) }) } #declare ldTex272=texture { ldrawTexPlasticABS(272, -1, false) } #declare ldMat272=material { ldrawMatPlasticABS(272, texture { ldrawTexPlasticABS(272, -1, true) }) } #declare ldTex277=texture { ldrawTexPlasticABS(277, -1, false) } #declare ldMat277=material { ldrawMatPlasticABS(277, texture { ldrawTexPlasticABS(277, -1, true) }) } #declare ldTex288=texture { ldrawTexPlasticABS(288, -1, false) } #declare ldMat288=material { ldrawMatPlasticABS(288, texture { ldrawTexPlasticABS(288, -1, true) }) } #declare ldTex320=texture { ldrawTexPlasticABS(320, -1, false) } #declare ldMat320=material { ldrawMatPlasticABS(320, texture { ldrawTexPlasticABS(320, -1, true) }) } #declare ldTex324=texture { ldrawTexRubber(324, -1, false) } #declare ldMat324=material { ldrawMatRubber(324, texture { ldrawTexRubber(324, -1, true) }) } #declare ldTex334=texture { ldrawTexChrome(334, -1, false) } #declare ldMat334=material { ldrawMatChrome(334, texture { ldrawTexChrome(334, -1, true) }) } #declare ldTex354=texture { ldrawTexPlasticABS(354, -1, false) } #declare ldMat354=material { ldrawMatPlasticABS(354, texture { ldrawTexPlasticABS(354, -1, true) }) } #declare ldTex366=texture { ldrawTexPlasticABS(366, -1, false) } #declare ldMat366=material { ldrawMatPlasticABS(366, texture { ldrawTexPlasticABS(366, -1, true) }) } #declare ldTex379=texture { ldrawTexPlasticABS(379, -1, false) } #declare ldMat379=material { ldrawMatPlasticABS(379, texture { ldrawTexPlasticABS(379, -1, true) }) } #declare ldTex382=texture { ldrawTexPlasticABS(382, -1, false) } #declare ldMat382=material { ldrawMatPlasticABS(382, texture { ldrawTexPlasticABS(382, -1, true) }) } #declare ldTex383=texture { ldrawTexChrome(383, -1, false) } #declare ldMat383=material { ldrawMatChrome(383, texture { ldrawTexChrome(383, -1, true) }) } #declare ldTex484=texture { ldrawTexPlasticABS(484, -1, false) } #declare ldMat484=material { ldrawMatPlasticABS(484, texture { ldrawTexPlasticABS(484, -1, true) }) } #declare ldTex487=texture { ldrawTexPlasticABS(487, -1, false) } #declare ldMat487=material { ldrawMatPlasticABS(487, texture { ldrawTexPlasticABS(487, -1, true) }) } #declare ldTex492=texture { ldrawTexPlasticABS(492, -1, false) } #declare ldMat492=material { ldrawMatPlasticABS(492, texture { ldrawTexPlasticABS(492, -1, true) }) } #declare ldTex493=texture { ldrawTexMetal(493, -1, false) } #declare ldMat493=material { ldrawMatMetal(493, texture { ldrawTexMetal(493, -1, true) }) } #declare ldTex494=texture { ldrawTexMetal(494, -1, false) } #declare ldMat494=material { ldrawMatMetal(494, texture { ldrawTexMetal(494, -1, true) }) } #declare ldTex503=texture { ldrawTexPlasticABS(503, -1, false) } #declare ldMat503=material { ldrawMatPlasticABS(503, texture { ldrawTexPlasticABS(503, -1, true) }) }