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:
-rw-r--r--intern/cycles/kernel/shaders/CMakeLists.txt19
-rw-r--r--intern/cycles/kernel/shaders/node_absorption_volume.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_add_closure.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_ambient_occlusion.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_anisotropic_bsdf.osl3
-rw-r--r--intern/cycles/kernel/shaders/node_attribute.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_background.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_bevel.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_blackbody.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_brick_texture.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_brightness.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_bump.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_camera.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_checker_texture.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_clamp.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_combine_hsv.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_combine_rgb.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_combine_xyz.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_convert_from_color.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_convert_from_float.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_convert_from_int.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_convert_from_normal.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_convert_from_point.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_convert_from_string.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_convert_from_vector.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_diffuse_bsdf.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_displacement.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_emission.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_environment_texture.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_fresnel.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_gamma.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_geometry.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_glass_bsdf.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_glossy_bsdf.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_gradient_texture.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_hair_bsdf.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_hair_info.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_hash.h2
-rw-r--r--intern/cycles/kernel/shaders/node_holdout.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_hsv.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_ies_light.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_image_texture.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_invert.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_layer_weight.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_light_falloff.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_light_path.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_magic_texture.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_map_range.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_mapping.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_math.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_mix.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_mix_closure.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_musgrave_texture.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_noise_texture.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_normal.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_normal_map.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_object_info.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_output_displacement.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_output_surface.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_output_volume.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_particle_info.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_principled_bsdf.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_principled_hair_bsdf.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_principled_volume.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_refraction_bsdf.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_rgb_curves.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_rgb_ramp.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_rgb_to_bw.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_scatter_volume.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_separate_hsv.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_separate_rgb.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_separate_xyz.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_set_normal.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_sky_texture.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_subsurface_scattering.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_tangent.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_texture_coordinate.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_toon_bsdf.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_translucent_bsdf.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_transparent_bsdf.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_uv_map.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_value.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_vector_curves.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_vector_displacement.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_vector_math.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_vector_transform.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_velvet_bsdf.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_vertex_color.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_voronoi_texture.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_voxel_texture.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_wave_texture.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_wavelength.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_white_noise_texture.osl2
-rw-r--r--intern/cycles/kernel/shaders/node_wireframe.osl2
-rw-r--r--intern/cycles/kernel/shaders/oslutil.h101
-rw-r--r--intern/cycles/kernel/shaders/stdcycles.h151
-rw-r--r--intern/cycles/kernel/shaders/stdosl.h880
-rw-r--r--intern/cycles/kernel/shaders/vector2.h291
-rw-r--r--intern/cycles/kernel/shaders/vector4.h327
-rw-r--r--intern/cycles/render/osl.cpp2
100 files changed, 260 insertions, 1698 deletions
diff --git a/intern/cycles/kernel/shaders/CMakeLists.txt b/intern/cycles/kernel/shaders/CMakeLists.txt
index f4258da70d3..8605f23b8fa 100644
--- a/intern/cycles/kernel/shaders/CMakeLists.txt
+++ b/intern/cycles/kernel/shaders/CMakeLists.txt
@@ -95,16 +95,27 @@ set(SRC_OSL
node_rgb_to_bw.osl
)
+# FindOSL.cmake does not give us the location of the shader library
+# but generally it can be figured out from the location of the oslc
+# compiler. However if this fails you can set OSL_SHADER_DIR to
+# bypass the auto discovery.
+if(NOT DEFINED OSL_SHADER_DIR)
+ get_filename_component(OSL_SHADER_DIR ${OSL_COMPILER} DIRECTORY)
+ get_filename_component(OSL_SHADER_DIR ${OSL_SHADER_DIR}/../shaders ABSOLUTE)
+endif()
+
+# The headers that OSL ships differs per release so we can not
+# hardcode this.
+file(GLOB SRC_OSL_HEADER_DIST ${OSL_SHADER_DIR}/*.h)
+
set(SRC_OSL_HEADERS
node_color.h
node_fresnel.h
node_hash.h
node_noise.h
node_ramp_util.h
- stdosl.h
- oslutil.h
- vector2.h
- vector4.h
+ stdcycles.h
+ ${SRC_OSL_HEADER_DIST}
)
set(SRC_OSO
diff --git a/intern/cycles/kernel/shaders/node_absorption_volume.osl b/intern/cycles/kernel/shaders/node_absorption_volume.osl
index e99bd254666..37ccc4c969f 100644
--- a/intern/cycles/kernel/shaders/node_absorption_volume.osl
+++ b/intern/cycles/kernel/shaders/node_absorption_volume.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_absorption_volume(color Color = color(0.8, 0.8, 0.8),
float Density = 1.0,
diff --git a/intern/cycles/kernel/shaders/node_add_closure.osl b/intern/cycles/kernel/shaders/node_add_closure.osl
index 077e2735e61..27ecc9ef0c2 100644
--- a/intern/cycles/kernel/shaders/node_add_closure.osl
+++ b/intern/cycles/kernel/shaders/node_add_closure.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_add_closure(closure color Closure1 = 0,
closure color Closure2 = 0,
diff --git a/intern/cycles/kernel/shaders/node_ambient_occlusion.osl b/intern/cycles/kernel/shaders/node_ambient_occlusion.osl
index 7bf28719e78..22d245d0698 100644
--- a/intern/cycles/kernel/shaders/node_ambient_occlusion.osl
+++ b/intern/cycles/kernel/shaders/node_ambient_occlusion.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_ambient_occlusion(color ColorIn = color(1.0, 1.0, 1.0),
int samples = 16,
diff --git a/intern/cycles/kernel/shaders/node_anisotropic_bsdf.osl b/intern/cycles/kernel/shaders/node_anisotropic_bsdf.osl
index 165c09eb8e0..5da511b9619 100644
--- a/intern/cycles/kernel/shaders/node_anisotropic_bsdf.osl
+++ b/intern/cycles/kernel/shaders/node_anisotropic_bsdf.osl
@@ -13,8 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
-#include "stdosl.h"
+ #include "stdcycles.h"
shader node_anisotropic_bsdf(color Color = 0.0,
string distribution = "GGX",
diff --git a/intern/cycles/kernel/shaders/node_attribute.osl b/intern/cycles/kernel/shaders/node_attribute.osl
index 336543cc130..abec8ebfbf0 100644
--- a/intern/cycles/kernel/shaders/node_attribute.osl
+++ b/intern/cycles/kernel/shaders/node_attribute.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_attribute(string bump_offset = "center",
string name = "",
diff --git a/intern/cycles/kernel/shaders/node_background.osl b/intern/cycles/kernel/shaders/node_background.osl
index 6ded0d2c65c..3f45db751b3 100644
--- a/intern/cycles/kernel/shaders/node_background.osl
+++ b/intern/cycles/kernel/shaders/node_background.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_background(color Color = 0.8,
float Strength = 1.0,
diff --git a/intern/cycles/kernel/shaders/node_bevel.osl b/intern/cycles/kernel/shaders/node_bevel.osl
index 189c20c52e7..e87ddab716d 100644
--- a/intern/cycles/kernel/shaders/node_bevel.osl
+++ b/intern/cycles/kernel/shaders/node_bevel.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_bevel(int samples = 4,
float Radius = 0.05,
diff --git a/intern/cycles/kernel/shaders/node_blackbody.osl b/intern/cycles/kernel/shaders/node_blackbody.osl
index 8a24bf1e28b..741efae755d 100644
--- a/intern/cycles/kernel/shaders/node_blackbody.osl
+++ b/intern/cycles/kernel/shaders/node_blackbody.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_blackbody(float Temperature = 1200.0, output color Color = 0.0)
{
diff --git a/intern/cycles/kernel/shaders/node_brick_texture.osl b/intern/cycles/kernel/shaders/node_brick_texture.osl
index 30644ef2ff3..075a324c730 100644
--- a/intern/cycles/kernel/shaders/node_brick_texture.osl
+++ b/intern/cycles/kernel/shaders/node_brick_texture.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
/* Brick */
diff --git a/intern/cycles/kernel/shaders/node_brightness.osl b/intern/cycles/kernel/shaders/node_brightness.osl
index 2defbc4b1db..019edfb79a3 100644
--- a/intern/cycles/kernel/shaders/node_brightness.osl
+++ b/intern/cycles/kernel/shaders/node_brightness.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_brightness(color ColorIn = 0.8,
float Bright = 0.0,
diff --git a/intern/cycles/kernel/shaders/node_bump.osl b/intern/cycles/kernel/shaders/node_bump.osl
index 3697bb37fd9..811182f40b5 100644
--- a/intern/cycles/kernel/shaders/node_bump.osl
+++ b/intern/cycles/kernel/shaders/node_bump.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
/* "Bump Mapping Unparameterized Surfaces on the GPU"
* Morten S. Mikkelsen, 2010 */
diff --git a/intern/cycles/kernel/shaders/node_camera.osl b/intern/cycles/kernel/shaders/node_camera.osl
index 833e9e775fe..45ca50c6e1e 100644
--- a/intern/cycles/kernel/shaders/node_camera.osl
+++ b/intern/cycles/kernel/shaders/node_camera.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_camera(output vector ViewVector = vector(0.0, 0.0, 0.0),
output float ViewZDepth = 0.0,
diff --git a/intern/cycles/kernel/shaders/node_checker_texture.osl b/intern/cycles/kernel/shaders/node_checker_texture.osl
index e05cf20099f..d6a30dbdb40 100644
--- a/intern/cycles/kernel/shaders/node_checker_texture.osl
+++ b/intern/cycles/kernel/shaders/node_checker_texture.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
/* Checker */
diff --git a/intern/cycles/kernel/shaders/node_clamp.osl b/intern/cycles/kernel/shaders/node_clamp.osl
index d689ba7f809..ce9392a0d98 100644
--- a/intern/cycles/kernel/shaders/node_clamp.osl
+++ b/intern/cycles/kernel/shaders/node_clamp.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_clamp(string type = "minmax",
float Value = 1.0,
diff --git a/intern/cycles/kernel/shaders/node_combine_hsv.osl b/intern/cycles/kernel/shaders/node_combine_hsv.osl
index 1658cf3d774..05e502b5bc1 100644
--- a/intern/cycles/kernel/shaders/node_combine_hsv.osl
+++ b/intern/cycles/kernel/shaders/node_combine_hsv.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_combine_hsv(float H = 0.0, float S = 0.0, float V = 0.0, output color Color = 0.8)
{
diff --git a/intern/cycles/kernel/shaders/node_combine_rgb.osl b/intern/cycles/kernel/shaders/node_combine_rgb.osl
index aaa95e9c5af..036f371eb5c 100644
--- a/intern/cycles/kernel/shaders/node_combine_rgb.osl
+++ b/intern/cycles/kernel/shaders/node_combine_rgb.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_combine_rgb(float R = 0.0, float G = 0.0, float B = 0.0, output color Image = 0.8)
{
diff --git a/intern/cycles/kernel/shaders/node_combine_xyz.osl b/intern/cycles/kernel/shaders/node_combine_xyz.osl
index 4ab49168704..4ebd86b605c 100644
--- a/intern/cycles/kernel/shaders/node_combine_xyz.osl
+++ b/intern/cycles/kernel/shaders/node_combine_xyz.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_combine_xyz(float X = 0.0, float Y = 0.0, float Z = 0.0, output vector Vector = 0.8)
{
diff --git a/intern/cycles/kernel/shaders/node_convert_from_color.osl b/intern/cycles/kernel/shaders/node_convert_from_color.osl
index 7ea9a1e4fb3..c3f0e118844 100644
--- a/intern/cycles/kernel/shaders/node_convert_from_color.osl
+++ b/intern/cycles/kernel/shaders/node_convert_from_color.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_convert_from_color(color value_color = 0.0,
output string value_string = "",
diff --git a/intern/cycles/kernel/shaders/node_convert_from_float.osl b/intern/cycles/kernel/shaders/node_convert_from_float.osl
index 13b5dea0838..61a15a1c2b0 100644
--- a/intern/cycles/kernel/shaders/node_convert_from_float.osl
+++ b/intern/cycles/kernel/shaders/node_convert_from_float.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_convert_from_float(float value_float = 0.0,
output string value_string = "",
diff --git a/intern/cycles/kernel/shaders/node_convert_from_int.osl b/intern/cycles/kernel/shaders/node_convert_from_int.osl
index a59e025d822..2e6a99b2765 100644
--- a/intern/cycles/kernel/shaders/node_convert_from_int.osl
+++ b/intern/cycles/kernel/shaders/node_convert_from_int.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_convert_from_int(int value_int = 0,
output string value_string = "",
diff --git a/intern/cycles/kernel/shaders/node_convert_from_normal.osl b/intern/cycles/kernel/shaders/node_convert_from_normal.osl
index 7bdd94d1941..64201d63190 100644
--- a/intern/cycles/kernel/shaders/node_convert_from_normal.osl
+++ b/intern/cycles/kernel/shaders/node_convert_from_normal.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_convert_from_normal(normal value_normal = normal(0.0, 0.0, 0.0),
output string value_string = "",
diff --git a/intern/cycles/kernel/shaders/node_convert_from_point.osl b/intern/cycles/kernel/shaders/node_convert_from_point.osl
index 79c1719e7a7..11d64f76d6f 100644
--- a/intern/cycles/kernel/shaders/node_convert_from_point.osl
+++ b/intern/cycles/kernel/shaders/node_convert_from_point.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_convert_from_point(point value_point = point(0.0, 0.0, 0.0),
output string value_string = "",
diff --git a/intern/cycles/kernel/shaders/node_convert_from_string.osl b/intern/cycles/kernel/shaders/node_convert_from_string.osl
index 48d894a6b3e..b496c4e6d05 100644
--- a/intern/cycles/kernel/shaders/node_convert_from_string.osl
+++ b/intern/cycles/kernel/shaders/node_convert_from_string.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_convert_from_string(string value_string = "",
output color value_color = color(0.0, 0.0, 0.0),
diff --git a/intern/cycles/kernel/shaders/node_convert_from_vector.osl b/intern/cycles/kernel/shaders/node_convert_from_vector.osl
index 92ab2313bcb..820faabd32b 100644
--- a/intern/cycles/kernel/shaders/node_convert_from_vector.osl
+++ b/intern/cycles/kernel/shaders/node_convert_from_vector.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_convert_from_vector(vector value_vector = vector(0.0, 0.0, 0.0),
output string value_string = "",
diff --git a/intern/cycles/kernel/shaders/node_diffuse_bsdf.osl b/intern/cycles/kernel/shaders/node_diffuse_bsdf.osl
index bd5554b838a..f5886f534eb 100644
--- a/intern/cycles/kernel/shaders/node_diffuse_bsdf.osl
+++ b/intern/cycles/kernel/shaders/node_diffuse_bsdf.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_diffuse_bsdf(color Color = 0.8,
float Roughness = 0.0,
diff --git a/intern/cycles/kernel/shaders/node_displacement.osl b/intern/cycles/kernel/shaders/node_displacement.osl
index a1f3b7b7737..44a4828d511 100644
--- a/intern/cycles/kernel/shaders/node_displacement.osl
+++ b/intern/cycles/kernel/shaders/node_displacement.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_displacement(string space = "object",
float Height = 0.0,
diff --git a/intern/cycles/kernel/shaders/node_emission.osl b/intern/cycles/kernel/shaders/node_emission.osl
index 57973f57ac6..f289a9711d9 100644
--- a/intern/cycles/kernel/shaders/node_emission.osl
+++ b/intern/cycles/kernel/shaders/node_emission.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_emission(color Color = 0.8, float Strength = 1.0, output closure color Emission = 0)
{
diff --git a/intern/cycles/kernel/shaders/node_environment_texture.osl b/intern/cycles/kernel/shaders/node_environment_texture.osl
index 43f607f7cb0..2bae30c785c 100644
--- a/intern/cycles/kernel/shaders/node_environment_texture.osl
+++ b/intern/cycles/kernel/shaders/node_environment_texture.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
#include "node_color.h"
vector environment_texture_direction_to_equirectangular(vector dir)
diff --git a/intern/cycles/kernel/shaders/node_fresnel.osl b/intern/cycles/kernel/shaders/node_fresnel.osl
index 89250db40f3..1658debf82c 100644
--- a/intern/cycles/kernel/shaders/node_fresnel.osl
+++ b/intern/cycles/kernel/shaders/node_fresnel.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
#include "node_fresnel.h"
shader node_fresnel(float IOR = 1.45, normal Normal = N, output float Fac = 0.0)
diff --git a/intern/cycles/kernel/shaders/node_gamma.osl b/intern/cycles/kernel/shaders/node_gamma.osl
index 9b9c17dc8af..0816df64fe8 100644
--- a/intern/cycles/kernel/shaders/node_gamma.osl
+++ b/intern/cycles/kernel/shaders/node_gamma.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_gamma(color ColorIn = 0.8, float Gamma = 1.0, output color ColorOut = 0.0)
{
diff --git a/intern/cycles/kernel/shaders/node_geometry.osl b/intern/cycles/kernel/shaders/node_geometry.osl
index 3cf2e974022..55cda71db1b 100644
--- a/intern/cycles/kernel/shaders/node_geometry.osl
+++ b/intern/cycles/kernel/shaders/node_geometry.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_geometry(normal NormalIn = N,
string bump_offset = "center",
diff --git a/intern/cycles/kernel/shaders/node_glass_bsdf.osl b/intern/cycles/kernel/shaders/node_glass_bsdf.osl
index c0b8a002536..120d57c37dd 100644
--- a/intern/cycles/kernel/shaders/node_glass_bsdf.osl
+++ b/intern/cycles/kernel/shaders/node_glass_bsdf.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
#include "node_fresnel.h"
shader node_glass_bsdf(color Color = 0.8,
diff --git a/intern/cycles/kernel/shaders/node_glossy_bsdf.osl b/intern/cycles/kernel/shaders/node_glossy_bsdf.osl
index 2d40ee8d3f6..a93b013c1d6 100644
--- a/intern/cycles/kernel/shaders/node_glossy_bsdf.osl
+++ b/intern/cycles/kernel/shaders/node_glossy_bsdf.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
#include "node_fresnel.h"
shader node_glossy_bsdf(color Color = 0.8,
diff --git a/intern/cycles/kernel/shaders/node_gradient_texture.osl b/intern/cycles/kernel/shaders/node_gradient_texture.osl
index 6cb181aee72..e9acebc0572 100644
--- a/intern/cycles/kernel/shaders/node_gradient_texture.osl
+++ b/intern/cycles/kernel/shaders/node_gradient_texture.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
/* Gradient */
diff --git a/intern/cycles/kernel/shaders/node_hair_bsdf.osl b/intern/cycles/kernel/shaders/node_hair_bsdf.osl
index bc912087666..3e0ac7af2e0 100644
--- a/intern/cycles/kernel/shaders/node_hair_bsdf.osl
+++ b/intern/cycles/kernel/shaders/node_hair_bsdf.osl
@@ -16,7 +16,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_hair_bsdf(color Color = 0.8,
string component = "reflection",
diff --git a/intern/cycles/kernel/shaders/node_hair_info.osl b/intern/cycles/kernel/shaders/node_hair_info.osl
index 991a27c4103..ee08ea57e68 100644
--- a/intern/cycles/kernel/shaders/node_hair_info.osl
+++ b/intern/cycles/kernel/shaders/node_hair_info.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_hair_info(output float IsStrand = 0.0,
output float Intercept = 0.0,
diff --git a/intern/cycles/kernel/shaders/node_hash.h b/intern/cycles/kernel/shaders/node_hash.h
index 7affe432bf2..b42e42ff910 100644
--- a/intern/cycles/kernel/shaders/node_hash.h
+++ b/intern/cycles/kernel/shaders/node_hash.h
@@ -1,4 +1,4 @@
-#include "stdosl.h"
+#include "stdcycles.h"
#include "vector2.h"
#include "vector4.h"
diff --git a/intern/cycles/kernel/shaders/node_holdout.osl b/intern/cycles/kernel/shaders/node_holdout.osl
index b51bc0543a5..92e41c92f72 100644
--- a/intern/cycles/kernel/shaders/node_holdout.osl
+++ b/intern/cycles/kernel/shaders/node_holdout.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_holdout(output closure color Holdout = holdout())
{
diff --git a/intern/cycles/kernel/shaders/node_hsv.osl b/intern/cycles/kernel/shaders/node_hsv.osl
index 30c56a20a92..40bef11977e 100644
--- a/intern/cycles/kernel/shaders/node_hsv.osl
+++ b/intern/cycles/kernel/shaders/node_hsv.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
#include "node_color.h"
shader node_hsv(float Hue = 0.5,
diff --git a/intern/cycles/kernel/shaders/node_ies_light.osl b/intern/cycles/kernel/shaders/node_ies_light.osl
index 4d881eb3b65..76348b4d758 100644
--- a/intern/cycles/kernel/shaders/node_ies_light.osl
+++ b/intern/cycles/kernel/shaders/node_ies_light.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
/* IES Light */
diff --git a/intern/cycles/kernel/shaders/node_image_texture.osl b/intern/cycles/kernel/shaders/node_image_texture.osl
index 9a0f2d054ea..bfaab514321 100644
--- a/intern/cycles/kernel/shaders/node_image_texture.osl
+++ b/intern/cycles/kernel/shaders/node_image_texture.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
#include "node_color.h"
point texco_remap_square(point co)
diff --git a/intern/cycles/kernel/shaders/node_invert.osl b/intern/cycles/kernel/shaders/node_invert.osl
index c7d41e4e129..23c16935ca1 100644
--- a/intern/cycles/kernel/shaders/node_invert.osl
+++ b/intern/cycles/kernel/shaders/node_invert.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_invert(float Fac = 1.0, color ColorIn = 0.8, output color ColorOut = 0.8)
{
diff --git a/intern/cycles/kernel/shaders/node_layer_weight.osl b/intern/cycles/kernel/shaders/node_layer_weight.osl
index 7c46f28b41b..4da69b62d2e 100644
--- a/intern/cycles/kernel/shaders/node_layer_weight.osl
+++ b/intern/cycles/kernel/shaders/node_layer_weight.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
#include "node_fresnel.h"
shader node_layer_weight(float Blend = 0.5,
diff --git a/intern/cycles/kernel/shaders/node_light_falloff.osl b/intern/cycles/kernel/shaders/node_light_falloff.osl
index d0d7dd9c5aa..3f3c9444a5a 100644
--- a/intern/cycles/kernel/shaders/node_light_falloff.osl
+++ b/intern/cycles/kernel/shaders/node_light_falloff.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_light_falloff(float Strength = 0.0,
float Smooth = 0.0,
diff --git a/intern/cycles/kernel/shaders/node_light_path.osl b/intern/cycles/kernel/shaders/node_light_path.osl
index c4a3624a67f..4ff06915771 100644
--- a/intern/cycles/kernel/shaders/node_light_path.osl
+++ b/intern/cycles/kernel/shaders/node_light_path.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_light_path(output float IsCameraRay = 0.0,
output float IsShadowRay = 0.0,
diff --git a/intern/cycles/kernel/shaders/node_magic_texture.osl b/intern/cycles/kernel/shaders/node_magic_texture.osl
index 26e7d57278b..476c6895f05 100644
--- a/intern/cycles/kernel/shaders/node_magic_texture.osl
+++ b/intern/cycles/kernel/shaders/node_magic_texture.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
/* Magic */
diff --git a/intern/cycles/kernel/shaders/node_map_range.osl b/intern/cycles/kernel/shaders/node_map_range.osl
index 242ec4271ed..1c49027e6dd 100644
--- a/intern/cycles/kernel/shaders/node_map_range.osl
+++ b/intern/cycles/kernel/shaders/node_map_range.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
float safe_divide(float a, float b)
{
diff --git a/intern/cycles/kernel/shaders/node_mapping.osl b/intern/cycles/kernel/shaders/node_mapping.osl
index e8a9d940eda..8d204999630 100644
--- a/intern/cycles/kernel/shaders/node_mapping.osl
+++ b/intern/cycles/kernel/shaders/node_mapping.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
point safe_divide(point a, point b)
{
diff --git a/intern/cycles/kernel/shaders/node_math.osl b/intern/cycles/kernel/shaders/node_math.osl
index 1eccb56405b..54a2e38dcd6 100644
--- a/intern/cycles/kernel/shaders/node_math.osl
+++ b/intern/cycles/kernel/shaders/node_math.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
float safe_divide(float a, float b)
{
diff --git a/intern/cycles/kernel/shaders/node_mix.osl b/intern/cycles/kernel/shaders/node_mix.osl
index 9fbd3391ade..a296b139af5 100644
--- a/intern/cycles/kernel/shaders/node_mix.osl
+++ b/intern/cycles/kernel/shaders/node_mix.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
#include "node_color.h"
color node_mix_blend(float t, color col1, color col2)
diff --git a/intern/cycles/kernel/shaders/node_mix_closure.osl b/intern/cycles/kernel/shaders/node_mix_closure.osl
index 517c59c8786..94fc2171c44 100644
--- a/intern/cycles/kernel/shaders/node_mix_closure.osl
+++ b/intern/cycles/kernel/shaders/node_mix_closure.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_mix_closure(float Fac = 0.5,
closure color Closure1 = 0,
diff --git a/intern/cycles/kernel/shaders/node_musgrave_texture.osl b/intern/cycles/kernel/shaders/node_musgrave_texture.osl
index d23ecfd4a31..cd054102968 100644
--- a/intern/cycles/kernel/shaders/node_musgrave_texture.osl
+++ b/intern/cycles/kernel/shaders/node_musgrave_texture.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
#include "node_noise.h"
#include "vector2.h"
#include "vector4.h"
diff --git a/intern/cycles/kernel/shaders/node_noise_texture.osl b/intern/cycles/kernel/shaders/node_noise_texture.osl
index 6cff1cdab2c..ab8f304c80d 100644
--- a/intern/cycles/kernel/shaders/node_noise_texture.osl
+++ b/intern/cycles/kernel/shaders/node_noise_texture.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
#include "vector2.h"
#include "vector4.h"
#include "node_noise.h"
diff --git a/intern/cycles/kernel/shaders/node_normal.osl b/intern/cycles/kernel/shaders/node_normal.osl
index 1d20c3e7cac..a0a88445427 100644
--- a/intern/cycles/kernel/shaders/node_normal.osl
+++ b/intern/cycles/kernel/shaders/node_normal.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_normal(normal direction = normal(0.0, 0.0, 0.0),
normal NormalIn = normal(0.0, 0.0, 0.0),
diff --git a/intern/cycles/kernel/shaders/node_normal_map.osl b/intern/cycles/kernel/shaders/node_normal_map.osl
index 90b593d00bc..912960f13ab 100644
--- a/intern/cycles/kernel/shaders/node_normal_map.osl
+++ b/intern/cycles/kernel/shaders/node_normal_map.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_normal_map(normal NormalIn = N,
float Strength = 1.0,
diff --git a/intern/cycles/kernel/shaders/node_object_info.osl b/intern/cycles/kernel/shaders/node_object_info.osl
index 350404bb747..44513d9a1ba 100644
--- a/intern/cycles/kernel/shaders/node_object_info.osl
+++ b/intern/cycles/kernel/shaders/node_object_info.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_object_info(output point Location = point(0.0, 0.0, 0.0),
output color Color = color(1.0, 1.0, 1.0),
diff --git a/intern/cycles/kernel/shaders/node_output_displacement.osl b/intern/cycles/kernel/shaders/node_output_displacement.osl
index fa7f603980b..bd60fc2b7e1 100644
--- a/intern/cycles/kernel/shaders/node_output_displacement.osl
+++ b/intern/cycles/kernel/shaders/node_output_displacement.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
displacement node_output_displacement(vector Displacement = 0.0)
{
diff --git a/intern/cycles/kernel/shaders/node_output_surface.osl b/intern/cycles/kernel/shaders/node_output_surface.osl
index 013666145da..cd746f79c4a 100644
--- a/intern/cycles/kernel/shaders/node_output_surface.osl
+++ b/intern/cycles/kernel/shaders/node_output_surface.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
surface node_output_surface(closure color Surface = 0)
{
diff --git a/intern/cycles/kernel/shaders/node_output_volume.osl b/intern/cycles/kernel/shaders/node_output_volume.osl
index dd479e751b3..4cc14cd6699 100644
--- a/intern/cycles/kernel/shaders/node_output_volume.osl
+++ b/intern/cycles/kernel/shaders/node_output_volume.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
volume node_output_volume(closure color Volume = 0)
{
diff --git a/intern/cycles/kernel/shaders/node_particle_info.osl b/intern/cycles/kernel/shaders/node_particle_info.osl
index e286c33a1ff..2dcdf3d0f3c 100644
--- a/intern/cycles/kernel/shaders/node_particle_info.osl
+++ b/intern/cycles/kernel/shaders/node_particle_info.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_particle_info(output float Index = 0.0,
output float Random = 0.0,
diff --git a/intern/cycles/kernel/shaders/node_principled_bsdf.osl b/intern/cycles/kernel/shaders/node_principled_bsdf.osl
index 657ced9b6e6..7fb562ffe47 100644
--- a/intern/cycles/kernel/shaders/node_principled_bsdf.osl
+++ b/intern/cycles/kernel/shaders/node_principled_bsdf.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
#include "node_fresnel.h"
shader node_principled_bsdf(string distribution = "Multiscatter GGX",
diff --git a/intern/cycles/kernel/shaders/node_principled_hair_bsdf.osl b/intern/cycles/kernel/shaders/node_principled_hair_bsdf.osl
index bf986438fca..4cf17e0e703 100644
--- a/intern/cycles/kernel/shaders/node_principled_hair_bsdf.osl
+++ b/intern/cycles/kernel/shaders/node_principled_hair_bsdf.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
color log3(color a)
{
diff --git a/intern/cycles/kernel/shaders/node_principled_volume.osl b/intern/cycles/kernel/shaders/node_principled_volume.osl
index 39cf6837eb2..0cb4cdebdaa 100644
--- a/intern/cycles/kernel/shaders/node_principled_volume.osl
+++ b/intern/cycles/kernel/shaders/node_principled_volume.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_principled_volume(color Color = color(0.5, 0.5, 0.5),
float Density = 1.0,
diff --git a/intern/cycles/kernel/shaders/node_refraction_bsdf.osl b/intern/cycles/kernel/shaders/node_refraction_bsdf.osl
index 941d99dd44d..9e9b31d9a87 100644
--- a/intern/cycles/kernel/shaders/node_refraction_bsdf.osl
+++ b/intern/cycles/kernel/shaders/node_refraction_bsdf.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_refraction_bsdf(color Color = 0.8,
string distribution = "sharp",
diff --git a/intern/cycles/kernel/shaders/node_rgb_curves.osl b/intern/cycles/kernel/shaders/node_rgb_curves.osl
index e34eb027cc3..1aca7966257 100644
--- a/intern/cycles/kernel/shaders/node_rgb_curves.osl
+++ b/intern/cycles/kernel/shaders/node_rgb_curves.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
#include "node_ramp_util.h"
shader node_rgb_curves(color ramp[] = {0.0},
diff --git a/intern/cycles/kernel/shaders/node_rgb_ramp.osl b/intern/cycles/kernel/shaders/node_rgb_ramp.osl
index c9f9746a4fb..5d4e13cbca6 100644
--- a/intern/cycles/kernel/shaders/node_rgb_ramp.osl
+++ b/intern/cycles/kernel/shaders/node_rgb_ramp.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
#include "node_ramp_util.h"
shader node_rgb_ramp(color ramp_color[] = {0.0},
diff --git a/intern/cycles/kernel/shaders/node_rgb_to_bw.osl b/intern/cycles/kernel/shaders/node_rgb_to_bw.osl
index 837d6caf5fc..f0a094d5b57 100644
--- a/intern/cycles/kernel/shaders/node_rgb_to_bw.osl
+++ b/intern/cycles/kernel/shaders/node_rgb_to_bw.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_rgb_to_bw(color Color = 0.0, output float Val = 0.0)
{
diff --git a/intern/cycles/kernel/shaders/node_scatter_volume.osl b/intern/cycles/kernel/shaders/node_scatter_volume.osl
index fce5716f372..36ad952dee6 100644
--- a/intern/cycles/kernel/shaders/node_scatter_volume.osl
+++ b/intern/cycles/kernel/shaders/node_scatter_volume.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_scatter_volume(color Color = color(0.8, 0.8, 0.8),
float Density = 1.0,
diff --git a/intern/cycles/kernel/shaders/node_separate_hsv.osl b/intern/cycles/kernel/shaders/node_separate_hsv.osl
index c77ed1f3755..ad1d7ae70d7 100644
--- a/intern/cycles/kernel/shaders/node_separate_hsv.osl
+++ b/intern/cycles/kernel/shaders/node_separate_hsv.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
#include "node_color.h"
shader node_separate_hsv(color Color = 0.8,
diff --git a/intern/cycles/kernel/shaders/node_separate_rgb.osl b/intern/cycles/kernel/shaders/node_separate_rgb.osl
index ee64add27e2..62e4aedb879 100644
--- a/intern/cycles/kernel/shaders/node_separate_rgb.osl
+++ b/intern/cycles/kernel/shaders/node_separate_rgb.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_separate_rgb(color Image = 0.8,
output float R = 0.0,
diff --git a/intern/cycles/kernel/shaders/node_separate_xyz.osl b/intern/cycles/kernel/shaders/node_separate_xyz.osl
index 8a563f5e920..acaf3942b6f 100644
--- a/intern/cycles/kernel/shaders/node_separate_xyz.osl
+++ b/intern/cycles/kernel/shaders/node_separate_xyz.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_separate_xyz(vector Vector = 0.8,
output float X = 0.0,
diff --git a/intern/cycles/kernel/shaders/node_set_normal.osl b/intern/cycles/kernel/shaders/node_set_normal.osl
index 9541b829ef7..26a97e2b5d1 100644
--- a/intern/cycles/kernel/shaders/node_set_normal.osl
+++ b/intern/cycles/kernel/shaders/node_set_normal.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
surface node_set_normal(normal Direction = N, output normal Normal = N)
{
diff --git a/intern/cycles/kernel/shaders/node_sky_texture.osl b/intern/cycles/kernel/shaders/node_sky_texture.osl
index 9b29e5489c2..145a95800b2 100644
--- a/intern/cycles/kernel/shaders/node_sky_texture.osl
+++ b/intern/cycles/kernel/shaders/node_sky_texture.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
#include "node_color.h"
float sky_angle_between(float thetav, float phiv, float theta, float phi)
diff --git a/intern/cycles/kernel/shaders/node_subsurface_scattering.osl b/intern/cycles/kernel/shaders/node_subsurface_scattering.osl
index e12199d8c3d..b1e854150ab 100644
--- a/intern/cycles/kernel/shaders/node_subsurface_scattering.osl
+++ b/intern/cycles/kernel/shaders/node_subsurface_scattering.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_subsurface_scattering(color Color = 0.8,
float Scale = 1.0,
diff --git a/intern/cycles/kernel/shaders/node_tangent.osl b/intern/cycles/kernel/shaders/node_tangent.osl
index 44eb9973f3d..83f19a4610b 100644
--- a/intern/cycles/kernel/shaders/node_tangent.osl
+++ b/intern/cycles/kernel/shaders/node_tangent.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_tangent(normal NormalIn = N,
string attr_name = "geom:tangent",
diff --git a/intern/cycles/kernel/shaders/node_texture_coordinate.osl b/intern/cycles/kernel/shaders/node_texture_coordinate.osl
index 13861653d04..ac05e984af2 100644
--- a/intern/cycles/kernel/shaders/node_texture_coordinate.osl
+++ b/intern/cycles/kernel/shaders/node_texture_coordinate.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_texture_coordinate(
normal NormalIn = N,
diff --git a/intern/cycles/kernel/shaders/node_toon_bsdf.osl b/intern/cycles/kernel/shaders/node_toon_bsdf.osl
index ed3a0b25c60..4a44730c70c 100644
--- a/intern/cycles/kernel/shaders/node_toon_bsdf.osl
+++ b/intern/cycles/kernel/shaders/node_toon_bsdf.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_toon_bsdf(color Color = 0.8,
string component = "diffuse",
diff --git a/intern/cycles/kernel/shaders/node_translucent_bsdf.osl b/intern/cycles/kernel/shaders/node_translucent_bsdf.osl
index 7ce1ab08c59..23a562bf34d 100644
--- a/intern/cycles/kernel/shaders/node_translucent_bsdf.osl
+++ b/intern/cycles/kernel/shaders/node_translucent_bsdf.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_translucent_bsdf(color Color = 0.8, normal Normal = N, output closure color BSDF = 0)
{
diff --git a/intern/cycles/kernel/shaders/node_transparent_bsdf.osl b/intern/cycles/kernel/shaders/node_transparent_bsdf.osl
index a735513ba89..eb737a05c41 100644
--- a/intern/cycles/kernel/shaders/node_transparent_bsdf.osl
+++ b/intern/cycles/kernel/shaders/node_transparent_bsdf.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_transparent_bsdf(color Color = 0.8, normal Normal = N, output closure color BSDF = 0)
{
diff --git a/intern/cycles/kernel/shaders/node_uv_map.osl b/intern/cycles/kernel/shaders/node_uv_map.osl
index 6f2887be63c..88d8c5ba394 100644
--- a/intern/cycles/kernel/shaders/node_uv_map.osl
+++ b/intern/cycles/kernel/shaders/node_uv_map.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_uv_map(int from_dupli = 0,
string attribute = "",
diff --git a/intern/cycles/kernel/shaders/node_value.osl b/intern/cycles/kernel/shaders/node_value.osl
index 398e2c0e392..13197b9a27a 100644
--- a/intern/cycles/kernel/shaders/node_value.osl
+++ b/intern/cycles/kernel/shaders/node_value.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_value(float value_value = 0.0,
vector vector_value = vector(0.0, 0.0, 0.0),
diff --git a/intern/cycles/kernel/shaders/node_vector_curves.osl b/intern/cycles/kernel/shaders/node_vector_curves.osl
index e8c8036b550..41993fd8b56 100644
--- a/intern/cycles/kernel/shaders/node_vector_curves.osl
+++ b/intern/cycles/kernel/shaders/node_vector_curves.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
#include "node_ramp_util.h"
shader node_vector_curves(color ramp[] = {0.0},
diff --git a/intern/cycles/kernel/shaders/node_vector_displacement.osl b/intern/cycles/kernel/shaders/node_vector_displacement.osl
index e9bd336347f..7cd9c2a37f2 100644
--- a/intern/cycles/kernel/shaders/node_vector_displacement.osl
+++ b/intern/cycles/kernel/shaders/node_vector_displacement.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_vector_displacement(color Vector = color(0.0, 0.0, 0.0),
float Midlevel = 0.0,
diff --git a/intern/cycles/kernel/shaders/node_vector_math.osl b/intern/cycles/kernel/shaders/node_vector_math.osl
index 4fa9b3bb57b..87bfb663d2c 100644
--- a/intern/cycles/kernel/shaders/node_vector_math.osl
+++ b/intern/cycles/kernel/shaders/node_vector_math.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
float safe_divide(float a, float b)
{
diff --git a/intern/cycles/kernel/shaders/node_vector_transform.osl b/intern/cycles/kernel/shaders/node_vector_transform.osl
index 22939577be0..1db799cfc9e 100644
--- a/intern/cycles/kernel/shaders/node_vector_transform.osl
+++ b/intern/cycles/kernel/shaders/node_vector_transform.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_vector_transform(string type = "vector",
string convert_from = "world",
diff --git a/intern/cycles/kernel/shaders/node_velvet_bsdf.osl b/intern/cycles/kernel/shaders/node_velvet_bsdf.osl
index 9290b845325..2a35a3da5a5 100644
--- a/intern/cycles/kernel/shaders/node_velvet_bsdf.osl
+++ b/intern/cycles/kernel/shaders/node_velvet_bsdf.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
#include "node_fresnel.h"
shader node_velvet_bsdf(color Color = 0.8,
diff --git a/intern/cycles/kernel/shaders/node_vertex_color.osl b/intern/cycles/kernel/shaders/node_vertex_color.osl
index 16bf3dd146e..70843b5543a 100644
--- a/intern/cycles/kernel/shaders/node_vertex_color.osl
+++ b/intern/cycles/kernel/shaders/node_vertex_color.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_vertex_color(string bump_offset = "center",
string layer_name = "",
diff --git a/intern/cycles/kernel/shaders/node_voronoi_texture.osl b/intern/cycles/kernel/shaders/node_voronoi_texture.osl
index 10a9f7a6329..7a24cde95fc 100644
--- a/intern/cycles/kernel/shaders/node_voronoi_texture.osl
+++ b/intern/cycles/kernel/shaders/node_voronoi_texture.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
#include "vector2.h"
#include "vector4.h"
#include "node_hash.h"
diff --git a/intern/cycles/kernel/shaders/node_voxel_texture.osl b/intern/cycles/kernel/shaders/node_voxel_texture.osl
index 0e4484561d8..14489298367 100644
--- a/intern/cycles/kernel/shaders/node_voxel_texture.osl
+++ b/intern/cycles/kernel/shaders/node_voxel_texture.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_voxel_texture(string filename = "",
string interpolation = "linear",
diff --git a/intern/cycles/kernel/shaders/node_wave_texture.osl b/intern/cycles/kernel/shaders/node_wave_texture.osl
index a706c442368..5b27c570e42 100644
--- a/intern/cycles/kernel/shaders/node_wave_texture.osl
+++ b/intern/cycles/kernel/shaders/node_wave_texture.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
#include "node_noise.h"
/* Wave */
diff --git a/intern/cycles/kernel/shaders/node_wavelength.osl b/intern/cycles/kernel/shaders/node_wavelength.osl
index c8c6eecb171..f484c4b4788 100644
--- a/intern/cycles/kernel/shaders/node_wavelength.osl
+++ b/intern/cycles/kernel/shaders/node_wavelength.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
shader node_wavelength(float Wavelength = 500.0, output color Color = 0.0)
{
diff --git a/intern/cycles/kernel/shaders/node_white_noise_texture.osl b/intern/cycles/kernel/shaders/node_white_noise_texture.osl
index 95f91d25e5e..03b791b04ef 100644
--- a/intern/cycles/kernel/shaders/node_white_noise_texture.osl
+++ b/intern/cycles/kernel/shaders/node_white_noise_texture.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
#include "vector2.h"
#include "vector4.h"
#include "node_hash.h"
diff --git a/intern/cycles/kernel/shaders/node_wireframe.osl b/intern/cycles/kernel/shaders/node_wireframe.osl
index ea4bd3a4c87..d5d5b63ade8 100644
--- a/intern/cycles/kernel/shaders/node_wireframe.osl
+++ b/intern/cycles/kernel/shaders/node_wireframe.osl
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "stdosl.h"
+#include "stdcycles.h"
#include "oslutil.h"
shader node_wireframe(string bump_offset = "center",
diff --git a/intern/cycles/kernel/shaders/oslutil.h b/intern/cycles/kernel/shaders/oslutil.h
deleted file mode 100644
index d48bfa4a665..00000000000
--- a/intern/cycles/kernel/shaders/oslutil.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Adapted from Open Shading Language with this license:
- *
- * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al.
- * All Rights Reserved.
- *
- * Modifications Copyright 2011, Blender Foundation.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Sony Pictures Imageworks nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef CCL_OSLUTIL_H
-#define CCL_OSLUTIL_H
-
-// Return wireframe opacity factor [0, 1] given a geometry type in
-// ("triangles", "polygons" or "patches"), and a line_width in raster
-// or world space depending on the last (raster) boolean argument.
-//
-float wireframe(string edge_type, float line_width, int raster)
-{
- // ray differentials are so big in diffuse context that this function would always return "wire"
- if (raytype("path:diffuse"))
- return 0.0;
-
- int np = 0;
- point p[64];
- float pixelWidth = 1;
-
- if (edge_type == "triangles") {
- np = 3;
- if (!getattribute("geom:trianglevertices", p))
- return 0.0;
- }
- else if (edge_type == "polygons" || edge_type == "patches") {
- getattribute("geom:numpolyvertices", np);
- if (np < 3 || !getattribute("geom:polyvertices", p))
- return 0.0;
- }
-
- if (raster) {
- // Project the derivatives of P to the viewing plane defined
- // by I so we have a measure of how big is a pixel at this point
- float pixelWidthX = length(Dx(P) - dot(Dx(P), I) * I);
- float pixelWidthY = length(Dy(P) - dot(Dy(P), I) * I);
- // Take the average of both axis' length
- pixelWidth = (pixelWidthX + pixelWidthY) / 2;
- }
-
- // Use half the width as the neighbor face will render the
- // other half. And take the square for fast comparison
- pixelWidth *= 0.5 * line_width;
- pixelWidth *= pixelWidth;
- for (int i = 0; i < np; i++) {
- int i2 = i ? i - 1 : np - 1;
- vector dir = P - p[i];
- vector edge = p[i] - p[i2];
- vector crs = cross(edge, dir);
- // At this point dot(crs, crs) / dot(edge, edge) is
- // the square of area / length(edge) == square of the
- // distance to the edge.
- if (dot(crs, crs) < (dot(edge, edge) * pixelWidth))
- return 1;
- }
- return 0;
-}
-
-float wireframe(string edge_type, float line_width)
-{
- return wireframe(edge_type, line_width, 1);
-}
-float wireframe(string edge_type)
-{
- return wireframe(edge_type, 1.0, 1);
-}
-float wireframe()
-{
- return wireframe("polygons", 1.0, 1);
-}
-
-#endif /* CCL_OSLUTIL_H */
diff --git a/intern/cycles/kernel/shaders/stdcycles.h b/intern/cycles/kernel/shaders/stdcycles.h
new file mode 100644
index 00000000000..8c27f31a357
--- /dev/null
+++ b/intern/cycles/kernel/shaders/stdcycles.h
@@ -0,0 +1,151 @@
+/////////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. All Rights Reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+// * Neither the name of Sony Pictures Imageworks nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef CCL_STDCYCLESOSL_H
+#define CCL_STDCYCLESOSL_H
+
+#include "stdosl.h"
+
+// Declaration of built-in functions and closures, stdosl.h does not make
+// these available so we have to redefine them.
+#define BUILTIN [[int builtin = 1]]
+#define BUILTIN_DERIV [[ int builtin = 1, int deriv = 1 ]]
+
+closure color diffuse_ramp(normal N, color colors[8]) BUILTIN;
+closure color phong_ramp(normal N, float exponent, color colors[8]) BUILTIN;
+closure color diffuse_toon(normal N, float size, float smooth) BUILTIN;
+closure color glossy_toon(normal N, float size, float smooth) BUILTIN;
+closure color microfacet_ggx(normal N, float ag) BUILTIN;
+closure color microfacet_ggx_aniso(normal N, vector T, float ax, float ay) BUILTIN;
+closure color microfacet_ggx_refraction(normal N, float ag, float eta) BUILTIN;
+closure color microfacet_multi_ggx(normal N, float ag, color C) BUILTIN;
+closure color microfacet_multi_ggx_aniso(normal N, vector T, float ax, float ay, color C) BUILTIN;
+closure color microfacet_multi_ggx_glass(normal N, float ag, float eta, color C) BUILTIN;
+closure color microfacet_ggx_fresnel(normal N, float ag, float eta, color C, color Cspec0) BUILTIN;
+closure color microfacet_ggx_aniso_fresnel(
+ normal N, vector T, float ax, float ay, float eta, color C, color Cspec0) BUILTIN;
+closure color
+microfacet_multi_ggx_fresnel(normal N, float ag, float eta, color C, color Cspec0) BUILTIN;
+closure color microfacet_multi_ggx_aniso_fresnel(
+ normal N, vector T, float ax, float ay, float eta, color C, color Cspec0) BUILTIN;
+closure color
+microfacet_multi_ggx_glass_fresnel(normal N, float ag, float eta, color C, color Cspec0) BUILTIN;
+closure color microfacet_beckmann(normal N, float ab) BUILTIN;
+closure color microfacet_beckmann_aniso(normal N, vector T, float ax, float ay) BUILTIN;
+closure color microfacet_beckmann_refraction(normal N, float ab, float eta) BUILTIN;
+closure color ashikhmin_shirley(normal N, vector T, float ax, float ay) BUILTIN;
+closure color ashikhmin_velvet(normal N, float sigma) BUILTIN;
+closure color ambient_occlusion() BUILTIN;
+closure color principled_diffuse(normal N, float roughness) BUILTIN;
+closure color principled_sheen(normal N) BUILTIN;
+closure color principled_clearcoat(normal N, float clearcoat, float clearcoat_roughness) BUILTIN;
+
+// BSSRDF
+closure color bssrdf(string method, normal N, vector radius, color albedo) BUILTIN;
+
+// Hair
+closure color
+hair_reflection(normal N, float roughnessu, float roughnessv, vector T, float offset) BUILTIN;
+closure color
+hair_transmission(normal N, float roughnessu, float roughnessv, vector T, float offset) BUILTIN;
+closure color principled_hair(normal N,
+ color sigma,
+ float roughnessu,
+ float roughnessv,
+ float coat,
+ float alpha,
+ float eta) BUILTIN;
+
+// Volume
+closure color henyey_greenstein(float g) BUILTIN;
+closure color absorption() BUILTIN;
+
+normal ensure_valid_reflection(normal Ng, vector I, normal N)
+{
+ /* The implementation here mirrors the one in kernel_montecarlo.h,
+ * check there for an explanation of the algorithm. */
+
+ float sqr(float x)
+ {
+ return x * x;
+ }
+
+ vector R = 2 * dot(N, I) * N - I;
+
+ float threshold = min(0.9 * dot(Ng, I), 0.01);
+ if (dot(Ng, R) >= threshold) {
+ return N;
+ }
+
+ float NdotNg = dot(N, Ng);
+ vector X = normalize(N - NdotNg * Ng);
+
+ float Ix = dot(I, X), Iz = dot(I, Ng);
+ float Ix2 = sqr(Ix), Iz2 = sqr(Iz);
+ float a = Ix2 + Iz2;
+
+ float b = sqrt(Ix2 * (a - sqr(threshold)));
+ float c = Iz * threshold + a;
+
+ float fac = 0.5 / a;
+ float N1_z2 = fac * (b + c), N2_z2 = fac * (-b + c);
+ int valid1 = (N1_z2 > 1e-5) && (N1_z2 <= (1.0 + 1e-5));
+ int valid2 = (N2_z2 > 1e-5) && (N2_z2 <= (1.0 + 1e-5));
+
+ float N_new_x, N_new_z;
+ if (valid1 && valid2) {
+ float N1_x = sqrt(1.0 - N1_z2), N1_z = sqrt(N1_z2);
+ float N2_x = sqrt(1.0 - N2_z2), N2_z = sqrt(N2_z2);
+
+ float R1 = 2 * (N1_x * Ix + N1_z * Iz) * N1_z - Iz;
+ float R2 = 2 * (N2_x * Ix + N2_z * Iz) * N2_z - Iz;
+
+ valid1 = (R1 >= 1e-5);
+ valid2 = (R2 >= 1e-5);
+ if (valid1 && valid2) {
+ N_new_x = (R1 < R2) ? N1_x : N2_x;
+ N_new_z = (R1 < R2) ? N1_z : N2_z;
+ }
+ else {
+ N_new_x = (R1 > R2) ? N1_x : N2_x;
+ N_new_z = (R1 > R2) ? N1_z : N2_z;
+ }
+ }
+ else if (valid1 || valid2) {
+ float Nz2 = valid1 ? N1_z2 : N2_z2;
+ N_new_x = sqrt(1.0 - Nz2);
+ N_new_z = sqrt(Nz2);
+ }
+ else {
+ return Ng;
+ }
+
+ return N_new_x * X + N_new_z * Ng;
+}
+
+
+#endif /* CCL_STDOSL_H */
diff --git a/intern/cycles/kernel/shaders/stdosl.h b/intern/cycles/kernel/shaders/stdosl.h
deleted file mode 100644
index 6515d914909..00000000000
--- a/intern/cycles/kernel/shaders/stdosl.h
+++ /dev/null
@@ -1,880 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-// * Neither the name of Sony Pictures Imageworks nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-/////////////////////////////////////////////////////////////////////////////
-
-#ifndef CCL_STDOSL_H
-#define CCL_STDOSL_H
-
-#ifndef M_PI
-# define M_PI 3.1415926535897932 /* pi */
-# define M_PI_2 1.5707963267948966 /* pi/2 */
-# define M_PI_4 0.7853981633974483 /* pi/4 */
-# define M_2_PI 0.6366197723675813 /* 2/pi */
-# define M_2PI 6.2831853071795865 /* 2*pi */
-# define M_4PI 12.566370614359173 /* 4*pi */
-# define M_2_SQRTPI 1.1283791670955126 /* 2/sqrt(pi) */
-# define M_E 2.7182818284590452 /* e (Euler's number) */
-# define M_LN2 0.6931471805599453 /* ln(2) */
-# define M_LN10 2.3025850929940457 /* ln(10) */
-# define M_LOG2E 1.4426950408889634 /* log_2(e) */
-# define M_LOG10E 0.4342944819032518 /* log_10(e) */
-# define M_SQRT2 1.4142135623730950 /* sqrt(2) */
-# define M_SQRT1_2 0.7071067811865475 /* 1/sqrt(2) */
-#endif
-
-// Declaration of built-in functions and closures
-#define BUILTIN [[int builtin = 1]]
-#define BUILTIN_DERIV [[ int builtin = 1, int deriv = 1 ]]
-
-#define PERCOMP1(name) \
- normal name(normal x) BUILTIN; \
- vector name(vector x) BUILTIN; \
- point name(point x) BUILTIN; \
- color name(color x) BUILTIN; \
- float name(float x) BUILTIN;
-
-#define PERCOMP2(name) \
- normal name(normal x, normal y) BUILTIN; \
- vector name(vector x, vector y) BUILTIN; \
- point name(point x, point y) BUILTIN; \
- color name(color x, color y) BUILTIN; \
- float name(float x, float y) BUILTIN;
-
-#define PERCOMP2F(name) \
- normal name(normal x, float y) BUILTIN; \
- vector name(vector x, float y) BUILTIN; \
- point name(point x, float y) BUILTIN; \
- color name(color x, float y) BUILTIN; \
- float name(float x, float y) BUILTIN;
-
-// Basic math
-normal degrees(normal x)
-{
- return x * (180.0 / M_PI);
-}
-vector degrees(vector x)
-{
- return x * (180.0 / M_PI);
-}
-point degrees(point x)
-{
- return x * (180.0 / M_PI);
-}
-color degrees(color x)
-{
- return x * (180.0 / M_PI);
-}
-float degrees(float x)
-{
- return x * (180.0 / M_PI);
-}
-normal radians(normal x)
-{
- return x * (M_PI / 180.0);
-}
-vector radians(vector x)
-{
- return x * (M_PI / 180.0);
-}
-point radians(point x)
-{
- return x * (M_PI / 180.0);
-}
-color radians(color x)
-{
- return x * (M_PI / 180.0);
-}
-float radians(float x)
-{
- return x * (M_PI / 180.0);
-}
-PERCOMP1(cos)
-PERCOMP1(sin)
-PERCOMP1(tan)
-PERCOMP1(acos)
-PERCOMP1(asin)
-PERCOMP1(atan)
-PERCOMP2(atan2)
-PERCOMP1(cosh)
-PERCOMP1(sinh)
-PERCOMP1(tanh)
-PERCOMP2F(pow)
-PERCOMP1(exp)
-PERCOMP1(exp2)
-PERCOMP1(expm1)
-PERCOMP1(log)
-point log(point a, float b)
-{
- return log(a) / log(b);
-}
-vector log(vector a, float b)
-{
- return log(a) / log(b);
-}
-color log(color a, float b)
-{
- return log(a) / log(b);
-}
-float log(float a, float b)
-{
- return log(a) / log(b);
-}
-PERCOMP1(log2)
-PERCOMP1(log10)
-PERCOMP1(logb)
-PERCOMP1(sqrt)
-PERCOMP1(inversesqrt)
-float hypot(float a, float b)
-{
- return sqrt(a * a + b * b);
-}
-float hypot(float a, float b, float c)
-{
- return sqrt(a * a + b * b + c * c);
-}
-PERCOMP1(abs)
-int abs(int x) BUILTIN;
-PERCOMP1(fabs)
-int fabs(int x) BUILTIN;
-PERCOMP1(sign)
-PERCOMP1(floor)
-PERCOMP1(ceil)
-PERCOMP1(round)
-PERCOMP1(trunc)
-PERCOMP2(fmod)
-PERCOMP2F(fmod)
-int mod(int a, int b)
-{
- return a - b * (int)floor(a / b);
-}
-point mod(point a, point b)
-{
- return a - b * floor(a / b);
-}
-vector mod(vector a, vector b)
-{
- return a - b * floor(a / b);
-}
-normal mod(normal a, normal b)
-{
- return a - b * floor(a / b);
-}
-color mod(color a, color b)
-{
- return a - b * floor(a / b);
-}
-point mod(point a, float b)
-{
- return a - b * floor(a / b);
-}
-vector mod(vector a, float b)
-{
- return a - b * floor(a / b);
-}
-normal mod(normal a, float b)
-{
- return a - b * floor(a / b);
-}
-color mod(color a, float b)
-{
- return a - b * floor(a / b);
-}
-float mod(float a, float b)
-{
- return a - b * floor(a / b);
-}
-PERCOMP2(min)
-int min(int a, int b) BUILTIN;
-PERCOMP2(max)
-int max(int a, int b) BUILTIN;
-normal clamp(normal x, normal minval, normal maxval)
-{
- return max(min(x, maxval), minval);
-}
-vector clamp(vector x, vector minval, vector maxval)
-{
- return max(min(x, maxval), minval);
-}
-point clamp(point x, point minval, point maxval)
-{
- return max(min(x, maxval), minval);
-}
-color clamp(color x, color minval, color maxval)
-{
- return max(min(x, maxval), minval);
-}
-float clamp(float x, float minval, float maxval)
-{
- return max(min(x, maxval), minval);
-}
-int clamp(int x, int minval, int maxval)
-{
- return max(min(x, maxval), minval);
-}
-#if 0
-normal mix(normal x, normal y, normal a)
-{
- return x * (1 - a) + y * a;
-}
-normal mix(normal x, normal y, float a)
-{
- return x * (1 - a) + y * a;
-}
-vector mix(vector x, vector y, vector a)
-{
- return x * (1 - a) + y * a;
-}
-vector mix(vector x, vector y, float a)
-{
- return x * (1 - a) + y * a;
-}
-point mix(point x, point y, point a)
-{
- return x * (1 - a) + y * a;
-}
-point mix(point x, point y, float a)
-{
- return x * (1 - a) + y * a;
-}
-color mix(color x, color y, color a)
-{
- return x * (1 - a) + y * a;
-}
-color mix(color x, color y, float a)
-{
- return x * (1 - a) + y * a;
-}
-float mix(float x, float y, float a)
-{
- return x * (1 - a) + y * a;
-}
-#else
-normal mix(normal x, normal y, normal a) BUILTIN;
-normal mix(normal x, normal y, float a) BUILTIN;
-vector mix(vector x, vector y, vector a) BUILTIN;
-vector mix(vector x, vector y, float a) BUILTIN;
-point mix(point x, point y, point a) BUILTIN;
-point mix(point x, point y, float a) BUILTIN;
-color mix(color x, color y, color a) BUILTIN;
-color mix(color x, color y, float a) BUILTIN;
-float mix(float x, float y, float a) BUILTIN;
-#endif
-int isnan(float x) BUILTIN;
-int isinf(float x) BUILTIN;
-int isfinite(float x) BUILTIN;
-float erf(float x) BUILTIN;
-float erfc(float x) BUILTIN;
-
-// Vector functions
-
-vector cross(vector a, vector b) BUILTIN;
-float dot(vector a, vector b) BUILTIN;
-float length(vector v) BUILTIN;
-float distance(point a, point b) BUILTIN;
-float distance(point a, point b, point q)
-{
- vector d = b - a;
- float dd = dot(d, d);
- if (dd == 0.0)
- return distance(q, a);
- float t = dot(q - a, d) / dd;
- return distance(q, a + clamp(t, 0.0, 1.0) * d);
-}
-normal normalize(normal v) BUILTIN;
-vector normalize(vector v) BUILTIN;
-vector faceforward(vector N, vector I, vector Nref) BUILTIN;
-vector faceforward(vector N, vector I) BUILTIN;
-vector reflect(vector I, vector N)
-{
- return I - 2 * dot(N, I) * N;
-}
-vector refract(vector I, vector N, float eta)
-{
- float IdotN = dot(I, N);
- float k = 1 - eta * eta * (1 - IdotN * IdotN);
- return (k < 0) ? vector(0, 0, 0) : (eta * I - N * (eta * IdotN + sqrt(k)));
-}
-void fresnel(vector I,
- normal N,
- float eta,
- output float Kr,
- output float Kt,
- output vector R,
- output vector T)
-{
- float sqr(float x)
- {
- return x * x;
- }
- float c = dot(I, N);
- if (c < 0)
- c = -c;
- R = reflect(I, N);
- float g = 1.0 / sqr(eta) - 1.0 + c * c;
- if (g >= 0.0) {
- g = sqrt(g);
- float beta = g - c;
- float F = (c * (g + c) - 1.0) / (c * beta + 1.0);
- F = 0.5 * (1.0 + sqr(F));
- F *= sqr(beta / (g + c));
- Kr = F;
- Kt = (1.0 - Kr) * eta * eta;
- // OPT: the following recomputes some of the above values, but it
- // gives us the same result as if the shader-writer called refract()
- T = refract(I, N, eta);
- }
- else {
- // total internal reflection
- Kr = 1.0;
- Kt = 0.0;
- T = vector(0, 0, 0);
- }
-}
-
-void fresnel(vector I, normal N, float eta, output float Kr, output float Kt)
-{
- vector R, T;
- fresnel(I, N, eta, Kr, Kt, R, T);
-}
-
-normal transform(matrix Mto, normal p) BUILTIN;
-vector transform(matrix Mto, vector p) BUILTIN;
-point transform(matrix Mto, point p) BUILTIN;
-normal transform(string from, string to, normal p) BUILTIN;
-vector transform(string from, string to, vector p) BUILTIN;
-point transform(string from, string to, point p) BUILTIN;
-normal transform(string to, normal p)
-{
- return transform("common", to, p);
-}
-vector transform(string to, vector p)
-{
- return transform("common", to, p);
-}
-point transform(string to, point p)
-{
- return transform("common", to, p);
-}
-
-float transformu(string tounits, float x) BUILTIN;
-float transformu(string fromunits, string tounits, float x) BUILTIN;
-
-point rotate(point p, float angle, point a, point b)
-{
- vector axis = normalize(b - a);
- float cosang, sinang;
- /* Older OSX has major issues with sincos() function,
- * it's likely a big in OSL or LLVM. For until we've
- * updated to new versions of this libraries we'll
- * use a workaround to prevent possible crashes on all
- * the platforms.
- *
- * Shouldn't be that bad because it's mainly used for
- * anisotropic shader where angle is usually constant.
- */
-#if 0
- sincos(angle, sinang, cosang);
-#else
- sinang = sin(angle);
- cosang = cos(angle);
-#endif
- float cosang1 = 1.0 - cosang;
- float x = axis[0], y = axis[1], z = axis[2];
- matrix M = matrix(x * x + (1.0 - x * x) * cosang,
- x * y * cosang1 + z * sinang,
- x * z * cosang1 - y * sinang,
- 0.0,
- x * y * cosang1 - z * sinang,
- y * y + (1.0 - y * y) * cosang,
- y * z * cosang1 + x * sinang,
- 0.0,
- x * z * cosang1 + y * sinang,
- y * z * cosang1 - x * sinang,
- z * z + (1.0 - z * z) * cosang,
- 0.0,
- 0.0,
- 0.0,
- 0.0,
- 1.0);
- return transform(M, p - a) + a;
-}
-
-normal ensure_valid_reflection(normal Ng, vector I, normal N)
-{
- /* The implementation here mirrors the one in kernel_montecarlo.h,
- * check there for an explanation of the algorithm. */
-
- float sqr(float x)
- {
- return x * x;
- }
-
- vector R = 2 * dot(N, I) * N - I;
-
- float threshold = min(0.9 * dot(Ng, I), 0.01);
- if (dot(Ng, R) >= threshold) {
- return N;
- }
-
- float NdotNg = dot(N, Ng);
- vector X = normalize(N - NdotNg * Ng);
-
- float Ix = dot(I, X), Iz = dot(I, Ng);
- float Ix2 = sqr(Ix), Iz2 = sqr(Iz);
- float a = Ix2 + Iz2;
-
- float b = sqrt(Ix2 * (a - sqr(threshold)));
- float c = Iz * threshold + a;
-
- float fac = 0.5 / a;
- float N1_z2 = fac * (b + c), N2_z2 = fac * (-b + c);
- int valid1 = (N1_z2 > 1e-5) && (N1_z2 <= (1.0 + 1e-5));
- int valid2 = (N2_z2 > 1e-5) && (N2_z2 <= (1.0 + 1e-5));
-
- float N_new_x, N_new_z;
- if (valid1 && valid2) {
- float N1_x = sqrt(1.0 - N1_z2), N1_z = sqrt(N1_z2);
- float N2_x = sqrt(1.0 - N2_z2), N2_z = sqrt(N2_z2);
-
- float R1 = 2 * (N1_x * Ix + N1_z * Iz) * N1_z - Iz;
- float R2 = 2 * (N2_x * Ix + N2_z * Iz) * N2_z - Iz;
-
- valid1 = (R1 >= 1e-5);
- valid2 = (R2 >= 1e-5);
- if (valid1 && valid2) {
- N_new_x = (R1 < R2) ? N1_x : N2_x;
- N_new_z = (R1 < R2) ? N1_z : N2_z;
- }
- else {
- N_new_x = (R1 > R2) ? N1_x : N2_x;
- N_new_z = (R1 > R2) ? N1_z : N2_z;
- }
- }
- else if (valid1 || valid2) {
- float Nz2 = valid1 ? N1_z2 : N2_z2;
- N_new_x = sqrt(1.0 - Nz2);
- N_new_z = sqrt(Nz2);
- }
- else {
- return Ng;
- }
-
- return N_new_x * X + N_new_z * Ng;
-}
-
-// Color functions
-
-float luminance(color c) BUILTIN;
-color blackbody(float temperatureK) BUILTIN;
-color wavelength_color(float wavelength_nm) BUILTIN;
-
-color transformc(string to, color x)
-{
- color rgb_to_hsv(color rgb)
- { // See Foley & van Dam
- float r = rgb[0], g = rgb[1], b = rgb[2];
- float mincomp = min(r, min(g, b));
- float maxcomp = max(r, max(g, b));
- float delta = maxcomp - mincomp; // chroma
- float h, s, v;
- v = maxcomp;
- if (maxcomp > 0)
- s = delta / maxcomp;
- else
- s = 0;
- if (s <= 0)
- h = 0;
- else {
- if (r >= maxcomp)
- h = (g - b) / delta;
- else if (g >= maxcomp)
- h = 2 + (b - r) / delta;
- else
- h = 4 + (r - g) / delta;
- h /= 6;
- if (h < 0)
- h += 1;
- }
- return color(h, s, v);
- }
-
- color rgb_to_hsl(color rgb)
- { // See Foley & van Dam
- // First convert rgb to hsv, then to hsl
- float minval = min(rgb[0], min(rgb[1], rgb[2]));
- color hsv = rgb_to_hsv(rgb);
- float maxval = hsv[2]; // v == maxval
- float h = hsv[0], s, l = (minval + maxval) / 2;
- if (minval == maxval)
- s = 0; // special 'achromatic' case, hue is 0
- else if (l <= 0.5)
- s = (maxval - minval) / (maxval + minval);
- else
- s = (maxval - minval) / (2 - maxval - minval);
- return color(h, s, l);
- }
-
- color r;
- if (to == "rgb" || to == "RGB")
- r = x;
- else if (to == "hsv")
- r = rgb_to_hsv(x);
- else if (to == "hsl")
- r = rgb_to_hsl(x);
- else if (to == "YIQ")
- r = color(dot(vector(0.299, 0.587, 0.114), (vector)x),
- dot(vector(0.596, -0.275, -0.321), (vector)x),
- dot(vector(0.212, -0.523, 0.311), (vector)x));
- else if (to == "XYZ")
- r = color(dot(vector(0.412453, 0.357580, 0.180423), (vector)x),
- dot(vector(0.212671, 0.715160, 0.072169), (vector)x),
- dot(vector(0.019334, 0.119193, 0.950227), (vector)x));
- else {
- error("Unknown color space \"%s\"", to);
- r = x;
- }
- return r;
-}
-
-color transformc(string from, string to, color x)
-{
- color hsv_to_rgb(color c)
- { // Reference: Foley & van Dam
- float h = c[0], s = c[1], v = c[2];
- color r;
- if (s < 0.0001) {
- r = v;
- }
- else {
- h = 6 * (h - floor(h)); // expand to [0..6)
- int hi = (int)h;
- float f = h - hi;
- float p = v * (1 - s);
- float q = v * (1 - s * f);
- float t = v * (1 - s * (1 - f));
- if (hi == 0)
- r = color(v, t, p);
- else if (hi == 1)
- r = color(q, v, p);
- else if (hi == 2)
- r = color(p, v, t);
- else if (hi == 3)
- r = color(p, q, v);
- else if (hi == 4)
- r = color(t, p, v);
- else
- r = color(v, p, q);
- }
- return r;
- }
-
- color hsl_to_rgb(color c)
- {
- float h = c[0], s = c[1], l = c[2];
- // Easiest to convert hsl -> hsv, then hsv -> RGB (per Foley & van Dam)
- float v = (l <= 0.5) ? (l * (1 + s)) : (l * (1 - s) + s);
- color r;
- if (v <= 0) {
- r = 0;
- }
- else {
- float min = 2 * l - v;
- s = (v - min) / v;
- r = hsv_to_rgb(color(h, s, v));
- }
- return r;
- }
-
- color r;
- if (from == "rgb" || from == "RGB")
- r = x;
- else if (from == "hsv")
- r = hsv_to_rgb(x);
- else if (from == "hsl")
- r = hsl_to_rgb(x);
- else if (from == "YIQ")
- r = color(dot(vector(1, 0.9557, 0.6199), (vector)x),
- dot(vector(1, -0.2716, -0.6469), (vector)x),
- dot(vector(1, -1.1082, 1.7051), (vector)x));
- else if (from == "XYZ")
- r = color(dot(vector(3.240479, -1.537150, -0.498535), (vector)x),
- dot(vector(-0.969256, 1.875991, 0.041556), (vector)x),
- dot(vector(0.055648, -0.204043, 1.057311), (vector)x));
- else {
- error("Unknown color space \"%s\"", to);
- r = x;
- }
- return transformc(to, r);
-}
-
-// Matrix functions
-
-float determinant(matrix m) BUILTIN;
-matrix transpose(matrix m) BUILTIN;
-
-// Pattern generation
-
-color step(color edge, color x) BUILTIN;
-point step(point edge, point x) BUILTIN;
-vector step(vector edge, vector x) BUILTIN;
-normal step(normal edge, normal x) BUILTIN;
-float step(float edge, float x) BUILTIN;
-float smoothstep(float edge0, float edge1, float x) BUILTIN;
-
-float linearstep(float edge0, float edge1, float x)
-{
- float result;
- if (edge0 != edge1) {
- float xclamped = clamp(x, edge0, edge1);
- result = (xclamped - edge0) / (edge1 - edge0);
- }
- else { // special case: edges coincide
- result = step(edge0, x);
- }
- return result;
-}
-
-float smooth_linearstep(float edge0, float edge1, float x_, float eps_)
-{
- float result;
- if (edge0 != edge1) {
- float rampup(float x, float r)
- {
- return 0.5 / r * x * x;
- }
- float width_inv = 1.0 / (edge1 - edge0);
- float eps = eps_ * width_inv;
- float x = (x_ - edge0) * width_inv;
- if (x <= -eps)
- result = 0;
- else if (x >= eps && x <= 1.0 - eps)
- result = x;
- else if (x >= 1.0 + eps)
- result = 1;
- else if (x < eps)
- result = rampup(x + eps, 2.0 * eps);
- else /* if (x < 1.0+eps) */
- result = 1.0 - rampup(1.0 + eps - x, 2.0 * eps);
- }
- else {
- result = step(edge0, x_);
- }
- return result;
-}
-
-float aastep(float edge, float s, float dedge, float ds)
-{
- // Box filtered AA step
- float width = fabs(dedge) + fabs(ds);
- float halfwidth = 0.5 * width;
- float e1 = edge - halfwidth;
- return (s <= e1) ? 0.0 : ((s >= (edge + halfwidth)) ? 1.0 : (s - e1) / width);
-}
-float aastep(float edge, float s, float ds)
-{
- return aastep(edge, s, filterwidth(edge), ds);
-}
-float aastep(float edge, float s)
-{
- return aastep(edge, s, filterwidth(edge), filterwidth(s));
-}
-
-// Derivatives and area operators
-
-// Displacement functions
-
-// String functions
-int strlen(string s) BUILTIN;
-int hash(string s) BUILTIN;
-int getchar(string s, int index) BUILTIN;
-int startswith(string s, string prefix) BUILTIN;
-int endswith(string s, string suffix) BUILTIN;
-string substr(string s, int start, int len) BUILTIN;
-string substr(string s, int start)
-{
- return substr(s, start, strlen(s));
-}
-float stof(string str) BUILTIN;
-int stoi(string str) BUILTIN;
-
-// Define concat in terms of shorter concat
-string concat(string a, string b, string c)
-{
- return concat(concat(a, b), c);
-}
-string concat(string a, string b, string c, string d)
-{
- return concat(concat(a, b, c), d);
-}
-string concat(string a, string b, string c, string d, string e)
-{
- return concat(concat(a, b, c, d), e);
-}
-string concat(string a, string b, string c, string d, string e, string f)
-{
- return concat(concat(a, b, c, d, e), f);
-}
-
-// Texture
-
-// Closures
-
-closure color diffuse(normal N) BUILTIN;
-closure color oren_nayar(normal N, float sigma) BUILTIN;
-closure color diffuse_ramp(normal N, color colors[8]) BUILTIN;
-closure color phong_ramp(normal N, float exponent, color colors[8]) BUILTIN;
-closure color diffuse_toon(normal N, float size, float smooth) BUILTIN;
-closure color glossy_toon(normal N, float size, float smooth) BUILTIN;
-closure color translucent(normal N) BUILTIN;
-closure color reflection(normal N) BUILTIN;
-closure color refraction(normal N, float eta) BUILTIN;
-closure color transparent() BUILTIN;
-closure color microfacet_ggx(normal N, float ag) BUILTIN;
-closure color microfacet_ggx_aniso(normal N, vector T, float ax, float ay) BUILTIN;
-closure color microfacet_ggx_refraction(normal N, float ag, float eta) BUILTIN;
-closure color microfacet_multi_ggx(normal N, float ag, color C) BUILTIN;
-closure color microfacet_multi_ggx_aniso(normal N, vector T, float ax, float ay, color C) BUILTIN;
-closure color microfacet_multi_ggx_glass(normal N, float ag, float eta, color C) BUILTIN;
-closure color microfacet_ggx_fresnel(normal N, float ag, float eta, color C, color Cspec0) BUILTIN;
-closure color microfacet_ggx_aniso_fresnel(
- normal N, vector T, float ax, float ay, float eta, color C, color Cspec0) BUILTIN;
-closure color
-microfacet_multi_ggx_fresnel(normal N, float ag, float eta, color C, color Cspec0) BUILTIN;
-closure color microfacet_multi_ggx_aniso_fresnel(
- normal N, vector T, float ax, float ay, float eta, color C, color Cspec0) BUILTIN;
-closure color
-microfacet_multi_ggx_glass_fresnel(normal N, float ag, float eta, color C, color Cspec0) BUILTIN;
-closure color microfacet_beckmann(normal N, float ab) BUILTIN;
-closure color microfacet_beckmann_aniso(normal N, vector T, float ax, float ay) BUILTIN;
-closure color microfacet_beckmann_refraction(normal N, float ab, float eta) BUILTIN;
-closure color ashikhmin_shirley(normal N, vector T, float ax, float ay) BUILTIN;
-closure color ashikhmin_velvet(normal N, float sigma) BUILTIN;
-closure color emission() BUILTIN;
-closure color background() BUILTIN;
-closure color holdout() BUILTIN;
-closure color ambient_occlusion() BUILTIN;
-closure color principled_diffuse(normal N, float roughness) BUILTIN;
-closure color principled_sheen(normal N) BUILTIN;
-closure color principled_clearcoat(normal N, float clearcoat, float clearcoat_roughness) BUILTIN;
-
-// BSSRDF
-closure color bssrdf(string method, normal N, vector radius, color albedo) BUILTIN;
-
-// Hair
-closure color
-hair_reflection(normal N, float roughnessu, float roughnessv, vector T, float offset) BUILTIN;
-closure color
-hair_transmission(normal N, float roughnessu, float roughnessv, vector T, float offset) BUILTIN;
-closure color principled_hair(normal N,
- color sigma,
- float roughnessu,
- float roughnessv,
- float coat,
- float alpha,
- float eta) BUILTIN;
-
-// Volume
-closure color henyey_greenstein(float g) BUILTIN;
-closure color absorption() BUILTIN;
-
-// OSL 1.5 Microfacet functions
-closure color microfacet(
- string distribution, normal N, vector U, float xalpha, float yalpha, float eta, int refract)
-{
- /* GGX */
- if (distribution == "ggx" || distribution == "default") {
- if (!refract) {
- if (xalpha == yalpha) {
- /* Isotropic */
- return microfacet_ggx(N, xalpha);
- }
- else {
- /* Anisotropic */
- return microfacet_ggx_aniso(N, U, xalpha, yalpha);
- }
- }
- else {
- return microfacet_ggx_refraction(N, xalpha, eta);
- }
- }
- /* Beckmann */
- else {
- if (!refract) {
- if (xalpha == yalpha) {
- /* Isotropic */
- return microfacet_beckmann(N, xalpha);
- }
- else {
- /* Anisotropic */
- return microfacet_beckmann_aniso(N, U, xalpha, yalpha);
- }
- }
- else {
- return microfacet_beckmann_refraction(N, xalpha, eta);
- }
- }
-}
-
-closure color microfacet(string distribution, normal N, float alpha, float eta, int refract)
-{
- return microfacet(distribution, N, vector(0), alpha, alpha, eta, refract);
-}
-
-// Renderer state
-int backfacing() BUILTIN;
-int raytype(string typename) BUILTIN;
-// the individual 'isFOOray' functions are deprecated
-int iscameraray()
-{
- return raytype("camera");
-}
-int isdiffuseray()
-{
- return raytype("diffuse");
-}
-int isglossyray()
-{
- return raytype("glossy");
-}
-int isshadowray()
-{
- return raytype("shadow");
-}
-int getmatrix(string fromspace, string tospace, output matrix M) BUILTIN;
-int getmatrix(string fromspace, output matrix M)
-{
- return getmatrix(fromspace, "common", M);
-}
-
-// Miscellaneous
-
-#undef BUILTIN
-#undef BUILTIN_DERIV
-#undef PERCOMP1
-#undef PERCOMP2
-#undef PERCOMP2F
-
-#endif /* CCL_STDOSL_H */
diff --git a/intern/cycles/kernel/shaders/vector2.h b/intern/cycles/kernel/shaders/vector2.h
deleted file mode 100644
index c524735d892..00000000000
--- a/intern/cycles/kernel/shaders/vector2.h
+++ /dev/null
@@ -1,291 +0,0 @@
-// Open Shading Language : Copyright (c) 2009-2017 Sony Pictures Imageworks Inc., et al.
-// https://github.com/imageworks/OpenShadingLanguage/blob/master/LICENSE
-
-#pragma once
-#define VECTOR2_H
-
-// vector2 is a 2D vector
-struct vector2 {
- float x;
- float y;
-};
-
-//
-// For vector2, define math operators to match vector
-//
-
-vector2 __operator__neg__(vector2 a)
-{
- return vector2(-a.x, -a.y);
-}
-
-vector2 __operator__add__(vector2 a, vector2 b)
-{
- return vector2(a.x + b.x, a.y + b.y);
-}
-
-vector2 __operator__add__(vector2 a, int b)
-{
- return a + vector2(b, b);
-}
-
-vector2 __operator__add__(vector2 a, float b)
-{
- return a + vector2(b, b);
-}
-
-vector2 __operator__add__(int a, vector2 b)
-{
- return vector2(a, a) + b;
-}
-
-vector2 __operator__add__(float a, vector2 b)
-{
- return vector2(a, a) + b;
-}
-
-vector2 __operator__sub__(vector2 a, vector2 b)
-{
- return vector2(a.x - b.x, a.y - b.y);
-}
-
-vector2 __operator__sub__(vector2 a, int b)
-{
- return a - vector2(b, b);
-}
-
-vector2 __operator__sub__(vector2 a, float b)
-{
- return a - vector2(b, b);
-}
-
-vector2 __operator__sub__(int a, vector2 b)
-{
- return vector2(a, a) - b;
-}
-
-vector2 __operator__sub__(float a, vector2 b)
-{
- return vector2(a, a) - b;
-}
-
-vector2 __operator__mul__(vector2 a, vector2 b)
-{
- return vector2(a.x * b.x, a.y * b.y);
-}
-
-vector2 __operator__mul__(vector2 a, int b)
-{
- return a * vector2(b, b);
-}
-
-vector2 __operator__mul__(vector2 a, float b)
-{
- return a * vector2(b, b);
-}
-
-vector2 __operator__mul__(int a, vector2 b)
-{
- return b * vector2(a, a);
-}
-
-vector2 __operator__mul__(float a, vector2 b)
-{
- return b * vector2(a, a);
-}
-
-vector2 __operator__div__(vector2 a, vector2 b)
-{
- return vector2(a.x / b.x, a.y / b.y);
-}
-
-vector2 __operator__div__(vector2 a, int b)
-{
- float b_inv = 1 / b;
- return a * vector2(b_inv, b_inv);
-}
-
-vector2 __operator__div__(vector2 a, float b)
-{
- float b_inv = 1 / b;
- return a * vector2(b_inv, b_inv);
-}
-
-vector2 __operator__div__(int a, vector2 b)
-{
- return vector2(a, a) / b;
-}
-
-vector2 __operator__div__(float a, vector2 b)
-{
- return vector2(a, a) / b;
-}
-
-int __operator__eq__(vector2 a, vector2 b)
-{
- return (a.x == b.x) && (a.y == b.y);
-}
-
-int __operator__ne__(vector2 a, vector2 b)
-{
- return (a.x != b.x) || (a.y != b.y);
-}
-
-//
-// For vector2, define most of the stdosl functions to match vector
-//
-
-vector2 abs(vector2 a)
-{
- return vector2(abs(a.x), abs(a.y));
-}
-
-vector2 ceil(vector2 a)
-{
- return vector2(ceil(a.x), ceil(a.y));
-}
-
-vector2 floor(vector2 a)
-{
- return vector2(floor(a.x), floor(a.y));
-}
-
-vector2 sqrt(vector2 a)
-{
- return vector2(sqrt(a.x), sqrt(a.y));
-}
-
-vector2 exp(vector2 a)
-{
- return vector2(exp(a.x), exp(a.y));
-}
-
-vector2 log(vector2 a)
-{
- return vector2(log(a.x), log(a.y));
-}
-
-vector2 log2(vector2 a)
-{
- return vector2(log2(a.x), log2(a.y));
-}
-
-vector2 mix(vector2 a, vector2 b, float x)
-{
- return vector2(mix(a.x, b.x, x), mix(a.y, b.y, x));
-}
-
-float dot(vector2 a, vector2 b)
-{
- return (a.x * b.x + a.y * b.y);
-}
-
-float length(vector2 a)
-{
- return hypot(a.x, a.y);
-}
-
-vector2 smoothstep(vector2 low, vector2 high, vector2 in)
-{
- return vector2(smoothstep(low.x, high.x, in.x), smoothstep(low.y, high.y, in.y));
-}
-
-vector2 smoothstep(float low, float high, vector2 in)
-{
- return vector2(smoothstep(low, high, in.x), smoothstep(low, high, in.y));
-}
-
-vector2 clamp(vector2 in, vector2 low, vector2 high)
-{
- return vector2(clamp(in.x, low.x, high.x), clamp(in.y, low.y, high.y));
-}
-
-vector2 clamp(vector2 in, float low, float high)
-{
- return clamp(in, vector2(low, low), vector2(high, high));
-}
-
-vector2 max(vector2 a, vector2 b)
-{
- return vector2(max(a.x, b.x), max(a.y, b.y));
-}
-
-vector2 max(vector2 a, float b)
-{
- return max(a, vector2(b, b));
-}
-
-vector2 normalize(vector2 a)
-{
- return a / length(a);
-}
-
-vector2 min(vector2 a, vector2 b)
-{
- return vector2(min(a.x, a.x), min(b.y, b.y));
-}
-
-vector2 min(vector2 a, float b)
-{
- return min(a, vector2(b, b));
-}
-
-vector2 fmod(vector2 a, vector2 b)
-{
- return vector2(fmod(a.x, b.x), fmod(a.y, b.y));
-}
-
-vector2 fmod(vector2 a, float b)
-{
- return fmod(a, vector2(b, b));
-}
-
-vector2 pow(vector2 in, vector2 amount)
-{
- return vector2(pow(in.x, amount.x), pow(in.y, amount.y));
-}
-
-vector2 pow(vector2 in, float amount)
-{
- return pow(in, vector2(amount, amount));
-}
-
-vector2 sign(vector2 a)
-{
- return vector2(sign(a.x), sign(a.y));
-}
-
-vector2 sin(vector2 a)
-{
- return vector2(sin(a.x), sin(a.y));
-}
-
-vector2 cos(vector2 a)
-{
- return vector2(cos(a.x), cos(a.y));
-}
-
-vector2 tan(vector2 a)
-{
- return vector2(tan(a.x), tan(a.y));
-}
-
-vector2 asin(vector2 a)
-{
- return vector2(asin(a.x), asin(a.y));
-}
-
-vector2 acos(vector2 a)
-{
- return vector2(acos(a.x), acos(a.y));
-}
-
-vector2 atan2(vector2 a, float f)
-{
- return vector2(atan2(a.x, f), atan2(a.y, f));
-}
-
-vector2 atan2(vector2 a, vector2 b)
-{
- return vector2(atan2(a.x, b.x), atan2(a.y, b.y));
-}
diff --git a/intern/cycles/kernel/shaders/vector4.h b/intern/cycles/kernel/shaders/vector4.h
deleted file mode 100644
index 58e1b3c2e23..00000000000
--- a/intern/cycles/kernel/shaders/vector4.h
+++ /dev/null
@@ -1,327 +0,0 @@
-// Open Shading Language : Copyright (c) 2009-2017 Sony Pictures Imageworks Inc., et al.
-// https://github.com/imageworks/OpenShadingLanguage/blob/master/LICENSE
-
-#pragma once
-#define VECTOR4_H
-
-// vector4 is a 4D vector
-struct vector4 {
- float x;
- float y;
- float z;
- float w;
-};
-
-//
-// For vector4, define math operators to match vector
-//
-
-vector4 __operator__neg__(vector4 a)
-{
- return vector4(-a.x, -a.y, -a.z, -a.w);
-}
-
-vector4 __operator__add__(vector4 a, vector4 b)
-{
- return vector4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w);
-}
-
-vector4 __operator__add__(vector4 a, int b)
-{
- return a + vector4(b, b, b, b);
-}
-
-vector4 __operator__add__(vector4 a, float b)
-{
- return a + vector4(b, b, b, b);
-}
-
-vector4 __operator__add__(int a, vector4 b)
-{
- return vector4(a, a, a, a) + b;
-}
-
-vector4 __operator__add__(float a, vector4 b)
-{
- return vector4(a, a, a, a) + b;
-}
-
-vector4 __operator__sub__(vector4 a, vector4 b)
-{
- return vector4(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w);
-}
-
-vector4 __operator__sub__(vector4 a, int b)
-{
- return a - vector4(b, b, b, b);
-}
-
-vector4 __operator__sub__(vector4 a, float b)
-{
- return a - vector4(b, b, b, b);
-}
-
-vector4 __operator__sub__(int a, vector4 b)
-{
- return vector4(a, a, a, a) - b;
-}
-
-vector4 __operator__sub__(float a, vector4 b)
-{
- return vector4(a, a, a, a) - b;
-}
-
-vector4 __operator__mul__(vector4 a, vector4 b)
-{
- return vector4(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w);
-}
-
-vector4 __operator__mul__(vector4 a, int b)
-{
- return a * vector4(b, b, b, b);
-}
-
-vector4 __operator__mul__(vector4 a, float b)
-{
- return a * vector4(b, b, b, b);
-}
-
-vector4 __operator__mul__(int a, vector4 b)
-{
- return vector4(a, a, a, a) * b;
-}
-
-vector4 __operator__mul__(float a, vector4 b)
-{
- return vector4(a, a, a, a) * b;
-}
-
-vector4 __operator__div__(vector4 a, vector4 b)
-{
- return vector4(a.x / b.x, a.y / b.y, a.z / b.z, a.w / b.w);
-}
-
-vector4 __operator__div__(vector4 a, int b)
-{
- float b_inv = 1 / b;
- return a * vector4(b_inv, b_inv, b_inv, b_inv);
-}
-
-vector4 __operator__div__(vector4 a, float b)
-{
- float b_inv = 1 / b;
- return a * vector4(b_inv, b_inv, b_inv, b_inv);
-}
-
-vector4 __operator__div__(int a, vector4 b)
-{
- return vector4(a, a, a, a) / b;
-}
-
-vector4 __operator__div__(float a, vector4 b)
-{
- return vector4(a, a, a, a) / b;
-}
-
-int __operator__eq__(vector4 a, vector4 b)
-{
- return (a.x == b.x) && (a.y == b.y) && (a.z == b.z) && (a.w == b.w);
-}
-
-int __operator__ne__(vector4 a, vector4 b)
-{
- return (a.x != b.x) || (a.y != b.y) || (a.z != b.z) || (a.w != b.w);
-}
-
-//
-// For vector4, define most of the stdosl functions to match vector
-//
-
-vector4 abs(vector4 in)
-{
- return vector4(abs(in.x), abs(in.y), abs(in.z), abs(in.w));
-}
-
-vector4 ceil(vector4 in)
-{
- return vector4(ceil(in.x), ceil(in.y), ceil(in.z), ceil(in.w));
-}
-
-vector4 floor(vector4 in)
-{
- return vector4(floor(in.x), floor(in.y), floor(in.z), floor(in.w));
-}
-
-vector4 sqrt(vector4 in)
-{
- return vector4(sqrt(in.x), sqrt(in.y), sqrt(in.z), sqrt(in.w));
-}
-
-vector4 exp(vector4 in)
-{
- return vector4(exp(in.x), exp(in.y), exp(in.z), exp(in.w));
-}
-
-vector4 log(vector4 in)
-{
- return vector4(log(in.x), log(in.y), log(in.z), log(in.w));
-}
-
-vector4 log2(vector4 in)
-{
- return vector4(log2(in.x), log2(in.y), log2(in.z), log2(in.w));
-}
-
-vector4 mix(vector4 value1, vector4 value2, float x)
-{
- return vector4(mix(value1.x, value2.x, x),
- mix(value1.y, value2.y, x),
- mix(value1.z, value2.z, x),
- mix(value1.w, value2.w, x));
-}
-
-vector vec4ToVec3(vector4 v)
-{
- return vector(v.x, v.y, v.z) / v.w;
-}
-
-float dot(vector4 a, vector4 b)
-{
- return ((a.x * b.x) + (a.y * b.y) + (a.z * b.z) + (a.w * b.w));
-}
-
-float length(vector4 a)
-{
- return sqrt(a.x * a.x + a.y * a.y + a.z * a.z + a.w * a.w);
-}
-
-vector4 smoothstep(vector4 low, vector4 high, vector4 in)
-{
- return vector4(smoothstep(low.x, high.x, in.x),
- smoothstep(low.y, high.y, in.y),
- smoothstep(low.z, high.z, in.z),
- smoothstep(low.w, high.w, in.w));
-}
-
-vector4 smoothstep(float low, float high, vector4 in)
-{
- return vector4(smoothstep(low, high, in.x),
- smoothstep(low, high, in.y),
- smoothstep(low, high, in.z),
- smoothstep(low, high, in.w));
-}
-
-vector4 clamp(vector4 in, vector4 low, vector4 high)
-{
- return vector4(clamp(in.x, low.x, high.x),
- clamp(in.y, low.y, high.y),
- clamp(in.z, low.z, high.z),
- clamp(in.w, low.w, high.w));
-}
-
-vector4 clamp(vector4 in, float low, float high)
-{
- return vector4(clamp(in.x, low, high),
- clamp(in.y, low, high),
- clamp(in.z, low, high),
- clamp(in.w, low, high));
-}
-
-vector4 max(vector4 a, vector4 b)
-{
- return vector4(max(a.x, b.x), max(a.y, b.y), max(a.z, b.z), max(a.w, b.w));
-}
-
-vector4 max(vector4 a, float b)
-{
- return max(a, vector4(b, b, b, b));
-}
-
-vector4 normalize(vector4 a)
-{
- return a / length(a);
-}
-
-vector4 min(vector4 a, vector4 b)
-{
- return vector4(min(a.x, b.x), min(a.y, b.y), min(a.z, b.z), min(a.w, b.w));
-}
-
-vector4 min(vector4 a, float b)
-{
- return min(a, vector4(b, b, b, b));
-}
-
-vector4 fmod(vector4 a, vector4 b)
-{
- return vector4(fmod(a.x, b.x), fmod(a.y, b.y), fmod(a.z, b.z), fmod(a.w, b.w));
-}
-
-vector4 fmod(vector4 a, float b)
-{
- return fmod(a, vector4(b, b, b, b));
-}
-
-vector4 pow(vector4 in, vector4 amount)
-{
- return vector4(
- pow(in.x, amount.x), pow(in.y, amount.y), pow(in.z, amount.z), pow(in.w, amount.w));
-}
-
-vector4 pow(vector4 in, float amount)
-{
- return vector4(pow(in.x, amount), pow(in.y, amount), pow(in.z, amount), pow(in.w, amount));
-}
-
-vector4 sign(vector4 a)
-{
- return vector4(sign(a.x), sign(a.y), sign(a.z), sign(a.w));
-}
-
-vector4 sin(vector4 a)
-{
- return vector4(sin(a.x), sin(a.y), sin(a.z), sin(a.w));
-}
-
-vector4 cos(vector4 a)
-{
- return vector4(cos(a.x), cos(a.y), cos(a.z), cos(a.w));
-}
-
-vector4 tan(vector4 a)
-{
- return vector4(tan(a.x), tan(a.y), tan(a.z), tan(a.w));
-}
-
-vector4 asin(vector4 a)
-{
- return vector4(asin(a.x), asin(a.y), asin(a.z), asin(a.w));
-}
-
-vector4 acos(vector4 a)
-{
- return vector4(acos(a.x), acos(a.y), acos(a.z), acos(a.w));
-}
-
-vector4 atan2(vector4 a, float f)
-{
- return vector4(atan2(a.x, f), atan2(a.y, f), atan2(a.z, f), atan2(a.w, f));
-}
-
-vector4 atan2(vector4 a, vector4 b)
-{
- return vector4(atan2(a.x, b.x), atan2(a.y, b.y), atan2(a.z, b.z), atan2(a.w, b.w));
-}
-
-vector4 transform(matrix M, vector4 p)
-{
- return vector4(M[0][0] * p.x + M[0][1] * p.y + M[0][2] * p.z + M[0][2] * p.w,
- M[1][0] * p.x + M[1][1] * p.y + M[1][2] * p.z + M[1][2] * p.w,
- M[2][0] * p.x + M[2][1] * p.y + M[2][2] * p.z + M[2][2] * p.w,
- M[3][0] * p.x + M[3][1] * p.y + M[3][2] * p.z + M[3][2] * p.w);
-}
-
-vector4 transform(string fromspace, string tospace, vector4 p)
-{
- return transform(matrix(fromspace, tospace), p);
-}
diff --git a/intern/cycles/render/osl.cpp b/intern/cycles/render/osl.cpp
index 1f0a243e6c1..b3916a67f0c 100644
--- a/intern/cycles/render/osl.cpp
+++ b/intern/cycles/render/osl.cpp
@@ -319,7 +319,7 @@ bool OSLShaderManager::osl_compile(const string &inputfile, const string &output
string include_path_arg = string("-I") + shader_path;
options.push_back(include_path_arg);
- stdosl_path = path_get("shader/stdosl.h");
+ stdosl_path = path_get("shader/stdcycles.h");
/* compile */
OSL::OSLCompiler *compiler = new OSL::OSLCompiler(&OSL::ErrorHandler::default_handler());