[Bf-blender-cvs] [0c7aaf9545b] cycles_texture_cache: Cycles: Fixes for OSL with texture caching: Textures are now right side up again and textures read from the cache are assumed to be linear.

Stefan Werner noreply at git.blender.org
Wed Sep 26 13:39:44 CEST 2018


Commit: 0c7aaf9545b65784776da74949c967d1db45405d
Author: Stefan Werner
Date:   Wed Sep 26 13:39:40 2018 +0200
Branches: cycles_texture_cache
https://developer.blender.org/rB0c7aaf9545b65784776da74949c967d1db45405d

Cycles: Fixes for OSL with texture caching: Textures are now right side up again and textures read from the cache are assumed to be linear.

===================================================================

M	intern/cycles/kernel/shaders/node_image_texture.osl

===================================================================

diff --git a/intern/cycles/kernel/shaders/node_image_texture.osl b/intern/cycles/kernel/shaders/node_image_texture.osl
index 7cd2922dd4f..a77c03f8333 100644
--- a/intern/cycles/kernel/shaders/node_image_texture.osl
+++ b/intern/cycles/kernel/shaders/node_image_texture.osl
@@ -64,7 +64,7 @@ color image_texture_lookup(string filename,
                            string interpolation,
                            string extension)
 {
-	color rgb = (color)texture(filename, u, 1.0 - v, "wrap", extension, "interp", interpolation, "alpha", Alpha);
+	color rgb = (color)texture(filename, u, v, "wrap", extension, "interp", interpolation, "alpha", Alpha);
 
 	if (use_alpha) {
 		rgb = color_unpremultiply(rgb, Alpha);
@@ -73,7 +73,7 @@ color image_texture_lookup(string filename,
 			rgb = min(rgb, 1.0);
 	}
 
-	if (color_space == "sRGB") {
+	if (color_space == "sRGB" && !endswith(filename, ".tx")) {
 		rgb = color_srgb_to_scene_linear(rgb);
 	}



More information about the Bf-blender-cvs mailing list