Ajout du projet Depths sur Git
This commit is contained in:
Vendored
+343
@@ -0,0 +1,343 @@
|
||||
// Open Shading Language : Copyright (c) 2009-2017 Sony Pictures Imageworks Inc., et al.
|
||||
// https://github.com/imageworks/OpenShadingLanguage/blob/master/LICENSE
|
||||
|
||||
#pragma once
|
||||
#define COLOR4_H
|
||||
|
||||
|
||||
// color4 is a color + alpha
|
||||
struct color4
|
||||
{
|
||||
color rgb;
|
||||
float a;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
// For color4, define math operators to match color
|
||||
//
|
||||
|
||||
color4 __operator__neg__(color4 a)
|
||||
{
|
||||
return color4(-a.rgb, -a.a);
|
||||
}
|
||||
|
||||
color4 __operator__add__(color4 a, color4 b)
|
||||
{
|
||||
return color4(a.rgb + b.rgb, a.a + b.a);
|
||||
}
|
||||
|
||||
color4 __operator__add__(color4 a, int b)
|
||||
{
|
||||
return a + color4(color(b), b);
|
||||
}
|
||||
|
||||
color4 __operator__add__(color4 a, float b)
|
||||
{
|
||||
return a + color4(color(b), b);
|
||||
}
|
||||
|
||||
color4 __operator__add__(int a, color4 b)
|
||||
{
|
||||
return color4(color(a), a) + b;
|
||||
}
|
||||
|
||||
color4 __operator__add__(float a, color4 b)
|
||||
{
|
||||
return color4(color(a), a) + b;
|
||||
}
|
||||
|
||||
color4 __operator__sub__(color4 a, color4 b)
|
||||
{
|
||||
return color4(a.rgb - b.rgb, a.a - b.a);
|
||||
}
|
||||
|
||||
color4 __operator__sub__(color4 a, int b)
|
||||
{
|
||||
return a - color4(color(b), b);
|
||||
}
|
||||
|
||||
color4 __operator__sub__(color4 a, float b)
|
||||
{
|
||||
return a - color4(color(b), b);
|
||||
}
|
||||
|
||||
color4 __operator__sub__(int a, color4 b)
|
||||
{
|
||||
return color4(color(a), a) - b;
|
||||
}
|
||||
|
||||
color4 __operator__sub__(float a, color4 b)
|
||||
{
|
||||
return color4(color(a), a) - b;
|
||||
}
|
||||
|
||||
color4 __operator__mul__(color4 a, color4 b)
|
||||
{
|
||||
return color4(a.rgb * b.rgb, a.a * b.a);
|
||||
}
|
||||
|
||||
color4 __operator__mul__(color4 a, int b)
|
||||
{
|
||||
return a * color4(color(b), b);
|
||||
}
|
||||
|
||||
color4 __operator__mul__(color4 a, float b)
|
||||
{
|
||||
return a * color4(color(b), b);
|
||||
}
|
||||
|
||||
color4 __operator__mul__(int a, color4 b)
|
||||
{
|
||||
return color4(color(a), a) * b;
|
||||
}
|
||||
|
||||
color4 __operator__mul__(float a, color4 b)
|
||||
{
|
||||
return color4(color(a), a) * b;
|
||||
}
|
||||
|
||||
color4 __operator__div__(color4 a, color4 b)
|
||||
{
|
||||
return color4(a.rgb / b.rgb, a.a / b.a);
|
||||
}
|
||||
|
||||
color4 __operator__div__(color4 a, int b)
|
||||
{
|
||||
float b_inv = 1.0/b;
|
||||
return a * color4(color(b_inv), b_inv);
|
||||
}
|
||||
|
||||
color4 __operator__div__(color4 a, float b)
|
||||
{
|
||||
float b_inv = 1.0/b;
|
||||
return a * color4(color(b_inv), b_inv);
|
||||
}
|
||||
|
||||
color4 __operator_div__(int a, color4 b)
|
||||
{
|
||||
return color4(color(a), a) / b;
|
||||
}
|
||||
|
||||
color4 __operator__div__(float a, color4 b)
|
||||
{
|
||||
return color4(color(a), a) / b;
|
||||
}
|
||||
|
||||
int __operator__eq__(color4 a, color4 b)
|
||||
{
|
||||
return (a.rgb == b.rgb) && (a.a == b.a);
|
||||
}
|
||||
|
||||
int __operator__ne__(color4 a, color4 b)
|
||||
{
|
||||
return (a.rgb != b.rgb) || (a.a != b.a);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// For color4, define most of the stdosl functions to match color
|
||||
//
|
||||
|
||||
color4 abs(color4 a)
|
||||
{
|
||||
return color4(abs(a.rgb), abs(a.a));
|
||||
}
|
||||
|
||||
color4 ceil(color4 a)
|
||||
{
|
||||
return color4(ceil(a.rgb), ceil(a.a));
|
||||
}
|
||||
|
||||
color4 round(color4 a)
|
||||
{
|
||||
return color4(round(a.rgb), round(a.a));
|
||||
}
|
||||
|
||||
color4 floor(color4 a)
|
||||
{
|
||||
return color4(floor(a.rgb), floor(a.a));
|
||||
}
|
||||
|
||||
color4 sqrt(color4 a)
|
||||
{
|
||||
return color4(sqrt(a.rgb), sqrt(a.a));
|
||||
}
|
||||
|
||||
color4 exp(color4 a)
|
||||
{
|
||||
return color4(exp(a.rgb), exp(a.a));
|
||||
}
|
||||
|
||||
color4 log(color4 a)
|
||||
{
|
||||
return color4(log(a.rgb), log(a.a));
|
||||
}
|
||||
|
||||
color4 log2(color4 a)
|
||||
{
|
||||
return color4(log2(a.rgb), log2(a.a));
|
||||
}
|
||||
|
||||
color4 mix(color4 a, color4 b, float x )
|
||||
{
|
||||
return color4(mix(a.rgb, b.rgb, x),
|
||||
mix(a.a, b.a, x));
|
||||
}
|
||||
|
||||
color4 mix(color4 a, color4 b, color4 x )
|
||||
{
|
||||
return color4(mix(a.rgb, b.rgb, x.rgb),
|
||||
mix(a.a, b.a, x.a));
|
||||
}
|
||||
|
||||
float dot(color4 a, color b)
|
||||
{
|
||||
return dot(a.rgb, b);
|
||||
}
|
||||
|
||||
color4 smoothstep(color4 edge0, color4 edge1, color4 c)
|
||||
{
|
||||
return color4(smoothstep(edge0.rgb, edge1.rgb, c.rgb),
|
||||
smoothstep(edge0.a, edge1.a, c.a));
|
||||
}
|
||||
|
||||
color4 smoothstep(float edge0, float edge1, color4 c)
|
||||
{
|
||||
return smoothstep(color4(color(edge0), edge0), color4(color(edge1), edge1), c);
|
||||
}
|
||||
|
||||
color4 clamp(color4 c, color4 minval, color4 maxval)
|
||||
{
|
||||
return color4(clamp(c.rgb, minval.rgb, maxval.rgb),
|
||||
clamp(c.a, minval.a, maxval.a));
|
||||
}
|
||||
|
||||
color4 clamp(color4 c, float minval, float maxval)
|
||||
{
|
||||
return clamp(c, color4(color(minval), minval), color4(color(maxval), maxval));
|
||||
}
|
||||
|
||||
color4 max(color4 a, color4 b)
|
||||
{
|
||||
return color4(max(a.rgb, b.rgb),
|
||||
max(a.a, b.a));
|
||||
}
|
||||
|
||||
color4 max(color4 a, float b)
|
||||
{
|
||||
return color4(max(a.rgb, b),
|
||||
max(a.a, b));
|
||||
}
|
||||
|
||||
color4 min(color4 a, color4 b)
|
||||
{
|
||||
return color4(min(a.rgb, b.rgb),
|
||||
min(a.a, b.a));
|
||||
}
|
||||
|
||||
color4 min(color4 a, float b)
|
||||
{
|
||||
return color4(min(a.rgb, b),
|
||||
min(a.a, b));
|
||||
}
|
||||
|
||||
color4 mod(color4 a, color4 b)
|
||||
{
|
||||
return color4(mod(a.rgb, b.rgb),
|
||||
mod(a.a, b.a));
|
||||
}
|
||||
|
||||
color4 mod(color4 a, int b)
|
||||
{
|
||||
return mod(a, color4(color(b), b));
|
||||
}
|
||||
|
||||
color4 mod(color4 a, float b)
|
||||
{
|
||||
return mod(a, color4(color(b), b));
|
||||
}
|
||||
|
||||
color4 fmod(color4 a, color4 b)
|
||||
{
|
||||
return color4(fmod(a.rgb, b.rgb),
|
||||
fmod(a.a, b.a));
|
||||
}
|
||||
|
||||
color4 fmod(color4 a, int b)
|
||||
{
|
||||
return fmod(a, color4(color(b), b));
|
||||
}
|
||||
|
||||
color4 fmod(color4 a, float b)
|
||||
{
|
||||
return fmod(a, color4(color(b), b));
|
||||
}
|
||||
|
||||
color4 pow(color4 base, color4 power)
|
||||
{
|
||||
return color4(pow(base.rgb, power.rgb),
|
||||
pow(base.a, power.a));
|
||||
}
|
||||
|
||||
color4 pow(color4 base, float power)
|
||||
{
|
||||
return color4(pow(base.rgb, power),
|
||||
pow(base.a, power));
|
||||
}
|
||||
|
||||
color4 sign(color4 a)
|
||||
{
|
||||
return color4(sign(a.rgb),
|
||||
sign(a.a));
|
||||
}
|
||||
|
||||
color4 sin(color4 a)
|
||||
{
|
||||
return color4(sin(a.rgb),
|
||||
sin(a.a));
|
||||
}
|
||||
|
||||
color4 cos(color4 a)
|
||||
{
|
||||
return color4(cos(a.rgb),
|
||||
cos(a.a));
|
||||
}
|
||||
|
||||
color4 tan(color4 a)
|
||||
{
|
||||
return color4(tan(a.rgb),
|
||||
tan(a.a));
|
||||
}
|
||||
|
||||
color4 asin(color4 a)
|
||||
{
|
||||
return color4(asin(a.rgb),
|
||||
asin(a.a));
|
||||
}
|
||||
|
||||
color4 acos(color4 a)
|
||||
{
|
||||
return color4(acos(a.rgb),
|
||||
acos(a.a));
|
||||
}
|
||||
|
||||
color4 atan2(color4 a, float f)
|
||||
{
|
||||
return color4(atan2(a.rgb, f),
|
||||
atan2(a.a, f));
|
||||
}
|
||||
|
||||
color4 atan2(color4 a, color4 b)
|
||||
{
|
||||
return color4(atan2(a.rgb, b.rgb),
|
||||
atan2(a.a, b.a));
|
||||
}
|
||||
|
||||
|
||||
color4 transformc (string fromspace, string tospace, color4 C)
|
||||
{
|
||||
return color4 (transformc (fromspace, tospace, C.rgb), C.a);
|
||||
}
|
||||
Vendored
+165
@@ -0,0 +1,165 @@
|
||||
// Open Shading Language : Copyright (c) 2009-2017 Sony Pictures Imageworks Inc., et al.
|
||||
// https://github.com/imageworks/OpenShadingLanguage/blob/master/LICENSE
|
||||
//
|
||||
// MaterialX specification (c) 2017 Lucasfilm Ltd.
|
||||
// http://www.materialx.org/
|
||||
|
||||
#pragma once
|
||||
#define MATRIX33_H
|
||||
|
||||
|
||||
struct matrix33
|
||||
{
|
||||
matrix m;
|
||||
};
|
||||
|
||||
int isValidAs33(matrix m44)
|
||||
{
|
||||
return m44[0][3] == 0 &&
|
||||
m44[1][3] == 0 &&
|
||||
m44[2][3] == 0 &&
|
||||
m44[3][0] == 0 &&
|
||||
m44[3][1] == 0 &&
|
||||
m44[3][2] == 0 &&
|
||||
m44[3][3] == 1;
|
||||
}
|
||||
|
||||
matrix matrix33To44 (matrix33 m33)
|
||||
{
|
||||
return m33.m;
|
||||
}
|
||||
|
||||
// Convert an arbitrary m44 to m33 by removing the translation
|
||||
//QUESTION: should we check if it's valid to represent the 4x4 as a 3x3?
|
||||
matrix33 matrix44To33 (matrix m44)
|
||||
{
|
||||
matrix33 m33;
|
||||
m33.m = m44;
|
||||
m33.m[0][3] = 0;
|
||||
m33.m[1][3] = 0;
|
||||
m33.m[2][3] = 0;
|
||||
m33.m[3][0] = 0;
|
||||
m33.m[3][1] = 0;
|
||||
m33.m[3][2] = 0;
|
||||
m33.m[3][3] = 1;
|
||||
|
||||
return m33;
|
||||
}
|
||||
|
||||
matrix33 __operator__neg__(matrix33 a)
|
||||
{
|
||||
matrix33 m33;
|
||||
m33.m = -a.m;
|
||||
return m33;
|
||||
}
|
||||
|
||||
|
||||
matrix33 __operator__mul__(int a, matrix33 b)
|
||||
{
|
||||
matrix33 m33;
|
||||
m33.m = a * b.m;
|
||||
return m33;
|
||||
}
|
||||
|
||||
matrix33 __operator__mul__(float a, matrix33 b)
|
||||
{
|
||||
matrix33 m33;
|
||||
m33.m = a * b.m;
|
||||
return m33;
|
||||
}
|
||||
|
||||
matrix33 __operator__mul__(matrix33 a, int b)
|
||||
{
|
||||
matrix33 m33;
|
||||
m33.m = a.m * b;
|
||||
return m33;
|
||||
}
|
||||
|
||||
matrix33 __operator__mul__(matrix33 a, float b)
|
||||
{
|
||||
matrix33 m33;
|
||||
m33.m = a.m * b;
|
||||
return m33;
|
||||
}
|
||||
|
||||
matrix33 __operator__mul__(matrix33 a, matrix33 b)
|
||||
{
|
||||
matrix33 m33;
|
||||
m33.m = a.m * b.m;
|
||||
return m33;
|
||||
}
|
||||
|
||||
matrix33 __operator__div__(int a, matrix33 b)
|
||||
{
|
||||
matrix33 m33;
|
||||
m33.m = a / b.m;
|
||||
return m33;
|
||||
}
|
||||
|
||||
matrix33 __operator__div__(float a, matrix33 b)
|
||||
{
|
||||
matrix33 m33;
|
||||
m33.m = a / b.m;
|
||||
return m33;
|
||||
}
|
||||
|
||||
matrix33 __operator__div__(matrix33 a, int b)
|
||||
{
|
||||
matrix33 m33;
|
||||
m33.m = a.m / b;
|
||||
return m33;
|
||||
}
|
||||
|
||||
matrix33 __operator__div__(matrix33 a, float b)
|
||||
{
|
||||
matrix33 m33;
|
||||
m33.m = a.m / b;
|
||||
return m33;
|
||||
}
|
||||
|
||||
matrix33 __operator__div__(matrix33 a, matrix33 b)
|
||||
{
|
||||
matrix33 m33;
|
||||
m33.m = a.m / b.m;
|
||||
return m33;
|
||||
}
|
||||
|
||||
int __operator__eq__(matrix33 a, matrix33 b)
|
||||
{
|
||||
return a.m == b.m;
|
||||
}
|
||||
|
||||
int __operator__ne__(matrix33 a, matrix33 b)
|
||||
{
|
||||
return a.m != b.m;
|
||||
}
|
||||
|
||||
float determinant (matrix33 a)
|
||||
{
|
||||
return determinant(a.m);
|
||||
}
|
||||
|
||||
matrix33 transpose(matrix33 a)
|
||||
{
|
||||
matrix33 m33;
|
||||
m33.m = transpose(a.m);
|
||||
return m33;
|
||||
}
|
||||
|
||||
point transform(matrix33 a, point b)
|
||||
{
|
||||
return transform(a.m, b);
|
||||
}
|
||||
|
||||
vector transform(matrix33 a, vector b)
|
||||
{
|
||||
return transform(a.m, b);
|
||||
}
|
||||
|
||||
normal transform(matrix33 a, normal b)
|
||||
{
|
||||
return transform(a.m, b);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Vendored
+530
@@ -0,0 +1,530 @@
|
||||
// Open Shading Language : Copyright (c) 2009-2017 Sony Pictures Imageworks Inc., et al.
|
||||
// https://github.com/imageworks/OpenShadingLanguage/blob/master/LICENSE
|
||||
//
|
||||
// MaterialX specification (c) 2017 Lucasfilm Ltd.
|
||||
// http://www.materialx.org/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "color4.h"
|
||||
#include "vector2.h"
|
||||
#include "vector4.h"
|
||||
#include "matrix33.h"
|
||||
|
||||
//
|
||||
// Support functions for OSL implementations of the MaterialX nodes.
|
||||
//
|
||||
|
||||
float mx_ternary(int expr, float v1, float v2) { if (expr) return v1; else return v2; }
|
||||
color mx_ternary(int expr, color v1, color v2) { if (expr) return v1; else return v2; }
|
||||
color4 mx_ternary(int expr, color4 v1, color4 v2) { if (expr) return v1; else return v2; }
|
||||
vector mx_ternary(int expr, vector v1, vector v2) { if (expr) return v1; else return v2; }
|
||||
vector2 mx_ternary(int expr, vector2 v1, vector2 v2) { if (expr) return v1; else return v2; }
|
||||
vector4 mx_ternary(int expr, vector4 v1, vector4 v2) { if (expr) return v1; else return v2; }
|
||||
matrix mx_ternary(int expr, matrix v1, matrix v2) { if (expr) return v1; else return v2; }
|
||||
matrix33 mx_ternary(int expr, matrix33 v1, matrix33 v2) { if (expr) return v1; else return v2; }
|
||||
|
||||
|
||||
matrix33 mx_add(matrix33 a, matrix33 b)
|
||||
{
|
||||
return matrix33(matrix(
|
||||
a.m[0][0]+b.m[0][0], a.m[0][1]+b.m[0][1], a.m[0][2]+b.m[0][2], 0.0,
|
||||
a.m[1][0]+b.m[1][0], a.m[1][1]+b.m[1][1], a.m[1][2]+b.m[1][2], 0.0,
|
||||
a.m[2][0]+b.m[2][0], a.m[2][1]+b.m[2][1], a.m[2][2]+b.m[2][2], 0.0,
|
||||
0.0, 0.0, 0.0, 1.0));
|
||||
}
|
||||
|
||||
matrix33 mx_add(matrix33 a, float b)
|
||||
{
|
||||
return matrix33(matrix(
|
||||
a.m[0][0]+b, a.m[0][1]+b, a.m[0][2]+b, 0.0,
|
||||
a.m[1][0]+b, a.m[1][1]+b, a.m[1][2]+b, 0.0,
|
||||
a.m[2][0]+b, a.m[2][1]+b, a.m[2][2]+b, 0.0,
|
||||
0.0, 0.0, 0.0, 1.0));
|
||||
}
|
||||
|
||||
matrix mx_add(matrix a, matrix b)
|
||||
{
|
||||
return matrix(
|
||||
a[0][0]+b[0][0], a[0][1]+b[0][1], a[0][2]+b[0][2], a[0][3]+b[0][3],
|
||||
a[1][0]+b[1][0], a[1][1]+b[1][1], a[1][2]+b[1][2], a[1][3]+b[1][3],
|
||||
a[2][0]+b[2][0], a[2][1]+b[2][1], a[2][2]+b[2][2], a[2][3]+b[2][3],
|
||||
a[3][0]+b[3][0], a[3][1]+b[3][1], a[3][2]+b[3][2], a[3][3]+b[3][3]);
|
||||
}
|
||||
|
||||
matrix mx_add(matrix a, float b)
|
||||
{
|
||||
return matrix(
|
||||
a[0][0]+b, a[0][1]+b, a[0][2]+b, a[0][3]+b,
|
||||
a[1][0]+b, a[1][1]+b, a[1][2]+b, a[1][3]+b,
|
||||
a[2][0]+b, a[2][1]+b, a[2][2]+b, a[2][3]+b,
|
||||
a[3][0]+b, a[3][1]+b, a[3][2]+b, a[3][3]+b);
|
||||
}
|
||||
|
||||
|
||||
matrix33 mx_subtract(matrix33 a, matrix33 b)
|
||||
{
|
||||
return matrix33(matrix(
|
||||
a.m[0][0]-b.m[0][0], a.m[0][1]-b.m[0][1], a.m[0][2]-b.m[0][2], 0.0,
|
||||
a.m[1][0]-b.m[1][0], a.m[1][1]-b.m[1][1], a.m[1][2]-b.m[1][2], 0.0,
|
||||
a.m[2][0]-b.m[2][0], a.m[2][1]-b.m[2][1], a.m[2][2]-b.m[2][2], 0.0,
|
||||
0.0, 0.0, 0.0, 1.0));
|
||||
}
|
||||
|
||||
matrix33 mx_subtract(matrix33 a, float b)
|
||||
{
|
||||
return matrix33(matrix(
|
||||
a.m[0][0]-b, a.m[0][1]-b, a.m[0][2]-b, 0.0,
|
||||
a.m[1][0]-b, a.m[1][1]-b, a.m[1][2]-b, 0.0,
|
||||
a.m[2][0]-b, a.m[2][1]-b, a.m[2][2]-b, 0.0,
|
||||
0.0, 0.0, 0.0, 1.0));
|
||||
}
|
||||
|
||||
matrix mx_subtract(matrix a, matrix b)
|
||||
{
|
||||
return matrix(
|
||||
a[0][0]-b[0][0], a[0][1]-b[0][1], a[0][2]-b[0][2], a[0][3]-b[0][3],
|
||||
a[1][0]-b[1][0], a[1][1]-b[1][1], a[1][2]-b[1][2], a[1][3]-b[1][3],
|
||||
a[2][0]-b[2][0], a[2][1]-b[2][1], a[2][2]-b[2][2], a[2][3]-b[2][3],
|
||||
a[3][0]-b[3][0], a[3][1]-b[3][1], a[3][2]-b[3][2], a[3][3]-b[3][3]);
|
||||
}
|
||||
|
||||
matrix mx_subtract(matrix a, float b)
|
||||
{
|
||||
return matrix(
|
||||
a[0][0]-b, a[0][1]-b, a[0][2]-b, a[0][3]-b,
|
||||
a[1][0]-b, a[1][1]-b, a[1][2]-b, a[1][3]-b,
|
||||
a[2][0]-b, a[2][1]-b, a[2][2]-b, a[2][3]-b,
|
||||
a[3][0]-b, a[3][1]-b, a[3][2]-b, a[3][3]-b);
|
||||
}
|
||||
|
||||
|
||||
float mx_remap(float in, float inLow, float inHigh, float outLow, float outHigh, int doClamp)
|
||||
{
|
||||
float x = (in - inLow)/(inHigh-inLow);
|
||||
if (doClamp == 1) {
|
||||
x = clamp(x, 0, 1);
|
||||
}
|
||||
return outLow + (outHigh - outLow) * x;
|
||||
}
|
||||
|
||||
color mx_remap(color in, color inLow, color inHigh, color outLow, color outHigh, int doClamp)
|
||||
{
|
||||
color x = (in - inLow) / (inHigh - inLow);
|
||||
if (doClamp == 1) {
|
||||
x = clamp(x, 0, 1);
|
||||
}
|
||||
return outLow + (outHigh - outLow) * x;
|
||||
}
|
||||
|
||||
color mx_remap(color in, float inLow, float inHigh, float outLow, float outHigh, int doClamp)
|
||||
{
|
||||
color x = (in - inLow) / (inHigh - inLow);
|
||||
if (doClamp == 1) {
|
||||
x = clamp(x, 0, 1);
|
||||
}
|
||||
return outLow + (outHigh - outLow) * x;
|
||||
}
|
||||
|
||||
color4 mx_remap(color4 c, color4 inLow, color4 inHigh, color4 outLow, color4 outHigh, int doClamp)
|
||||
{
|
||||
return color4(mx_remap(c.rgb, inLow.rgb, inHigh.rgb, outLow.rgb, outHigh.rgb, doClamp),
|
||||
mx_remap(c.a, inLow.a, inHigh.a, outLow.a, outHigh.a, doClamp));
|
||||
}
|
||||
|
||||
color4 mx_remap(color4 c, float inLow, float inHigh, float outLow, float outHigh, int doClamp)
|
||||
{
|
||||
color4 c4_inLow = color4(color(inLow), inLow);
|
||||
color4 c4_inHigh = color4(color(inHigh), inHigh);
|
||||
color4 c4_outLow = color4(color(outLow), outLow);
|
||||
color4 c4_outHigh = color4(color(outHigh), outHigh);
|
||||
return mx_remap(c, c4_inLow, c4_inHigh, c4_outLow, c4_outHigh, doClamp);
|
||||
}
|
||||
|
||||
vector2 mx_remap(vector2 in, vector2 inLow, vector2 inHigh, vector2 outLow, vector2 outHigh, int doClamp)
|
||||
{
|
||||
return vector2(mx_remap(in.x, inLow.x, inHigh.x, outLow.x, outHigh.x, doClamp),
|
||||
mx_remap(in.y, inLow.y, inHigh.y, outLow.y, outHigh.y, doClamp));
|
||||
}
|
||||
|
||||
vector2 mx_remap(vector2 in, float inLow, float inHigh, float outLow, float outHigh, int doClamp)
|
||||
{
|
||||
return vector2(mx_remap(in.x, inLow, inHigh, outLow, outHigh, doClamp),
|
||||
mx_remap(in.y, inLow, inHigh, outLow, outHigh, doClamp));
|
||||
}
|
||||
|
||||
vector4 mx_remap(vector4 in, vector4 inLow, vector4 inHigh, vector4 outLow, vector4 outHigh, int doClamp)
|
||||
{
|
||||
return vector4(mx_remap(in.x, inLow.x, inHigh.x, outLow.x, outHigh.x, doClamp),
|
||||
mx_remap(in.y, inLow.y, inHigh.y, outLow.y, outHigh.y, doClamp),
|
||||
mx_remap(in.z, inLow.z, inHigh.z, outLow.z, outHigh.z, doClamp),
|
||||
mx_remap(in.w, inLow.w, inHigh.w, outLow.w, outHigh.w, doClamp));
|
||||
}
|
||||
|
||||
vector4 mx_remap(vector4 in, float inLow, float inHigh, float outLow, float outHigh, int doClamp)
|
||||
{
|
||||
return vector4(mx_remap(in.x, inLow, inHigh, outLow, outHigh, doClamp),
|
||||
mx_remap(in.y, inLow, inHigh, outLow, outHigh, doClamp),
|
||||
mx_remap(in.z, inLow, inHigh, outLow, outHigh, doClamp),
|
||||
mx_remap(in.w, inLow, inHigh, outLow, outHigh, doClamp));
|
||||
}
|
||||
|
||||
|
||||
float mx_contrast(float in, float amount, float pivot)
|
||||
{
|
||||
float out = in - pivot;
|
||||
out *= amount;
|
||||
out += pivot;
|
||||
return out;
|
||||
}
|
||||
|
||||
color mx_contrast(color in, color amount, color pivot)
|
||||
{
|
||||
color out = in - pivot;
|
||||
out *= amount;
|
||||
out += pivot;
|
||||
return out;
|
||||
}
|
||||
|
||||
color mx_contrast(color in, float amount, float pivot)
|
||||
{
|
||||
color out = in - pivot;
|
||||
out *= amount;
|
||||
out += pivot;
|
||||
return out;
|
||||
}
|
||||
|
||||
color4 mx_contrast(color4 c, color4 amount, color4 pivot)
|
||||
{
|
||||
return color4(mx_contrast(c.rgb, amount.rgb, pivot.rgb),
|
||||
mx_contrast(c.a, amount.a, pivot.a));
|
||||
}
|
||||
|
||||
color4 mx_contrast(color4 c, float amount, float pivot)
|
||||
{
|
||||
return mx_contrast(c, color4(color(amount), amount), color4(color(pivot), pivot));
|
||||
}
|
||||
|
||||
vector2 mx_contrast(vector2 in, vector2 amount, vector2 pivot)
|
||||
{
|
||||
return vector2 (mx_contrast(in.x, amount.x, pivot.x),
|
||||
mx_contrast(in.y, amount.y, pivot.y));
|
||||
}
|
||||
|
||||
vector2 mx_contrast(vector2 in, float amount, float pivot)
|
||||
{
|
||||
return mx_contrast(in, vector2(amount, amount), vector2(pivot, pivot));
|
||||
}
|
||||
|
||||
vector4 mx_contrast(vector4 in, vector4 amount, vector4 pivot)
|
||||
{
|
||||
return vector4(mx_contrast(in.x, amount.x, pivot.x),
|
||||
mx_contrast(in.y, amount.y, pivot.y),
|
||||
mx_contrast(in.z, amount.z, pivot.z),
|
||||
mx_contrast(in.w, amount.w, pivot.w));
|
||||
}
|
||||
|
||||
vector4 mx_contrast(vector4 in, float amount, float pivot)
|
||||
{
|
||||
return vector4(mx_contrast(in.x, amount, pivot),
|
||||
mx_contrast(in.y, amount, pivot),
|
||||
mx_contrast(in.z, amount, pivot),
|
||||
mx_contrast(in.w, amount, pivot));
|
||||
}
|
||||
|
||||
|
||||
vector2 mx_noise(string noisetype, float x, float y)
|
||||
{
|
||||
color cnoise = (color) noise(noisetype, x, y);
|
||||
return vector2 (cnoise[0], cnoise[1]);
|
||||
}
|
||||
|
||||
color4 mx_noise(string noisetype, float x, float y)
|
||||
{
|
||||
color cnoise = (color) noise(noisetype, x, y);
|
||||
float fnoise = (float) noise(noisetype, x + 19, y + 73);
|
||||
return color4 (cnoise, fnoise);
|
||||
}
|
||||
|
||||
vector4 mx_noise(string noisetype, float x, float y)
|
||||
{
|
||||
color cnoise = (color) noise(noisetype, x, y);
|
||||
float fnoise = (float) noise(noisetype, x + 19, y + 73);
|
||||
return vector4 (cnoise[0], cnoise[1], cnoise[2], fnoise);
|
||||
}
|
||||
|
||||
vector2 mx_noise(string noisetype, point position)
|
||||
{
|
||||
color cnoise = (color) noise(noisetype, position);
|
||||
return vector2 (cnoise[0], cnoise[1]);
|
||||
}
|
||||
|
||||
color4 mx_noise(string noisetype, point position)
|
||||
{
|
||||
color cnoise = (color) noise(noisetype, position);
|
||||
float fnoise = (float) noise(noisetype, position+vector(19,73,29));
|
||||
return color4 (cnoise, fnoise);
|
||||
}
|
||||
|
||||
vector4 mx_noise(string noisetype, point position)
|
||||
{
|
||||
color cnoise = (color) noise(noisetype, position);
|
||||
float fnoise = (float) noise(noisetype, position+vector(19,73,29));
|
||||
return vector4 (cnoise[0], cnoise[1], cnoise[2], fnoise);
|
||||
}
|
||||
|
||||
|
||||
float mx_fbm(point position, int octaves, float lacunarity, float diminish, string noisetype)
|
||||
{
|
||||
float out = 0;
|
||||
float amp = 1.0;
|
||||
point p = position;
|
||||
|
||||
for (int i = 0; i < octaves; i += 1) {
|
||||
out += amp * noise(noisetype, p);
|
||||
amp *= diminish;
|
||||
p *= lacunarity;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
color mx_fbm(point position, int octaves, float lacunarity, float diminish, string noisetype)
|
||||
{
|
||||
color out = 0;
|
||||
float amp = 1.0;
|
||||
point p = position;
|
||||
|
||||
for (int i = 0; i < octaves; i += 1) {
|
||||
out += amp * (color)noise(noisetype, p);
|
||||
amp *= diminish;
|
||||
p *= lacunarity;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
vector2 mx_fbm(point position, int octaves, float lacunarity, float diminish, string noisetype)
|
||||
{
|
||||
return vector2((float) mx_fbm(position, octaves, lacunarity, diminish, noisetype),
|
||||
(float) mx_fbm(position+point(19, 193, 17), octaves, lacunarity, diminish, noisetype));
|
||||
}
|
||||
|
||||
color4 mx_fbm(point position, int octaves, float lacunarity, float diminish, string noisetype)
|
||||
{
|
||||
color c = (color) mx_fbm(position, octaves, lacunarity, diminish, noisetype);
|
||||
float f = (float) mx_fbm(position+point(19, 193, 17), octaves, lacunarity, diminish, noisetype);
|
||||
return color4 (c, f);
|
||||
}
|
||||
|
||||
vector4 mx_fbm(point position, int octaves, float lacunarity, float diminish, string noisetype)
|
||||
{
|
||||
color c = (color) mx_fbm(position, octaves, lacunarity, diminish, noisetype);
|
||||
float f = (float) mx_fbm(position+point(19, 193, 17), octaves, lacunarity, diminish, noisetype);
|
||||
return vector4 (c[0], c[1], c[2], f);
|
||||
}
|
||||
|
||||
|
||||
void mx_split_float(output float x, output int ix)
|
||||
{
|
||||
ix = int(floor(x));
|
||||
x -= ix;
|
||||
}
|
||||
|
||||
float mx_worley_distance(vector2 p, int x, int y, int X, int Y, float jitter, int metric)
|
||||
{
|
||||
vector o = cellnoise(x+X, y+Y);
|
||||
o = (o - .5)*jitter + .5;
|
||||
float cposx = x + o[0];
|
||||
float cposy = y + o[1];
|
||||
float diffx = cposx - p.x;
|
||||
float diffy = cposy - p.y;
|
||||
|
||||
if (metric == 2)
|
||||
return abs(diffx) + abs(diffy); // Manhattan distance
|
||||
if (metric == 3)
|
||||
return max(abs(diffx), abs(diffy)); // Chebyshev distance
|
||||
return diffx*diffx + diffy*diffy; // Euclidean or distance^2
|
||||
}
|
||||
|
||||
float mx_worley_distance(vector p, int x, int y, int z, int X, int Y, int Z, float jitter, int metric)
|
||||
{
|
||||
vector o = cellnoise(vector(x+X, y+Y, z+Z));
|
||||
o = (o - .5)*jitter + .5;
|
||||
vector cpos = vector(x, y, z) + o;
|
||||
vector diff = cpos - p;
|
||||
|
||||
if (metric == 2)
|
||||
return abs(diff[0]) + abs(diff[1]); // Manhattan distance
|
||||
if (metric == 3)
|
||||
return max(abs(diff[0]), abs(diff[1])); // Chebyshev distance
|
||||
return dot(diff, diff); // Eucldean or distance^2
|
||||
}
|
||||
|
||||
void mx_sort_distance(float dist, output vector2 result)
|
||||
{
|
||||
if (dist < result.x)
|
||||
{
|
||||
result.y = result.x;
|
||||
result.x = dist;
|
||||
}
|
||||
else if (dist < result.y)
|
||||
{
|
||||
result.y = dist;
|
||||
}
|
||||
}
|
||||
|
||||
void mx_sort_distance(float dist, output vector result)
|
||||
{
|
||||
if (dist < result[0])
|
||||
{
|
||||
result[2] = result[1];
|
||||
result[1] = result[0];
|
||||
result[0] = dist;
|
||||
}
|
||||
else if (dist < result[1])
|
||||
{
|
||||
result[2] = result[1];
|
||||
result[1] = dist;
|
||||
}
|
||||
else if (dist < result[2])
|
||||
{
|
||||
result[2] = dist;
|
||||
}
|
||||
}
|
||||
|
||||
float mx_worley_noise_float(vector2 p, float jitter, int metric)
|
||||
{
|
||||
int X, Y;
|
||||
vector2 seed = p;
|
||||
float result = 1e6;
|
||||
|
||||
mx_split_float(seed.x, X);
|
||||
mx_split_float(seed.y, Y);
|
||||
for (int x = -1; x <= 1; ++x)
|
||||
{
|
||||
for (int y = -1; y <= 1; ++y)
|
||||
{
|
||||
float d = mx_worley_distance(seed, x, y, X, Y, jitter, metric);
|
||||
result = min(result, d);
|
||||
}
|
||||
}
|
||||
if (metric == 0)
|
||||
result = sqrt(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
vector2 mx_worley_noise_vector2(vector2 p, float jitter, int metric)
|
||||
{
|
||||
int X, Y;
|
||||
vector2 seed = p;
|
||||
vector2 result = vector2(1e6, 1e6);
|
||||
|
||||
mx_split_float(seed.x, X);
|
||||
mx_split_float(seed.y, Y);
|
||||
for (int x = -1; x <= 1; ++x)
|
||||
{
|
||||
for (int y = -1; y <= 1; ++y)
|
||||
{
|
||||
float d = mx_worley_distance(seed, x, y, X, Y, jitter, metric);
|
||||
mx_sort_distance(d, result);
|
||||
}
|
||||
}
|
||||
if (metric == 0)
|
||||
result = sqrt(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
vector mx_worley_noise_vector3(vector2 p, float jitter, int metric)
|
||||
{
|
||||
int X, Y;
|
||||
vector2 seed = p;
|
||||
vector result = vector(1e6, 1e6, 1e6);
|
||||
|
||||
mx_split_float(seed.x, X);
|
||||
mx_split_float(seed.y, Y);
|
||||
for (int x = -1; x <= 1; ++x)
|
||||
{
|
||||
for (int y = -1; y <= 1; ++y)
|
||||
{
|
||||
float d = mx_worley_distance(seed, x, y, X, Y, jitter, metric);
|
||||
mx_sort_distance(d, result);
|
||||
}
|
||||
}
|
||||
if (metric == 0)
|
||||
result = sqrt(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
float mx_worley_noise_float(vector p, float jitter, int metric)
|
||||
{
|
||||
int X, Y, Z;
|
||||
vector seed = p;
|
||||
float result = 1e6;
|
||||
|
||||
mx_split_float(seed[0], X);
|
||||
mx_split_float(seed[1], Y);
|
||||
mx_split_float(seed[2], Z);
|
||||
for (int x = -1; x <= 1; ++x)
|
||||
{
|
||||
for (int y = -1; y <= 1; ++y)
|
||||
{
|
||||
for (int z = -1; z <= 1; ++z)
|
||||
{
|
||||
float d = mx_worley_distance(seed, x, y, z, X, Y, Z, jitter, metric);
|
||||
result = min(result, d);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (metric == 0)
|
||||
result = sqrt(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
vector2 mx_worley_noise_vector2(vector p, float jitter, int metric)
|
||||
{
|
||||
int X, Y, Z;
|
||||
vector seed = p;
|
||||
vector2 result = vector2(1e6, 1e6);
|
||||
|
||||
mx_split_float(seed[0], X);
|
||||
mx_split_float(seed[1], Y);
|
||||
mx_split_float(seed[2], Z);
|
||||
for (int x = -1; x <= 1; ++x)
|
||||
{
|
||||
for (int y = -1; y <= 1; ++y)
|
||||
{
|
||||
for (int z = -1; z <= 1; ++z)
|
||||
{
|
||||
float d = mx_worley_distance(seed, x, y, z, X, Y, Z, jitter, metric);
|
||||
mx_sort_distance(d, result);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (metric == 0)
|
||||
result = sqrt(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
vector mx_worley_noise_vector3(vector p, float jitter, int metric)
|
||||
{
|
||||
int X, Y, Z;
|
||||
vector result = 1e6;
|
||||
vector seed = p;
|
||||
|
||||
mx_split_float(seed[0], X);
|
||||
mx_split_float(seed[1], Y);
|
||||
mx_split_float(seed[2], Z);
|
||||
for (int x = -1; x <= 1; ++x)
|
||||
{
|
||||
for (int y = -1; y <= 1; ++y)
|
||||
{
|
||||
for (int z = -1; z <= 1; ++z)
|
||||
{
|
||||
float d = mx_worley_distance(seed, x, y, z, X, Y, Z, jitter, metric);
|
||||
mx_sort_distance(d, result);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (metric == 0)
|
||||
result = sqrt(result);
|
||||
return result;
|
||||
}
|
||||
Vendored
+336
@@ -0,0 +1,336 @@
|
||||
// Open Shading Language : Copyright (c) 2009-2017 Sony Pictures Imageworks Inc., et al.
|
||||
// https://github.com/imageworks/OpenShadingLanguage/blob/master/LICENSE
|
||||
|
||||
#pragma once
|
||||
#define VECTOR2_H
|
||||
|
||||
// vector2 is a 2D vector
|
||||
struct vector2
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
// For vector2, define math operators to match vector
|
||||
//
|
||||
|
||||
vector2 __operator__neg__(vector2 a)
|
||||
{
|
||||
return vector2(-a.x, -a.y);
|
||||
}
|
||||
|
||||
vector2 __operator__add__(vector2 a, vector2 b)
|
||||
{
|
||||
return vector2(a.x + b.x, a.y + b.y);
|
||||
}
|
||||
|
||||
vector2 __operator__add__(vector2 a, int b)
|
||||
{
|
||||
return a + vector2(b, b);
|
||||
}
|
||||
|
||||
vector2 __operator__add__(vector2 a, float b)
|
||||
{
|
||||
return a + vector2(b, b);
|
||||
}
|
||||
|
||||
vector2 __operator__add__(int a, vector2 b)
|
||||
{
|
||||
return vector2(a, a) + b;
|
||||
}
|
||||
|
||||
vector2 __operator__add__(float a, vector2 b)
|
||||
{
|
||||
return vector2(a, a) + b;
|
||||
}
|
||||
|
||||
vector2 __operator__sub__(vector2 a, vector2 b)
|
||||
{
|
||||
return vector2(a.x - b.x, a.y - b.y);
|
||||
}
|
||||
|
||||
vector2 __operator__sub__(vector2 a, int b)
|
||||
{
|
||||
return a - vector2(b, b);
|
||||
}
|
||||
|
||||
vector2 __operator__sub__(vector2 a, float b)
|
||||
{
|
||||
return a - vector2(b, b);
|
||||
}
|
||||
|
||||
vector2 __operator__sub__(int a, vector2 b)
|
||||
{
|
||||
return vector2(a, a) - b;
|
||||
}
|
||||
|
||||
vector2 __operator__sub__(float a, vector2 b)
|
||||
{
|
||||
return vector2(a, a) - b;
|
||||
}
|
||||
|
||||
vector2 __operator__mul__(vector2 a, vector2 b)
|
||||
{
|
||||
return vector2(a.x * b.x, a.y * b.y);
|
||||
}
|
||||
|
||||
vector2 __operator__mul__(vector2 a, int b)
|
||||
{
|
||||
return a * vector2(b, b);
|
||||
}
|
||||
|
||||
vector2 __operator__mul__(vector2 a, float b)
|
||||
{
|
||||
return a * vector2(b, b);
|
||||
}
|
||||
|
||||
vector2 __operator__mul__(int a, vector2 b)
|
||||
{
|
||||
return b * vector2(a, a);
|
||||
}
|
||||
|
||||
vector2 __operator__mul__(float a, vector2 b)
|
||||
{
|
||||
return b * vector2(a, a);
|
||||
}
|
||||
|
||||
vector2 __operator__div__(vector2 a, vector2 b)
|
||||
{
|
||||
return vector2(a.x / b.x, a.y / b.y);
|
||||
}
|
||||
|
||||
vector2 __operator__div__(vector2 a, int b)
|
||||
{
|
||||
float b_inv = 1.0/b;
|
||||
return a * vector2(b_inv, b_inv);
|
||||
}
|
||||
|
||||
vector2 __operator__div__(vector2 a, float b)
|
||||
{
|
||||
float b_inv = 1.0/b;
|
||||
return a * vector2(b_inv, b_inv);
|
||||
}
|
||||
|
||||
vector2 __operator__div__(int a, vector2 b)
|
||||
{
|
||||
return vector2(a, a) / b;
|
||||
}
|
||||
|
||||
vector2 __operator__div__(float a, vector2 b)
|
||||
{
|
||||
return vector2(a, a) / b;
|
||||
}
|
||||
|
||||
int __operator__eq__(vector2 a, vector2 b)
|
||||
{
|
||||
return (a.x == b.x) && (a.y == b.y);
|
||||
}
|
||||
|
||||
int __operator__ne__(vector2 a, vector2 b)
|
||||
{
|
||||
return (a.x != b.x) || (a.y != b.y);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// For vector2, define most of the stdosl functions to match vector
|
||||
//
|
||||
|
||||
vector2 abs(vector2 a)
|
||||
{
|
||||
return vector2 (abs(a.x), abs(a.y));
|
||||
}
|
||||
|
||||
vector2 ceil(vector2 a)
|
||||
{
|
||||
return vector2 (ceil(a.x), ceil(a.y));
|
||||
}
|
||||
|
||||
vector2 round(vector2 a)
|
||||
{
|
||||
return vector2 (round(a.x), round(a.y));
|
||||
}
|
||||
|
||||
vector2 floor(vector2 a)
|
||||
{
|
||||
return vector2 (floor(a.x), floor(a.y));
|
||||
}
|
||||
|
||||
vector2 sqrt(vector2 a)
|
||||
{
|
||||
return vector2 (sqrt(a.x), sqrt(a.y));
|
||||
}
|
||||
|
||||
vector2 exp(vector2 a)
|
||||
{
|
||||
return vector2 (exp(a.x), exp(a.y));
|
||||
}
|
||||
|
||||
vector2 log(vector2 a)
|
||||
{
|
||||
return vector2 (log(a.x), log(a.y));
|
||||
}
|
||||
|
||||
vector2 log2(vector2 a)
|
||||
{
|
||||
return vector2 (log2(a.x), log2(a.y));
|
||||
}
|
||||
|
||||
vector2 mix(vector2 a, vector2 b, float x )
|
||||
{
|
||||
return vector2 (mix(a.x, b.x, x), mix(a.y, b.y, x));
|
||||
}
|
||||
|
||||
vector2 mix(vector2 a, vector2 b, vector2 x )
|
||||
{
|
||||
return vector2 (mix(a.x, b.x, x.x), mix(a.y, b.y, x.y));
|
||||
}
|
||||
|
||||
float dot(vector2 a, vector2 b)
|
||||
{
|
||||
return (a.x * b.x + a.y * b.y);
|
||||
}
|
||||
|
||||
float length (vector2 a)
|
||||
{
|
||||
return hypot (a.x, a.y);
|
||||
}
|
||||
|
||||
vector2 smoothstep(vector2 low, vector2 high, vector2 in)
|
||||
{
|
||||
return vector2 (smoothstep(low.x, high.x, in.x),
|
||||
smoothstep(low.y, high.y, in.y));
|
||||
}
|
||||
|
||||
vector2 smoothstep(float low, float high, vector2 in)
|
||||
{
|
||||
return vector2 (smoothstep(low, high, in.x),
|
||||
smoothstep(low, high, in.y));
|
||||
}
|
||||
|
||||
vector2 clamp(vector2 in, vector2 low, vector2 high)
|
||||
{
|
||||
return vector2 (clamp(in.x, low.x, high.x),
|
||||
clamp(in.y, low.y, high.y));
|
||||
}
|
||||
|
||||
vector2 clamp(vector2 in, float low, float high)
|
||||
{
|
||||
return clamp(in, vector2(low, low), vector2(high, high));
|
||||
}
|
||||
|
||||
vector2 max(vector2 a, vector2 b)
|
||||
{
|
||||
return vector2 (max(a.x, b.x),
|
||||
max(a.y, b.y));
|
||||
}
|
||||
|
||||
vector2 max(vector2 a, float b)
|
||||
{
|
||||
return max(a, vector2(b, b));
|
||||
}
|
||||
|
||||
vector2 normalize(vector2 a)
|
||||
{
|
||||
return a / length(a);
|
||||
}
|
||||
|
||||
vector2 min(vector2 a, vector2 b)
|
||||
{
|
||||
return vector2 (min(a.x, a.x),
|
||||
min(b.y, b.y));
|
||||
}
|
||||
|
||||
vector2 min(vector2 a, float b)
|
||||
{
|
||||
return min(a, vector2(b, b));
|
||||
}
|
||||
|
||||
vector2 mod(vector2 a, vector2 b)
|
||||
{
|
||||
return vector2(mod(a.x, b.x),
|
||||
mod(a.y, b.y));
|
||||
}
|
||||
|
||||
vector2 mod(vector2 a, float b)
|
||||
{
|
||||
return mod(a, vector2(b, b));
|
||||
}
|
||||
|
||||
vector2 fmod(vector2 a, vector2 b)
|
||||
{
|
||||
return vector2 (fmod(a.x, b.x),
|
||||
fmod(a.y, b.y));
|
||||
}
|
||||
|
||||
vector2 fmod(vector2 a, float b)
|
||||
{
|
||||
return fmod(a, vector2(b, b));
|
||||
}
|
||||
|
||||
vector2 pow(vector2 in, vector2 amount)
|
||||
{
|
||||
return vector2(pow(in.x, amount.x),
|
||||
pow(in.y, amount.y));
|
||||
}
|
||||
|
||||
vector2 pow(vector2 in, float amount)
|
||||
{
|
||||
return vector2(pow(in.x, amount),
|
||||
pow(in.y, amount));
|
||||
}
|
||||
|
||||
vector2 sign(vector2 a)
|
||||
{
|
||||
return vector2(sign(a.x),
|
||||
sign(a.y));
|
||||
}
|
||||
|
||||
vector2 sin(vector2 a)
|
||||
{
|
||||
return vector2(sin(a.x),
|
||||
sin(a.y));
|
||||
}
|
||||
|
||||
vector2 cos(vector2 a)
|
||||
{
|
||||
return vector2(cos(a.x),
|
||||
cos(a.y));
|
||||
}
|
||||
|
||||
vector2 tan(vector2 a)
|
||||
{
|
||||
return vector2(tan(a.x),
|
||||
tan(a.y));
|
||||
}
|
||||
|
||||
vector2 asin(vector2 a)
|
||||
{
|
||||
return vector2(asin(a.x),
|
||||
asin(a.y));
|
||||
}
|
||||
|
||||
vector2 acos(vector2 a)
|
||||
{
|
||||
return vector2(acos(a.x),
|
||||
acos(a.y));
|
||||
}
|
||||
|
||||
vector2 atan2(vector2 a, float f)
|
||||
{
|
||||
return vector2(atan2(a.x, f),
|
||||
atan2(a.y, f));
|
||||
}
|
||||
|
||||
vector2 atan2(vector2 a, vector2 b)
|
||||
{
|
||||
return vector2(atan2(a.x, b.x),
|
||||
atan2(a.y, b.y));
|
||||
}
|
||||
|
||||
|
||||
Vendored
+423
@@ -0,0 +1,423 @@
|
||||
// Open Shading Language : Copyright (c) 2009-2017 Sony Pictures Imageworks Inc., et al.
|
||||
// https://github.com/imageworks/OpenShadingLanguage/blob/master/LICENSE
|
||||
|
||||
#pragma once
|
||||
#define VECTOR4_H
|
||||
|
||||
|
||||
// vector4 is a 4D vector
|
||||
struct vector4
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
float w;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//
|
||||
// For vector4, define math operators to match vector
|
||||
//
|
||||
|
||||
vector4 __operator__neg__(vector4 a)
|
||||
{
|
||||
return vector4(-a.x, -a.y, -a.z, -a.w);
|
||||
}
|
||||
|
||||
vector4 __operator__add__(vector4 a, vector4 b)
|
||||
{
|
||||
return vector4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w);
|
||||
}
|
||||
|
||||
vector4 __operator__add__(vector4 a, int b)
|
||||
{
|
||||
return a + vector4(b, b, b, b);
|
||||
}
|
||||
|
||||
vector4 __operator__add__(vector4 a, float b)
|
||||
{
|
||||
return a + vector4(b, b, b, b);
|
||||
}
|
||||
|
||||
vector4 __operator__add__(int a, vector4 b)
|
||||
{
|
||||
return vector4(a, a, a, a) + b;
|
||||
}
|
||||
|
||||
vector4 __operator__add__(float a, vector4 b)
|
||||
{
|
||||
return vector4(a, a, a, a) + b;
|
||||
}
|
||||
|
||||
vector4 __operator__sub__(vector4 a, vector4 b)
|
||||
{
|
||||
return vector4(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w);
|
||||
}
|
||||
|
||||
vector4 __operator__sub__(vector4 a, int b)
|
||||
{
|
||||
return a - vector4(b, b, b, b);
|
||||
}
|
||||
|
||||
vector4 __operator__sub__(vector4 a, float b)
|
||||
{
|
||||
return a - vector4(b, b, b, b);
|
||||
}
|
||||
|
||||
vector4 __operator__sub__(int a, vector4 b)
|
||||
{
|
||||
return vector4(a, a, a, a) - b;
|
||||
}
|
||||
|
||||
vector4 __operator__sub__(float a, vector4 b)
|
||||
{
|
||||
return vector4(a, a, a, a) - b;
|
||||
}
|
||||
|
||||
vector4 __operator__mul__(vector4 a, vector4 b)
|
||||
{
|
||||
return vector4(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w);
|
||||
}
|
||||
|
||||
vector4 __operator__mul__(vector4 a, int b)
|
||||
{
|
||||
return a * vector4(b, b, b, b);
|
||||
}
|
||||
|
||||
vector4 __operator__mul__(vector4 a, float b)
|
||||
{
|
||||
return a * vector4(b, b, b, b);
|
||||
}
|
||||
|
||||
vector4 __operator__mul__(int a, vector4 b)
|
||||
{
|
||||
return vector4(a, a, a, a) * b;
|
||||
}
|
||||
|
||||
vector4 __operator__mul__(float a, vector4 b)
|
||||
{
|
||||
return vector4(a, a, a, a) * b;
|
||||
}
|
||||
|
||||
vector4 __operator__div__(vector4 a, vector4 b)
|
||||
{
|
||||
return vector4(a.x / b.x, a.y / b.y, a.z / b.z, a.w / b.w);
|
||||
}
|
||||
|
||||
vector4 __operator__div__(vector4 a, int b)
|
||||
{
|
||||
float b_inv = 1.0/b;
|
||||
return a * vector4(b_inv, b_inv, b_inv, b_inv);
|
||||
}
|
||||
|
||||
vector4 __operator__div__(vector4 a, float b)
|
||||
{
|
||||
float b_inv = 1.0/b;
|
||||
return a * vector4(b_inv, b_inv, b_inv, b_inv);
|
||||
}
|
||||
|
||||
vector4 __operator__div__(int a, vector4 b)
|
||||
{
|
||||
return vector4(a, a, a, a) / b;
|
||||
}
|
||||
|
||||
vector4 __operator__div__(float a, vector4 b)
|
||||
{
|
||||
return vector4(a, a, a, a) / b;
|
||||
}
|
||||
|
||||
int __operator__eq__(vector4 a, vector4 b)
|
||||
{
|
||||
return (a.x == b.x) && (a.y == b.y) && (a.z == b.z) && (a.w == b.w);
|
||||
}
|
||||
|
||||
int __operator__ne__(vector4 a, vector4 b)
|
||||
{
|
||||
return (a.x != b.x) || (a.y != b.y) || (a.z != b.z) || (a.w != b.w);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// For vector4, define most of the stdosl functions to match vector
|
||||
//
|
||||
|
||||
vector4 abs(vector4 in)
|
||||
{
|
||||
return vector4 (abs(in.x),
|
||||
abs(in.y),
|
||||
abs(in.z),
|
||||
abs(in.w));
|
||||
}
|
||||
|
||||
vector4 ceil(vector4 in)
|
||||
{
|
||||
return vector4 (ceil(in.x),
|
||||
ceil(in.y),
|
||||
ceil(in.z),
|
||||
ceil(in.w));
|
||||
}
|
||||
|
||||
vector4 round(vector4 in)
|
||||
{
|
||||
return vector4 (round(in.x),
|
||||
round(in.y),
|
||||
round(in.z),
|
||||
round(in.w));
|
||||
}
|
||||
|
||||
vector4 floor(vector4 in)
|
||||
{
|
||||
return vector4 (floor(in.x),
|
||||
floor(in.y),
|
||||
floor(in.z),
|
||||
floor(in.w));
|
||||
}
|
||||
|
||||
vector4 sqrt(vector4 in)
|
||||
{
|
||||
return vector4 (sqrt(in.x),
|
||||
sqrt(in.y),
|
||||
sqrt(in.z),
|
||||
sqrt(in.w));
|
||||
}
|
||||
|
||||
vector4 exp(vector4 in)
|
||||
{
|
||||
return vector4 (exp(in.x),
|
||||
exp(in.y),
|
||||
exp(in.z),
|
||||
exp(in.w));
|
||||
}
|
||||
|
||||
vector4 log(vector4 in)
|
||||
{
|
||||
return vector4 (log(in.x),
|
||||
log(in.y),
|
||||
log(in.z),
|
||||
log(in.w));
|
||||
}
|
||||
|
||||
vector4 log2(vector4 in)
|
||||
{
|
||||
return vector4 (log2(in.x),
|
||||
log2(in.y),
|
||||
log2(in.z),
|
||||
log2(in.w));
|
||||
}
|
||||
|
||||
vector4 mix(vector4 value1, vector4 value2, float x )
|
||||
{
|
||||
return vector4 (mix( value1.x, value2.x, x),
|
||||
mix( value1.y, value2.y, x),
|
||||
mix( value1.z, value2.z, x),
|
||||
mix( value1.w, value2.w, x));
|
||||
}
|
||||
|
||||
vector4 mix(vector4 value1, vector4 value2, vector4 x )
|
||||
{
|
||||
return vector4 (mix( value1.x, value2.x, x.x),
|
||||
mix( value1.y, value2.y, x.y),
|
||||
mix( value1.z, value2.z, x.z),
|
||||
mix( value1.w, value2.w, x.w));
|
||||
}
|
||||
|
||||
vector vec4ToVec3(vector4 v)
|
||||
{
|
||||
return vector(v.x, v.y, v.z) / v.w;
|
||||
}
|
||||
|
||||
float dot(vector4 a, vector4 b)
|
||||
{
|
||||
return ((a.x * b.x) + (a.y * b.y) + (a.z * b.z) + (a.w * b.w));
|
||||
}
|
||||
|
||||
float length (vector4 a)
|
||||
{
|
||||
return sqrt (a.x*a.x + a.y*a.y + a.z*a.z + a.w*a.w);
|
||||
}
|
||||
|
||||
vector4 smoothstep(vector4 low, vector4 high, vector4 in)
|
||||
{
|
||||
return vector4 (smoothstep(low.x, high.x, in.x),
|
||||
smoothstep(low.y, high.y, in.y),
|
||||
smoothstep(low.z, high.z, in.z),
|
||||
smoothstep(low.w, high.w, in.w));
|
||||
}
|
||||
|
||||
vector4 smoothstep(float low, float high, vector4 in)
|
||||
{
|
||||
return vector4 (smoothstep(low, high, in.x),
|
||||
smoothstep(low, high, in.y),
|
||||
smoothstep(low, high, in.z),
|
||||
smoothstep(low, high, in.w));
|
||||
}
|
||||
|
||||
vector4 clamp(vector4 in, vector4 low, vector4 high)
|
||||
{
|
||||
return vector4 (clamp(in.x, low.x, high.x),
|
||||
clamp(in.y, low.y, high.y),
|
||||
clamp(in.z, low.z, high.z),
|
||||
clamp(in.w, low.w, high.w));
|
||||
}
|
||||
|
||||
vector4 clamp(vector4 in, float low, float high)
|
||||
{
|
||||
return vector4 (clamp(in.x, low, high),
|
||||
clamp(in.y, low, high),
|
||||
clamp(in.z, low, high),
|
||||
clamp(in.w, low, high));
|
||||
}
|
||||
|
||||
vector4 max(vector4 a, vector4 b)
|
||||
{
|
||||
return vector4 (max(a.x, b.x),
|
||||
max(a.y, b.y),
|
||||
max(a.z, b.z),
|
||||
max(a.w, b.w));
|
||||
}
|
||||
|
||||
vector4 max(vector4 a, float b)
|
||||
{
|
||||
return max(a, vector4(b, b, b, b));
|
||||
}
|
||||
|
||||
vector4 normalize(vector4 a)
|
||||
{
|
||||
return a / length(a);
|
||||
}
|
||||
|
||||
vector4 min(vector4 a, vector4 b)
|
||||
{
|
||||
return vector4 (min(a.x, b.x),
|
||||
min(a.y, b.y),
|
||||
min(a.z, b.z),
|
||||
min(a.w, b.w));
|
||||
}
|
||||
|
||||
vector4 min(vector4 a, float b)
|
||||
{
|
||||
return min(a, vector4(b, b, b, b));
|
||||
}
|
||||
|
||||
vector4 mod(vector4 a, vector4 b)
|
||||
{
|
||||
return vector4(mod(a.x, b.x),
|
||||
mod(a.y, b.y),
|
||||
mod(a.z, b.z),
|
||||
mod(a.w, b.w));
|
||||
}
|
||||
|
||||
vector4 mod(vector4 a, float b)
|
||||
{
|
||||
return mod(a, vector4(b, b, b, b));
|
||||
}
|
||||
|
||||
vector4 fmod(vector4 a, vector4 b)
|
||||
{
|
||||
return vector4 (fmod(a.x, b.x),
|
||||
fmod(a.y, b.y),
|
||||
fmod(a.z, b.z),
|
||||
fmod(a.w, b.w));
|
||||
}
|
||||
|
||||
vector4 fmod(vector4 a, float b)
|
||||
{
|
||||
return fmod(a, vector4(b, b, b, b));
|
||||
}
|
||||
|
||||
vector4 pow(vector4 in, vector4 amount)
|
||||
{
|
||||
return vector4 (pow(in.x, amount.x),
|
||||
pow(in.y, amount.y),
|
||||
pow(in.z, amount.z),
|
||||
pow(in.w, amount.w));
|
||||
}
|
||||
|
||||
vector4 pow(vector4 in, float amount)
|
||||
{
|
||||
return vector4 (pow(in.x, amount),
|
||||
pow(in.y, amount),
|
||||
pow(in.z, amount),
|
||||
pow(in.w, amount));
|
||||
}
|
||||
|
||||
vector4 sign(vector4 a)
|
||||
{
|
||||
return vector4(sign(a.x),
|
||||
sign(a.y),
|
||||
sign(a.z),
|
||||
sign(a.w));
|
||||
}
|
||||
|
||||
vector4 sin(vector4 a)
|
||||
{
|
||||
return vector4(sin(a.x),
|
||||
sin(a.y),
|
||||
sin(a.z),
|
||||
sin(a.w));
|
||||
}
|
||||
|
||||
vector4 cos(vector4 a)
|
||||
{
|
||||
return vector4(cos(a.x),
|
||||
cos(a.y),
|
||||
cos(a.z),
|
||||
cos(a.w));
|
||||
}
|
||||
|
||||
vector4 tan(vector4 a)
|
||||
{
|
||||
return vector4(tan(a.x),
|
||||
tan(a.y),
|
||||
tan(a.z),
|
||||
tan(a.w));
|
||||
}
|
||||
|
||||
vector4 asin(vector4 a)
|
||||
{
|
||||
return vector4(asin(a.x),
|
||||
asin(a.y),
|
||||
asin(a.z),
|
||||
asin(a.w));
|
||||
}
|
||||
|
||||
vector4 acos(vector4 a)
|
||||
{
|
||||
return vector4(acos(a.x),
|
||||
acos(a.y),
|
||||
acos(a.z),
|
||||
acos(a.w));
|
||||
}
|
||||
|
||||
vector4 atan2(vector4 a, float f)
|
||||
{
|
||||
return vector4(atan2(a.x, f),
|
||||
atan2(a.y, f),
|
||||
atan2(a.z, f),
|
||||
atan2(a.w, f));
|
||||
}
|
||||
|
||||
vector4 atan2(vector4 a, vector4 b)
|
||||
{
|
||||
return vector4(atan2(a.x, b.x),
|
||||
atan2(a.y, b.y),
|
||||
atan2(a.z, b.z),
|
||||
atan2(a.w, b.w));
|
||||
}
|
||||
|
||||
|
||||
vector4 transform (matrix M, vector4 p)
|
||||
{
|
||||
return vector4 (M[0][0]*p.x + M[1][0]*p.y + M[2][0]*p.z + M[3][0]*p.w,
|
||||
M[0][1]*p.x + M[1][1]*p.y + M[2][1]*p.z + M[3][1]*p.w,
|
||||
M[0][2]*p.x + M[1][2]*p.y + M[2][2]*p.z + M[3][2]*p.w,
|
||||
M[0][3]*p.x + M[1][3]*p.y + M[2][3]*p.z + M[3][3]*p.w);
|
||||
}
|
||||
|
||||
vector4 transform (string fromspace, string tospace, vector4 p)
|
||||
{
|
||||
return transform (matrix(fromspace,tospace), p);
|
||||
}
|
||||
Vendored
+150
@@ -0,0 +1,150 @@
|
||||
// Restrict to 7x7 kernel size for performance reasons
|
||||
#define MX_MAX_SAMPLE_COUNT 49
|
||||
// Size of all weights for all levels (including level 1)
|
||||
#define MX_WEIGHT_ARRAY_SIZE 84
|
||||
|
||||
//
|
||||
// Function to compute the sample size relative to a texture coordinate
|
||||
//
|
||||
vector2 mx_compute_sample_size_uv(vector2 uv, float filterSize, float filterOffset)
|
||||
{
|
||||
vector derivUVx = Dx(vector(uv.x, uv.y, 0.0)) * 0.5;
|
||||
vector derivUVy = Dy(vector(uv.x, uv.y, 0.0)) * 0.5;
|
||||
float derivX = abs(derivUVx[0]) + abs(derivUVy[0]);
|
||||
float derivY = abs(derivUVx[1]) + abs(derivUVy[1]);
|
||||
float sampleSizeU = filterSize * derivX + filterOffset;
|
||||
if (sampleSizeU < 1.0E-05)
|
||||
sampleSizeU = 1.0E-05;
|
||||
float sampleSizeV = filterSize * derivY + filterOffset;
|
||||
if (sampleSizeV < 1.0E-05)
|
||||
sampleSizeV = 1.0E-05;
|
||||
return vector2(sampleSizeU, sampleSizeV);
|
||||
}
|
||||
|
||||
// Kernel weights for box filter
|
||||
void mx_get_box_weights(output float W[MX_MAX_SAMPLE_COUNT], int filterSize)
|
||||
{
|
||||
int sampleCount = filterSize*filterSize;
|
||||
float value = 1.0 / float(sampleCount);
|
||||
for (int i=0; i<sampleCount; i++)
|
||||
{
|
||||
W[i] = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Kernel weights for Gaussian filter. Sigma is assumed to be 1.
|
||||
void mx_get_gaussian_weights(output float W[MX_MAX_SAMPLE_COUNT], int filterSize)
|
||||
{
|
||||
if (filterSize >= 7)
|
||||
{
|
||||
W[0] = 0.000036; W[1] = 0.000363; W[2] = 0.001446; W[3] = 0.002291; W[4] = 0.001446; W[5] = 0.000363; W[6] = 0.000036;
|
||||
W[7] = 0.000363; W[8] = 0.003676; W[9] = 0.014662; W[10] = 0.023226; W[11] = 0.014662; W[12] = 0.003676; W[13] = 0.000363;
|
||||
W[14] = 0.001446; W[15] = 0.014662; W[16] = 0.058488; W[17] = 0.092651; W[18] = 0.058488; W[19] = 0.014662; W[20] = 0.001446;
|
||||
W[21] = 0.002291; W[22] = 0.023226; W[23] = 0.092651; W[24] = 0.146768; W[25] = 0.092651; W[26] = 0.023226; W[27] = 0.002291;
|
||||
W[28] = 0.001446; W[29] = 0.014662; W[30] = 0.058488; W[31] = 0.092651; W[32] = 0.058488; W[33] = 0.014662; W[34] = 0.001446;
|
||||
W[35] = 0.000363; W[36] = 0.003676; W[37] = 0.014662; W[38] = 0.023226; W[39] = 0.014662; W[40] = 0.003676; W[41] = 0.000363;
|
||||
W[42] = 0.000036; W[43] = 0.000363; W[44] = 0.001446; W[45] = 0.002291; W[46] = 0.001446; W[47] = 0.000363; W[48] = 0.000036;
|
||||
}
|
||||
else if (filterSize >= 5)
|
||||
{
|
||||
W[0] = 0.003765; W[1] = 0.015019; W[2] = 0.023792; W[3] = 0.015019; W[4] = 0.003765;
|
||||
W[5] = 0.015019; W[6] = 0.059912; W[7] = 0.094907; W[8] = 0.059912; W[9] = 0.015019;
|
||||
W[10] = 0.023792; W[11] = 0.094907; W[12] = 0.150342; W[13] = 0.094907; W[14] = 0.023792;
|
||||
W[15] = 0.015019; W[16] = 0.059912; W[17] = 0.094907; W[18] = 0.059912; W[19] = 0.015019;
|
||||
W[20] = 0.003765; W[21] = 0.015019; W[22] = 0.023792; W[23] = 0.015019; W[24] = 0.003765;
|
||||
}
|
||||
else if (filterSize >= 3)
|
||||
{
|
||||
W[0] = 0.0625; W[1] = 0.125; W[2] = 0.0625;
|
||||
W[3] = 0.125; W[4] = 0.25; W[5] = 0.125;
|
||||
W[6] = 0.0625; W[7] = 0.125; W[8] = 0.0625;
|
||||
}
|
||||
else
|
||||
{
|
||||
W[0] = 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Apply filter for float samples S, using weights W.
|
||||
// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 }
|
||||
//
|
||||
float mx_convolution_float(float S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount)
|
||||
{
|
||||
float result = 0.0;
|
||||
for (int i = 0; i < sampleCount; i++)
|
||||
{
|
||||
result += S[i]*W[i+offset];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Apply filter for vector2 samples S, using weights W.
|
||||
// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 }
|
||||
//
|
||||
vector2 mx_convolution_vector2(vector2 S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount)
|
||||
{
|
||||
vector2 result = vector2(0.0, 0.0);
|
||||
for (int i=0; i<sampleCount; i++)
|
||||
{
|
||||
result += S[i]*W[i+offset];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Apply filter for vector samples S, using weights W.
|
||||
// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 }
|
||||
//
|
||||
vector mx_convolution_vector(vector S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount)
|
||||
{
|
||||
vector result = vector(0.0, 0.0, 0.0);
|
||||
for (int i=0; i<sampleCount; i++)
|
||||
{
|
||||
result += S[i]*W[i+offset];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Apply filter for vector4 samples S, using weights W.
|
||||
// sampleCount should be a square of a odd number { 1, 3, 5, 7 }
|
||||
//
|
||||
vector4 mx_convolution_vector4(vector4 S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount)
|
||||
{
|
||||
vector4 result = vector4(0.0, 0.0, 0.0, 0.0);
|
||||
for (int i=0; i<sampleCount; i++)
|
||||
{
|
||||
result += S[i]*W[i+offset];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Apply filter for color samples S, using weights W.
|
||||
// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 }
|
||||
//
|
||||
color mx_convolution_color(color S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount)
|
||||
{
|
||||
color result = color(0.0);
|
||||
for (int i=0; i<sampleCount; i++)
|
||||
{
|
||||
result += S[i]*W[i+offset];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Apply filter for color4 samples S, using weights W.
|
||||
// sampleCount should be a square of a odd number { 1, 3, 5, 7 }
|
||||
//
|
||||
color4 mx_convolution_color4(color4 S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount)
|
||||
{
|
||||
color4 result = color4(color(0.0, 0.0, 0.0), 0.0);
|
||||
for (int i=0; i<sampleCount; i++)
|
||||
{
|
||||
result += S[i]*W[i+offset];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
vector2 mx_transform_uv(vector2 texcoord)
|
||||
{
|
||||
return texcoord;
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
vector2 mx_transform_uv(vector2 texcoord)
|
||||
{
|
||||
return vector2(texcoord.x, 1.0 - texcoord.y);
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
void mx_ambientocclusion_float(float coneangle, float maxdistance, output float result)
|
||||
{
|
||||
// This node is a stub and does not currently operate to specification
|
||||
result = 0;
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
#include "mx_burn_float.osl"
|
||||
|
||||
void mx_burn_color3(color fg, color bg, float mix, output color result)
|
||||
{
|
||||
mx_burn_float(fg[0], bg[0], mix, result[0]);
|
||||
mx_burn_float(fg[1], bg[1], mix, result[1]);
|
||||
mx_burn_float(fg[2], bg[2], mix, result[2]);
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
#include "mx_burn_float.osl"
|
||||
|
||||
void mx_burn_color4(color4 fg, color4 bg, float mix, output color4 result)
|
||||
{
|
||||
mx_burn_float(fg.rgb[0], bg.rgb[0], mix, result.rgb[0]);
|
||||
mx_burn_float(fg.rgb[1], bg.rgb[1], mix, result.rgb[1]);
|
||||
mx_burn_float(fg.rgb[2], bg.rgb[2], mix, result.rgb[2]);
|
||||
mx_burn_float(fg.a, bg.a, mix, result.a);
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
void mx_burn_float(float fg, float bg, float mix, output float result)
|
||||
{
|
||||
if (abs(fg) < M_FLOAT_EPS)
|
||||
{
|
||||
result = 0.0;
|
||||
return;
|
||||
}
|
||||
result = mix*(1.0 - ((1.0 - bg) / fg)) + ((1.0-mix)*bg);
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
void mx_cellnoise2d_float(vector2 texcoord, output float result)
|
||||
{
|
||||
result = cellnoise(texcoord.x, texcoord.y);
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
void mx_cellnoise3d_float(vector position, output float result)
|
||||
{
|
||||
result = cellnoise(position);
|
||||
}
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
void mx_creatematrix_vector3_matrix33(vector in1, vector in2, vector in3, output matrix result)
|
||||
{
|
||||
result = matrix(in1.x, in1.y, in1.z, 0.0,
|
||||
in2.x, in2.y, in2.z, 0.0,
|
||||
in3.x, in3.y, in3.z, 0.0,
|
||||
0.0, 0.0, 0.0, 1.0);
|
||||
}
|
||||
|
||||
void mx_creatematrix_vector3_matrix44(vector in1, vector in2, vector in3, vector in4, output matrix result)
|
||||
{
|
||||
result = matrix(in1.x, in1.y, in1.z, 0.0,
|
||||
in2.x, in2.y, in2.z, 0.0,
|
||||
in3.x, in3.y, in3.z, 0.0,
|
||||
in4.x, in4.y, in4.z, 1.0);
|
||||
}
|
||||
|
||||
void mx_creatematrix_vector4_matrix44(vector4 in1, vector4 in2, vector4 in3, vector4 in4, output matrix result)
|
||||
{
|
||||
result = matrix(in1.x, in1.y, in1.z, in1.w,
|
||||
in2.x, in2.y, in2.z, in2.w,
|
||||
in3.x, in3.y, in3.z, in3.w,
|
||||
in4.x, in4.y, in4.z, in4.w);
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
void mx_disjointover_color4(color4 fg, color4 bg, float mix, output color4 result)
|
||||
{
|
||||
float summedAlpha = fg.a + bg.a;
|
||||
|
||||
if (summedAlpha <= 1)
|
||||
{
|
||||
result.rgb = fg.rgb + bg.rgb;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (abs(bg.a) < M_FLOAT_EPS)
|
||||
{
|
||||
result.rgb = 0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
float x = (1 - fg.a) / bg.a;
|
||||
result.rgb = fg.rgb + bg.rgb * x;
|
||||
}
|
||||
}
|
||||
result.a = min(summedAlpha, 1.0);
|
||||
|
||||
result.rgb = result.rgb * mix + (1.0 - mix) * bg.rgb;
|
||||
result.a = result.a * mix + (1.0 - mix) * bg.a;
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
#include "mx_dodge_float.osl"
|
||||
|
||||
void mx_dodge_color3(color fg, color bg, float mix, output color result)
|
||||
{
|
||||
mx_dodge_float(fg[0], bg[0], mix, result[0]);
|
||||
mx_dodge_float(fg[1], bg[1], mix, result[1]);
|
||||
mx_dodge_float(fg[2], bg[2], mix, result[2]);
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
#include "mx_dodge_float.osl"
|
||||
|
||||
void mx_dodge_color4(color4 fg , color4 bg , float mix , output color4 result)
|
||||
{
|
||||
mx_dodge_float(fg.rgb[0], bg.rgb[0], mix, result.rgb[0]);
|
||||
mx_dodge_float(fg.rgb[1], bg.rgb[1], mix, result.rgb[1]);
|
||||
mx_dodge_float(fg.rgb[2], bg.rgb[2], mix, result.rgb[2]);
|
||||
mx_dodge_float(fg.a, bg.a, mix, result.a);
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
void mx_dodge_float(float fg, float bg, float mix, output float out)
|
||||
{
|
||||
if (abs(1.0 - fg) < M_FLOAT_EPS)
|
||||
{
|
||||
out = 0.0;
|
||||
return;
|
||||
}
|
||||
out = mix*(bg / (1.0 - fg)) + ((1.0-mix)*bg);
|
||||
}
|
||||
Packaged/Windows/Engine/Binaries/ThirdParty/MaterialX/libraries/stdlib/genosl/mx_fractal3d_float.osl
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
void mx_fractal3d_float(float amplitude, int octaves, float lacunarity, float diminish, vector position, output float result)
|
||||
{
|
||||
float f = mx_fbm(position, octaves, lacunarity, diminish, "snoise");
|
||||
result = f * amplitude;
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
void mx_fractal3d_vector2(vector2 amplitude, int octaves, float lacunarity, float diminish, vector position, output vector2 result)
|
||||
{
|
||||
vector2 f = mx_fbm(position, octaves, lacunarity, diminish, "snoise");
|
||||
result = f * amplitude;
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
void mx_fractal3d_vector3(vector amplitude, int octaves, float lacunarity, float diminish, vector position, output vector result)
|
||||
{
|
||||
vector f = mx_fbm(position, octaves, lacunarity, diminish, "snoise");
|
||||
result = f * amplitude;
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
void mx_fractal3d_vector4(vector4 amplitude, int octaves, float lacunarity, float diminish, vector position, output vector4 result)
|
||||
{
|
||||
vector4 f = mx_fbm(position, octaves, lacunarity, diminish, "snoise");
|
||||
result = f * amplitude;
|
||||
}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
void mx_frame_float(output float result)
|
||||
{
|
||||
getattribute("frame", result);
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
void mx_geomcolor_color3(int index, output color result)
|
||||
{
|
||||
getattribute("color", result);
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
void mx_geomcolor_color4(int index, output color4 result)
|
||||
{
|
||||
float value[4];
|
||||
getattribute("color", value);
|
||||
result.rgb[0] = value[0];
|
||||
result.rgb[1] = value[1];
|
||||
result.rgb[2] = value[2];
|
||||
result.a = value[3];
|
||||
}
|
||||
Packaged/Windows/Engine/Binaries/ThirdParty/MaterialX/libraries/stdlib/genosl/mx_geomcolor_float.osl
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
void mx_geomcolor_float(int index, output float result)
|
||||
{
|
||||
getattribute("color", result);
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
void mx_geompropvalue_boolean(string geomprop, int defaultVal, output int out)
|
||||
{
|
||||
if (getattribute(geomprop, out) == 0)
|
||||
out = defaultVal;
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
void mx_geompropvalue_color(string geomprop, color defaultVal, output color out)
|
||||
{
|
||||
if (getattribute(geomprop, out) == 0)
|
||||
out = defaultVal;
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
void mx_geompropvalue_color4(string geomprop, color4 defaultVal, output color4 out)
|
||||
{
|
||||
float value[4];
|
||||
if (getattribute(geomprop, value) == 0)
|
||||
{
|
||||
out.rgb = defaultVal.rgb;
|
||||
out.a = defaultVal.a;
|
||||
}
|
||||
else
|
||||
{
|
||||
out.rgb[0] = value[0];
|
||||
out.rgb[1] = value[1];
|
||||
out.rgb[2] = value[2];
|
||||
out.a = value[3];
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
void mx_geompropvalue_float(string geomprop, float defaultVal, output float result)
|
||||
{
|
||||
if (getattribute(geomprop, result) == 0)
|
||||
{
|
||||
result = defaultVal;
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
void mx_geompropvalue_integer(string geomprop, int defaultVal, output int out)
|
||||
{
|
||||
if (getattribute(geomprop, out) == 0)
|
||||
out = defaultVal;
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
void mx_geompropvalue_string(string geomprop, string defaultVal, output string out)
|
||||
{
|
||||
if (getattribute(geomprop, out) == 0)
|
||||
out = defaultVal;
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
void mx_geompropvalue_vector2(string geomprop, vector2 defaultVal, output vector2 out)
|
||||
{
|
||||
float value[2];
|
||||
if (getattribute(geomprop, value) == 0)
|
||||
{
|
||||
out = defaultVal;
|
||||
}
|
||||
else
|
||||
{
|
||||
out.x = value[0];
|
||||
out.y = value[1];
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
void mx_geompropvalue_vector(string geomprop, vector defaultVal, output vector out)
|
||||
{
|
||||
if (getattribute(geomprop, out) == 0)
|
||||
out = defaultVal;
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
void mx_geompropvalue_vector4(string geomprop, vector4 defaultVal, output vector4 out)
|
||||
{
|
||||
float value[4];
|
||||
if (getattribute(geomprop, value) == 0)
|
||||
{
|
||||
out = defaultVal;
|
||||
}
|
||||
else
|
||||
{
|
||||
out.x = value[0];
|
||||
out.y = value[1];
|
||||
out.z = value[2];
|
||||
out.w = value[3];
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
void mx_heighttonormal_vector3(float in, float scale, output vector result)
|
||||
{
|
||||
point htP = P + normalize(N) * in * scale;
|
||||
result = normalize(calculatenormal(htP));
|
||||
}
|
||||
Packaged/Windows/Engine/Binaries/ThirdParty/MaterialX/libraries/stdlib/genosl/mx_hsvtorgb_color3.osl
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
void mx_hsvtorgb_color3(vector _in, output vector result)
|
||||
{
|
||||
result = transformc("hsv","rgb", _in);
|
||||
}
|
||||
Packaged/Windows/Engine/Binaries/ThirdParty/MaterialX/libraries/stdlib/genosl/mx_hsvtorgb_color4.osl
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
void mx_hsvtorgb_color4(color4 _in, output color4 result)
|
||||
{
|
||||
result = color4(transformc("hsv","rgb", _in.rgb), 1.0);
|
||||
}
|
||||
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
#include "lib/$fileTransformUv"
|
||||
|
||||
void mx_image_color3(textureresource file, string layer, color default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output color out)
|
||||
{
|
||||
if (file.filename == "" ||
|
||||
(uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) ||
|
||||
(vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0)))
|
||||
{
|
||||
out = default_value;
|
||||
return;
|
||||
}
|
||||
|
||||
color missingColor = default_value;
|
||||
vector2 st = mx_transform_uv(texcoord);
|
||||
out = texture(file.filename, st.x, st.y, "subimage", layer, "missingcolor", missingColor, "swrap", uaddressmode, "twrap", vaddressmode, "colorspace", file.colorspace);
|
||||
}
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
#include "lib/$fileTransformUv"
|
||||
|
||||
void mx_image_color4(textureresource file, string layer, color4 default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output color4 out)
|
||||
{
|
||||
if (file.filename == "" ||
|
||||
(uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) ||
|
||||
(vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0)))
|
||||
{
|
||||
out = default_value;
|
||||
return;
|
||||
}
|
||||
|
||||
color missingColor = default_value.rgb;
|
||||
float missingAlpha = default_value.a;
|
||||
vector2 st = mx_transform_uv(texcoord);
|
||||
float alpha;
|
||||
color rgb = texture(file.filename, st.x, st.y, "alpha", alpha, "subimage", layer,
|
||||
"missingcolor", missingColor, "missingalpha", missingAlpha, "swrap", uaddressmode, "twrap", vaddressmode, "colorspace", file.colorspace);
|
||||
|
||||
out = color4(rgb, alpha);
|
||||
}
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
#include "lib/$fileTransformUv"
|
||||
|
||||
void mx_image_float(textureresource file, string layer, float default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output float out)
|
||||
{
|
||||
if (file.filename == "" ||
|
||||
(uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) ||
|
||||
(vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0)))
|
||||
{
|
||||
out = default_value;
|
||||
return;
|
||||
}
|
||||
|
||||
color missingColor = color(default_value);
|
||||
vector2 st = mx_transform_uv(texcoord);
|
||||
color rgb = texture(file.filename, st.x, st.y, "subimage", layer, "missingcolor", missingColor, "swrap", uaddressmode, "twrap", vaddressmode);
|
||||
out = rgb[0];
|
||||
}
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
#include "lib/$fileTransformUv"
|
||||
|
||||
void mx_image_vector2(textureresource file, string layer, vector2 default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output vector2 out)
|
||||
{
|
||||
if (file.filename == "" ||
|
||||
(uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) ||
|
||||
(vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0)))
|
||||
{
|
||||
out = default_value;
|
||||
return;
|
||||
}
|
||||
|
||||
color missingColor = color(default_value.x, default_value.y, 0.0);
|
||||
vector2 st = mx_transform_uv(texcoord);
|
||||
color rgb = texture(file.filename, st.x, st.y, "subimage", layer, "missingcolor", missingColor, "swrap", uaddressmode, "twrap", vaddressmode);
|
||||
out.x = rgb[0];
|
||||
out.y = rgb[1];
|
||||
}
|
||||
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
#include "lib/$fileTransformUv"
|
||||
|
||||
void mx_image_vector3(textureresource file, string layer, vector default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output vector out)
|
||||
{
|
||||
if (file.filename == "" ||
|
||||
(uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) ||
|
||||
(vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0)))
|
||||
{
|
||||
out = default_value;
|
||||
return;
|
||||
}
|
||||
|
||||
color missingColor = default_value;
|
||||
vector2 st = mx_transform_uv(texcoord);
|
||||
out = texture(file.filename, st.x, st.y, "subimage", layer, "missingcolor", missingColor, "swrap", uaddressmode, "twrap", vaddressmode);
|
||||
}
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
#include "lib/$fileTransformUv"
|
||||
|
||||
void mx_image_vector4(textureresource file, string layer, vector4 default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output vector4 out)
|
||||
{
|
||||
if (file.filename == "" ||
|
||||
(uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) ||
|
||||
(vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0)))
|
||||
{
|
||||
out = default_value;
|
||||
return;
|
||||
}
|
||||
|
||||
color missingColor = color(default_value.x, default_value.y, default_value.z);
|
||||
float missingAlpha = default_value.w;
|
||||
vector2 st = mx_transform_uv(texcoord);
|
||||
float alpha;
|
||||
color rgb = texture(file.filename, st.x, st.y, "alpha", alpha, "subimage", layer,
|
||||
"missingcolor", missingColor, "missingalpha", missingAlpha, "swrap", uaddressmode, "twrap", vaddressmode);
|
||||
|
||||
out = vector4(rgb[0], rgb[1], rgb[2], alpha);
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
void mx_luminance_color3(color in, color lumacoeffs, output color result)
|
||||
{
|
||||
result = dot(in, lumacoeffs);
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
void mx_luminance_color4(color4 in, color lumacoeffs, output color4 result)
|
||||
{
|
||||
result = color4(dot(in.rgb, lumacoeffs), in.a);
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
void mx_mix_surfaceshader(surfaceshader fg, surfaceshader bg, float w, output surfaceshader result)
|
||||
{
|
||||
result.bsdf = mix(bg.bsdf, fg.bsdf, w);
|
||||
result.edf = mix(bg.edf, fg.edf, w);
|
||||
result.opacity = mix(bg.opacity, fg.opacity, w);
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
void mx_noise2d_float(float amplitude, float pivot, vector2 texcoord, output float result)
|
||||
{
|
||||
float value = noise("snoise", texcoord.x, texcoord.y);
|
||||
result = value * amplitude + pivot;
|
||||
}
|
||||
Packaged/Windows/Engine/Binaries/ThirdParty/MaterialX/libraries/stdlib/genosl/mx_noise2d_vector2.osl
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
void mx_noise2d_vector2(vector2 amplitude, float pivot, vector2 texcoord, output vector2 result)
|
||||
{
|
||||
vector2 value = mx_noise("snoise", texcoord.x, texcoord.y);
|
||||
result = value * amplitude + pivot;
|
||||
}
|
||||
Packaged/Windows/Engine/Binaries/ThirdParty/MaterialX/libraries/stdlib/genosl/mx_noise2d_vector3.osl
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
void mx_noise2d_vector3(vector amplitude, float pivot, vector2 texcoord, output vector result)
|
||||
{
|
||||
vector value = noise("snoise", texcoord.x, texcoord.y);
|
||||
result = value * amplitude + pivot;
|
||||
}
|
||||
Packaged/Windows/Engine/Binaries/ThirdParty/MaterialX/libraries/stdlib/genosl/mx_noise2d_vector4.osl
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
void mx_noise2d_vector4(vector4 amplitude, float pivot, vector2 texcoord, output vector4 result)
|
||||
{
|
||||
vector4 value = mx_noise("snoise", texcoord.x, texcoord.y);
|
||||
result = value * amplitude + pivot;
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
void mx_noise3d_float(float amplitude, float pivot, vector position, output float result)
|
||||
{
|
||||
float value = noise("snoise", position);
|
||||
result = value * amplitude + pivot;
|
||||
}
|
||||
Packaged/Windows/Engine/Binaries/ThirdParty/MaterialX/libraries/stdlib/genosl/mx_noise3d_vector2.osl
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
void mx_noise3d_vector2(vector2 amplitude, float pivot, vector position, output vector2 result)
|
||||
{
|
||||
vector2 value = mx_noise("snoise", position);
|
||||
result = value * amplitude + pivot;
|
||||
}
|
||||
Packaged/Windows/Engine/Binaries/ThirdParty/MaterialX/libraries/stdlib/genosl/mx_noise3d_vector3.osl
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
void mx_noise3d_vector3(vector amplitude, float pivot, vector position, output vector result)
|
||||
{
|
||||
vector value = noise("snoise", position);
|
||||
result = value * amplitude + pivot;
|
||||
}
|
||||
Packaged/Windows/Engine/Binaries/ThirdParty/MaterialX/libraries/stdlib/genosl/mx_noise3d_vector4.osl
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
void mx_noise3d_vector4(vector4 amplitude, float pivot, vector position, output vector4 result)
|
||||
{
|
||||
vector4 value = mx_noise("snoise", position);
|
||||
result = value * amplitude + pivot;
|
||||
}
|
||||
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
void mx_normalmap_vector2(vector value, string map_space, vector2 normal_scale, vector N, vector U, output vector result)
|
||||
{
|
||||
// Tangent space
|
||||
if (map_space == "tangent")
|
||||
{
|
||||
vector v = value * 2.0 - 1.0;
|
||||
vector T = normalize(U - dot(U, N) * N);
|
||||
vector B = normalize(cross(N, T));
|
||||
result = normalize(T * v[0] * normal_scale.x + B * v[1] * normal_scale.y + N * v[2]);
|
||||
}
|
||||
// Object space
|
||||
else
|
||||
{
|
||||
vector n = value * 2.0 - 1.0;
|
||||
result = normalize(n);
|
||||
}
|
||||
}
|
||||
|
||||
void mx_normalmap_float(vector value, string map_space, float normal_scale, vector N, vector U, output vector result)
|
||||
{
|
||||
mx_normalmap_vector2(value, map_space, vector2(normal_scale, normal_scale), N, U, result);
|
||||
}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
void mx_premult_color4(color4 in, output color4 result)
|
||||
{
|
||||
result = color4(in.rgb * in.a, in.a);
|
||||
}
|
||||
Packaged/Windows/Engine/Binaries/ThirdParty/MaterialX/libraries/stdlib/genosl/mx_rgbtohsv_color3.osl
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
void mx_rgbtohsv_color3(vector _in, output vector result)
|
||||
{
|
||||
result = transformc("rgb","hsv", _in);
|
||||
}
|
||||
Packaged/Windows/Engine/Binaries/ThirdParty/MaterialX/libraries/stdlib/genosl/mx_rgbtohsv_color4.osl
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
void mx_rgbtohsv_color4(color4 _in, output color4 result)
|
||||
{
|
||||
result = color4(transformc("rgb","hsv", _in.rgb), 1.0);
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
void mx_rotate_vector2(vector2 _in, float amount, output vector2 result)
|
||||
{
|
||||
float rotationRadians = radians(amount);
|
||||
float sa = sin(rotationRadians);
|
||||
float ca = cos(rotationRadians);
|
||||
result = vector2(ca*_in.x + sa*_in.y, -sa*_in.x + ca*_in.y);
|
||||
}
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
matrix rotationMatrix(vector axis, float angle)
|
||||
{
|
||||
vector nAxis = normalize(axis);
|
||||
float s = sin(angle);
|
||||
float c = cos(angle);
|
||||
float oc = 1.0 - c;
|
||||
|
||||
return matrix(oc * nAxis[0] * nAxis[0] + c, oc * nAxis[0] * nAxis[1] - nAxis[2] * s, oc * nAxis[2] * nAxis[0] + nAxis[1] * s, 0.0,
|
||||
oc * nAxis[0] * nAxis[1] + nAxis[2] * s, oc * nAxis[1] * nAxis[1] + c, oc * nAxis[1] * nAxis[2] - nAxis[0] * s, 0.0,
|
||||
oc * nAxis[2] * nAxis[0] - nAxis[1] * s, oc * nAxis[1] * nAxis[2] + nAxis[0] * s, oc * nAxis[2] * nAxis[2] + c, 0.0,
|
||||
0.0, 0.0, 0.0, 1.0);
|
||||
}
|
||||
|
||||
void mx_rotate_vector3(vector _in, float amount, vector axis, output vector result)
|
||||
{
|
||||
float rotationRadians = radians(amount);
|
||||
matrix m = rotationMatrix(axis, rotationRadians);
|
||||
vector4 trans = transform(m, vector4(_in[0], _in[1], _in[2], 1.0));
|
||||
result = vector(trans.x, trans.y, trans.z);
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
void mx_surface_unlit(float emission_weight, color emission_color, float transmission_weight, color transmission_color, float opacity, output surfaceshader result)
|
||||
{
|
||||
float trans = clamp(transmission_weight, 0.0, 1.0);
|
||||
result.bsdf = trans * transmission_color * transparent();
|
||||
result.edf = (1.0 - trans) * emission_weight * emission_color * emission();
|
||||
result.opacity = clamp(opacity, 0.0, 1.0);
|
||||
}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
void mx_time_float(float fps, output float result)
|
||||
{
|
||||
float frame;
|
||||
getattribute("frame", frame);
|
||||
result = frame / fps;
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
void mx_transformmatrix_vector2M3(vector2 val, matrix m, output vector2 result)
|
||||
{
|
||||
point res = transform(m, point(val.x, val.y, 1.0));
|
||||
result.x = res[0];
|
||||
result.y = res[1];
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
void mx_unpremult_color4(color4 in, output color4 result)
|
||||
{
|
||||
result = color4(in.rgb / in.a, in.a);
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
void mx_worleynoise2d_float(vector2 texcoord, float jitter, output float result)
|
||||
{
|
||||
result = mx_worley_noise_float(texcoord, jitter, 0);
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
void mx_worleynoise2d_vector2(vector2 texcoord, float jitter, output vector2 result)
|
||||
{
|
||||
result = mx_worley_noise_vector2(texcoord, jitter, 0);
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
void mx_worleynoise2d_vector3(vector2 texcoord, float jitter, output vector result)
|
||||
{
|
||||
result = mx_worley_noise_vector3(texcoord, jitter, 0);
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
void mx_worleynoise3d_float(vector position, float jitter, output float result)
|
||||
{
|
||||
result = mx_worley_noise_float(position, jitter, 0);
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
void mx_worleynoise3d_vector2(vector position, float jitter, output vector2 result)
|
||||
{
|
||||
result = mx_worley_noise_vector2(position, jitter, 0);
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
void mx_worleynoise3d_vector3(vector position, float jitter, output vector result)
|
||||
{
|
||||
result = mx_worley_noise_vector3(position, jitter, 0);
|
||||
}
|
||||
+777
@@ -0,0 +1,777 @@
|
||||
<?xml version="1.0"?>
|
||||
<materialx version="1.38">
|
||||
<!--
|
||||
Copyright Contributors to the MaterialX Project
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
Declarations for OSL implementations of standard nodes included in the MaterialX specification.
|
||||
-->
|
||||
|
||||
<!-- ======================================================================== -->
|
||||
<!-- Shader nodes -->
|
||||
<!-- ======================================================================== -->
|
||||
|
||||
<!-- <surfacematerial> -->
|
||||
<implementation name="IM_surfacematerial_genosl" nodedef="ND_surfacematerial" target="genosl" />
|
||||
|
||||
<!-- <surface_unlit> -->
|
||||
<implementation name="IM_surface_unlit_genosl" nodedef="ND_surface_unlit" file="mx_surface_unlit.osl" function="mx_surface_unlit" target="genosl" />
|
||||
|
||||
<!-- ======================================================================== -->
|
||||
<!-- Texture nodes -->
|
||||
<!-- ======================================================================== -->
|
||||
|
||||
<!-- <image> -->
|
||||
<implementation name="IM_image_float_genosl" nodedef="ND_image_float" file="mx_image_float.osl" function="mx_image_float" target="genosl">
|
||||
<input name="default" type="float" implname="default_value" />
|
||||
</implementation>
|
||||
<implementation name="IM_image_color3_genosl" nodedef="ND_image_color3" file="mx_image_color3.osl" function="mx_image_color3" target="genosl">
|
||||
<input name="default" type="color3" implname="default_value" />
|
||||
</implementation>
|
||||
<implementation name="IM_image_color4_genosl" nodedef="ND_image_color4" file="mx_image_color4.osl" function="mx_image_color4" target="genosl">
|
||||
<input name="default" type="color4" implname="default_value" />
|
||||
</implementation>
|
||||
<implementation name="IM_image_vector2_genosl" nodedef="ND_image_vector2" file="mx_image_vector2.osl" function="mx_image_vector2" target="genosl">
|
||||
<input name="default" type="vector2" implname="default_value" />
|
||||
</implementation>
|
||||
<implementation name="IM_image_vector3_genosl" nodedef="ND_image_vector3" file="mx_image_vector3.osl" function="mx_image_vector3" target="genosl">
|
||||
<input name="default" type="vector3" implname="default_value" />
|
||||
</implementation>
|
||||
<implementation name="IM_image_vector4_genosl" nodedef="ND_image_vector4" file="mx_image_vector4.osl" function="mx_image_vector4" target="genosl">
|
||||
<input name="default" type="vector4" implname="default_value" />
|
||||
</implementation>
|
||||
|
||||
<!-- <triplanarprojection> -->
|
||||
|
||||
<!-- <normalmap> -->
|
||||
<implementation name="IM_normalmap_float_genosl" nodedef="ND_normalmap" file="mx_normalmap.osl" function="mx_normalmap_float" target="genosl" />
|
||||
<implementation name="IM_normalmap_vector2_genosl" nodedef="ND_normalmap_vector2" file="mx_normalmap.osl" function="mx_normalmap_vector2" target="genosl" />
|
||||
|
||||
<!-- ======================================================================== -->
|
||||
<!-- Procedural nodes -->
|
||||
<!-- ======================================================================== -->
|
||||
|
||||
<!-- <constant> -->
|
||||
<implementation name="IM_constant_float_genosl" nodedef="ND_constant_float" target="genosl" sourcecode="{{value}}" />
|
||||
<implementation name="IM_constant_color3_genosl" nodedef="ND_constant_color3" target="genosl" sourcecode="{{value}}" />
|
||||
<implementation name="IM_constant_color4_genosl" nodedef="ND_constant_color4" target="genosl" sourcecode="{{value}}" />
|
||||
<implementation name="IM_constant_vector2_genosl" nodedef="ND_constant_vector2" target="genosl" sourcecode="{{value}}" />
|
||||
<implementation name="IM_constant_vector3_genosl" nodedef="ND_constant_vector3" target="genosl" sourcecode="{{value}}" />
|
||||
<implementation name="IM_constant_vector4_genosl" nodedef="ND_constant_vector4" target="genosl" sourcecode="{{value}}" />
|
||||
<implementation name="IM_constant_boolean_genosl" nodedef="ND_constant_boolean" target="genosl" sourcecode="{{value}}" />
|
||||
<implementation name="IM_constant_integer_genosl" nodedef="ND_constant_integer" target="genosl" sourcecode="{{value}}" />
|
||||
<implementation name="IM_constant_matrix33_genosl" nodedef="ND_constant_matrix33" target="genosl" sourcecode="{{value}}" />
|
||||
<implementation name="IM_constant_matrix44_genosl" nodedef="ND_constant_matrix44" target="genosl" sourcecode="{{value}}" />
|
||||
<implementation name="IM_constant_string_genosl" nodedef="ND_constant_string" target="genosl" sourcecode="{{value}}" />
|
||||
<implementation name="IM_constant_filename_genosl" nodedef="ND_constant_filename" target="genosl" sourcecode="{{value}}" />
|
||||
|
||||
<!-- <ramplr> -->
|
||||
<implementation name="IM_ramplr_float_genosl" nodedef="ND_ramplr_float" target="genosl" sourcecode="mix({{valuel}}, {{valuer}}, clamp({{texcoord}}.x, 0, 1))" />
|
||||
<implementation name="IM_ramplr_color3_genosl" nodedef="ND_ramplr_color3" target="genosl" sourcecode="mix({{valuel}}, {{valuer}}, clamp({{texcoord}}.x, 0, 1))" />
|
||||
<implementation name="IM_ramplr_color4_genosl" nodedef="ND_ramplr_color4" target="genosl" sourcecode="mix({{valuel}}, {{valuer}}, clamp({{texcoord}}.x, 0, 1))" />
|
||||
<implementation name="IM_ramplr_vector2_genosl" nodedef="ND_ramplr_vector2" target="genosl" sourcecode="mix({{valuel}}, {{valuer}}, clamp({{texcoord}}.x, 0, 1))" />
|
||||
<implementation name="IM_ramplr_vector3_genosl" nodedef="ND_ramplr_vector3" target="genosl" sourcecode="mix({{valuel}}, {{valuer}}, clamp({{texcoord}}.x, 0, 1))" />
|
||||
<implementation name="IM_ramplr_vector4_genosl" nodedef="ND_ramplr_vector4" target="genosl" sourcecode="mix({{valuel}}, {{valuer}}, clamp({{texcoord}}.x, 0, 1))" />
|
||||
|
||||
<!-- <ramptb> -->
|
||||
<implementation name="IM_ramptb_float_genosl" nodedef="ND_ramptb_float" target="genosl" sourcecode="mix({{valuet}}, {{valueb}}, clamp({{texcoord}}.y, 0, 1))" />
|
||||
<implementation name="IM_ramptb_color3_genosl" nodedef="ND_ramptb_color3" target="genosl" sourcecode="mix({{valuet}}, {{valueb}}, clamp({{texcoord}}.y, 0, 1))" />
|
||||
<implementation name="IM_ramptb_color4_genosl" nodedef="ND_ramptb_color4" target="genosl" sourcecode="mix({{valuet}}, {{valueb}}, clamp({{texcoord}}.y, 0, 1))" />
|
||||
<implementation name="IM_ramptb_vector2_genosl" nodedef="ND_ramptb_vector2" target="genosl" sourcecode="mix({{valuet}}, {{valueb}}, clamp({{texcoord}}.y, 0, 1))" />
|
||||
<implementation name="IM_ramptb_vector3_genosl" nodedef="ND_ramptb_vector3" target="genosl" sourcecode="mix({{valuet}}, {{valueb}}, clamp({{texcoord}}.y, 0, 1))" />
|
||||
<implementation name="IM_ramptb_vector4_genosl" nodedef="ND_ramptb_vector4" target="genosl" sourcecode="mix({{valuet}}, {{valueb}}, clamp({{texcoord}}.y, 0, 1))" />
|
||||
|
||||
<!-- <splitlr> -->
|
||||
<implementation name="IM_splitlr_float_genosl" nodedef="ND_splitlr_float" target="genosl" sourcecode="mix({{valuel}}, {{valuer}}, aastep({{center}}, {{texcoord}}.x))" />
|
||||
<implementation name="IM_splitlr_color3_genosl" nodedef="ND_splitlr_color3" target="genosl" sourcecode="mix({{valuel}}, {{valuer}}, aastep({{center}}, {{texcoord}}.x))" />
|
||||
<implementation name="IM_splitlr_color4_genosl" nodedef="ND_splitlr_color4" target="genosl" sourcecode="mix({{valuel}}, {{valuer}}, aastep({{center}}, {{texcoord}}.x))" />
|
||||
<implementation name="IM_splitlr_vector2_genosl" nodedef="ND_splitlr_vector2" target="genosl" sourcecode="mix({{valuel}}, {{valuer}}, aastep({{center}}, {{texcoord}}.x))" />
|
||||
<implementation name="IM_splitlr_vector3_genosl" nodedef="ND_splitlr_vector3" target="genosl" sourcecode="mix({{valuel}}, {{valuer}}, aastep({{center}}, {{texcoord}}.x))" />
|
||||
<implementation name="IM_splitlr_vector4_genosl" nodedef="ND_splitlr_vector4" target="genosl" sourcecode="mix({{valuel}}, {{valuer}}, aastep({{center}}, {{texcoord}}.x))" />
|
||||
|
||||
<!-- <splittb> -->
|
||||
<implementation name="IM_splittb_float_genosl" nodedef="ND_splittb_float" target="genosl" sourcecode="mix({{valuet}}, {{valueb}}, aastep({{center}}, {{texcoord}}.y))" />
|
||||
<implementation name="IM_splittb_color3_genosl" nodedef="ND_splittb_color3" target="genosl" sourcecode="mix({{valuet}}, {{valueb}}, aastep({{center}}, {{texcoord}}.y))" />
|
||||
<implementation name="IM_splittb_color4_genosl" nodedef="ND_splittb_color4" target="genosl" sourcecode="mix({{valuet}}, {{valueb}}, aastep({{center}}, {{texcoord}}.y))" />
|
||||
<implementation name="IM_splittb_vector2_genosl" nodedef="ND_splittb_vector2" target="genosl" sourcecode="mix({{valuet}}, {{valueb}}, aastep({{center}}, {{texcoord}}.y))" />
|
||||
<implementation name="IM_splittb_vector3_genosl" nodedef="ND_splittb_vector3" target="genosl" sourcecode="mix({{valuet}}, {{valueb}}, aastep({{center}}, {{texcoord}}.y))" />
|
||||
<implementation name="IM_splittb_vector4_genosl" nodedef="ND_splittb_vector4" target="genosl" sourcecode="mix({{valuet}}, {{valueb}}, aastep({{center}}, {{texcoord}}.y))" />
|
||||
|
||||
<!-- <noise2d> -->
|
||||
<implementation name="IM_noise2d_float_genosl" nodedef="ND_noise2d_float" file="mx_noise2d_float.osl" function="mx_noise2d_float" target="genosl" />
|
||||
<implementation name="IM_noise2d_vector2_genosl" nodedef="ND_noise2d_vector2" file="mx_noise2d_vector2.osl" function="mx_noise2d_vector2" target="genosl" />
|
||||
<implementation name="IM_noise2d_vector3_genosl" nodedef="ND_noise2d_vector3" file="mx_noise2d_vector3.osl" function="mx_noise2d_vector3" target="genosl" />
|
||||
<implementation name="IM_noise2d_vector4_genosl" nodedef="ND_noise2d_vector4" file="mx_noise2d_vector4.osl" function="mx_noise2d_vector4" target="genosl" />
|
||||
|
||||
<!-- <noise3d> -->
|
||||
<implementation name="IM_noise3d_float_genosl" nodedef="ND_noise3d_float" file="mx_noise3d_float.osl" function="mx_noise3d_float" target="genosl" />
|
||||
<implementation name="IM_noise3d_vector2_genosl" nodedef="ND_noise3d_vector2" file="mx_noise3d_vector2.osl" function="mx_noise3d_vector2" target="genosl" />
|
||||
<implementation name="IM_noise3d_vector3_genosl" nodedef="ND_noise3d_vector3" file="mx_noise3d_vector3.osl" function="mx_noise3d_vector3" target="genosl" />
|
||||
<implementation name="IM_noise3d_vector4_genosl" nodedef="ND_noise3d_vector4" file="mx_noise3d_vector4.osl" function="mx_noise3d_vector4" target="genosl" />
|
||||
|
||||
<!-- <fractal3d> -->
|
||||
<implementation name="IM_fractal3d_float_genosl" nodedef="ND_fractal3d_float" file="mx_fractal3d_float.osl" function="mx_fractal3d_float" target="genosl" />
|
||||
<implementation name="IM_fractal3d_vector2_genosl" nodedef="ND_fractal3d_vector2" file="mx_fractal3d_vector2.osl" function="mx_fractal3d_vector2" target="genosl" />
|
||||
<implementation name="IM_fractal3d_vector3_genosl" nodedef="ND_fractal3d_vector3" file="mx_fractal3d_vector3.osl" function="mx_fractal3d_vector3" target="genosl" />
|
||||
<implementation name="IM_fractal3d_vector4_genosl" nodedef="ND_fractal3d_vector4" file="mx_fractal3d_vector4.osl" function="mx_fractal3d_vector4" target="genosl" />
|
||||
|
||||
<!-- <cellnoise2d> -->
|
||||
<implementation name="IM_cellnoise2d_float_genosl" nodedef="ND_cellnoise2d_float" file="mx_cellnoise2d_float.osl" function="mx_cellnoise2d_float" target="genosl" />
|
||||
|
||||
<!-- <cellnoise3d> -->
|
||||
<implementation name="IM_cellnoise3d_float_genosl" nodedef="ND_cellnoise3d_float" file="mx_cellnoise3d_float.osl" function="mx_cellnoise3d_float" target="genosl" />
|
||||
|
||||
<!-- <worleynoise2d> -->
|
||||
<implementation name="IM_worleynoise2d_float_genosl" nodedef="ND_worleynoise2d_float" file="mx_worleynoise2d_float.osl" function="mx_worleynoise2d_float" target="genosl" />
|
||||
<implementation name="IM_worleynoise2d_vector2_genosl" nodedef="ND_worleynoise2d_vector2" file="mx_worleynoise2d_vector2.osl" function="mx_worleynoise2d_vector2" target="genosl" />
|
||||
<implementation name="IM_worleynoise2d_vector3_genosl" nodedef="ND_worleynoise2d_vector3" file="mx_worleynoise2d_vector3.osl" function="mx_worleynoise2d_vector3" target="genosl" />
|
||||
|
||||
<!-- <worleynoise3d> -->
|
||||
<implementation name="IM_worleynoise3d_float_genosl" nodedef="ND_worleynoise3d_float" file="mx_worleynoise3d_float.osl" function="mx_worleynoise3d_float" target="genosl" />
|
||||
<implementation name="IM_worleynoise3d_vector2_genosl" nodedef="ND_worleynoise3d_vector2" file="mx_worleynoise3d_vector2.osl" function="mx_worleynoise3d_vector2" target="genosl" />
|
||||
<implementation name="IM_worleynoise3d_vector3_genosl" nodedef="ND_worleynoise3d_vector3" file="mx_worleynoise3d_vector3.osl" function="mx_worleynoise3d_vector3" target="genosl" />
|
||||
|
||||
<!-- ======================================================================== -->
|
||||
<!-- Global nodes -->
|
||||
<!-- ======================================================================== -->
|
||||
|
||||
<!-- <ambientocclusion> -->
|
||||
<implementation name="IM_ambientocclusion_float_genosl" nodedef="ND_ambientocclusion_float" file="mx_ambientocclusion_float.osl" function="mx_ambientocclusion_float" target="genosl" />
|
||||
|
||||
<!-- ======================================================================== -->
|
||||
<!-- Geometric nodes -->
|
||||
<!-- ======================================================================== -->
|
||||
|
||||
<!-- <position> -->
|
||||
<implementation name="IM_position_vector3_genosl" nodedef="ND_position_vector3" target="genosl" sourcecode="transform({{space}}, P)" />
|
||||
|
||||
<!-- <normal> -->
|
||||
<implementation name="IM_normal_vector3_genosl" nodedef="ND_normal_vector3" target="genosl" sourcecode="transform({{space}}, N)" />
|
||||
|
||||
<!-- <tangent> -->
|
||||
<implementation name="IM_tangent_vector3_genosl" nodedef="ND_tangent_vector3" target="genosl" sourcecode="transform({{space}}, normalize(dPdu))" />
|
||||
|
||||
<!-- <bitangent> -->
|
||||
<implementation name="IM_bitangent_vector3_genosl" nodedef="ND_bitangent_vector3" target="genosl" sourcecode="transform({{space}}, normalize(dPdv))" />
|
||||
|
||||
<!-- <texcoord> -->
|
||||
<implementation name="IM_texcoord_vector2_genosl" nodedef="ND_texcoord_vector2" target="genosl" sourcecode="vector2(u,v)" />
|
||||
<implementation name="IM_texcoord_vector3_genosl" nodedef="ND_texcoord_vector3" target="genosl" sourcecode="vector(u,v,0)" />
|
||||
|
||||
<!-- <geomcolor> -->
|
||||
<implementation name="IM_geomcolor_float_genosl" nodedef="ND_geomcolor_float" file="mx_geomcolor_float.osl" function="mx_geomcolor_float" target="genosl" />
|
||||
<implementation name="IM_geomcolor_color3_genosl" nodedef="ND_geomcolor_color3" file="mx_geomcolor_color3.osl" function="mx_geomcolor_color3" target="genosl" />
|
||||
<implementation name="IM_geomcolor_color4_genosl" nodedef="ND_geomcolor_color4" file="mx_geomcolor_color4.osl" function="mx_geomcolor_color4" target="genosl" />
|
||||
|
||||
<!-- <geompropvalue> -->
|
||||
<implementation name="IM_geompropvalue_integer_genosl" nodedef="ND_geompropvalue_integer" file="mx_geompropvalue_integer.osl" function="mx_geompropvalue_integer" target="genosl" />
|
||||
<implementation name="IM_geompropvalue_boolean_genosl" nodedef="ND_geompropvalue_boolean" file="mx_geompropvalue_boolean.osl" function="mx_geompropvalue_boolean" target="genosl" />
|
||||
<implementation name="IM_geompropvalue_string_genosl" nodedef="ND_geompropvalue_string" file="mx_geompropvalue_string.osl" function="mx_geompropvalue_string" target="genosl" />
|
||||
<implementation name="IM_geompropvalue_float_genosl" nodedef="ND_geompropvalue_float" file="mx_geompropvalue_float.osl" function="mx_geompropvalue_float" target="genosl" />
|
||||
<implementation name="IM_geompropvalue_color3_genosl" nodedef="ND_geompropvalue_color3" file="mx_geompropvalue_color3.osl" function="mx_geompropvalue_color" target="genosl" />
|
||||
<implementation name="IM_geompropvalue_color4_genosl" nodedef="ND_geompropvalue_color4" file="mx_geompropvalue_color4.osl" function="mx_geompropvalue_color4" target="genosl" />
|
||||
<implementation name="IM_geompropvalue_vector2_genosl" nodedef="ND_geompropvalue_vector2" file="mx_geompropvalue_vector2.osl" function="mx_geompropvalue_vector2" target="genosl" />
|
||||
<implementation name="IM_geompropvalue_vector3_genosl" nodedef="ND_geompropvalue_vector3" file="mx_geompropvalue_vector3.osl" function="mx_geompropvalue_vector" target="genosl" />
|
||||
<implementation name="IM_geompropvalue_vector4_genosl" nodedef="ND_geompropvalue_vector4" file="mx_geompropvalue_vector4.osl" function="mx_geompropvalue_vector4" target="genosl" />
|
||||
|
||||
<!-- ======================================================================== -->
|
||||
<!-- Application nodes -->
|
||||
<!-- ======================================================================== -->
|
||||
|
||||
<!-- <frame> -->
|
||||
<implementation name="IM_frame_float_genosl" nodedef="ND_frame_float" file="mx_frame_float.osl" function="mx_frame_float" target="genosl" />
|
||||
|
||||
<!-- <time> -->
|
||||
<implementation name="IM_time_float_genosl" nodedef="ND_time_float" file="mx_time_float.osl" function="mx_time_float" target="genosl" />
|
||||
|
||||
<!-- ======================================================================== -->
|
||||
<!-- Math nodes -->
|
||||
<!-- ======================================================================== -->
|
||||
|
||||
<!-- <add> -->
|
||||
<implementation name="IM_add_float_genosl" nodedef="ND_add_float" target="genosl" sourcecode="{{in1}} + {{in2}}" />
|
||||
<implementation name="IM_add_color3_genosl" nodedef="ND_add_color3" target="genosl" sourcecode="{{in1}} + {{in2}}" />
|
||||
<implementation name="IM_add_color3FA_genosl" nodedef="ND_add_color3FA" target="genosl" sourcecode="{{in1}} + {{in2}}" />
|
||||
<implementation name="IM_add_color4_genosl" nodedef="ND_add_color4" target="genosl" sourcecode="{{in1}} + {{in2}}" />
|
||||
<implementation name="IM_add_color4FA_genosl" nodedef="ND_add_color4FA" target="genosl" sourcecode="{{in1}} + {{in2}}" />
|
||||
<implementation name="IM_add_vector2_genosl" nodedef="ND_add_vector2" target="genosl" sourcecode="{{in1}} + {{in2}}" />
|
||||
<implementation name="IM_add_vector2FA_genosl" nodedef="ND_add_vector2FA" target="genosl" sourcecode="{{in1}} + {{in2}}" />
|
||||
<implementation name="IM_add_vector3_genosl" nodedef="ND_add_vector3" target="genosl" sourcecode="{{in1}} + {{in2}}" />
|
||||
<implementation name="IM_add_vector3FA_genosl" nodedef="ND_add_vector3FA" target="genosl" sourcecode="{{in1}} + {{in2}}" />
|
||||
<implementation name="IM_add_vector4_genosl" nodedef="ND_add_vector4" target="genosl" sourcecode="{{in1}} + {{in2}}" />
|
||||
<implementation name="IM_add_vector4FA_genosl" nodedef="ND_add_vector4FA" target="genosl" sourcecode="{{in1}} + {{in2}}" />
|
||||
<implementation name="IM_add_matrix33_genosl" nodedef="ND_add_matrix33" sourcecode="mx_add({{in1}}, {{in2}})" target="genosl" />
|
||||
<implementation name="IM_add_matrix33FA_genosl" nodedef="ND_add_matrix33FA" sourcecode="mx_add({{in1}}, {{in2}})" target="genosl" />
|
||||
<implementation name="IM_add_matrix44_genosl" nodedef="ND_add_matrix44" sourcecode="mx_add({{in1}}, {{in2}})" target="genosl" />
|
||||
<implementation name="IM_add_matrix44FA_genosl" nodedef="ND_add_matrix44FA" sourcecode="mx_add({{in1}}, {{in2}})" target="genosl" />
|
||||
|
||||
<!-- <subtract> -->
|
||||
<implementation name="IM_subtract_float_genosl" nodedef="ND_subtract_float" target="genosl" sourcecode="{{in1}} - {{in2}}" />
|
||||
<implementation name="IM_subtract_color3_genosl" nodedef="ND_subtract_color3" target="genosl" sourcecode="{{in1}} - {{in2}}" />
|
||||
<implementation name="IM_subtract_color3FA_genosl" nodedef="ND_subtract_color3FA" target="genosl" sourcecode="{{in1}} - {{in2}}" />
|
||||
<implementation name="IM_subtract_color4_genosl" nodedef="ND_subtract_color4" target="genosl" sourcecode="{{in1}} - {{in2}}" />
|
||||
<implementation name="IM_subtract_color4FA_genosl" nodedef="ND_subtract_color4FA" target="genosl" sourcecode="{{in1}} - {{in2}}" />
|
||||
<implementation name="IM_subtract_vector2_genosl" nodedef="ND_subtract_vector2" target="genosl" sourcecode="{{in1}} - {{in2}}" />
|
||||
<implementation name="IM_subtract_vector2FA_genosl" nodedef="ND_subtract_vector2FA" target="genosl" sourcecode="{{in1}} - {{in2}}" />
|
||||
<implementation name="IM_subtract_vector3_genosl" nodedef="ND_subtract_vector3" target="genosl" sourcecode="{{in1}} - {{in2}}" />
|
||||
<implementation name="IM_subtract_vector3FA_genosl" nodedef="ND_subtract_vector3FA" target="genosl" sourcecode="{{in1}} - {{in2}}" />
|
||||
<implementation name="IM_subtract_vector4_genosl" nodedef="ND_subtract_vector4" target="genosl" sourcecode="{{in1}} - {{in2}}" />
|
||||
<implementation name="IM_subtract_vector4FA_genosl" nodedef="ND_subtract_vector4FA" target="genosl" sourcecode="{{in1}} - {{in2}}" />
|
||||
<implementation name="IM_subtract_matrix33_genosl" nodedef="ND_subtract_matrix33" sourcecode="mx_subtract({{in1}}, {{in2}})" target="genosl" />
|
||||
<implementation name="IM_subtract_matrix33FA_genosl" nodedef="ND_subtract_matrix33FA" sourcecode="mx_subtract({{in1}}, {{in2}})" target="genosl" />
|
||||
<implementation name="IM_subtract_matrix44_genosl" nodedef="ND_subtract_matrix44" sourcecode="mx_subtract({{in1}}, {{in2}})" target="genosl" />
|
||||
<implementation name="IM_subtract_matrix44FA_genosl" nodedef="ND_subtract_matrix44FA" sourcecode="mx_subtract({{in1}}, {{in2}})" target="genosl" />
|
||||
|
||||
<!-- <multiply> -->
|
||||
<implementation name="IM_multiply_float_genosl" nodedef="ND_multiply_float" target="genosl" sourcecode="{{in1}} * {{in2}}" />
|
||||
<implementation name="IM_multiply_color3_genosl" nodedef="ND_multiply_color3" target="genosl" sourcecode="{{in1}} * {{in2}}" />
|
||||
<implementation name="IM_multiply_color3FA_genosl" nodedef="ND_multiply_color3FA" target="genosl" sourcecode="{{in1}} * {{in2}}" />
|
||||
<implementation name="IM_multiply_color4_genosl" nodedef="ND_multiply_color4" target="genosl" sourcecode="{{in1}} * {{in2}}" />
|
||||
<implementation name="IM_multiply_color4FA_genosl" nodedef="ND_multiply_color4FA" target="genosl" sourcecode="{{in1}} * {{in2}}" />
|
||||
<implementation name="IM_multiply_vector2_genosl" nodedef="ND_multiply_vector2" target="genosl" sourcecode="{{in1}} * {{in2}}" />
|
||||
<implementation name="IM_multiply_vector2FA_genosl" nodedef="ND_multiply_vector2FA" target="genosl" sourcecode="{{in1}} * {{in2}}" />
|
||||
<implementation name="IM_multiply_vector3_genosl" nodedef="ND_multiply_vector3" target="genosl" sourcecode="{{in1}} * {{in2}}" />
|
||||
<implementation name="IM_multiply_vector3FA_genosl" nodedef="ND_multiply_vector3FA" target="genosl" sourcecode="{{in1}} * {{in2}}" />
|
||||
<implementation name="IM_multiply_vector4_genosl" nodedef="ND_multiply_vector4" target="genosl" sourcecode="{{in1}} * {{in2}}" />
|
||||
<implementation name="IM_multiply_vector4FA_genosl" nodedef="ND_multiply_vector4FA" target="genosl" sourcecode="{{in1}} * {{in2}}" />
|
||||
<implementation name="IM_multiply_matrix33_genosl" nodedef="ND_multiply_matrix33" target="genosl" sourcecode="{{in1}} * {{in2}}" />
|
||||
<implementation name="IM_multiply_matrix44_genosl" nodedef="ND_multiply_matrix44" target="genosl" sourcecode="{{in1}} * {{in2}}" />
|
||||
|
||||
<!-- <divide> -->
|
||||
<implementation name="IM_divide_float_genosl" nodedef="ND_divide_float" target="genosl" sourcecode="{{in1}} / {{in2}}" />
|
||||
<implementation name="IM_divide_color3_genosl" nodedef="ND_divide_color3" target="genosl" sourcecode="{{in1}} / {{in2}}" />
|
||||
<implementation name="IM_divide_color3FA_genosl" nodedef="ND_divide_color3FA" target="genosl" sourcecode="{{in1}} / {{in2}}" />
|
||||
<implementation name="IM_divide_color4_genosl" nodedef="ND_divide_color4" target="genosl" sourcecode="{{in1}} / {{in2}}" />
|
||||
<implementation name="IM_divide_color4FA_genosl" nodedef="ND_divide_color4FA" target="genosl" sourcecode="{{in1}} / {{in2}}" />
|
||||
<implementation name="IM_divide_vector2_genosl" nodedef="ND_divide_vector2" target="genosl" sourcecode="{{in1}} / {{in2}}" />
|
||||
<implementation name="IM_divide_vector2FA_genosl" nodedef="ND_divide_vector2FA" target="genosl" sourcecode="{{in1}} / {{in2}}" />
|
||||
<implementation name="IM_divide_vector3_genosl" nodedef="ND_divide_vector3" target="genosl" sourcecode="{{in1}} / {{in2}}" />
|
||||
<implementation name="IM_divide_vector3FA_genosl" nodedef="ND_divide_vector3FA" target="genosl" sourcecode="{{in1}} / {{in2}}" />
|
||||
<implementation name="IM_divide_vector4_genosl" nodedef="ND_divide_vector4" target="genosl" sourcecode="{{in1}} / {{in2}}" />
|
||||
<implementation name="IM_divide_vector4FA_genosl" nodedef="ND_divide_vector4FA" target="genosl" sourcecode="{{in1}} / {{in2}}" />
|
||||
<implementation name="IM_divide_matrix33_genosl" nodedef="ND_divide_matrix33" target="genosl" sourcecode="{{in1}} / {{in2}}" />
|
||||
<implementation name="IM_divide_matrix44_genosl" nodedef="ND_divide_matrix44" target="genosl" sourcecode="{{in1}} / {{in2}}" />
|
||||
|
||||
<!-- <modulo> -->
|
||||
<implementation name="IM_modulo_float_genosl" nodedef="ND_modulo_float" target="genosl" sourcecode="mod({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_modulo_color3_genosl" nodedef="ND_modulo_color3" target="genosl" sourcecode="mod({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_modulo_color3FA_genosl" nodedef="ND_modulo_color3FA" target="genosl" sourcecode="mod({{in1}}, color({{in2}},{{in2}},{{in2}}))" />
|
||||
<implementation name="IM_modulo_color4_genosl" nodedef="ND_modulo_color4" target="genosl" sourcecode="mod({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_modulo_color4FA_genosl" nodedef="ND_modulo_color4FA" target="genosl" sourcecode="mod({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_modulo_vector2_genosl" nodedef="ND_modulo_vector2" target="genosl" sourcecode="mod({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_modulo_vector2FA_genosl" nodedef="ND_modulo_vector2FA" target="genosl" sourcecode="mod({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_modulo_vector3_genosl" nodedef="ND_modulo_vector3" target="genosl" sourcecode="mod({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_modulo_vector3FA_genosl" nodedef="ND_modulo_vector3FA" target="genosl" sourcecode="mod({{in1}}, vector({{in2}},{{in2}},{{in2}}))" />
|
||||
<implementation name="IM_modulo_vector4_genosl" nodedef="ND_modulo_vector4" target="genosl" sourcecode="mod({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_modulo_vector4FA_genosl" nodedef="ND_modulo_vector4FA" target="genosl" sourcecode="mod({{in1}}, {{in2}})" />
|
||||
|
||||
<!-- <invert> -->
|
||||
<implementation name="IM_invert_float_genosl" nodedef="ND_invert_float" target="genosl" sourcecode="{{amount}} - {{in}}" />
|
||||
<implementation name="IM_invert_color3_genosl" nodedef="ND_invert_color3" target="genosl" sourcecode="{{amount}} - {{in}}" />
|
||||
<implementation name="IM_invert_color3FA_genosl" nodedef="ND_invert_color3FA" target="genosl" sourcecode="{{amount}} - {{in}}" />
|
||||
<implementation name="IM_invert_color4_genosl" nodedef="ND_invert_color4" target="genosl" sourcecode="{{amount}} - {{in}}" />
|
||||
<implementation name="IM_invert_color4FA_genosl" nodedef="ND_invert_color4FA" target="genosl" sourcecode="{{amount}} - {{in}}" />
|
||||
<implementation name="IM_invert_vector2_genosl" nodedef="ND_invert_vector2" target="genosl" sourcecode="{{amount}} - {{in}}" />
|
||||
<implementation name="IM_invert_vector2FA_genosl" nodedef="ND_invert_vector2FA" target="genosl" sourcecode="{{amount}} - {{in}}" />
|
||||
<implementation name="IM_invert_vector3_genosl" nodedef="ND_invert_vector3" target="genosl" sourcecode="{{amount}} - {{in}}" />
|
||||
<implementation name="IM_invert_vector3FA_genosl" nodedef="ND_invert_vector3FA" target="genosl" sourcecode="{{amount}} - {{in}}" />
|
||||
<implementation name="IM_invert_vector4_genosl" nodedef="ND_invert_vector4" target="genosl" sourcecode="{{amount}} - {{in}}" />
|
||||
<implementation name="IM_invert_vector4FA_genosl" nodedef="ND_invert_vector4FA" target="genosl" sourcecode="{{amount}} - {{in}}" />
|
||||
|
||||
<!-- <absval> -->
|
||||
<implementation name="IM_absval_float_genosl" nodedef="ND_absval_float" target="genosl" sourcecode="abs({{in}})" />
|
||||
<implementation name="IM_absval_color3_genosl" nodedef="ND_absval_color3" target="genosl" sourcecode="abs({{in}})" />
|
||||
<implementation name="IM_absval_color4_genosl" nodedef="ND_absval_color4" target="genosl" sourcecode="abs({{in}})" />
|
||||
<implementation name="IM_absval_vector2_genosl" nodedef="ND_absval_vector2" target="genosl" sourcecode="abs({{in}})" />
|
||||
<implementation name="IM_absval_vector3_genosl" nodedef="ND_absval_vector3" target="genosl" sourcecode="abs({{in}})" />
|
||||
<implementation name="IM_absval_vector4_genosl" nodedef="ND_absval_vector4" target="genosl" sourcecode="abs({{in}})" />
|
||||
|
||||
<!-- <floor> -->
|
||||
<implementation name="IM_floor_float_genosl" nodedef="ND_floor_float" target="genosl" sourcecode="floor({{in}})" />
|
||||
<implementation name="IM_floor_color3_genosl" nodedef="ND_floor_color3" target="genosl" sourcecode="floor({{in}})" />
|
||||
<implementation name="IM_floor_color4_genosl" nodedef="ND_floor_color4" target="genosl" sourcecode="floor({{in}})" />
|
||||
<implementation name="IM_floor_vector2_genosl" nodedef="ND_floor_vector2" target="genosl" sourcecode="floor({{in}})" />
|
||||
<implementation name="IM_floor_vector3_genosl" nodedef="ND_floor_vector3" target="genosl" sourcecode="floor({{in}})" />
|
||||
<implementation name="IM_floor_vector4_genosl" nodedef="ND_floor_vector4" target="genosl" sourcecode="floor({{in}})" />
|
||||
<implementation name="IM_floor_integer_genosl" nodedef="ND_floor_integer" target="genosl" sourcecode="int(floor({{in}}))" />
|
||||
|
||||
<!-- <ceil> -->
|
||||
<implementation name="IM_ceil_float_genosl" nodedef="ND_ceil_float" target="genosl" sourcecode="ceil({{in}})" />
|
||||
<implementation name="IM_ceil_color3_genosl" nodedef="ND_ceil_color3" target="genosl" sourcecode="ceil({{in}})" />
|
||||
<implementation name="IM_ceil_color4_genosl" nodedef="ND_ceil_color4" target="genosl" sourcecode="ceil({{in}})" />
|
||||
<implementation name="IM_ceil_vector2_genosl" nodedef="ND_ceil_vector2" target="genosl" sourcecode="ceil({{in}})" />
|
||||
<implementation name="IM_ceil_vector3_genosl" nodedef="ND_ceil_vector3" target="genosl" sourcecode="ceil({{in}})" />
|
||||
<implementation name="IM_ceil_vector4_genosl" nodedef="ND_ceil_vector4" target="genosl" sourcecode="ceil({{in}})" />
|
||||
<implementation name="IM_ceil_integer_genosl" nodedef="ND_ceil_integer" target="genosl" sourcecode="int(ceil({{in}}))" />
|
||||
|
||||
<!-- <round> -->
|
||||
<implementation name="IM_round_float_genosl" nodedef="ND_round_float" target="genosl" sourcecode="round({{in}})" />
|
||||
<implementation name="IM_round_color3_genosl" nodedef="ND_round_color3" target="genosl" sourcecode="round({{in}})" />
|
||||
<implementation name="IM_round_color4_genosl" nodedef="ND_round_color4" target="genosl" sourcecode="round({{in}})" />
|
||||
<implementation name="IM_round_vector2_genosl" nodedef="ND_round_vector2" target="genosl" sourcecode="round({{in}})" />
|
||||
<implementation name="IM_round_vector3_genosl" nodedef="ND_round_vector3" target="genosl" sourcecode="round({{in}})" />
|
||||
<implementation name="IM_round_vector4_genosl" nodedef="ND_round_vector4" target="genosl" sourcecode="round({{in}})" />
|
||||
<implementation name="IM_round_integer_genosl" nodedef="ND_round_integer" target="genosl" sourcecode="int(round({{in}}))" />
|
||||
|
||||
<!-- <power> -->
|
||||
<implementation name="IM_power_float_genosl" nodedef="ND_power_float" target="genosl" sourcecode="pow({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_power_color3_genosl" nodedef="ND_power_color3" target="genosl" sourcecode="pow({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_power_color3FA_genosl" nodedef="ND_power_color3FA" target="genosl" sourcecode="pow({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_power_color4_genosl" nodedef="ND_power_color4" target="genosl" sourcecode="pow({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_power_color4FA_genosl" nodedef="ND_power_color4FA" target="genosl" sourcecode="pow({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_power_vector2_genosl" nodedef="ND_power_vector2" target="genosl" sourcecode="pow({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_power_vector2FA_genosl" nodedef="ND_power_vector2FA" target="genosl" sourcecode="pow({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_power_vector3_genosl" nodedef="ND_power_vector3" target="genosl" sourcecode="pow({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_power_vector3FA_genosl" nodedef="ND_power_vector3FA" target="genosl" sourcecode="pow({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_power_vector4_genosl" nodedef="ND_power_vector4" target="genosl" sourcecode="pow({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_power_vector4FA_genosl" nodedef="ND_power_vector4FA" target="genosl" sourcecode="pow({{in1}}, {{in2}})" />
|
||||
|
||||
<!-- <sin>, <cos>, <tan>, <asin>, <acos>, <atan2> -->
|
||||
<implementation name="IM_sin_float_genosl" nodedef="ND_sin_float" target="genosl" sourcecode="sin({{in}})" />
|
||||
<implementation name="IM_cos_float_genosl" nodedef="ND_cos_float" target="genosl" sourcecode="cos({{in}})" />
|
||||
<implementation name="IM_tan_float_genosl" nodedef="ND_tan_float" target="genosl" sourcecode="tan({{in}})" />
|
||||
<implementation name="IM_asin_float_genosl" nodedef="ND_asin_float" target="genosl" sourcecode="asin({{in}})" />
|
||||
<implementation name="IM_acos_float_genosl" nodedef="ND_acos_float" target="genosl" sourcecode="acos({{in}})" />
|
||||
<implementation name="IM_atan2_float_genosl" nodedef="ND_atan2_float" target="genosl" sourcecode="atan2({{in1}},{{in2}})" />
|
||||
<implementation name="IM_sin_vector2_genosl" nodedef="ND_sin_vector2" target="genosl" sourcecode="sin({{in}})" />
|
||||
<implementation name="IM_cos_vector2_genosl" nodedef="ND_cos_vector2" target="genosl" sourcecode="cos({{in}})" />
|
||||
<implementation name="IM_tan_vector2_genosl" nodedef="ND_tan_vector2" target="genosl" sourcecode="tan({{in}})" />
|
||||
<implementation name="IM_asin_vector2_genosl" nodedef="ND_asin_vector2" target="genosl" sourcecode="asin({{in}})" />
|
||||
<implementation name="IM_acos_vector2_genosl" nodedef="ND_acos_vector2" target="genosl" sourcecode="acos({{in}})" />
|
||||
<implementation name="IM_atan2_vector2_genosl" nodedef="ND_atan2_vector2" target="genosl" sourcecode="atan2({{in1}},{{in2}})" />
|
||||
<implementation name="IM_sin_vector3_genosl" nodedef="ND_sin_vector3" target="genosl" sourcecode="sin({{in}})" />
|
||||
<implementation name="IM_cos_vector3_genosl" nodedef="ND_cos_vector3" target="genosl" sourcecode="cos({{in}})" />
|
||||
<implementation name="IM_tan_vector3_genosl" nodedef="ND_tan_vector3" target="genosl" sourcecode="tan({{in}})" />
|
||||
<implementation name="IM_asin_vector3_genosl" nodedef="ND_asin_vector3" target="genosl" sourcecode="asin({{in}})" />
|
||||
<implementation name="IM_acos_vector3_genosl" nodedef="ND_acos_vector3" target="genosl" sourcecode="acos({{in}})" />
|
||||
<implementation name="IM_atan2_vector3_genosl" nodedef="ND_atan2_vector3" target="genosl" sourcecode="atan2({{in1}},{{in2}})" />
|
||||
<implementation name="IM_sin_vector4_genosl" nodedef="ND_sin_vector4" target="genosl" sourcecode="sin({{in}})" />
|
||||
<implementation name="IM_cos_vector4_genosl" nodedef="ND_cos_vector4" target="genosl" sourcecode="cos({{in}})" />
|
||||
<implementation name="IM_tan_vector4_genosl" nodedef="ND_tan_vector4" target="genosl" sourcecode="tan({{in}})" />
|
||||
<implementation name="IM_asin_vector4_genosl" nodedef="ND_asin_vector4" target="genosl" sourcecode="asin({{in}})" />
|
||||
<implementation name="IM_acos_vector4_genosl" nodedef="ND_acos_vector4" target="genosl" sourcecode="acos({{in}})" />
|
||||
<implementation name="IM_atan2_vector4_genosl" nodedef="ND_atan2_vector4" target="genosl" sourcecode="atan2({{in1}},{{in2}})" />
|
||||
|
||||
<!-- <sqrt> -->
|
||||
<implementation name="IM_sqrt_float_genosl" nodedef="ND_sqrt_float" target="genosl" sourcecode="sqrt({{in}})" />
|
||||
<implementation name="IM_sqrt_vector2_genosl" nodedef="ND_sqrt_vector2" target="genosl" sourcecode="sqrt({{in}})" />
|
||||
<implementation name="IM_sqrt_vector3_genosl" nodedef="ND_sqrt_vector3" target="genosl" sourcecode="sqrt({{in}})" />
|
||||
<implementation name="IM_sqrt_vector4_genosl" nodedef="ND_sqrt_vector4" target="genosl" sourcecode="sqrt({{in}})" />
|
||||
|
||||
<!-- <ln> -->
|
||||
<implementation name="IM_ln_float_genosl" nodedef="ND_ln_float" target="genosl" sourcecode="log({{in}})" />
|
||||
<implementation name="IM_ln_vector2_genosl" nodedef="ND_ln_vector2" target="genosl" sourcecode="log({{in}})" />
|
||||
<implementation name="IM_ln_vector3_genosl" nodedef="ND_ln_vector3" target="genosl" sourcecode="log({{in}})" />
|
||||
<implementation name="IM_ln_vector4_genosl" nodedef="ND_ln_vector4" target="genosl" sourcecode="log({{in}})" />
|
||||
|
||||
<!-- <exp> -->
|
||||
<implementation name="IM_exp_float_genosl" nodedef="ND_exp_float" target="genosl" sourcecode="exp({{in}})" />
|
||||
<implementation name="IM_exp_vector2_genosl" nodedef="ND_exp_vector2" target="genosl" sourcecode="exp({{in}})" />
|
||||
<implementation name="IM_exp_vector3_genosl" nodedef="ND_exp_vector3" target="genosl" sourcecode="exp({{in}})" />
|
||||
<implementation name="IM_exp_vector4_genosl" nodedef="ND_exp_vector4" target="genosl" sourcecode="exp({{in}})" />
|
||||
|
||||
<!-- sign -->
|
||||
<implementation name="IM_sign_float_genosl" nodedef="ND_sign_float" target="genosl" sourcecode="sign({{in}})" />
|
||||
<implementation name="IM_sign_color3_genosl" nodedef="ND_sign_color3" target="genosl" sourcecode="sign({{in}})" />
|
||||
<implementation name="IM_sign_color4_genosl" nodedef="ND_sign_color4" target="genosl" sourcecode="sign({{in}})" />
|
||||
<implementation name="IM_sign_vector2_genosl" nodedef="ND_sign_vector2" target="genosl" sourcecode="sign({{in}})" />
|
||||
<implementation name="IM_sign_vector3_genosl" nodedef="ND_sign_vector3" target="genosl" sourcecode="sign({{in}})" />
|
||||
<implementation name="IM_sign_vector4_genosl" nodedef="ND_sign_vector4" target="genosl" sourcecode="sign({{in}})" />
|
||||
|
||||
<!-- <clamp> -->
|
||||
<implementation name="IM_clamp_float_genosl" nodedef="ND_clamp_float" target="genosl" sourcecode="clamp({{in}}, {{low}}, {{high}})" />
|
||||
<implementation name="IM_clamp_color3_genosl" nodedef="ND_clamp_color3" target="genosl" sourcecode="clamp({{in}}, {{low}}, {{high}})" />
|
||||
<implementation name="IM_clamp_color3FA_genosl" nodedef="ND_clamp_color3FA" target="genosl" sourcecode="clamp({{in}}, {{low}}, {{high}})" />
|
||||
<implementation name="IM_clamp_color4_genosl" nodedef="ND_clamp_color4" target="genosl" sourcecode="clamp({{in}}, {{low}}, {{high}})" />
|
||||
<implementation name="IM_clamp_color4FA_genosl" nodedef="ND_clamp_color4FA" target="genosl" sourcecode="clamp({{in}}, {{low}}, {{high}})" />
|
||||
<implementation name="IM_clamp_vector2_genosl" nodedef="ND_clamp_vector2" target="genosl" sourcecode="clamp({{in}}, {{low}}, {{high}})" />
|
||||
<implementation name="IM_clamp_vector2FA_genosl" nodedef="ND_clamp_vector2FA" target="genosl" sourcecode="clamp({{in}}, {{low}}, {{high}})" />
|
||||
<implementation name="IM_clamp_vector3_genosl" nodedef="ND_clamp_vector3" target="genosl" sourcecode="clamp({{in}}, {{low}}, {{high}})" />
|
||||
<implementation name="IM_clamp_vector3FA_genosl" nodedef="ND_clamp_vector3FA" target="genosl" sourcecode="clamp({{in}}, {{low}}, {{high}})" />
|
||||
<implementation name="IM_clamp_vector4_genosl" nodedef="ND_clamp_vector4" target="genosl" sourcecode="clamp({{in}}, {{low}}, {{high}})" />
|
||||
<implementation name="IM_clamp_vector4FA_genosl" nodedef="ND_clamp_vector4FA" target="genosl" sourcecode="clamp({{in}}, {{low}}, {{high}})" />
|
||||
|
||||
<!-- <min> -->
|
||||
<implementation name="IM_min_float_genosl" nodedef="ND_min_float" target="genosl" sourcecode="min({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_min_color3_genosl" nodedef="ND_min_color3" target="genosl" sourcecode="min({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_min_color3FA_genosl" nodedef="ND_min_color3FA" target="genosl" sourcecode="min({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_min_color4_genosl" nodedef="ND_min_color4" target="genosl" sourcecode="min({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_min_color4FA_genosl" nodedef="ND_min_color4FA" target="genosl" sourcecode="min({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_min_vector2_genosl" nodedef="ND_min_vector2" target="genosl" sourcecode="min({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_min_vector2FA_genosl" nodedef="ND_min_vector2FA" target="genosl" sourcecode="min({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_min_vector3_genosl" nodedef="ND_min_vector3" target="genosl" sourcecode="min({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_min_vector3FA_genosl" nodedef="ND_min_vector3FA" target="genosl" sourcecode="min({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_min_vector4_genosl" nodedef="ND_min_vector4" target="genosl" sourcecode="min({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_min_vector4FA_genosl" nodedef="ND_min_vector4FA" target="genosl" sourcecode="min({{in1}}, {{in2}})" />
|
||||
|
||||
<!-- <max> -->
|
||||
<implementation name="IM_max_float_genosl" nodedef="ND_max_float" target="genosl" sourcecode="max({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_max_color3_genosl" nodedef="ND_max_color3" target="genosl" sourcecode="max({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_max_color3FA_genosl" nodedef="ND_max_color3FA" target="genosl" sourcecode="max({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_max_color4_genosl" nodedef="ND_max_color4" target="genosl" sourcecode="max({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_max_color4FA_genosl" nodedef="ND_max_color4FA" target="genosl" sourcecode="max({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_max_vector2_genosl" nodedef="ND_max_vector2" target="genosl" sourcecode="max({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_max_vector2FA_genosl" nodedef="ND_max_vector2FA" target="genosl" sourcecode="max({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_max_vector3_genosl" nodedef="ND_max_vector3" target="genosl" sourcecode="max({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_max_vector3FA_genosl" nodedef="ND_max_vector3FA" target="genosl" sourcecode="max({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_max_vector4_genosl" nodedef="ND_max_vector4" target="genosl" sourcecode="max({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_max_vector4FA_genosl" nodedef="ND_max_vector4FA" target="genosl" sourcecode="max({{in1}}, {{in2}})" />
|
||||
|
||||
<!-- <normalize> -->
|
||||
<implementation name="IM_normalize_vector2_genosl" nodedef="ND_normalize_vector2" target="genosl" sourcecode="normalize({{in}})" />
|
||||
<implementation name="IM_normalize_vector3_genosl" nodedef="ND_normalize_vector3" target="genosl" sourcecode="normalize({{in}})" />
|
||||
<implementation name="IM_normalize_vector4_genosl" nodedef="ND_normalize_vector4" target="genosl" sourcecode="normalize({{in}})" />
|
||||
|
||||
<!-- <magnitude> -->
|
||||
<implementation name="IM_magnitude_vector2_genosl" nodedef="ND_magnitude_vector2" target="genosl" sourcecode="length({{in}})" />
|
||||
<implementation name="IM_magnitude_vector3_genosl" nodedef="ND_magnitude_vector3" target="genosl" sourcecode="length({{in}})" />
|
||||
<implementation name="IM_magnitude_vector4_genosl" nodedef="ND_magnitude_vector4" target="genosl" sourcecode="length({{in}})" />
|
||||
|
||||
<!-- <dotproduct> -->
|
||||
<implementation name="IM_dotproduct_vector2_genosl" nodedef="ND_dotproduct_vector2" target="genosl" sourcecode="dot({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_dotproduct_vector3_genosl" nodedef="ND_dotproduct_vector3" target="genosl" sourcecode="dot({{in1}}, {{in2}})" />
|
||||
<implementation name="IM_dotproduct_vector4_genosl" nodedef="ND_dotproduct_vector4" target="genosl" sourcecode="dot({{in1}}, {{in2}})" />
|
||||
|
||||
<!-- <crossproduct> -->
|
||||
<implementation name="IM_crossproduct_vector3_genosl" nodedef="ND_crossproduct_vector3" target="genosl" sourcecode="cross({{in1}}, {{in2}})" />
|
||||
|
||||
<!-- <transformpoint> -->
|
||||
<implementation name="IM_transformpoint_vector3_genosl" nodedef="ND_transformpoint_vector3" target="genosl" sourcecode="transform({{fromspace}}, {{tospace}}, point({{in}}))" />
|
||||
|
||||
<!-- <transformvector> -->
|
||||
<implementation name="IM_transformvector_vector3_genosl" nodedef="ND_transformvector_vector3" target="genosl" sourcecode="transform({{fromspace}}, {{tospace}}, {{in}})" />
|
||||
|
||||
<!-- <transformnormal> -->
|
||||
<implementation name="IM_transformnormal_vector3_genosl" nodedef="ND_transformnormal_vector3" target="genosl" sourcecode="transform({{fromspace}}, {{tospace}}, normal({{in}}))" />
|
||||
|
||||
<!-- <transformmatrix> -->
|
||||
<implementation name="IM_transformmatrix_vector2M3_genosl" nodedef="ND_transformmatrix_vector2M3" function="mx_transformmatrix_vector2M3" file="mx_transformmatrix_vector2M3.osl" target="genosl" />
|
||||
<implementation name="IM_transformmatrix_vector3_genosl" nodedef="ND_transformmatrix_vector3" target="genosl" sourcecode="transform({{mat}}, {{in}})" />
|
||||
<implementation name="IM_transformmatrix_vector3M4_genosl" nodedef="ND_transformmatrix_vector3M4" target="genosl" sourcecode="transform({{mat}}, {{in}})" />
|
||||
<implementation name="IM_transformmatrix_vector4_genosl" nodedef="ND_transformmatrix_vector4" target="genosl" sourcecode="transform({{mat}}, {{in}})" />
|
||||
|
||||
<!-- <transpose> -->
|
||||
<implementation name="IM_transpose_matrix33_genosl" nodedef="ND_transpose_matrix33" target="genosl" sourcecode="transpose({{in}})" />
|
||||
<implementation name="IM_transpose_matrix44_genosl" nodedef="ND_transpose_matrix44" target="genosl" sourcecode="transpose({{in}})" />
|
||||
|
||||
<!-- <determinant> -->
|
||||
<implementation name="IM_determinant_matrix33_genosl" nodedef="ND_determinant_matrix33" target="genosl" sourcecode="determinant({{in}})" />
|
||||
<implementation name="IM_determinant_matrix44_genosl" nodedef="ND_determinant_matrix44" target="genosl" sourcecode="determinant({{in}})" />
|
||||
|
||||
<!-- <invertmatrix> -->
|
||||
<implementation name="IM_invertmatrix_matrix33_genosl" nodedef="ND_invertmatrix_matrix33" target="genosl" sourcecode="1 / {{in}}" />
|
||||
<implementation name="IM_invertmatrix_matrix44_genosl" nodedef="ND_invertmatrix_matrix44" target="genosl" sourcecode="1 / {{in}}" />
|
||||
|
||||
<!-- <rotate2d> -->
|
||||
<implementation name="IM_rotate2d_vector2_genosl" nodedef="ND_rotate2d_vector2" file="mx_rotate_vector2.osl" function="mx_rotate_vector2" target="genosl" />
|
||||
|
||||
<!-- <rotate3d> -->
|
||||
<implementation name="IM_rotate3d_vector3_genosl" nodedef="ND_rotate3d_vector3" file="mx_rotate_vector3.osl" function="mx_rotate_vector3" target="genosl" />
|
||||
|
||||
<!-- ======================================================================== -->
|
||||
<!-- Adjustment nodes -->
|
||||
<!-- ======================================================================== -->
|
||||
|
||||
<!-- <remap> -->
|
||||
<implementation name="IM_remap_float_genosl" nodedef="ND_remap_float" target="genosl" sourcecode="mx_remap({{in}}, {{inlow}}, {{inhigh}}, {{outlow}}, {{outhigh}}, 0)" />
|
||||
<implementation name="IM_remap_color3_genosl" nodedef="ND_remap_color3" target="genosl" sourcecode="mx_remap({{in}}, {{inlow}}, {{inhigh}}, {{outlow}}, {{outhigh}}, 0)" />
|
||||
<implementation name="IM_remap_color3FA_genosl" nodedef="ND_remap_color3FA" target="genosl" sourcecode="mx_remap({{in}}, {{inlow}}, {{inhigh}}, {{outlow}}, {{outhigh}}, 0)" />
|
||||
<implementation name="IM_remap_color4_genosl" nodedef="ND_remap_color4" target="genosl" sourcecode="mx_remap({{in}}, {{inlow}}, {{inhigh}}, {{outlow}}, {{outhigh}}, 0)" />
|
||||
<implementation name="IM_remap_color4FA_genosl" nodedef="ND_remap_color4FA" target="genosl" sourcecode="mx_remap({{in}}, {{inlow}}, {{inhigh}}, {{outlow}}, {{outhigh}}, 0)" />
|
||||
<implementation name="IM_remap_vector2_genosl" nodedef="ND_remap_vector2" target="genosl" sourcecode="mx_remap({{in}}, {{inlow}}, {{inhigh}}, {{outlow}}, {{outhigh}}, 0)" />
|
||||
<implementation name="IM_remap_vector2FA_genosl" nodedef="ND_remap_vector2FA" target="genosl" sourcecode="mx_remap({{in}}, {{inlow}}, {{inhigh}}, {{outlow}}, {{outhigh}}, 0)" />
|
||||
<implementation name="IM_remap_vector3_genosl" nodedef="ND_remap_vector3" target="genosl" sourcecode="mx_remap({{in}}, {{inlow}}, {{inhigh}}, {{outlow}}, {{outhigh}}, 0)" />
|
||||
<implementation name="IM_remap_vector3FA_genosl" nodedef="ND_remap_vector3FA" target="genosl" sourcecode="mx_remap({{in}}, {{inlow}}, {{inhigh}}, {{outlow}}, {{outhigh}}, 0)" />
|
||||
<implementation name="IM_remap_vector4_genosl" nodedef="ND_remap_vector4" target="genosl" sourcecode="mx_remap({{in}}, {{inlow}}, {{inhigh}}, {{outlow}}, {{outhigh}}, 0)" />
|
||||
<implementation name="IM_remap_vector4FA_genosl" nodedef="ND_remap_vector4FA" target="genosl" sourcecode="mx_remap({{in}}, {{inlow}}, {{inhigh}}, {{outlow}}, {{outhigh}}, 0)" />
|
||||
|
||||
<!-- <smoothstep> -->
|
||||
<implementation name="IM_smoothstep_float_genosl" nodedef="ND_smoothstep_float" target="genosl" sourcecode="smoothstep({{low}}, {{high}}, {{in}})" />
|
||||
<implementation name="IM_smoothstep_vector2_genosl" nodedef="ND_smoothstep_vector2" target="genosl" sourcecode="smoothstep({{low}}, {{high}}, {{in}})" />
|
||||
<implementation name="IM_smoothstep_vector3_genosl" nodedef="ND_smoothstep_vector3" target="genosl" sourcecode="smoothstep({{low}}, {{high}}, {{in}})" />
|
||||
<implementation name="IM_smoothstep_vector4_genosl" nodedef="ND_smoothstep_vector4" target="genosl" sourcecode="smoothstep({{low}}, {{high}}, {{in}})" />
|
||||
|
||||
<!-- <luminance> -->
|
||||
<implementation name="IM_luminance_color3_genosl" nodedef="ND_luminance_color3" file="mx_luminance_color3.osl" function="mx_luminance_color3" target="genosl" />
|
||||
<implementation name="IM_luminance_color4_genosl" nodedef="ND_luminance_color4" file="mx_luminance_color4.osl" function="mx_luminance_color4" target="genosl" />
|
||||
|
||||
<!-- <rgbtohsv> -->
|
||||
<implementation name="IM_rgbtohsv_color3_genosl" nodedef="ND_rgbtohsv_color3" file="mx_rgbtohsv_color3.osl" function="mx_rgbtohsv_color3" target="genosl" />
|
||||
<implementation name="IM_rgbtohsv_color4_genosl" nodedef="ND_rgbtohsv_color4" file="mx_rgbtohsv_color4.osl" function="mx_rgbtohsv_color4" target="genosl" />
|
||||
|
||||
<!-- <hsvtorgb> -->
|
||||
<implementation name="IM_hsvtorgb_color3_genosl" nodedef="ND_hsvtorgb_color3" file="mx_hsvtorgb_color3.osl" function="mx_hsvtorgb_color3" target="genosl" />
|
||||
<implementation name="IM_hsvtorgb_color4_genosl" nodedef="ND_hsvtorgb_color4" file="mx_hsvtorgb_color4.osl" function="mx_hsvtorgb_color4" target="genosl" />
|
||||
|
||||
<!-- ======================================================================== -->
|
||||
<!-- Compositing nodes -->
|
||||
<!-- ======================================================================== -->
|
||||
|
||||
<!-- <premult> -->
|
||||
<implementation name="IM_premult_color4_genosl" nodedef="ND_premult_color4" file="mx_premult_color4.osl" function="mx_premult_color4" target="genosl" />
|
||||
|
||||
<!-- <unpremult> -->
|
||||
<implementation name="IM_unpremult_color4_genosl" nodedef="ND_unpremult_color4" file="mx_unpremult_color4.osl" function="mx_unpremult_color4" target="genosl" />
|
||||
|
||||
<!-- <plus> -->
|
||||
<implementation name="IM_plus_float_genosl" nodedef="ND_plus_float" target="genosl" sourcecode="({{mix}}*({{bg}} + {{fg}})) + ((1.0-{{mix}})*{{bg}})" />
|
||||
<implementation name="IM_plus_color3_genosl" nodedef="ND_plus_color3" target="genosl" sourcecode="({{mix}}*({{bg}} + {{fg}})) + ((1.0-{{mix}})*{{bg}})" />
|
||||
<implementation name="IM_plus_color4_genosl" nodedef="ND_plus_color4" target="genosl" sourcecode="({{mix}}*({{bg}} + {{fg}})) + ((1.0-{{mix}})*{{bg}})" />
|
||||
|
||||
<!-- <minus> -->
|
||||
<implementation name="IM_minus_float_genosl" nodedef="ND_minus_float" target="genosl" sourcecode="({{mix}}*({{bg}} - {{fg}})) + ((1.0-{{mix}})*{{bg}})" />
|
||||
<implementation name="IM_minus_color3_genosl" nodedef="ND_minus_color3" target="genosl" sourcecode="({{mix}}*({{bg}} - {{fg}})) + ((1.0-{{mix}})*{{bg}})" />
|
||||
<implementation name="IM_minus_color4_genosl" nodedef="ND_minus_color4" target="genosl" sourcecode="({{mix}}*({{bg}} - {{fg}})) + ((1.0-{{mix}})*{{bg}})" />
|
||||
|
||||
<!-- <difference> -->
|
||||
<implementation name="IM_difference_float_genosl" nodedef="ND_difference_float" target="genosl" sourcecode="({{mix}}*abs({{bg}} - {{fg}})) + ((1.0-{{mix}})*{{bg}})" />
|
||||
<implementation name="IM_difference_color3_genosl" nodedef="ND_difference_color3" target="genosl" sourcecode="({{mix}}*abs({{bg}} - {{fg}})) + ((1.0-{{mix}})*{{bg}})" />
|
||||
<implementation name="IM_difference_color4_genosl" nodedef="ND_difference_color4" target="genosl" sourcecode="({{mix}}*abs({{bg}} - {{fg}})) + ((1.0-{{mix}})*{{bg}})" />
|
||||
|
||||
<!-- <burn> -->
|
||||
<implementation name="IM_burn_float_genosl" nodedef="ND_burn_float" file="mx_burn_float.osl" function="mx_burn_float" target="genosl" />
|
||||
<implementation name="IM_burn_color3_genosl" nodedef="ND_burn_color3" file="mx_burn_color3.osl" function="mx_burn_color3" target="genosl" />
|
||||
<implementation name="IM_burn_color4_genosl" nodedef="ND_burn_color4" file="mx_burn_color4.osl" function="mx_burn_color4" target="genosl" />
|
||||
|
||||
<!-- <dodge> -->
|
||||
<implementation name="IM_dodge_float_genosl" nodedef="ND_dodge_float" file="mx_dodge_float.osl" function="mx_dodge_float" target="genosl" />
|
||||
<implementation name="IM_dodge_color3_genosl" nodedef="ND_dodge_color3" file="mx_dodge_color3.osl" function="mx_dodge_color3" target="genosl" />
|
||||
<implementation name="IM_dodge_color4_genosl" nodedef="ND_dodge_color4" file="mx_dodge_color4.osl" function="mx_dodge_color4" target="genosl" />
|
||||
|
||||
<!-- <screen> -->
|
||||
<implementation name="IM_screen_float_genosl" nodedef="ND_screen_float" target="genosl" sourcecode="({{mix}}*((1.0 - (1.0 - {{fg}}) * (1 - {{bg}})))) + ((1.0-{{mix}})*{{bg}})" />
|
||||
<implementation name="IM_screen_color3_genosl" nodedef="ND_screen_color3" target="genosl" sourcecode="({{mix}}*((1.0 - (1.0 - {{fg}}) * (1 - {{bg}})))) + ((1.0-{{mix}})*{{bg}})" />
|
||||
<implementation name="IM_screen_color4_genosl" nodedef="ND_screen_color4" target="genosl" sourcecode="({{mix}}*((1.0 - (1.0 - {{fg}}) * (1 - {{bg}})))) + ((1.0-{{mix}})*{{bg}})" />
|
||||
|
||||
<!-- <disjointover> -->
|
||||
<implementation name="IM_disjointover_color4_genosl" nodedef="ND_disjointover_color4" file="mx_disjointover_color4.osl" function="mx_disjointover_color4" target="genosl" />
|
||||
|
||||
<!-- <in> -->
|
||||
<implementation name="IM_in_color4_genosl" nodedef="ND_in_color4" target="genosl" sourcecode="({{fg}}*{{bg}}.a * {{mix}}) + ({{bg}} * (1.0-{{mix}}))" />
|
||||
|
||||
<!-- <mask> -->
|
||||
<implementation name="IM_mask_color4_genosl" nodedef="ND_mask_color4" target="genosl" sourcecode="({{bg}}*{{fg}}.a * {{mix}}) + ({{bg}} * (1.0-{{mix}}));" />
|
||||
|
||||
<!-- <matte> -->
|
||||
<implementation name="IM_matte_color4_genosl" nodedef="ND_matte_color4" target="genosl" sourcecode="color4({{fg}}.rgb*{{fg}}.a + {{bg}}.rgb*(1.0-{{fg}}.a), {{fg}}.a + ({{bg}}.a*(1.0-{{fg}}.a)) ) * {{mix}} + ({{bg}} * (1.0-{{mix}}))" />
|
||||
|
||||
<!-- <out> -->
|
||||
<implementation name="IM_out_color4_genosl" nodedef="ND_out_color4" target="genosl" sourcecode="({{fg}}*(1.0-{{bg}}.a) * {{mix}}) + ({{bg}} * (1.0-{{mix}}))" />
|
||||
|
||||
<!-- <over> -->
|
||||
<implementation name="IM_over_color4_genosl" nodedef="ND_over_color4" target="genosl" sourcecode="({{fg}} + ({{bg}}*(1.0-{{fg}}.a))) * {{mix}} + {{bg}} * (1.0-{{mix}})" />
|
||||
|
||||
<!-- <inside> -->
|
||||
<implementation name="IM_inside_float_genosl" nodedef="ND_inside_float" target="genosl" sourcecode="{{in}} * {{mask}}" />
|
||||
<implementation name="IM_inside_color3_genosl" nodedef="ND_inside_color3" target="genosl" sourcecode="{{in}} * {{mask}}" />
|
||||
<implementation name="IM_inside_color4_genosl" nodedef="ND_inside_color4" target="genosl" sourcecode="{{in}} * {{mask}}" />
|
||||
|
||||
<!-- <outside> -->
|
||||
<implementation name="IM_outside_float_genosl" nodedef="ND_outside_float" target="genosl" sourcecode="{{in}} * (1.0 - {{mask}})" />
|
||||
<implementation name="IM_outside_color3_genosl" nodedef="ND_outside_color3" target="genosl" sourcecode="{{in}} * (1.0 - {{mask}})" />
|
||||
<implementation name="IM_outside_color4_genosl" nodedef="ND_outside_color4" target="genosl" sourcecode="{{in}} * (1.0 - {{mask}})" />
|
||||
|
||||
<!-- <mix> -->
|
||||
<implementation name="IM_mix_float_genosl" nodedef="ND_mix_float" target="genosl" sourcecode="mix({{bg}}, {{fg}}, {{mix}})" />
|
||||
<implementation name="IM_mix_color3_genosl" nodedef="ND_mix_color3" target="genosl" sourcecode="mix({{bg}}, {{fg}}, {{mix}})" />
|
||||
<implementation name="IM_mix_color3_color3_genosl" nodedef="ND_mix_color3_color3" target="genosl" sourcecode="mix({{bg}}, {{fg}}, {{mix}})" />
|
||||
<implementation name="IM_mix_color4_genosl" nodedef="ND_mix_color4" target="genosl" sourcecode="mix({{bg}}, {{fg}}, {{mix}})" />
|
||||
<implementation name="IM_mix_color4_color4_genosl" nodedef="ND_mix_color4_color4" target="genosl" sourcecode="mix({{bg}}, {{fg}}, {{mix}})" />
|
||||
<implementation name="IM_mix_vector2_genosl" nodedef="ND_mix_vector2" target="genosl" sourcecode="mix({{bg}}, {{fg}}, {{mix}})" />
|
||||
<implementation name="IM_mix_vector2_vector2_genosl" nodedef="ND_mix_vector2_vector2" target="genosl" sourcecode="mix({{bg}}, {{fg}}, {{mix}})" />
|
||||
<implementation name="IM_mix_vector3_genosl" nodedef="ND_mix_vector3" target="genosl" sourcecode="mix({{bg}}, {{fg}}, {{mix}})" />
|
||||
<implementation name="IM_mix_vector3_vector3_genosl" nodedef="ND_mix_vector3_vector3" target="genosl" sourcecode="mix({{bg}}, {{fg}}, {{mix}})" />
|
||||
<implementation name="IM_mix_vector4_genosl" nodedef="ND_mix_vector4" target="genosl" sourcecode="mix({{bg}}, {{fg}}, {{mix}})" />
|
||||
<implementation name="IM_mix_vector4_vector4_genosl" nodedef="ND_mix_vector4_vector4" target="genosl" sourcecode="mix({{bg}}, {{fg}}, {{mix}})" />
|
||||
<implementation name="IM_mix_surfaceshader_genosl" nodedef="ND_mix_surfaceshader" file="mx_mix_surfaceshader.osl" function="mx_mix_surfaceshader" target="genosl" />
|
||||
|
||||
<!-- ======================================================================== -->
|
||||
<!-- Conditional nodes -->
|
||||
<!-- ======================================================================== -->
|
||||
|
||||
<!-- <ifgreater> -->
|
||||
<implementation name="IM_ifgreater_float_genosl" nodedef="ND_ifgreater_float" target="genosl" sourcecode="mx_ternary({{value1}} > {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifgreater_color3_genosl" nodedef="ND_ifgreater_color3" target="genosl" sourcecode="mx_ternary({{value1}} > {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifgreater_color4_genosl" nodedef="ND_ifgreater_color4" target="genosl" sourcecode="mx_ternary({{value1}} > {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifgreater_vector2_genosl" nodedef="ND_ifgreater_vector2" target="genosl" sourcecode="mx_ternary({{value1}} > {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifgreater_vector3_genosl" nodedef="ND_ifgreater_vector3" target="genosl" sourcecode="mx_ternary({{value1}} > {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifgreater_vector4_genosl" nodedef="ND_ifgreater_vector4" target="genosl" sourcecode="mx_ternary({{value1}} > {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifgreater_floatI_genosl" nodedef="ND_ifgreater_floatI" target="genosl" sourcecode="mx_ternary({{value1}} > {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifgreater_color3I_genosl" nodedef="ND_ifgreater_color3I" target="genosl" sourcecode="mx_ternary({{value1}} > {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifgreater_color4I_genosl" nodedef="ND_ifgreater_color4I" target="genosl" sourcecode="mx_ternary({{value1}} > {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifgreater_vector2I_genosl" nodedef="ND_ifgreater_vector2I" target="genosl" sourcecode="mx_ternary({{value1}} > {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifgreater_vector3I_genosl" nodedef="ND_ifgreater_vector3I" target="genosl" sourcecode="mx_ternary({{value1}} > {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifgreater_vector4I_genosl" nodedef="ND_ifgreater_vector4I" target="genosl" sourcecode="mx_ternary({{value1}} > {{value2}}, {{in1}}, {{in2}})" />
|
||||
|
||||
<!-- <ifgreatereq> -->
|
||||
<implementation name="IM_ifgreatereq_float_genosl" nodedef="ND_ifgreatereq_float" target="genosl" sourcecode="mx_ternary({{value1}} >= {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifgreatereq_color3_genosl" nodedef="ND_ifgreatereq_color3" target="genosl" sourcecode="mx_ternary({{value1}} >= {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifgreatereq_color4_genosl" nodedef="ND_ifgreatereq_color4" target="genosl" sourcecode="mx_ternary({{value1}} >= {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifgreatereq_vector2_genosl" nodedef="ND_ifgreatereq_vector2" target="genosl" sourcecode="mx_ternary({{value1}} >= {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifgreatereq_vector3_genosl" nodedef="ND_ifgreatereq_vector3" target="genosl" sourcecode="mx_ternary({{value1}} >= {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifgreatereq_vector4_genosl" nodedef="ND_ifgreatereq_vector4" target="genosl" sourcecode="mx_ternary({{value1}} >= {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifgreatereq_floatI_genosl" nodedef="ND_ifgreatereq_floatI" target="genosl" sourcecode="mx_ternary({{value1}} >= {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifgreatereq_color3I_genosl" nodedef="ND_ifgreatereq_color3I" target="genosl" sourcecode="mx_ternary({{value1}} >= {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifgreatereq_color4I_genosl" nodedef="ND_ifgreatereq_color4I" target="genosl" sourcecode="mx_ternary({{value1}} >= {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifgreatereq_vector2I_genosl" nodedef="ND_ifgreatereq_vector2I" target="genosl" sourcecode="mx_ternary({{value1}} >= {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifgreatereq_vector3I_genosl" nodedef="ND_ifgreatereq_vector3I" target="genosl" sourcecode="mx_ternary({{value1}} >= {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifgreatereq_vector4I_genosl" nodedef="ND_ifgreatereq_vector4I" target="genosl" sourcecode="mx_ternary({{value1}} >= {{value2}}, {{in1}}, {{in2}})" />
|
||||
|
||||
<!-- <ifequal> -->
|
||||
<implementation name="IM_ifequal_float_genosl" nodedef="ND_ifequal_float" target="genosl" sourcecode="mx_ternary({{value1}} == {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifequal_color3_genosl" nodedef="ND_ifequal_color3" target="genosl" sourcecode="mx_ternary({{value1}} == {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifequal_color4_genosl" nodedef="ND_ifequal_color4" target="genosl" sourcecode="mx_ternary({{value1}} == {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifequal_vector2_genosl" nodedef="ND_ifequal_vector2" target="genosl" sourcecode="mx_ternary({{value1}} == {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifequal_vector3_genosl" nodedef="ND_ifequal_vector3" target="genosl" sourcecode="mx_ternary({{value1}} == {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifequal_vector4_genosl" nodedef="ND_ifequal_vector4" target="genosl" sourcecode="mx_ternary({{value1}} == {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifequal_floatI_genosl" nodedef="ND_ifequal_floatI" target="genosl" sourcecode="mx_ternary({{value1}} == {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifequal_color3I_genosl" nodedef="ND_ifequal_color3I" target="genosl" sourcecode="mx_ternary({{value1}} == {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifequal_color4I_genosl" nodedef="ND_ifequal_color4I" target="genosl" sourcecode="mx_ternary({{value1}} == {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifequal_vector2I_genosl" nodedef="ND_ifequal_vector2I" target="genosl" sourcecode="mx_ternary({{value1}} == {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifequal_vector3I_genosl" nodedef="ND_ifequal_vector3I" target="genosl" sourcecode="mx_ternary({{value1}} == {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifequal_vector4I_genosl" nodedef="ND_ifequal_vector4I" target="genosl" sourcecode="mx_ternary({{value1}} == {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifequal_floatB_genosl" nodedef="ND_ifequal_floatB" target="genosl" sourcecode="mx_ternary({{value1}} == {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifequal_color3B_genosl" nodedef="ND_ifequal_color3B" target="genosl" sourcecode="mx_ternary({{value1}} == {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifequal_color4B_genosl" nodedef="ND_ifequal_color4B" target="genosl" sourcecode="mx_ternary({{value1}} == {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifequal_vector2B_genosl" nodedef="ND_ifequal_vector2B" target="genosl" sourcecode="mx_ternary({{value1}} == {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifequal_vector3B_genosl" nodedef="ND_ifequal_vector3B" target="genosl" sourcecode="mx_ternary({{value1}} == {{value2}}, {{in1}}, {{in2}})" />
|
||||
<implementation name="IM_ifequal_vector4B_genosl" nodedef="ND_ifequal_vector4B" target="genosl" sourcecode="mx_ternary({{value1}} == {{value2}}, {{in1}}, {{in2}})" />
|
||||
|
||||
<!-- <switch> -->
|
||||
<!-- 'which' type : float -->
|
||||
<implementation name="IM_switch_float_genosl" nodedef="ND_switch_float" target="genosl" />
|
||||
<implementation name="IM_switch_color3_genosl" nodedef="ND_switch_color3" target="genosl" />
|
||||
<implementation name="IM_switch_color4_genosl" nodedef="ND_switch_color4" target="genosl" />
|
||||
<implementation name="IM_switch_vector2_genosl" nodedef="ND_switch_vector2" target="genosl" />
|
||||
<implementation name="IM_switch_vector3_genosl" nodedef="ND_switch_vector3" target="genosl" />
|
||||
<implementation name="IM_switch_vector4_genosl" nodedef="ND_switch_vector4" target="genosl" />
|
||||
<!-- 'which' type : integer -->
|
||||
<implementation name="IM_switch_floatI_genosl" nodedef="ND_switch_floatI" target="genosl" />
|
||||
<implementation name="IM_switch_color3I_genosl" nodedef="ND_switch_color3I" target="genosl" />
|
||||
<implementation name="IM_switch_color4I_genosl" nodedef="ND_switch_color4I" target="genosl" />
|
||||
<implementation name="IM_switch_vector2I_genosl" nodedef="ND_switch_vector2I" target="genosl" />
|
||||
<implementation name="IM_switch_vector3I_genosl" nodedef="ND_switch_vector3I" target="genosl" />
|
||||
<implementation name="IM_switch_vector4I_genosl" nodedef="ND_switch_vector4I" target="genosl" />
|
||||
|
||||
<!-- ======================================================================== -->
|
||||
<!-- Channel nodes -->
|
||||
<!-- ======================================================================== -->
|
||||
|
||||
<!-- <convert> -->
|
||||
<implementation name="IM_convert_float_color3_genosl" nodedef="ND_convert_float_color3" target="genosl" />
|
||||
<implementation name="IM_convert_float_color4_genosl" nodedef="ND_convert_float_color4" target="genosl" />
|
||||
<implementation name="IM_convert_float_vector2_genosl" nodedef="ND_convert_float_vector2" target="genosl" />
|
||||
<implementation name="IM_convert_float_vector3_genosl" nodedef="ND_convert_float_vector3" target="genosl" />
|
||||
<implementation name="IM_convert_float_vector4_genosl" nodedef="ND_convert_float_vector4" target="genosl" />
|
||||
<implementation name="IM_convert_vector2_vector3_genosl" nodedef="ND_convert_vector2_vector3" target="genosl" />
|
||||
<implementation name="IM_convert_vector3_vector2_genosl" nodedef="ND_convert_vector3_vector2" target="genosl" />
|
||||
<implementation name="IM_convert_vector3_color3_genosl" nodedef="ND_convert_vector3_color3" target="genosl" />
|
||||
<implementation name="IM_convert_vector3_vector4_genosl" nodedef="ND_convert_vector3_vector4" target="genosl" />
|
||||
<implementation name="IM_convert_vector4_vector3_genosl" nodedef="ND_convert_vector4_vector3" target="genosl" />
|
||||
<implementation name="IM_convert_vector4_color4_genosl" nodedef="ND_convert_vector4_color4" target="genosl" />
|
||||
<implementation name="IM_convert_color3_vector3_genosl" nodedef="ND_convert_color3_vector3" target="genosl" />
|
||||
<implementation name="IM_convert_color4_vector4_genosl" nodedef="ND_convert_color4_vector4" target="genosl" />
|
||||
<implementation name="IM_convert_color3_color4_genosl" nodedef="ND_convert_color3_color4" target="genosl" />
|
||||
<implementation name="IM_convert_color4_color3_genosl" nodedef="ND_convert_color4_color3" target="genosl" />
|
||||
<implementation name="IM_convert_boolean_float_genosl" nodedef="ND_convert_boolean_float" target="genosl" />
|
||||
<implementation name="IM_convert_integer_float_genosl" nodedef="ND_convert_integer_float" target="genosl" />
|
||||
|
||||
<!-- <swizzle> -->
|
||||
<!-- from type: float -->
|
||||
<implementation name="IM_swizzle_float_color3_genosl" nodedef="ND_swizzle_float_color3" target="genosl" />
|
||||
<implementation name="IM_swizzle_float_color4_genosl" nodedef="ND_swizzle_float_color4" target="genosl" />
|
||||
<implementation name="IM_swizzle_float_vector2_genosl" nodedef="ND_swizzle_float_vector2" target="genosl" />
|
||||
<implementation name="IM_swizzle_float_vector3_genosl" nodedef="ND_swizzle_float_vector3" target="genosl" />
|
||||
<implementation name="IM_swizzle_float_vector4_genosl" nodedef="ND_swizzle_float_vector4" target="genosl" />
|
||||
<!-- from type: color3 -->
|
||||
<implementation name="IM_swizzle_color3_float_genosl" nodedef="ND_swizzle_color3_float" target="genosl" />
|
||||
<implementation name="IM_swizzle_color3_color3_genosl" nodedef="ND_swizzle_color3_color3" target="genosl" />
|
||||
<implementation name="IM_swizzle_color3_color4_genosl" nodedef="ND_swizzle_color3_color4" target="genosl" />
|
||||
<implementation name="IM_swizzle_color3_vector2_genosl" nodedef="ND_swizzle_color3_vector2" target="genosl" />
|
||||
<implementation name="IM_swizzle_color3_vector3_genosl" nodedef="ND_swizzle_color3_vector3" target="genosl" />
|
||||
<implementation name="IM_swizzle_color3_vector4_genosl" nodedef="ND_swizzle_color3_vector4" target="genosl" />
|
||||
<!-- from type: color4 -->
|
||||
<implementation name="IM_swizzle_color4_float_genosl" nodedef="ND_swizzle_color4_float" target="genosl" />
|
||||
<implementation name="IM_swizzle_color4_color3_genosl" nodedef="ND_swizzle_color4_color3" target="genosl" />
|
||||
<implementation name="IM_swizzle_color4_color4_genosl" nodedef="ND_swizzle_color4_color4" target="genosl" />
|
||||
<implementation name="IM_swizzle_color4_vector2_genosl" nodedef="ND_swizzle_color4_vector2" target="genosl" />
|
||||
<implementation name="IM_swizzle_color4_vector3_genosl" nodedef="ND_swizzle_color4_vector3" target="genosl" />
|
||||
<implementation name="IM_swizzle_color4_vector4_genosl" nodedef="ND_swizzle_color4_vector4" target="genosl" />
|
||||
<!-- from type: vector2 -->
|
||||
<implementation name="IM_swizzle_vector2_float_genosl" nodedef="ND_swizzle_vector2_float" target="genosl" />
|
||||
<implementation name="IM_swizzle_vector2_color3_genosl" nodedef="ND_swizzle_vector2_color3" target="genosl" />
|
||||
<implementation name="IM_swizzle_vector2_color4_genosl" nodedef="ND_swizzle_vector2_color4" target="genosl" />
|
||||
<implementation name="IM_swizzle_vector2_vector2_genosl" nodedef="ND_swizzle_vector2_vector2" target="genosl" />
|
||||
<implementation name="IM_swizzle_vector2_vector3_genosl" nodedef="ND_swizzle_vector2_vector3" target="genosl" />
|
||||
<implementation name="IM_swizzle_vector2_vector4_genosl" nodedef="ND_swizzle_vector2_vector4" target="genosl" />
|
||||
<!-- from type: vector3 -->
|
||||
<implementation name="IM_swizzle_vector3_float_genosl" nodedef="ND_swizzle_vector3_float" target="genosl" />
|
||||
<implementation name="IM_swizzle_vector3_color3_genosl" nodedef="ND_swizzle_vector3_color3" target="genosl" />
|
||||
<implementation name="IM_swizzle_vector3_color4_genosl" nodedef="ND_swizzle_vector3_color4" target="genosl" />
|
||||
<implementation name="IM_swizzle_vector3_vector2_genosl" nodedef="ND_swizzle_vector3_vector2" target="genosl" />
|
||||
<implementation name="IM_swizzle_vector3_vector3_genosl" nodedef="ND_swizzle_vector3_vector3" target="genosl" />
|
||||
<implementation name="IM_swizzle_vector3_vector4_genosl" nodedef="ND_swizzle_vector3_vector4" target="genosl" />
|
||||
<!-- from type: vector4 -->
|
||||
<implementation name="IM_swizzle_vector4_float_genosl" nodedef="ND_swizzle_vector4_float" target="genosl" />
|
||||
<implementation name="IM_swizzle_vector4_color3_genosl" nodedef="ND_swizzle_vector4_color3" target="genosl" />
|
||||
<implementation name="IM_swizzle_vector4_color4_genosl" nodedef="ND_swizzle_vector4_color4" target="genosl" />
|
||||
<implementation name="IM_swizzle_vector4_vector2_genosl" nodedef="ND_swizzle_vector4_vector2" target="genosl" />
|
||||
<implementation name="IM_swizzle_vector4_vector3_genosl" nodedef="ND_swizzle_vector4_vector3" target="genosl" />
|
||||
<implementation name="IM_swizzle_vector4_vector4_genosl" nodedef="ND_swizzle_vector4_vector4" target="genosl" />
|
||||
|
||||
<!-- <combine2> -->
|
||||
<implementation name="IM_combine2_vector2_genosl" nodedef="ND_combine2_vector2" target="genosl" />
|
||||
<implementation name="IM_combine2_color4CF_genosl" nodedef="ND_combine2_color4CF" target="genosl" />
|
||||
<implementation name="IM_combine2_vector4VF_genosl" nodedef="ND_combine2_vector4VF" target="genosl" />
|
||||
<implementation name="IM_combine2_vector4VV_genosl" nodedef="ND_combine2_vector4VV" target="genosl" />
|
||||
|
||||
<!-- <combine3> -->
|
||||
<implementation name="IM_combine3_color3_genosl" nodedef="ND_combine3_color3" target="genosl" />
|
||||
<implementation name="IM_combine3_vector3_genosl" nodedef="ND_combine3_vector3" target="genosl" />
|
||||
|
||||
<!-- <combine4> -->
|
||||
<implementation name="IM_combine4_color4_genosl" nodedef="ND_combine4_color4" target="genosl" />
|
||||
<implementation name="IM_combine4_vector4_genosl" nodedef="ND_combine4_vector4" target="genosl" />
|
||||
|
||||
<!-- <creatematrix> -->
|
||||
<implementation name="IM_creatematrix_vector3_matrix33_genosl" nodedef="ND_creatematrix_vector3_matrix33" file="mx_creatematrix.osl" function="mx_creatematrix_vector3_matrix33" target="genosl" />
|
||||
<implementation name="IM_creatematrix_vector3_matrix44_genosl" nodedef="ND_creatematrix_vector3_matrix44" file="mx_creatematrix.osl" function="mx_creatematrix_vector3_matrix44" target="genosl" />
|
||||
<implementation name="IM_creatematrix_vector4_matrix44_genosl" nodedef="ND_creatematrix_vector4_matrix44" file="mx_creatematrix.osl" function="mx_creatematrix_vector4_matrix44" target="genosl" />
|
||||
|
||||
<!-- ======================================================================== -->
|
||||
<!-- Convolution nodes -->
|
||||
<!-- ======================================================================== -->
|
||||
|
||||
<!-- <blur> -->
|
||||
<implementation name="IM_blur_float_genosl" nodedef="ND_blur_float" target="genosl" />
|
||||
<implementation name="IM_blur_color3_genosl" nodedef="ND_blur_color3" target="genosl" />
|
||||
<implementation name="IM_blur_color4_genosl" nodedef="ND_blur_color4" target="genosl" />
|
||||
<implementation name="IM_blur_vector2_genosl" nodedef="ND_blur_vector2" target="genosl" />
|
||||
<implementation name="IM_blur_vector3_genosl" nodedef="ND_blur_vector3" target="genosl" />
|
||||
<implementation name="IM_blur_vector4_genosl" nodedef="ND_blur_vector4" target="genosl" />
|
||||
|
||||
<!-- <heighttonormal> -->
|
||||
<implementation name="IM_heighttonormal_vector3_genosl" nodedef="ND_heighttonormal_vector3" file="mx_heighttonormal_vector3.osl" function="mx_heighttonormal_vector3" target="genosl" />
|
||||
|
||||
<!-- ======================================================================== -->
|
||||
<!-- Organization nodes -->
|
||||
<!-- ======================================================================== -->
|
||||
|
||||
<!-- <dot> -->
|
||||
<implementation name="IM_dot_float_genosl" nodedef="ND_dot_float" target="genosl" sourcecode="{{in}}" />
|
||||
<implementation name="IM_dot_color3_genosl" nodedef="ND_dot_color3" target="genosl" sourcecode="{{in}}" />
|
||||
<implementation name="IM_dot_color4_genosl" nodedef="ND_dot_color4" target="genosl" sourcecode="{{in}}" />
|
||||
<implementation name="IM_dot_vector2_genosl" nodedef="ND_dot_vector2" target="genosl" sourcecode="{{in}}" />
|
||||
<implementation name="IM_dot_vector3_genosl" nodedef="ND_dot_vector3" target="genosl" sourcecode="{{in}}" />
|
||||
<implementation name="IM_dot_vector4_genosl" nodedef="ND_dot_vector4" target="genosl" sourcecode="{{in}}" />
|
||||
<implementation name="IM_dot_boolean_genosl" nodedef="ND_dot_boolean" target="genosl" sourcecode="{{in}}" />
|
||||
<implementation name="IM_dot_integer_genosl" nodedef="ND_dot_integer" target="genosl" sourcecode="{{in}}" />
|
||||
<implementation name="IM_dot_matrix33_genosl" nodedef="ND_dot_matrix33" target="genosl" sourcecode="{{in}}" />
|
||||
<implementation name="IM_dot_matrix44_genosl" nodedef="ND_dot_matrix44" target="genosl" sourcecode="{{in}}" />
|
||||
<implementation name="IM_dot_string_genosl" nodedef="ND_dot_string" target="genosl" sourcecode="{{in}}" />
|
||||
<implementation name="IM_dot_filename_genosl" nodedef="ND_dot_filename" target="genosl" sourcecode="{{in}}" />
|
||||
<implementation name="IM_dot_surfaceshader_genosl" nodedef="ND_dot_surfaceshader" target="genosl" sourcecode="{{in}}" />
|
||||
<implementation name="IM_dot_displacementshader_genosl" nodedef="ND_dot_displacementshader" target="genosl" sourcecode="{{in}}" />
|
||||
<implementation name="IM_dot_volumeshader_genosl" nodedef="ND_dot_volumeshader" target="genosl" sourcecode="{{in}}" />
|
||||
<implementation name="IM_dot_lightshader_genosl" nodedef="ND_dot_lightshader" target="genosl" sourcecode="{{in}}" />
|
||||
</materialx>
|
||||
Reference in New Issue
Block a user