Code: Select all
<albedo>
<shader>
<shader><![CDATA[
def Zangle() real:
dotk(normalWS())
def Snow() real:
0.8
def StoneX() real:
0.11
def StoneY() real:
0.10
def StoneZ() real:
0.09
def Zless() bool:
gte(Zangle(), 0.6)
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>
and here is my attempt to implement the same idea into the <blend> element of the material, which gives me only one of the materials or the other, (the "Zless() bool" only changes the material if it is set higher than 1) :
Code: Select all
<blend>
<a_name>snow</a_name>
<b_name>stone</b_name>
<blend>
<shader>
<shader><![CDATA[ def Zangle() real:
dotk(normalWS())
def Zslope() bool:
gte(Zangle(), 0.8)
def eval() real :
if(Zslope(),
0.0, 1.0)
]]></shader>
</shader>
</blend>
<step_blend>false</step_blend>
</blend>
thanks!


