Permalink
Browse files

Add SARockLayer - this is one step from SARock

It can be used to simplify compilation or
to allow more customisation in the final material.
  • Loading branch information...
1 parent 74f2b16 commit 5a8ed8fa79fef1397dd39952474ff431011d7e88 sambler committed Jan 25, 2013
View
133 stone/SARock/SARockLayer.noodle-withGroupExpand.bcm
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<material view_color="rgb(0.80000, 0.80000, 0.80000)" sample_lamp="True">
+ <nodes>
+ <node type="FRAME" label="4.0" loc="-1766, -13" />
+ <node type="FRAME" label="4.5" loc="-1180, 369" />
+ <node type="FRAME" label="6.0" loc="-514, 375" />
+ <node type="FRAME" label="1.0" loc="-2156, 756" />
+ <node type="FRAME" label="1.5" loc="-1685, 712" />
+ <node type="FRAME" label="2.0" loc="-1215, 700" />
+ <node type="FRAME" label="2.5" loc="-777, 700" />
+ <node type="FRAME" label="3.0" loc="-294, 460" />
+ <node type="FRAME" label="3.5" loc="-2182, -7" />
+ <node type="FRAME" label="5.0" loc="-761, 362" />
+ <node type="SCRIPT" mode="INTERNAL" script="0" vector="Vector(0.0, 0.0, 0.0)" noisebasis="0" scale="8.91199" detail="3.53299" distortion="3.0" intensity="0.10000" concentration="2.03999" colorone="rgba(0.01889, 0.01889, 0.01889, 1.0)" colortwo="rgba(0.65899, 0.74400, 1.0, 1.0)" inbump="0.0" loc="93, 368" />
+ <node type="SCRIPT" mode="INTERNAL" script="1" vector="Vector(0.0, 0.0, 0.0)" noisebasis="0" scale="30.10000" detail="3.0" distortion="1.0" intensity="0.20000" concentration="2.05999" colorone="rgba(0.01889, 0.01889, 0.01889, 1.0)" colortwo="rgba(0.65899, 0.74400, 1.0, 1.0)" inbump="0.0" loc="-22, -18" />
+ <node type="SCRIPT" mode="INTERNAL" script="2" vector="Vector(0.0, 0.0, 0.0)" noisebasis="0" scale="30.0" detail="3.0" distortion="1.0" intensity="0.80000" concentration="2.05999" colorone="rgba(0.01889, 0.01889, 0.01889, 1.0)" colortwo="rgba(0.0, 0.0, 0.0, 1.0)" inbump="0.0" loc="227, -26" />
+ <node type="OUTPUT_MATERIAL" loc="446, 375" />
+ <node type="BUMP" strength="0.79999" loc="53, 300" />
+ <node type="BSDF_DIFFUSE" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.0" loc="249, 382" />
+ <node type="SCRIPT" mode="INTERNAL" script="3" vector="Vector(0.0, 0.0, 0.0)" noisebasis="0" scale="2.29500" detail="1.19299" distortion="0.0" intensity="0.40000" concentration="3.00839" colorone="rgba(0.01889, 0.01889, 0.01889, 1.0)" colortwo="rgba(0.28900, 0.21999, 0.125, 1.0)" inbump="0.0" loc="28, 106" />
+ <node type="SCRIPT" mode="INTERNAL" script="4" vector="Vector(0.0, 0.0, 0.0)" noisebasis="0" scale="32.20000" detail="3.20000" distortion="1.39999" intensity="0.40000" concentration="2.05999" colorone="rgba(0.01889, 0.01889, 0.01889, 1.0)" colortwo="rgba(0.28744, 0.21952, 0.12477, 1.0)" inbump="0.0" loc="27, 149" />
+ <node type="SCRIPT" mode="INTERNAL" script="5" vector="Vector(0.0, 0.0, 0.0)" noisebasis="0" scale="10.03999" detail="2.05999" distortion="0.0" intensity="0.30000" concentration="3.02800" colorone="rgba(0.01889, 0.01889, 0.01889, 1.0)" colortwo="rgba(0.63300, 0.55000, 0.32100, 1.0)" inbump="0.0" loc="25, 158" />
+ <node type="SCRIPT" mode="INTERNAL" script="6" vector="Vector(0.0, 0.0, 0.0)" noisebasis="0" scale="31.10000" detail="3.0" distortion="1.39999" intensity="0.40000" concentration="2.05999" colorone="rgba(0.01889, 0.01889, 0.01889, 1.0)" colortwo="rgba(0.63075, 0.55201, 0.32314, 1.0)" inbump="0.0" loc="49, 156" />
+ <node type="SCRIPT" mode="INTERNAL" script="7" vector="Vector(0.0, 0.0, 0.0)" noisebasis="0" scale="6.28000" detail="2.0" distortion="0.0" intensity="0.80000" concentration="2.94899" colorone="rgba(0.01889, 0.01889, 0.01889, 1.0)" colortwo="rgba(0.25999, 0.14900, 0.05950, 1.0)" inbump="0.0" loc="27, 396" />
+ <node type="SCRIPT" mode="INTERNAL" script="8" vector="Vector(0.0, 0.0, 0.0)" noisebasis="0" scale="29.59799" detail="3.0" distortion="1.39999" intensity="0.40000" concentration="2.05999" colorone="rgba(0.01889, 0.01889, 0.01889, 1.0)" colortwo="rgba(0.25999, 0.14900, 0.05950, 1.0)" inbump="0.0" loc="63, 366" />
+ <node type="REROUTE" loc="-2319, 399" />
+ <node type="REROUTE" loc="-2311, 89" />
+ <node type="REROUTE" loc="-2333, 50" />
+ <node type="REROUTE" loc="-2339, 422" />
+ <node type="REROUTE" loc="22, 495" />
+ <node type="REROUTE" loc="49, 474" />
+ <node type="REROUTE" loc="30, 760" />
+ <node type="REROUTE" loc="58, 770" />
+ <node type="TEX_COORD" dupli="False" loc="-2745, 1023" />
+ <node type="MAPPING" translation="Vector(0.0, 0.0, 0.0)" rotation="Vector(0.0, 0.0, 0.0)" scale="Vector(1.0, 1.0, 1.0)" use_min="False" use_max="False" vector="Vector(0.0, 0.0, 0.0)" loc="-2515, 1056" />
+ <node type="REROUTE" loc="-1789, 955" />
+ <node type="REROUTE" loc="-1277, 955" />
+ <node type="REROUTE" loc="-347, 955" />
+ <node type="REROUTE" loc="-2200, 955" />
+ <node type="REROUTE" loc="-814, 955" />
+ <node type="REROUTE" loc="-1744, 475" />
+ <node type="REROUTE" loc="-2216, 475" />
+ <node type="REROUTE" loc="-812, 415" />
+ <node type="REROUTE" loc="-357, 415" />
+ <node type="REROUTE" loc="-1282, 415" />
+ <node type="SCRIPT" mode="INTERNAL" script="9" vector="Vector(0.0, 0.0, 0.0)" noisebasis="0" scale="5.55999" detail="1.82799" distortion="1.39199" intensity="0.15000" concentration="2.16000" colorone="rgba(0.01889, 0.01889, 0.01889, 1.0)" colortwo="rgba(1.0, 1.0, 1.0, 1.0)" inbump="0.0" loc="10, -11" />
+ </nodes>
+ <links>
+ <link to="13" input="0" from="15" output="0" />
+ <link to="16" input="0" from="35" output="0" />
+ <link to="17" input="7" from="16" output="0" />
+ <link to="18" input="7" from="17" output="0" />
+ <link to="19" input="7" from="18" output="0" />
+ <link to="20" input="7" from="19" output="0" />
+ <link to="21" input="7" from="23" output="0" />
+ <link to="10" input="7" from="21" output="0" />
+ <link to="11" input="7" from="10" output="0" />
+ <link to="42" input="7" from="11" output="0" />
+ <link to="12" input="7" from="42" output="0" />
+ <link to="15" input="0" from="12" output="0" />
+ <link to="17" input="9" from="16" output="1" />
+ <link to="18" input="9" from="17" output="1" />
+ <link to="19" input="9" from="18" output="1" />
+ <link to="20" input="9" from="19" output="1" />
+ <link to="21" input="9" from="24" output="0" />
+ <link to="10" input="9" from="21" output="1" />
+ <link to="11" input="9" from="10" output="1" />
+ <link to="42" input="9" from="11" output="1" />
+ <link to="12" input="9" from="42" output="1" />
+ <link to="14" input="1" from="12" output="1" />
+ <link to="15" input="2" from="14" output="0" />
+ <link to="28" input="0" from="20" output="1" />
+ <link to="29" input="0" from="20" output="0" />
+ <link to="26" input="0" from="28" output="0" />
+ <link to="27" input="0" from="29" output="0" />
+ <link to="25" input="0" from="26" output="0" />
+ <link to="22" input="0" from="27" output="0" />
+ <link to="24" input="0" from="25" output="0" />
+ <link to="23" input="0" from="22" output="0" />
+ <link to="31" input="0" from="30" output="0" />
+ <link to="35" input="0" from="31" output="0" />
+ <link to="32" input="0" from="35" output="0" />
+ <link to="17" input="0" from="32" output="0" />
+ <link to="33" input="0" from="32" output="0" />
+ <link to="18" input="0" from="33" output="0" />
+ <link to="36" input="0" from="33" output="0" />
+ <link to="19" input="0" from="36" output="0" />
+ <link to="34" input="0" from="36" output="0" />
+ <link to="20" input="0" from="34" output="0" />
+ <link to="38" input="0" from="35" output="0" />
+ <link to="21" input="0" from="38" output="0" />
+ <link to="37" input="0" from="38" output="0" />
+ <link to="10" input="0" from="37" output="0" />
+ <link to="41" input="0" from="37" output="0" />
+ <link to="11" input="0" from="41" output="0" />
+ <link to="39" input="0" from="41" output="0" />
+ <link to="42" input="0" from="39" output="0" />
+ <link to="40" input="0" from="39" output="0" />
+ <link to="12" input="0" from="40" output="0" />
+ </links>
+ <scripts>
+ <script name="SARockLayer.osl" id="0">
+/*<br /> * SARockLayer.osl by Shane Ambler (c)2012<br /> * from https://github.com/sambler/osl-shaders<br /> *<br /> * license: BSD<br /> *<br /> * This is a part of SARock.osl extracted to simplify the compiling<br /> * in exchange for a more complex node tree.<br /> * The full SARock script links 10 of these together.<br /> * This method does offer an increased level of customisation.<br /> *<br /> */<br /><br />#include &quot;stdosl.h&quot;<br />#include &quot;node_texture.h&quot;<br /><br />/* noise from node_noise_texture.osl from blender source tree - removed fac and colour*/<br />float rock_noise(point p, string basis, float distortion, float detail)<br />{<br /> point r;<br /> int hard = 0;<br /><br /> if (distortion != 0.0) {<br /> r[0] = noise_basis(p + point(13.5), basis) * distortion;<br /> r[1] = noise_basis(p, basis) * distortion;<br /> r[2] = noise_basis(p - point(13.5), basis) * distortion;<br /><br /> p += r;<br /> }<br /><br /> return noise_turbulence(p, basis, detail, hard);<br />}<br /><br />float SpreadTexture (<br /> vector inVec,<br /> string inBasis,<br /> float inIntensity,<br /> float inConcentration,<br /> float inScale,<br /> float inDetail,<br /> float inDistortion )<br />{<br /> float outFac;<br /> outFac = rock_noise(inVec * inScale, inBasis, inDistortion, inDetail);<br /> outFac = ((floor(outFac-inConcentration + 0.5) + inConcentration) * outFac) * inIntensity;<br /> <br /> return outFac;<br />}<br /><br />shader SARock(<br /> vector Vector = P,<br /> int NoiseBasis = 0,<br /> float Scale = 2.295,<br /> float Detail = 1.193,<br /> float Distortion = 0.0,<br /> float Intensity = 0.4,<br /> float Concentration = 3.0084,<br /> color ColorOne = color(0.0189),<br /> color ColorTwo = color(0.289,0.22,0.125),<br /> float InBump = 0,<br /> output color Color = color(1),<br /> output float Bump = 0 )<br />{<br /> string Basis = &quot;Perlin&quot;;<br /> float Fac = 0;<br /> <br /> if (NoiseBasis == 1)<br /> Basis = &quot;Voronoi F1&quot;;<br /> else if (NoiseBasis == 2)<br /> Basis = &quot;Voronoi F2&quot;;<br /> else if (NoiseBasis == 3)<br /> Basis = &quot;Voronoi F3&quot;;<br /> else if (NoiseBasis == 4)<br /> Basis = &quot;Voronoi F4&quot;;<br /> else if (NoiseBasis == 5)<br /> Basis = &quot;Voronoi F2-F1&quot;;<br /> else if (NoiseBasis == 6)<br /> Basis = &quot;Voronoi Crackle&quot;;<br /> else if (NoiseBasis == 7)<br /> Basis = &quot;Cell Noise&quot;;<br /> else /* default */<br /> Basis = &quot;Perlin&quot;;<br /><br /> Fac = SpreadTexture(Vector, Basis, <br /> Intensity, Concentration, <br /> Scale, Detail, Distortion);<br /> Color = mix(ColorOne,ColorTwo,Fac);<br /> Bump = InBump + (Fac / 10);<br />}<br /><br />
+ </script>
+ <script name="SARockLayer.osl" id="1">
+/*<br /> * SARockLayer.osl by Shane Ambler (c)2012<br /> * from https://github.com/sambler/osl-shaders<br /> *<br /> * license: BSD<br /> *<br /> * This is a part of SARock.osl extracted to simplify the compiling<br /> * in exchange for a more complex node tree.<br /> * The full SARock script links 10 of these together.<br /> * This method does offer an increased level of customisation.<br /> *<br /> */<br /><br />#include &quot;stdosl.h&quot;<br />#include &quot;node_texture.h&quot;<br /><br />/* noise from node_noise_texture.osl from blender source tree - removed fac and colour*/<br />float rock_noise(point p, string basis, float distortion, float detail)<br />{<br /> point r;<br /> int hard = 0;<br /><br /> if (distortion != 0.0) {<br /> r[0] = noise_basis(p + point(13.5), basis) * distortion;<br /> r[1] = noise_basis(p, basis) * distortion;<br /> r[2] = noise_basis(p - point(13.5), basis) * distortion;<br /><br /> p += r;<br /> }<br /><br /> return noise_turbulence(p, basis, detail, hard);<br />}<br /><br />float SpreadTexture (<br /> vector inVec,<br /> string inBasis,<br /> float inIntensity,<br /> float inConcentration,<br /> float inScale,<br /> float inDetail,<br /> float inDistortion )<br />{<br /> float outFac;<br /> outFac = rock_noise(inVec * inScale, inBasis, inDistortion, inDetail);<br /> outFac = ((floor(outFac-inConcentration + 0.5) + inConcentration) * outFac) * inIntensity;<br /> <br /> return outFac;<br />}<br /><br />shader SARock(<br /> vector Vector = P,<br /> int NoiseBasis = 0,<br /> float Scale = 2.295,<br /> float Detail = 1.193,<br /> float Distortion = 0.0,<br /> float Intensity = 0.4,<br /> float Concentration = 3.0084,<br /> color ColorOne = color(0.0189),<br /> color ColorTwo = color(0.289,0.22,0.125),<br /> float InBump = 0,<br /> output color Color = color(1),<br /> output float Bump = 0 )<br />{<br /> string Basis = &quot;Perlin&quot;;<br /> float Fac = 0;<br /> <br /> if (NoiseBasis == 1)<br /> Basis = &quot;Voronoi F1&quot;;<br /> else if (NoiseBasis == 2)<br /> Basis = &quot;Voronoi F2&quot;;<br /> else if (NoiseBasis == 3)<br /> Basis = &quot;Voronoi F3&quot;;<br /> else if (NoiseBasis == 4)<br /> Basis = &quot;Voronoi F4&quot;;<br /> else if (NoiseBasis == 5)<br /> Basis = &quot;Voronoi F2-F1&quot;;<br /> else if (NoiseBasis == 6)<br /> Basis = &quot;Voronoi Crackle&quot;;<br /> else if (NoiseBasis == 7)<br /> Basis = &quot;Cell Noise&quot;;<br /> else /* default */<br /> Basis = &quot;Perlin&quot;;<br /><br /> Fac = SpreadTexture(Vector, Basis, <br /> Intensity, Concentration, <br /> Scale, Detail, Distortion);<br /> Color = mix(ColorOne,ColorTwo,Fac);<br /> Bump = InBump + (Fac / 10);<br />}<br /><br />
+ </script>
+ <script name="SARockLayer.osl" id="2">
+/*<br /> * SARockLayer.osl by Shane Ambler (c)2012<br /> * from https://github.com/sambler/osl-shaders<br /> *<br /> * license: BSD<br /> *<br /> * This is a part of SARock.osl extracted to simplify the compiling<br /> * in exchange for a more complex node tree.<br /> * The full SARock script links 10 of these together.<br /> * This method does offer an increased level of customisation.<br /> *<br /> */<br /><br />#include &quot;stdosl.h&quot;<br />#include &quot;node_texture.h&quot;<br /><br />/* noise from node_noise_texture.osl from blender source tree - removed fac and colour*/<br />float rock_noise(point p, string basis, float distortion, float detail)<br />{<br /> point r;<br /> int hard = 0;<br /><br /> if (distortion != 0.0) {<br /> r[0] = noise_basis(p + point(13.5), basis) * distortion;<br /> r[1] = noise_basis(p, basis) * distortion;<br /> r[2] = noise_basis(p - point(13.5), basis) * distortion;<br /><br /> p += r;<br /> }<br /><br /> return noise_turbulence(p, basis, detail, hard);<br />}<br /><br />float SpreadTexture (<br /> vector inVec,<br /> string inBasis,<br /> float inIntensity,<br /> float inConcentration,<br /> float inScale,<br /> float inDetail,<br /> float inDistortion )<br />{<br /> float outFac;<br /> outFac = rock_noise(inVec * inScale, inBasis, inDistortion, inDetail);<br /> outFac = ((floor(outFac-inConcentration + 0.5) + inConcentration) * outFac) * inIntensity;<br /> <br /> return outFac;<br />}<br /><br />shader SARock(<br /> vector Vector = P,<br /> int NoiseBasis = 0,<br /> float Scale = 2.295,<br /> float Detail = 1.193,<br /> float Distortion = 0.0,<br /> float Intensity = 0.4,<br /> float Concentration = 3.0084,<br /> color ColorOne = color(0.0189),<br /> color ColorTwo = color(0.289,0.22,0.125),<br /> float InBump = 0,<br /> output color Color = color(1),<br /> output float Bump = 0 )<br />{<br /> string Basis = &quot;Perlin&quot;;<br /> float Fac = 0;<br /> <br /> if (NoiseBasis == 1)<br /> Basis = &quot;Voronoi F1&quot;;<br /> else if (NoiseBasis == 2)<br /> Basis = &quot;Voronoi F2&quot;;<br /> else if (NoiseBasis == 3)<br /> Basis = &quot;Voronoi F3&quot;;<br /> else if (NoiseBasis == 4)<br /> Basis = &quot;Voronoi F4&quot;;<br /> else if (NoiseBasis == 5)<br /> Basis = &quot;Voronoi F2-F1&quot;;<br /> else if (NoiseBasis == 6)<br /> Basis = &quot;Voronoi Crackle&quot;;<br /> else if (NoiseBasis == 7)<br /> Basis = &quot;Cell Noise&quot;;<br /> else /* default */<br /> Basis = &quot;Perlin&quot;;<br /><br /> Fac = SpreadTexture(Vector, Basis, <br /> Intensity, Concentration, <br /> Scale, Detail, Distortion);<br /> Color = mix(ColorOne,ColorTwo,Fac);<br /> Bump = InBump + (Fac / 10);<br />}<br /><br />
+ </script>
+ <script name="SARockLayer.osl" id="3">
+/*<br /> * SARockLayer.osl by Shane Ambler (c)2012<br /> * from https://github.com/sambler/osl-shaders<br /> *<br /> * license: BSD<br /> *<br /> * This is a part of SARock.osl extracted to simplify the compiling<br /> * in exchange for a more complex node tree.<br /> * The full SARock script links 10 of these together.<br /> * This method does offer an increased level of customisation.<br /> *<br /> */<br /><br />#include &quot;stdosl.h&quot;<br />#include &quot;node_texture.h&quot;<br /><br />/* noise from node_noise_texture.osl from blender source tree - removed fac and colour*/<br />float rock_noise(point p, string basis, float distortion, float detail)<br />{<br /> point r;<br /> int hard = 0;<br /><br /> if (distortion != 0.0) {<br /> r[0] = noise_basis(p + point(13.5), basis) * distortion;<br /> r[1] = noise_basis(p, basis) * distortion;<br /> r[2] = noise_basis(p - point(13.5), basis) * distortion;<br /><br /> p += r;<br /> }<br /><br /> return noise_turbulence(p, basis, detail, hard);<br />}<br /><br />float SpreadTexture (<br /> vector inVec,<br /> string inBasis,<br /> float inIntensity,<br /> float inConcentration,<br /> float inScale,<br /> float inDetail,<br /> float inDistortion )<br />{<br /> float outFac;<br /> outFac = rock_noise(inVec * inScale, inBasis, inDistortion, inDetail);<br /> outFac = ((floor(outFac-inConcentration + 0.5) + inConcentration) * outFac) * inIntensity;<br /> <br /> return outFac;<br />}<br /><br />shader SARock(<br /> vector Vector = P,<br /> int NoiseBasis = 0,<br /> float Scale = 2.295,<br /> float Detail = 1.193,<br /> float Distortion = 0.0,<br /> float Intensity = 0.4,<br /> float Concentration = 3.0084,<br /> color ColorOne = color(0.0189),<br /> color ColorTwo = color(0.289,0.22,0.125),<br /> float InBump = 0,<br /> output color Color = color(1),<br /> output float Bump = 0 )<br />{<br /> string Basis = &quot;Perlin&quot;;<br /> float Fac = 0;<br /> <br /> if (NoiseBasis == 1)<br /> Basis = &quot;Voronoi F1&quot;;<br /> else if (NoiseBasis == 2)<br /> Basis = &quot;Voronoi F2&quot;;<br /> else if (NoiseBasis == 3)<br /> Basis = &quot;Voronoi F3&quot;;<br /> else if (NoiseBasis == 4)<br /> Basis = &quot;Voronoi F4&quot;;<br /> else if (NoiseBasis == 5)<br /> Basis = &quot;Voronoi F2-F1&quot;;<br /> else if (NoiseBasis == 6)<br /> Basis = &quot;Voronoi Crackle&quot;;<br /> else if (NoiseBasis == 7)<br /> Basis = &quot;Cell Noise&quot;;<br /> else /* default */<br /> Basis = &quot;Perlin&quot;;<br /><br /> Fac = SpreadTexture(Vector, Basis, <br /> Intensity, Concentration, <br /> Scale, Detail, Distortion);<br /> Color = mix(ColorOne,ColorTwo,Fac);<br /> Bump = InBump + (Fac / 10);<br />}<br /><br />
+ </script>
+ <script name="SARockLayer.osl" id="4">
+/*<br /> * SARockLayer.osl by Shane Ambler (c)2012<br /> * from https://github.com/sambler/osl-shaders<br /> *<br /> * license: BSD<br /> *<br /> * This is a part of SARock.osl extracted to simplify the compiling<br /> * in exchange for a more complex node tree.<br /> * The full SARock script links 10 of these together.<br /> * This method does offer an increased level of customisation.<br /> *<br /> */<br /><br />#include &quot;stdosl.h&quot;<br />#include &quot;node_texture.h&quot;<br /><br />/* noise from node_noise_texture.osl from blender source tree - removed fac and colour*/<br />float rock_noise(point p, string basis, float distortion, float detail)<br />{<br /> point r;<br /> int hard = 0;<br /><br /> if (distortion != 0.0) {<br /> r[0] = noise_basis(p + point(13.5), basis) * distortion;<br /> r[1] = noise_basis(p, basis) * distortion;<br /> r[2] = noise_basis(p - point(13.5), basis) * distortion;<br /><br /> p += r;<br /> }<br /><br /> return noise_turbulence(p, basis, detail, hard);<br />}<br /><br />float SpreadTexture (<br /> vector inVec,<br /> string inBasis,<br /> float inIntensity,<br /> float inConcentration,<br /> float inScale,<br /> float inDetail,<br /> float inDistortion )<br />{<br /> float outFac;<br /> outFac = rock_noise(inVec * inScale, inBasis, inDistortion, inDetail);<br /> outFac = ((floor(outFac-inConcentration + 0.5) + inConcentration) * outFac) * inIntensity;<br /> <br /> return outFac;<br />}<br /><br />shader SARock(<br /> vector Vector = P,<br /> int NoiseBasis = 0,<br /> float Scale = 2.295,<br /> float Detail = 1.193,<br /> float Distortion = 0.0,<br /> float Intensity = 0.4,<br /> float Concentration = 3.0084,<br /> color ColorOne = color(0.0189),<br /> color ColorTwo = color(0.289,0.22,0.125),<br /> float InBump = 0,<br /> output color Color = color(1),<br /> output float Bump = 0 )<br />{<br /> string Basis = &quot;Perlin&quot;;<br /> float Fac = 0;<br /> <br /> if (NoiseBasis == 1)<br /> Basis = &quot;Voronoi F1&quot;;<br /> else if (NoiseBasis == 2)<br /> Basis = &quot;Voronoi F2&quot;;<br /> else if (NoiseBasis == 3)<br /> Basis = &quot;Voronoi F3&quot;;<br /> else if (NoiseBasis == 4)<br /> Basis = &quot;Voronoi F4&quot;;<br /> else if (NoiseBasis == 5)<br /> Basis = &quot;Voronoi F2-F1&quot;;<br /> else if (NoiseBasis == 6)<br /> Basis = &quot;Voronoi Crackle&quot;;<br /> else if (NoiseBasis == 7)<br /> Basis = &quot;Cell Noise&quot;;<br /> else /* default */<br /> Basis = &quot;Perlin&quot;;<br /><br /> Fac = SpreadTexture(Vector, Basis, <br /> Intensity, Concentration, <br /> Scale, Detail, Distortion);<br /> Color = mix(ColorOne,ColorTwo,Fac);<br /> Bump = InBump + (Fac / 10);<br />}<br /><br />
+ </script>
+ <script name="SARockLayer.osl" id="5">
+/*<br /> * SARockLayer.osl by Shane Ambler (c)2012<br /> * from https://github.com/sambler/osl-shaders<br /> *<br /> * license: BSD<br /> *<br /> * This is a part of SARock.osl extracted to simplify the compiling<br /> * in exchange for a more complex node tree.<br /> * The full SARock script links 10 of these together.<br /> * This method does offer an increased level of customisation.<br /> *<br /> */<br /><br />#include &quot;stdosl.h&quot;<br />#include &quot;node_texture.h&quot;<br /><br />/* noise from node_noise_texture.osl from blender source tree - removed fac and colour*/<br />float rock_noise(point p, string basis, float distortion, float detail)<br />{<br /> point r;<br /> int hard = 0;<br /><br /> if (distortion != 0.0) {<br /> r[0] = noise_basis(p + point(13.5), basis) * distortion;<br /> r[1] = noise_basis(p, basis) * distortion;<br /> r[2] = noise_basis(p - point(13.5), basis) * distortion;<br /><br /> p += r;<br /> }<br /><br /> return noise_turbulence(p, basis, detail, hard);<br />}<br /><br />float SpreadTexture (<br /> vector inVec,<br /> string inBasis,<br /> float inIntensity,<br /> float inConcentration,<br /> float inScale,<br /> float inDetail,<br /> float inDistortion )<br />{<br /> float outFac;<br /> outFac = rock_noise(inVec * inScale, inBasis, inDistortion, inDetail);<br /> outFac = ((floor(outFac-inConcentration + 0.5) + inConcentration) * outFac) * inIntensity;<br /> <br /> return outFac;<br />}<br /><br />shader SARock(<br /> vector Vector = P,<br /> int NoiseBasis = 0,<br /> float Scale = 2.295,<br /> float Detail = 1.193,<br /> float Distortion = 0.0,<br /> float Intensity = 0.4,<br /> float Concentration = 3.0084,<br /> color ColorOne = color(0.0189),<br /> color ColorTwo = color(0.289,0.22,0.125),<br /> float InBump = 0,<br /> output color Color = color(1),<br /> output float Bump = 0 )<br />{<br /> string Basis = &quot;Perlin&quot;;<br /> float Fac = 0;<br /> <br /> if (NoiseBasis == 1)<br /> Basis = &quot;Voronoi F1&quot;;<br /> else if (NoiseBasis == 2)<br /> Basis = &quot;Voronoi F2&quot;;<br /> else if (NoiseBasis == 3)<br /> Basis = &quot;Voronoi F3&quot;;<br /> else if (NoiseBasis == 4)<br /> Basis = &quot;Voronoi F4&quot;;<br /> else if (NoiseBasis == 5)<br /> Basis = &quot;Voronoi F2-F1&quot;;<br /> else if (NoiseBasis == 6)<br /> Basis = &quot;Voronoi Crackle&quot;;<br /> else if (NoiseBasis == 7)<br /> Basis = &quot;Cell Noise&quot;;<br /> else /* default */<br /> Basis = &quot;Perlin&quot;;<br /><br /> Fac = SpreadTexture(Vector, Basis, <br /> Intensity, Concentration, <br /> Scale, Detail, Distortion);<br /> Color = mix(ColorOne,ColorTwo,Fac);<br /> Bump = InBump + (Fac / 10);<br />}<br /><br />
+ </script>
+ <script name="SARockLayer.osl" id="6">
+/*<br /> * SARockLayer.osl by Shane Ambler (c)2012<br /> * from https://github.com/sambler/osl-shaders<br /> *<br /> * license: BSD<br /> *<br /> * This is a part of SARock.osl extracted to simplify the compiling<br /> * in exchange for a more complex node tree.<br /> * The full SARock script links 10 of these together.<br /> * This method does offer an increased level of customisation.<br /> *<br /> */<br /><br />#include &quot;stdosl.h&quot;<br />#include &quot;node_texture.h&quot;<br /><br />/* noise from node_noise_texture.osl from blender source tree - removed fac and colour*/<br />float rock_noise(point p, string basis, float distortion, float detail)<br />{<br /> point r;<br /> int hard = 0;<br /><br /> if (distortion != 0.0) {<br /> r[0] = noise_basis(p + point(13.5), basis) * distortion;<br /> r[1] = noise_basis(p, basis) * distortion;<br /> r[2] = noise_basis(p - point(13.5), basis) * distortion;<br /><br /> p += r;<br /> }<br /><br /> return noise_turbulence(p, basis, detail, hard);<br />}<br /><br />float SpreadTexture (<br /> vector inVec,<br /> string inBasis,<br /> float inIntensity,<br /> float inConcentration,<br /> float inScale,<br /> float inDetail,<br /> float inDistortion )<br />{<br /> float outFac;<br /> outFac = rock_noise(inVec * inScale, inBasis, inDistortion, inDetail);<br /> outFac = ((floor(outFac-inConcentration + 0.5) + inConcentration) * outFac) * inIntensity;<br /> <br /> return outFac;<br />}<br /><br />shader SARock(<br /> vector Vector = P,<br /> int NoiseBasis = 0,<br /> float Scale = 2.295,<br /> float Detail = 1.193,<br /> float Distortion = 0.0,<br /> float Intensity = 0.4,<br /> float Concentration = 3.0084,<br /> color ColorOne = color(0.0189),<br /> color ColorTwo = color(0.289,0.22,0.125),<br /> float InBump = 0,<br /> output color Color = color(1),<br /> output float Bump = 0 )<br />{<br /> string Basis = &quot;Perlin&quot;;<br /> float Fac = 0;<br /> <br /> if (NoiseBasis == 1)<br /> Basis = &quot;Voronoi F1&quot;;<br /> else if (NoiseBasis == 2)<br /> Basis = &quot;Voronoi F2&quot;;<br /> else if (NoiseBasis == 3)<br /> Basis = &quot;Voronoi F3&quot;;<br /> else if (NoiseBasis == 4)<br /> Basis = &quot;Voronoi F4&quot;;<br /> else if (NoiseBasis == 5)<br /> Basis = &quot;Voronoi F2-F1&quot;;<br /> else if (NoiseBasis == 6)<br /> Basis = &quot;Voronoi Crackle&quot;;<br /> else if (NoiseBasis == 7)<br /> Basis = &quot;Cell Noise&quot;;<br /> else /* default */<br /> Basis = &quot;Perlin&quot;;<br /><br /> Fac = SpreadTexture(Vector, Basis, <br /> Intensity, Concentration, <br /> Scale, Detail, Distortion);<br /> Color = mix(ColorOne,ColorTwo,Fac);<br /> Bump = InBump + (Fac / 10);<br />}<br /><br />
+ </script>
+ <script name="SARockLayer.osl" id="7">
+/*<br /> * SARockLayer.osl by Shane Ambler (c)2012<br /> * from https://github.com/sambler/osl-shaders<br /> *<br /> * license: BSD<br /> *<br /> * This is a part of SARock.osl extracted to simplify the compiling<br /> * in exchange for a more complex node tree.<br /> * The full SARock script links 10 of these together.<br /> * This method does offer an increased level of customisation.<br /> *<br /> */<br /><br />#include &quot;stdosl.h&quot;<br />#include &quot;node_texture.h&quot;<br /><br />/* noise from node_noise_texture.osl from blender source tree - removed fac and colour*/<br />float rock_noise(point p, string basis, float distortion, float detail)<br />{<br /> point r;<br /> int hard = 0;<br /><br /> if (distortion != 0.0) {<br /> r[0] = noise_basis(p + point(13.5), basis) * distortion;<br /> r[1] = noise_basis(p, basis) * distortion;<br /> r[2] = noise_basis(p - point(13.5), basis) * distortion;<br /><br /> p += r;<br /> }<br /><br /> return noise_turbulence(p, basis, detail, hard);<br />}<br /><br />float SpreadTexture (<br /> vector inVec,<br /> string inBasis,<br /> float inIntensity,<br /> float inConcentration,<br /> float inScale,<br /> float inDetail,<br /> float inDistortion )<br />{<br /> float outFac;<br /> outFac = rock_noise(inVec * inScale, inBasis, inDistortion, inDetail);<br /> outFac = ((floor(outFac-inConcentration + 0.5) + inConcentration) * outFac) * inIntensity;<br /> <br /> return outFac;<br />}<br /><br />shader SARock(<br /> vector Vector = P,<br /> int NoiseBasis = 0,<br /> float Scale = 2.295,<br /> float Detail = 1.193,<br /> float Distortion = 0.0,<br /> float Intensity = 0.4,<br /> float Concentration = 3.0084,<br /> color ColorOne = color(0.0189),<br /> color ColorTwo = color(0.289,0.22,0.125),<br /> float InBump = 0,<br /> output color Color = color(1),<br /> output float Bump = 0 )<br />{<br /> string Basis = &quot;Perlin&quot;;<br /> float Fac = 0;<br /> <br /> if (NoiseBasis == 1)<br /> Basis = &quot;Voronoi F1&quot;;<br /> else if (NoiseBasis == 2)<br /> Basis = &quot;Voronoi F2&quot;;<br /> else if (NoiseBasis == 3)<br /> Basis = &quot;Voronoi F3&quot;;<br /> else if (NoiseBasis == 4)<br /> Basis = &quot;Voronoi F4&quot;;<br /> else if (NoiseBasis == 5)<br /> Basis = &quot;Voronoi F2-F1&quot;;<br /> else if (NoiseBasis == 6)<br /> Basis = &quot;Voronoi Crackle&quot;;<br /> else if (NoiseBasis == 7)<br /> Basis = &quot;Cell Noise&quot;;<br /> else /* default */<br /> Basis = &quot;Perlin&quot;;<br /><br /> Fac = SpreadTexture(Vector, Basis, <br /> Intensity, Concentration, <br /> Scale, Detail, Distortion);<br /> Color = mix(ColorOne,ColorTwo,Fac);<br /> Bump = InBump + (Fac / 10);<br />}<br /><br />
+ </script>
+ <script name="SARockLayer.osl" id="8">
+/*<br /> * SARockLayer.osl by Shane Ambler (c)2012<br /> * from https://github.com/sambler/osl-shaders<br /> *<br /> * license: BSD<br /> *<br /> * This is a part of SARock.osl extracted to simplify the compiling<br /> * in exchange for a more complex node tree.<br /> * The full SARock script links 10 of these together.<br /> * This method does offer an increased level of customisation.<br /> *<br /> */<br /><br />#include &quot;stdosl.h&quot;<br />#include &quot;node_texture.h&quot;<br /><br />/* noise from node_noise_texture.osl from blender source tree - removed fac and colour*/<br />float rock_noise(point p, string basis, float distortion, float detail)<br />{<br /> point r;<br /> int hard = 0;<br /><br /> if (distortion != 0.0) {<br /> r[0] = noise_basis(p + point(13.5), basis) * distortion;<br /> r[1] = noise_basis(p, basis) * distortion;<br /> r[2] = noise_basis(p - point(13.5), basis) * distortion;<br /><br /> p += r;<br /> }<br /><br /> return noise_turbulence(p, basis, detail, hard);<br />}<br /><br />float SpreadTexture (<br /> vector inVec,<br /> string inBasis,<br /> float inIntensity,<br /> float inConcentration,<br /> float inScale,<br /> float inDetail,<br /> float inDistortion )<br />{<br /> float outFac;<br /> outFac = rock_noise(inVec * inScale, inBasis, inDistortion, inDetail);<br /> outFac = ((floor(outFac-inConcentration + 0.5) + inConcentration) * outFac) * inIntensity;<br /> <br /> return outFac;<br />}<br /><br />shader SARock(<br /> vector Vector = P,<br /> int NoiseBasis = 0,<br /> float Scale = 2.295,<br /> float Detail = 1.193,<br /> float Distortion = 0.0,<br /> float Intensity = 0.4,<br /> float Concentration = 3.0084,<br /> color ColorOne = color(0.0189),<br /> color ColorTwo = color(0.289,0.22,0.125),<br /> float InBump = 0,<br /> output color Color = color(1),<br /> output float Bump = 0 )<br />{<br /> string Basis = &quot;Perlin&quot;;<br /> float Fac = 0;<br /> <br /> if (NoiseBasis == 1)<br /> Basis = &quot;Voronoi F1&quot;;<br /> else if (NoiseBasis == 2)<br /> Basis = &quot;Voronoi F2&quot;;<br /> else if (NoiseBasis == 3)<br /> Basis = &quot;Voronoi F3&quot;;<br /> else if (NoiseBasis == 4)<br /> Basis = &quot;Voronoi F4&quot;;<br /> else if (NoiseBasis == 5)<br /> Basis = &quot;Voronoi F2-F1&quot;;<br /> else if (NoiseBasis == 6)<br /> Basis = &quot;Voronoi Crackle&quot;;<br /> else if (NoiseBasis == 7)<br /> Basis = &quot;Cell Noise&quot;;<br /> else /* default */<br /> Basis = &quot;Perlin&quot;;<br /><br /> Fac = SpreadTexture(Vector, Basis, <br /> Intensity, Concentration, <br /> Scale, Detail, Distortion);<br /> Color = mix(ColorOne,ColorTwo,Fac);<br /> Bump = InBump + (Fac / 10);<br />}<br /><br />
+ </script>
+ <script name="SARockLayer.osl" id="9">
+/*<br /> * SARockLayer.osl by Shane Ambler (c)2012<br /> * from https://github.com/sambler/osl-shaders<br /> *<br /> * license: BSD<br /> *<br /> * This is a part of SARock.osl extracted to simplify the compiling<br /> * in exchange for a more complex node tree.<br /> * The full SARock script links 10 of these together.<br /> * This method does offer an increased level of customisation.<br /> *<br /> */<br /><br />#include &quot;stdosl.h&quot;<br />#include &quot;node_texture.h&quot;<br /><br />/* noise from node_noise_texture.osl from blender source tree - removed fac and colour*/<br />float rock_noise(point p, string basis, float distortion, float detail)<br />{<br /> point r;<br /> int hard = 0;<br /><br /> if (distortion != 0.0) {<br /> r[0] = noise_basis(p + point(13.5), basis) * distortion;<br /> r[1] = noise_basis(p, basis) * distortion;<br /> r[2] = noise_basis(p - point(13.5), basis) * distortion;<br /><br /> p += r;<br /> }<br /><br /> return noise_turbulence(p, basis, detail, hard);<br />}<br /><br />float SpreadTexture (<br /> vector inVec,<br /> string inBasis,<br /> float inIntensity,<br /> float inConcentration,<br /> float inScale,<br /> float inDetail,<br /> float inDistortion )<br />{<br /> float outFac;<br /> outFac = rock_noise(inVec * inScale, inBasis, inDistortion, inDetail);<br /> outFac = ((floor(outFac-inConcentration + 0.5) + inConcentration) * outFac) * inIntensity;<br /> <br /> return outFac;<br />}<br /><br />shader SARock(<br /> vector Vector = P,<br /> int NoiseBasis = 0,<br /> float Scale = 2.295,<br /> float Detail = 1.193,<br /> float Distortion = 0.0,<br /> float Intensity = 0.4,<br /> float Concentration = 3.0084,<br /> color ColorOne = color(0.0189),<br /> color ColorTwo = color(0.289,0.22,0.125),<br /> float InBump = 0,<br /> output color Color = color(1),<br /> output float Bump = 0 )<br />{<br /> string Basis = &quot;Perlin&quot;;<br /> float Fac = 0;<br /> <br /> if (NoiseBasis == 1)<br /> Basis = &quot;Voronoi F1&quot;;<br /> else if (NoiseBasis == 2)<br /> Basis = &quot;Voronoi F2&quot;;<br /> else if (NoiseBasis == 3)<br /> Basis = &quot;Voronoi F3&quot;;<br /> else if (NoiseBasis == 4)<br /> Basis = &quot;Voronoi F4&quot;;<br /> else if (NoiseBasis == 5)<br /> Basis = &quot;Voronoi F2-F1&quot;;<br /> else if (NoiseBasis == 6)<br /> Basis = &quot;Voronoi Crackle&quot;;<br /> else if (NoiseBasis == 7)<br /> Basis = &quot;Cell Noise&quot;;<br /> else /* default */<br /> Basis = &quot;Perlin&quot;;<br /><br /> Fac = SpreadTexture(Vector, Basis, <br /> Intensity, Concentration, <br /> Scale, Detail, Distortion);<br /> Color = mix(ColorOne,ColorTwo,Fac);<br /> Bump = InBump + (Fac / 10);<br />}<br /><br />
+ </script>
+ </scripts>
+</material>
View
BIN stone/SARock/SARockLayer.noodle-withGroupExpand.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
90 stone/SARock/SARockLayer.osl
@@ -0,0 +1,90 @@
+/*
+ * SARockLayer.osl by Shane Ambler (c)2012
+ * from https://github.com/sambler/osl-shaders
+ *
+ * license: BSD
+ *
+ * This is a part of SARock.osl extracted to simplify the compiling
+ * in exchange for a more complex node tree.
+ * The full SARock script links 10 of these together.
+ * This method does offer an increased level of customisation.
+ *
+ */
+
+#include "stdosl.h"
+#include "node_texture.h"
+
+/* noise from node_noise_texture.osl from blender source tree - removed fac and colour*/
+float rock_noise(point p, string basis, float distortion, float detail)
+{
+ point r;
+ int hard = 0;
+
+ if (distortion != 0.0) {
+ r[0] = noise_basis(p + point(13.5), basis) * distortion;
+ r[1] = noise_basis(p, basis) * distortion;
+ r[2] = noise_basis(p - point(13.5), basis) * distortion;
+
+ p += r;
+ }
+
+ return noise_turbulence(p, basis, detail, hard);
+}
+
+float SpreadTexture (
+ vector inVec,
+ string inBasis,
+ float inIntensity,
+ float inConcentration,
+ float inScale,
+ float inDetail,
+ float inDistortion )
+{
+ float outFac;
+ outFac = rock_noise(inVec * inScale, inBasis, inDistortion, inDetail);
+ outFac = ((floor(outFac-inConcentration + 0.5) + inConcentration) * outFac) * inIntensity;
+
+ return outFac;
+}
+
+shader SARock(
+ vector Vector = P,
+ int NoiseBasis = 0,
+ float Scale = 2.295,
+ float Detail = 1.193,
+ float Distortion = 0.0,
+ float Intensity = 0.4,
+ float Concentration = 3.0084,
+ color ColorOne = color(0.0189),
+ color ColorTwo = color(0.289,0.22,0.125),
+ float InBump = 0,
+ output color Color = color(1),
+ output float Bump = 0 )
+{
+ string Basis = "Perlin";
+ float Fac = 0;
+
+ if (NoiseBasis == 1)
+ Basis = "Voronoi F1";
+ else if (NoiseBasis == 2)
+ Basis = "Voronoi F2";
+ else if (NoiseBasis == 3)
+ Basis = "Voronoi F3";
+ else if (NoiseBasis == 4)
+ Basis = "Voronoi F4";
+ else if (NoiseBasis == 5)
+ Basis = "Voronoi F2-F1";
+ else if (NoiseBasis == 6)
+ Basis = "Voronoi Crackle";
+ else if (NoiseBasis == 7)
+ Basis = "Cell Noise";
+ else /* default */
+ Basis = "Perlin";
+
+ Fac = SpreadTexture(Vector, Basis,
+ Intensity, Concentration,
+ Scale, Detail, Distortion);
+ Color = mix(ColorOne,ColorTwo,Fac);
+ Bump = InBump + (Fac / 10);
+}
+
View
BIN stone/SARock/SARockLayer.osl.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5a8ed8f

Please sign in to comment.