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:
authorLukas Stockner <lukas.stockner@freenet.de>2019-05-02 16:45:31 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-05-03 16:42:49 +0300
commit68b15fc3ad4f74be192150d3a2fb35e7ef2d4edd (patch)
tree26c2aa7b37c3520417acf13b4a80c3023346b1c2 /intern/cycles/render/nodes.h
parentdba4684f82a179a5c8abdae5940bc7c35e65a1a7 (diff)
Cycles: support loading images from arbitrary OpenColorIO color space
These are the internal changes to Cycles, for Blender integration there are no functional changes in this commit. Images are converted to scene linear color space on file load, and on reading from the OpenImageIO texture cache. 8-bit images are compressed with the sRGB transfer function to avoid precision loss while keeping memory usages low. This also means that for common cases of 8-bit sRGB images no conversion happens at all on image loading. Initial patch by Lukas, completed by Brecht. Differential Revision: https://developer.blender.org/D3491
Diffstat (limited to 'intern/cycles/render/nodes.h')
-rw-r--r--intern/cycles/render/nodes.h52
1 files changed, 31 insertions, 21 deletions
diff --git a/intern/cycles/render/nodes.h b/intern/cycles/render/nodes.h
index 7796711115e..88fa728ecd1 100644
--- a/intern/cycles/render/nodes.h
+++ b/intern/cycles/render/nodes.h
@@ -92,13 +92,18 @@ class ImageTextureNode : public ImageSlotTextureNode {
return true;
}
- ImageManager *image_manager;
- int is_float;
- bool is_linear;
+ virtual bool equals(const ShaderNode &other)
+ {
+ const ImageTextureNode &image_node = (const ImageTextureNode &)other;
+ return ImageSlotTextureNode::equals(other) && builtin_data == image_node.builtin_data &&
+ animated == image_node.animated;
+ }
+
+ /* Parameters. */
bool use_alpha;
ustring filename;
void *builtin_data;
- NodeImageColorSpace color_space;
+ ustring colorspace;
NodeImageProjection projection;
InterpolationType interpolation;
ExtensionType extension;
@@ -106,12 +111,11 @@ class ImageTextureNode : public ImageSlotTextureNode {
bool animated;
float3 vector;
- virtual bool equals(const ShaderNode &other)
- {
- const ImageTextureNode &image_node = (const ImageTextureNode &)other;
- return ImageSlotTextureNode::equals(other) && builtin_data == image_node.builtin_data &&
- animated == image_node.animated;
- }
+ /* Runtime. */
+ ImageManager *image_manager;
+ int is_float;
+ bool compress_as_srgb;
+ ustring known_colorspace;
};
class EnvironmentTextureNode : public ImageSlotTextureNode {
@@ -129,24 +133,28 @@ class EnvironmentTextureNode : public ImageSlotTextureNode {
return NODE_GROUP_LEVEL_2;
}
- ImageManager *image_manager;
- int is_float;
- bool is_linear;
+ virtual bool equals(const ShaderNode &other)
+ {
+ const EnvironmentTextureNode &env_node = (const EnvironmentTextureNode &)other;
+ return ImageSlotTextureNode::equals(other) && builtin_data == env_node.builtin_data &&
+ animated == env_node.animated;
+ }
+
+ /* Parameters. */
bool use_alpha;
ustring filename;
void *builtin_data;
- NodeImageColorSpace color_space;
+ ustring colorspace;
NodeEnvironmentProjection projection;
InterpolationType interpolation;
bool animated;
float3 vector;
- virtual bool equals(const ShaderNode &other)
- {
- const EnvironmentTextureNode &env_node = (const EnvironmentTextureNode &)other;
- return ImageSlotTextureNode::equals(other) && builtin_data == env_node.builtin_data &&
- animated == env_node.animated;
- }
+ /* Runtime. */
+ ImageManager *image_manager;
+ int is_float;
+ bool compress_as_srgb;
+ ustring known_colorspace;
};
class SkyTextureNode : public TextureNode {
@@ -319,15 +327,17 @@ class PointDensityTextureNode : public ShaderNode {
void add_image();
+ /* Parameters. */
ustring filename;
NodeTexVoxelSpace space;
InterpolationType interpolation;
Transform tfm;
float3 vector;
+ void *builtin_data;
+ /* Runtime. */
ImageManager *image_manager;
int slot;
- void *builtin_data;
virtual bool equals(const ShaderNode &other)
{