Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/cycles/kernel/osl')
-rw-r--r--intern/cycles/kernel/osl/osl_globals.h13
-rw-r--r--intern/cycles/kernel/osl/osl_services.cpp10
2 files changed, 14 insertions, 9 deletions
diff --git a/intern/cycles/kernel/osl/osl_globals.h b/intern/cycles/kernel/osl/osl_globals.h
index 414aaf891db..51bc5cf81a9 100644
--- a/intern/cycles/kernel/osl/osl_globals.h
+++ b/intern/cycles/kernel/osl/osl_globals.h
@@ -37,6 +37,7 @@ using std::isfinite;
CCL_NAMESPACE_BEGIN
class OSLRenderServices;
+class ColorSpaceProcessor;
/* OSL Texture Handle
*
@@ -53,21 +54,15 @@ class OSLRenderServices;
struct OSLTextureHandle : public OIIO::RefCnt {
enum Type { OIIO, SVM, IES, BEVEL, AO };
- OSLTextureHandle() : type(OIIO), svm_slot(-1), oiio_handle(NULL)
- {
- }
-
- OSLTextureHandle(Type type) : type(type), svm_slot(-1), oiio_handle(NULL)
- {
- }
-
- OSLTextureHandle(Type type, int svm_slot) : type(type), svm_slot(svm_slot), oiio_handle(NULL)
+ OSLTextureHandle(Type type = OIIO, int svm_slot = -1)
+ : type(type), svm_slot(svm_slot), oiio_handle(NULL), processor(NULL)
{
}
Type type;
int svm_slot;
OSL::TextureSystem::TextureHandle *oiio_handle;
+ ColorSpaceProcessor *processor;
};
typedef OIIO::intrusive_ptr<OSLTextureHandle> OSLTextureHandleRef;
diff --git a/intern/cycles/kernel/osl/osl_services.cpp b/intern/cycles/kernel/osl/osl_services.cpp
index 7de596a2c30..0257f569f4a 100644
--- a/intern/cycles/kernel/osl/osl_services.cpp
+++ b/intern/cycles/kernel/osl/osl_services.cpp
@@ -25,6 +25,7 @@
#include <string.h>
+#include "render/colorspace.h"
#include "render/mesh.h"
#include "render/object.h"
#include "render/scene.h"
@@ -1116,6 +1117,9 @@ bool OSLRenderServices::texture(ustring filename,
* other nasty stuff happening. */
ts->geterror();
}
+ else if (handle && handle->processor) {
+ ColorSpaceManager::to_scene_linear(handle->processor, result, nchannels);
+ }
break;
}
}
@@ -1213,6 +1217,9 @@ bool OSLRenderServices::texture3d(ustring filename,
* other nasty stuff happening. */
ts->geterror();
}
+ else if (handle && handle->processor) {
+ ColorSpaceManager::to_scene_linear(handle->processor, result, nchannels);
+ }
break;
}
case OSLTextureHandle::IES:
@@ -1287,6 +1294,9 @@ bool OSLRenderServices::environment(ustring filename,
result[3] = 1.0f;
}
}
+ else if (handle && handle->processor) {
+ ColorSpaceManager::to_scene_linear(handle->processor, result, nchannels);
+ }
return status;
}