Cycles: Add implementation of clip extension mode

For now there's no OpenCL support, it'll come later.
This commit is contained in:
Sergey Sharybin
2015-07-28 14:36:08 +02:00
parent 3fba620858
commit 4690281b17
4 changed files with 160 additions and 104 deletions

View File

@@ -379,11 +379,17 @@ void ImageTextureNode::compile(OSLCompiler& compiler)
break;
}
if (extension == EXTENSION_REPEAT) {
compiler.parameter("wrap", "periodic");
}
else {
compiler.parameter("wrap", "clamp");
switch(extension) {
case EXTENSION_EXTEND:
compiler.parameter("wrap", "clamp");
break;
case EXTENSION_CLIP:
compiler.parameter("wrap", "black");
break;
case EXTENSION_REPEAT:
default:
compiler.parameter("wrap", "periodic");
break;
}
compiler.add(this, "node_image_texture");