Fix T48783: OSL render errors after recent refactoring.
This commit is contained in:
@@ -81,6 +81,7 @@ set(SRC_OSL
|
||||
node_wireframe.osl
|
||||
node_hair_bsdf.osl
|
||||
node_uv_map.osl
|
||||
node_rgb_to_bw.osl
|
||||
)
|
||||
|
||||
set(SRC_OSL_HEADERS
|
||||
|
@@ -88,7 +88,7 @@ shader node_image_texture(
|
||||
string color_space = "sRGB",
|
||||
string projection = "flat",
|
||||
string interpolation = "smartcubic",
|
||||
string wrap = "periodic",
|
||||
string extension = "periodic",
|
||||
float projection_blend = 0.0,
|
||||
int is_float = 1,
|
||||
int use_alpha = 1,
|
||||
@@ -108,7 +108,7 @@ shader node_image_texture(
|
||||
use_alpha,
|
||||
is_float,
|
||||
interpolation,
|
||||
wrap);
|
||||
extension);
|
||||
}
|
||||
else if (projection == "box") {
|
||||
/* object space normal */
|
||||
@@ -184,7 +184,7 @@ shader node_image_texture(
|
||||
use_alpha,
|
||||
is_float,
|
||||
interpolation,
|
||||
wrap);
|
||||
extension);
|
||||
Alpha += weight[0] * tmp_alpha;
|
||||
}
|
||||
if (weight[1] > 0.0) {
|
||||
@@ -195,7 +195,7 @@ shader node_image_texture(
|
||||
use_alpha,
|
||||
is_float,
|
||||
interpolation,
|
||||
wrap);
|
||||
extension);
|
||||
Alpha += weight[1] * tmp_alpha;
|
||||
}
|
||||
if (weight[2] > 0.0) {
|
||||
@@ -206,7 +206,7 @@ shader node_image_texture(
|
||||
use_alpha,
|
||||
is_float,
|
||||
interpolation,
|
||||
wrap);
|
||||
extension);
|
||||
Alpha += weight[2] * tmp_alpha;
|
||||
}
|
||||
}
|
||||
@@ -219,7 +219,7 @@ shader node_image_texture(
|
||||
use_alpha,
|
||||
is_float,
|
||||
interpolation,
|
||||
wrap);
|
||||
extension);
|
||||
}
|
||||
else if (projection == "tube") {
|
||||
point projected = map_to_tube(texco_remap_square(p));
|
||||
@@ -230,6 +230,6 @@ shader node_image_texture(
|
||||
use_alpha,
|
||||
is_float,
|
||||
interpolation,
|
||||
wrap);
|
||||
extension);
|
||||
}
|
||||
}
|
||||
|
25
intern/cycles/kernel/shaders/node_rgb_to_bw.osl
Normal file
25
intern/cycles/kernel/shaders/node_rgb_to_bw.osl
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright 2011-2013 Blender Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "stdosl.h"
|
||||
|
||||
shader node_rgb_to_bw(
|
||||
color Color = 0.0,
|
||||
output float Val = 0.0)
|
||||
{
|
||||
Val = Color[0] * 0.2126 + Color[1] * 0.7152 + Color[2] * 0.0722;
|
||||
}
|
||||
|
Reference in New Issue
Block a user