[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [4057] contrib/py/scripts/addons/ online_mat_lib/material-library/bundled/cycles: added osl_textures/ hex_color.bcm, osl_textures/hex_wire.bcm
Brendon Murphy
meta.androcto1 at gmail.com
Sun Dec 16 13:58:41 CET 2012
Revision: 4057
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=4057
Author: meta-androcto
Date: 2012-12-16 12:58:37 +0000 (Sun, 16 Dec 2012)
Log Message:
-----------
added osl_textures/hex_color.bcm, osl_textures/hex_wire.bcm
using an earlier version of hex tiles osl, these examples feature more complex node trees, including color ramps & "wire shading" set up.
Modified Paths:
--------------
contrib/py/scripts/addons/online_mat_lib/material-library/bundled/cycles/index.xml
Added Paths:
-----------
contrib/py/scripts/addons/online_mat_lib/material-library/bundled/cycles/osl_textures/hex_color.bcm
contrib/py/scripts/addons/online_mat_lib/material-library/bundled/cycles/osl_textures/hex_color.jpg
contrib/py/scripts/addons/online_mat_lib/material-library/bundled/cycles/osl_textures/hex_wire.bcm
contrib/py/scripts/addons/online_mat_lib/material-library/bundled/cycles/osl_textures/hex_wire.jpg
Modified: contrib/py/scripts/addons/online_mat_lib/material-library/bundled/cycles/index.xml
===================================================================
--- contrib/py/scripts/addons/online_mat_lib/material-library/bundled/cycles/index.xml 2012-12-16 12:00:21 UTC (rev 4056)
+++ contrib/py/scripts/addons/online_mat_lib/material-library/bundled/cycles/index.xml 2012-12-16 12:58:37 UTC (rev 4057)
@@ -43,6 +43,8 @@
</category>
<category title="OSL_Textures" folder="osl_textures" addon="0.4">
<material name="Hex Tile" href="hex_tile" by="varkenvarken" stars="4" addon="0.4" />
+ <material name="Hex Wire" href="hex_wire" by="varkenvarken" stars="4" complexity="complex" addon="0.4" />
+ <material name="Hex Color" href="hex_color" by="varkenvarken" stars="4" complexity="complex" addon="0.4" />
</category>
<category title="Plastics" folder="plastics" addon="0.4">
<material name="Toy Brick (Red)" href="toy_brick_red" by="Peter Cassetta" stars="4" addon="0.4" />
Added: contrib/py/scripts/addons/online_mat_lib/material-library/bundled/cycles/osl_textures/hex_color.bcm
===================================================================
--- contrib/py/scripts/addons/online_mat_lib/material-library/bundled/cycles/osl_textures/hex_color.bcm (rev 0)
+++ contrib/py/scripts/addons/online_mat_lib/material-library/bundled/cycles/osl_textures/hex_color.bcm 2012-12-16 12:58:37 UTC (rev 4057)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<material view_color="rgb(0.80000, 0.80000, 0.80000)" sample_lamp="True">
+ <nodes>
+ <node type="OUTPUT_MATERIAL" loc="546, 298" />
+ <node type="MIX_SHADER" fac="0.20000" loc="326, 327" />
+ <node type="SCRIPT" mode="INTERNAL" script="0" diffuse_color1="rgba(0.20000, 0.80000, 0.20000, 1.0)" diffuse_color2="rgba(0.80000, 0.20000, 0.20000, 1.0)" diffuse_color3="rgba(0.20000, 0.20000, 0.80000, 1.0)" coordinates="Vector(0.0, 0.0, 0.0)" loc="-106, 239" />
+ <node type="MAPPING" translation="Vector(0.0, 0.0, 0.0)" rotation="Vector(0.0, 0.0, 0.0)" scale="Vector(50.0, 50.0, 200.0)" use_min="False" use_max="False" vector="Vector(0.0, 0.0, 0.0)" loc="-402, 295" />
+ <node type="BSDF_GLOSSY" distribution="BECKMANN" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.20000" loc="117, 162" />
+ <node type="BSDF_DIFFUSE" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.0" loc="122, 305" />
+ <node type="TEX_COORD" dupli="False" loc="-615, 279" />
+ </nodes>
+ <links>
+ <link to="1" input="1" from="5" output="0" />
+ <link to="0" input="0" from="1" output="0" />
+ <link to="1" input="2" from="4" output="0" />
+ <link to="5" input="0" from="2" output="0" />
+ <link to="0" input="2" from="2" output="2" />
+ <link to="2" input="3" from="3" output="0" />
+ <link to="3" input="0" from="6" output="2" />
+ </links>
+ <scripts>
+ <script name="Hexagon_Color_.osl" id="0">
+#define A 0.86602540378443864676372317075294 // sqrt(3)/2<br />#define A2 (2*A)<br />#define A4 (4*A)<br />#define SY (1/A)<br /><br />shader hexagons(<br /> color Diffuse_Color1 = color(0.2, 0.8, 0.2),<br /> color Diffuse_Color2 = color(0.8, 0.2, 0.2),<br /> color Diffuse_Color3 = color(0.2, 0.2, 0.8),<br /> vector Coordinates = 0,<br /> output color Color = 0,<br /> output int Index = 1,<br /> output float Distance = 0)<br />{<br /> // calculate the color<br /> <br /> color colors[3] = {Diffuse_Color1,<br /> Diffuse_Color2,<br /> Diffuse_Color3}; <br /> <br /> // we warp the grid so that two adjacent equilateral triangles<br /> // are mapped to two triangles that fit in a square<br /> float syc = Coordinates[1] * SY;<br /> float sxc = Coordinates[0] + 0.5 * syc;<br /> <br /> int ind[18] = {1,1,3,3,3,1, 2,2,2,3,3,3, 1,2,2,2,1,1};<br /> <br /> int iy = int(mod(syc,3.0));<br /> in
t ix = int(mod(sxc,3.0));<br /> ix = iy * 6 + ix * 2 + ( mod(sxc,1.0) > mod(syc,1.0) ); <br /> Index = ind[ix];<br /> Color = colors[Index-1]; <br /> <br /> // calculate the distance to the center of the hexagon<br /> <br /> float sx = mod(Coordinates[0],3);<br /> float sy = mod(Coordinates[1]+0.75,A4); <br /><br /> // map everthing to a single quadrant<br /> if ( sx > 1.5 ) sx = 3 - sx;<br /> if ( sy > A2 ) sy = A4 - sy;<br /> <br /> // the distance were interested in is the distance to <br /> // the *closest* center point <br /> float d1 = distance(vector(sx,sy,0),vector(1.5,A2,0));<br /> float d2 = distance(vector(sx,sy,0),vector(0,A,0));<br /> float d6 = distance(vector(sx,sy,0),vector(1.5,0,0));<br /> <br /> Distance = min(min(d1,d2), d6);<br /> <br />}<br />
+ </script>
+ </scripts>
+</material>
\ No newline at end of file
Added: contrib/py/scripts/addons/online_mat_lib/material-library/bundled/cycles/osl_textures/hex_color.jpg
===================================================================
(Binary files differ)
Property changes on: contrib/py/scripts/addons/online_mat_lib/material-library/bundled/cycles/osl_textures/hex_color.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: contrib/py/scripts/addons/online_mat_lib/material-library/bundled/cycles/osl_textures/hex_wire.bcm
===================================================================
--- contrib/py/scripts/addons/online_mat_lib/material-library/bundled/cycles/osl_textures/hex_wire.bcm (rev 0)
+++ contrib/py/scripts/addons/online_mat_lib/material-library/bundled/cycles/osl_textures/hex_wire.bcm 2012-12-16 12:58:37 UTC (rev 4057)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<material view_color="rgb(0.80000, 0.80000, 0.80000)" sample_lamp="True">
+ <nodes>
+ <node type="BSDF_DIFFUSE" color="rgba(0.80000, 0.80000, 0.80000, 1.0)" roughness="0.0" loc="223, 340" />
+ <node type="TEX_COORD" hide="True" dupli="False" loc="-550, 297" />
+ <node type="MAPPING" hide="True" translation="Vector(0.0, 0.0, 0.0)" rotation="Vector(0.0, 0.0, 0.0)" scale="Vector(50.0, 50.0, 200.0)" use_min="False" use_max="False" vector="Vector(0.0, 0.0, 0.0)" loc="-420, 224" />
+ <node type="SCRIPT" mode="INTERNAL" script="0" diffuse_color1="rgba(0.20000, 0.80000, 0.20000, 1.0)" diffuse_color2="rgba(0.80000, 0.20000, 0.20000, 1.0)" diffuse_color3="rgba(0.20000, 0.20000, 0.80000, 1.0)" coordinates="Vector(0.0, 0.0, 0.0)" loc="-302, 347" />
+ <node type="VALTORGB" interpolation="B_SPLINE" fac="0.5" stops="3" stop1="0.0|rgba(0.0, 0.0, 0.0, 1.0)" stop2="0.80909|rgba(1.0, 1.0, 1.0, 1.0)" stop3="0.90454|rgba(0.00227, 0.00227, 0.00227, 1.0)" loc="-56, 145" />
+ <node type="VALTORGB" interpolation="CARDINAL" fac="0.5" stops="3" stop1="0.0|rgba(0.0, 0.0, 0.0, 1.0)" stop2="0.81818|rgba(0.0, 0.0, 0.0, 1.0)" stop3="0.82272|rgba(1.0, 1.0, 1.0, 1.0)" loc="-51, 365" />
+ <node type="MIX_SHADER" fac="0.20000" loc="394, 331" />
+ <node type="BSDF_TRANSPARENT" color="rgba(1.0, 1.0, 1.0, 1.0)" loc="255, 170" />
+ <node type="OUTPUT_MATERIAL" loc="584, 254" />
+ </nodes>
+ <links>
+ <link to="8" input="0" from="6" output="0" />
+ <link to="5" input="0" from="3" output="2" />
+ <link to="3" input="3" from="2" output="0" />
+ <link to="2" input="0" from="1" output="2" />
+ <link to="4" input="0" from="3" output="2" />
+ <link to="8" input="2" from="3" output="2" />
+ <link to="6" input="0" from="5" output="0" />
+ <link to="6" input="2" from="0" output="0" />
+ <link to="6" input="1" from="7" output="0" />
+ <link to="8" input="1" from="7" output="0" />
+ <link to="7" input="0" from="4" output="0" />
+ </links>
+ <scripts>
+ <script name="Hexagon_Color_.osl" id="0">
+#define A 0.86602540378443864676372317075294 // sqrt(3)/2<br />#define A2 (2*A)<br />#define A4 (4*A)<br />#define SY (1/A)<br /><br />shader hexagons(<br /> color Diffuse_Color1 = color(0.2, 0.8, 0.2),<br /> color Diffuse_Color2 = color(0.8, 0.2, 0.2),<br /> color Diffuse_Color3 = color(0.2, 0.2, 0.8),<br /> vector Coordinates = 0,<br /> output color Color = 0,<br /> output int Index = 1,<br /> output float Distance = 0)<br />{<br /> // calculate the color<br /> <br /> color colors[3] = {Diffuse_Color1,<br /> Diffuse_Color2,<br /> Diffuse_Color3}; <br /> <br /> // we warp the grid so that two adjacent equilateral triangles<br /> // are mapped to two triangles that fit in a square<br /> float syc = Coordinates[1] * SY;<br /> float sxc = Coordinates[0] + 0.5 * syc;<br /> <br /> int ind[18] = {1,1,3,3,3,1, 2,2,2,3,3,3, 1,2,2,2,1,1};<br /> <br /> int iy = int(mod(syc,3.0));<br /> in
t ix = int(mod(sxc,3.0));<br /> ix = iy * 6 + ix * 2 + ( mod(sxc,1.0) > mod(syc,1.0) ); <br /> Index = ind[ix];<br /> Color = colors[Index-1]; <br /> <br /> // calculate the distance to the center of the hexagon<br /> <br /> float sx = mod(Coordinates[0],3);<br /> float sy = mod(Coordinates[1]+0.75,A4); <br /><br /> // map everthing to a single quadrant<br /> if ( sx > 1.5 ) sx = 3 - sx;<br /> if ( sy > A2 ) sy = A4 - sy;<br /> <br /> // the distance were interested in is the distance to <br /> // the *closest* center point <br /> float d1 = distance(vector(sx,sy,0),vector(1.5,A2,0));<br /> float d2 = distance(vector(sx,sy,0),vector(0,A,0));<br /> float d6 = distance(vector(sx,sy,0),vector(1.5,0,0));<br /> <br /> Distance = min(min(d1,d2), d6);<br /> <br />}<br />
+ </script>
+ </scripts>
+</material>
\ No newline at end of file
Added: contrib/py/scripts/addons/online_mat_lib/material-library/bundled/cycles/osl_textures/hex_wire.jpg
===================================================================
(Binary files differ)
Property changes on: contrib/py/scripts/addons/online_mat_lib/material-library/bundled/cycles/osl_textures/hex_wire.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
More information about the Bf-extensions-cvs
mailing list