Fix mapping node min/max not working OSL.

This commit is contained in:
Brecht Van Lommel
2012-12-06 09:13:57 +00:00
parent 8274848fa1
commit c20292f624
2 changed files with 12 additions and 1 deletions

View File

@@ -20,9 +20,17 @@
shader node_mapping(
matrix Matrix = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
point mapping_min = point(0.0, 0.0, 0.0),
point mapping_max = point(0.0, 0.0, 0.0),
int use_minmax = 0,
point VectorIn = point(0.0, 0.0, 0.0),
output point VectorOut = point(0.0, 0.0, 0.0))
{
VectorOut = transform(Matrix, VectorIn);
point p = transform(Matrix, VectorIn);
if(use_minmax)
p = min(max(mapping_min, p), mapping_max);
VectorOut = p;
}