Material Database

View Source

<?xml version="1.0" encoding="utf-8" ?>
<scenedata>
    <material>
        <name>MarbleStudio2D</name>
        <phong>
            <diffuse_albedo>
                <shader>
                    <param>
                        <colour3>
                            <name>BaseColor</name>
                            <description>BaseColor</description>
                            <value>0.7893137335777283 0.7893137335777283 0.7893137335777283</value>
                        </colour3>
                    </param>
                    <param>
                        <colour3>
                            <name>VeinColor</name>
                            <description>VeinColor</description>
                            <value>0.012663720175623894 0.012663720175623894 0.012663720175623894</value>
                        </colour3>
                    </param>
                    <param>
                        <real>
                            <name>VeinWidth</name>
                            <description>VeinWidth</description>
                            <min>-0</min>
                            <max>1</max>
                            <value>0.04</value>
                        </real>
                    </param>
                    <param>
                        <real>
                            <name>Diffusion</name>
                            <description>Diffusion</description>
                            <min>-0</min>
                            <max>1</max>
                            <value>0.11</value>
                        </real>
                    </param>
                    <param>
                        <int>
                            <name>SoftVein</name>
                            <description>SoftVein</description>
                            <min>0</min>
                            <max>1</max>
                            <value>1</value>
                        </int>
                    </param>
                    <param>
                        <real>
                            <name>Scale1</name>
                            <description>Scale1</description>
                            <min>-0</min>
                            <max>50</max>
                            <value>3</value>
                        </real>
                    </param>
                    <param>
                        <real>
                            <name>Scale2</name>
                            <description>Scale2</description>
                            <min>-0</min>
                            <max>50</max>
                            <value>6</value>
                        </real>
                    </param>
                    <param>
                        <real>
                            <name>Scale3</name>
                            <description>Scale3</description>
                            <min>-0</min>
                            <max>50</max>
                            <value>9</value>
                        </real>
                    </param>
                    <param>
                        <int>
                            <name>Detail</name>
                            <description>Detail</description>
                            <min>-3</min>
                            <max>3</max>
                            <value>-3</value>
                        </int>
                    </param>
                    <shader>
                        <![CDATA[def addvec2(vec2 v1, vec2 v2) vec2:
vec2(v1.x+v2.x, v1.y+v2.y)

def marble() real :

let

coords = tex()
paramVeinWidth = paramVeinWidth()
paramDetail = paramDetail()

a = abs(fbm(addvec2(coords, vec2(5.0,-3.0))*paramScale1(),4 + paramDetail))
b = abs(fbm(addvec2(coords, vec2(8.0,0.0))*paramScale2(),6 + paramDetail))
c = abs(fbm(coords*paramScale3(),8 + paramDetail))
d = max(max(a, b), c)

shape = d * (1.0 + paramVeinWidth) - paramVeinWidth
absShape = abs(shape)
diff = pow(absShape, paramDiffusion())

in

	if(paramSoftVein()==1||shape>0.0,
		diff,
		absShape
	)



def eval(vec3 pos) vec3 : 

	lerp
	(
		paramVeinColor(),
		paramBaseColor(),
		marble()
	)
			]]>
</shader>
                </shader>
            </diffuse_albedo>
            <exponent>
                <shader>
                    <param>
                        <real>
                            <name>Min</name>
                            <description>Min</description>
                            <min>2</min>
                            <max>2000</max>
                            <value>6.3</value>
                        </real>
                    </param>
                    <param>
                        <real>
                            <name>Max</name>
                            <description>Max</description>
                            <min>2</min>
                            <max>2000</max>
                            <value>491.51</value>
                        </real>
                    </param>
                    <param>
                        <real>
                            <name>NoiseScale</name>
                            <description>NoiseScale</description>
                            <min>4</min>
                            <max>200</max>
                            <value>50.06</value>
                        </real>
                    </param>
                    <shader>
                        <![CDATA[def eval(vec3 pos) real :

let
paramMin = paramMin()
in
	(fbm(tex() * paramNoiseScale(), 8) * 0.5 + 0.5)
*	(paramMax() - paramMin) + paramMin
]]>
</shader>
                </shader>
            </exponent>
            <layer>0</layer>
            <fresnel_scale>1</fresnel_scale>
            <ior>1.5</ior>
            <nk_data />
        </phong>
    </material>
</scenedata>

-->