Material Database

View Source

<?xml version="1.0" encoding="utf-8" ?>
<scenedata>
    <material>
        <name>snow cover rough</name>
        <diffuse>
            <albedo>
                <shader>
                    <shader>
                        <![CDATA[
			def Zangle() real:
				dotk(normalWS())
			
			def Snow() real:
				0.8			#snow brightness
			def StoneX() real:
				0.06		#stone 'red' value
			def StoneY() real:
				0.05		#stone 'green' value
			def StoneZ() real:
				0.04		#stone 'blue' value

			def Zless() bool:
				gte(Zangle(), 0.6)	#tweak this number to adjust snow coverage, lower means more snow

			def Xcheck() real:
				if(Zless(),
				Snow(), StoneX())
			def Ycheck() real:
				if(Zless(),
				Snow(), StoneY())
			def Zcheck() real:
				if(Zless(),
				Snow(), StoneZ())

                  def eval(vec3 pos) vec3 :
			vec3(
				Xcheck(),
				Ycheck(),
				Zcheck()
			)]]>
</shader>
                </shader>
            </albedo>
            <bump>
                <shader>
                    <shader>
                        <![CDATA[def eval() real :
						fbm(getTexCoords(0)*50.0, 3)*0.0003
]]>
</shader>
                </shader>
            </bump>
            <random_triangle_colours>false</random_triangle_colours>
            <layer>0</layer>
        </diffuse>
    </material>
</scenedata>

-->