[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51836] trunk/blender: Cycles OSL: refactoring and fixes

Brecht Van Lommel brechtvanlommel at pandora.be
Sat Nov 3 15:32:13 CET 2012


Revision: 51836
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51836
Author:   blendix
Date:     2012-11-03 14:32:13 +0000 (Sat, 03 Nov 2012)
Log Message:
-----------
Cycles OSL: refactoring and fixes

* Moved kernel/osl/nodes to kernel/shaders
* Renamed standard attributes to use geom:, particle:, object: prefixes
* Update stdosl.h to properly reflect the closures we support
* Fix the wrong stdosl.h being used for building shaders
* Add geom:numpolyvertices, geom:trianglevertices, geom:polyvertices attributes

Modified Paths:
--------------
    trunk/blender/CMakeLists.txt
    trunk/blender/intern/cycles/blender/addon/engine.py
    trunk/blender/intern/cycles/blender/addon/enums.py
    trunk/blender/intern/cycles/kernel/CMakeLists.txt
    trunk/blender/intern/cycles/kernel/closure/bsdf_microfacet.h
    trunk/blender/intern/cycles/kernel/kernel_triangle.h
    trunk/blender/intern/cycles/kernel/osl/CMakeLists.txt
    trunk/blender/intern/cycles/kernel/osl/osl_services.cpp
    trunk/blender/intern/cycles/render/mesh.cpp
    trunk/blender/intern/cycles/util/util_md5.h
    trunk/blender/source/creator/CMakeLists.txt

Added Paths:
-----------
    trunk/blender/intern/cycles/kernel/shaders/
    trunk/blender/intern/cycles/kernel/shaders/CMakeLists.txt
    trunk/blender/intern/cycles/kernel/shaders/node_add_closure.osl
    trunk/blender/intern/cycles/kernel/shaders/node_attribute.osl
    trunk/blender/intern/cycles/kernel/shaders/node_background.osl
    trunk/blender/intern/cycles/kernel/shaders/node_brick_texture.osl
    trunk/blender/intern/cycles/kernel/shaders/node_brightness.osl
    trunk/blender/intern/cycles/kernel/shaders/node_bump.osl
    trunk/blender/intern/cycles/kernel/shaders/node_camera.osl
    trunk/blender/intern/cycles/kernel/shaders/node_checker_texture.osl
    trunk/blender/intern/cycles/kernel/shaders/node_color.h
    trunk/blender/intern/cycles/kernel/shaders/node_combine_rgb.osl
    trunk/blender/intern/cycles/kernel/shaders/node_convert_from_color.osl
    trunk/blender/intern/cycles/kernel/shaders/node_convert_from_float.osl
    trunk/blender/intern/cycles/kernel/shaders/node_convert_from_int.osl
    trunk/blender/intern/cycles/kernel/shaders/node_convert_from_normal.osl
    trunk/blender/intern/cycles/kernel/shaders/node_convert_from_point.osl
    trunk/blender/intern/cycles/kernel/shaders/node_convert_from_vector.osl
    trunk/blender/intern/cycles/kernel/shaders/node_diffuse_bsdf.osl
    trunk/blender/intern/cycles/kernel/shaders/node_emission.osl
    trunk/blender/intern/cycles/kernel/shaders/node_environment_texture.osl
    trunk/blender/intern/cycles/kernel/shaders/node_fresnel.h
    trunk/blender/intern/cycles/kernel/shaders/node_fresnel.osl
    trunk/blender/intern/cycles/kernel/shaders/node_gamma.osl
    trunk/blender/intern/cycles/kernel/shaders/node_geometry.osl
    trunk/blender/intern/cycles/kernel/shaders/node_glass_bsdf.osl
    trunk/blender/intern/cycles/kernel/shaders/node_glossy_bsdf.osl
    trunk/blender/intern/cycles/kernel/shaders/node_gradient_texture.osl
    trunk/blender/intern/cycles/kernel/shaders/node_holdout.osl
    trunk/blender/intern/cycles/kernel/shaders/node_hsv.osl
    trunk/blender/intern/cycles/kernel/shaders/node_image_texture.osl
    trunk/blender/intern/cycles/kernel/shaders/node_invert.osl
    trunk/blender/intern/cycles/kernel/shaders/node_layer_weight.osl
    trunk/blender/intern/cycles/kernel/shaders/node_light_falloff.osl
    trunk/blender/intern/cycles/kernel/shaders/node_light_path.osl
    trunk/blender/intern/cycles/kernel/shaders/node_magic_texture.osl
    trunk/blender/intern/cycles/kernel/shaders/node_mapping.osl
    trunk/blender/intern/cycles/kernel/shaders/node_math.osl
    trunk/blender/intern/cycles/kernel/shaders/node_mix.osl
    trunk/blender/intern/cycles/kernel/shaders/node_mix_closure.osl
    trunk/blender/intern/cycles/kernel/shaders/node_musgrave_texture.osl
    trunk/blender/intern/cycles/kernel/shaders/node_noise_texture.osl
    trunk/blender/intern/cycles/kernel/shaders/node_normal.osl
    trunk/blender/intern/cycles/kernel/shaders/node_object_info.osl
    trunk/blender/intern/cycles/kernel/shaders/node_output_displacement.osl
    trunk/blender/intern/cycles/kernel/shaders/node_output_surface.osl
    trunk/blender/intern/cycles/kernel/shaders/node_output_volume.osl
    trunk/blender/intern/cycles/kernel/shaders/node_particle_info.osl
    trunk/blender/intern/cycles/kernel/shaders/node_rgb_ramp.osl
    trunk/blender/intern/cycles/kernel/shaders/node_separate_rgb.osl
    trunk/blender/intern/cycles/kernel/shaders/node_set_normal.osl
    trunk/blender/intern/cycles/kernel/shaders/node_sky_texture.osl
    trunk/blender/intern/cycles/kernel/shaders/node_texture.h
    trunk/blender/intern/cycles/kernel/shaders/node_texture_coordinate.osl
    trunk/blender/intern/cycles/kernel/shaders/node_translucent_bsdf.osl
    trunk/blender/intern/cycles/kernel/shaders/node_transparent_bsdf.osl
    trunk/blender/intern/cycles/kernel/shaders/node_value.osl
    trunk/blender/intern/cycles/kernel/shaders/node_vector_math.osl
    trunk/blender/intern/cycles/kernel/shaders/node_velvet_bsdf.osl
    trunk/blender/intern/cycles/kernel/shaders/node_voronoi_texture.osl
    trunk/blender/intern/cycles/kernel/shaders/node_ward_bsdf.osl
    trunk/blender/intern/cycles/kernel/shaders/node_wave_texture.osl
    trunk/blender/intern/cycles/kernel/shaders/oslutil.h
    trunk/blender/intern/cycles/kernel/shaders/stdosl.h

Removed Paths:
-------------
    trunk/blender/intern/cycles/kernel/osl/nodes/CMakeLists.txt
    trunk/blender/intern/cycles/kernel/osl/nodes/node_add_closure.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_attribute.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_background.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_brick_texture.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_brightness.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_bump.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_camera.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_checker_texture.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_color.h
    trunk/blender/intern/cycles/kernel/osl/nodes/node_combine_rgb.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_convert_from_color.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_convert_from_float.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_convert_from_int.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_convert_from_normal.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_convert_from_point.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_convert_from_vector.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_diffuse_bsdf.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_emission.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_environment_texture.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_fresnel.h
    trunk/blender/intern/cycles/kernel/osl/nodes/node_fresnel.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_gamma.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_geometry.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_glass_bsdf.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_glossy_bsdf.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_gradient_texture.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_holdout.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_hsv.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_image_texture.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_invert.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_layer_weight.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_light_falloff.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_light_path.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_magic_texture.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_mapping.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_math.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_mix.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_mix_closure.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_musgrave_texture.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_noise_texture.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_normal.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_object_info.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_output_displacement.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_output_surface.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_output_volume.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_particle_info.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_rgb_ramp.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_separate_rgb.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_set_normal.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_sky_texture.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_texture.h
    trunk/blender/intern/cycles/kernel/osl/nodes/node_texture_coordinate.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_translucent_bsdf.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_transparent_bsdf.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_value.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_vector_math.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_velvet_bsdf.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_voronoi_texture.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_ward_bsdf.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/node_wave_texture.osl
    trunk/blender/intern/cycles/kernel/osl/nodes/oslutil.h
    trunk/blender/intern/cycles/kernel/osl/nodes/stdosl.h

Modified: trunk/blender/CMakeLists.txt
===================================================================
--- trunk/blender/CMakeLists.txt	2012-11-03 14:31:55 UTC (rev 51835)
+++ trunk/blender/CMakeLists.txt	2012-11-03 14:32:13 UTC (rev 51836)
@@ -658,11 +658,7 @@
 			else()
 				set(Boost_USE_MULTITHREADED ON)
 			endif()
-			if(WITH_CYCLES_OSL)
-				find_package(Boost 1.34 COMPONENTS filesystem python3 regex system thread) # osl_nodes uses boost_python
-			else()
-				find_package(Boost 1.34 COMPONENTS filesystem regex system thread)
-			endif()
+			find_package(Boost 1.34 COMPONENTS filesystem regex system thread)
 			mark_as_advanced(Boost_DIR)  # why doesnt boost do this?
 		endif()
 
@@ -1137,12 +1133,6 @@
 				debug libboost_date_time-${BOOST_DEBUG_POSTFIX} debug libboost_filesystem-${BOOST_DEBUG_POSTFIX}
 				debug libboost_regex-${BOOST_DEBUG_POSTFIX}
 				debug libboost_system-${BOOST_DEBUG_POSTFIX} debug libboost_thread-${BOOST_DEBUG_POSTFIX})
-				if(WITH_CYCLES_OSL)
-					set(BOOST_LIBRARIES ${BOOST_LIBRARIES}
-						optimized libboost_python3-${BOOST_POSTFIX}
-						debug libboost_python3-${BOOST_DEBUG_POSTFIX})
-				endif(WITH_CYCLES_OSL)
-				
 			set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB")
 		endif()
 			
@@ -1323,12 +1313,6 @@
 				debug boost_date_time-${BOOST_DEBUG_POSTFIX} boost_filesystem-${BOOST_DEBUG_POSTFIX}
 				boost_regex-${BOOST_DEBUG_POSTFIX}
 				boost_system-${BOOST_DEBUG_POSTFIX} boost_thread-${BOOST_DEBUG_POSTFIX})
-				if(WITH_CYCLES_OSL)
-					set(BOOST_LIBRARIES ${BOOST_LIBRARIES}
-						optimized libboost_python3-${BOOST_POSTFIX}
-						debug libboost_python3-${BOOST_DEBUG_POSTFIX}) 
-				endif(WITH_CYCLES_OSL)
-					
 			set(BOOST_LIBPATH ${BOOST}/lib)
 			set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB -DBOOST_THREAD_USE_LIB ")
 		endif()
@@ -1583,11 +1567,7 @@
 	if(WITH_BOOST)
 		set(BOOST ${LIBDIR}/boost)
 		set(BOOST_INCLUDE_DIR ${BOOST}/include)
-		if(WITH_CYCLES_OSL)
-			set(BOOST_LIBRARIES boost_date_time-mt boost_filesystem-mt boost_python3-mt boost_regex-mt boost_system-mt boost_thread-mt)
-		else(WITH_CYCLES_OSL)
-			set(BOOST_LIBRARIES boost_date_time-mt boost_filesystem-mt boost_regex-mt boost_system-mt boost_thread-mt)
-		endif(WITH_CYCLES_OSL)
+		set(BOOST_LIBRARIES boost_date_time-mt boost_filesystem-mt boost_regex-mt boost_system-mt boost_thread-mt)
 		set(BOOST_LIBPATH ${BOOST}/lib)
 		set(BOOST_DEFINITIONS)
 	endif()

Modified: trunk/blender/intern/cycles/blender/addon/engine.py
===================================================================
--- trunk/blender/intern/cycles/blender/addon/engine.py	2012-11-03 14:31:55 UTC (rev 51835)
+++ trunk/blender/intern/cycles/blender/addon/engine.py	2012-11-03 14:32:13 UTC (rev 51836)
@@ -83,3 +83,4 @@
 def with_osl():
     import _cycles
     return _cycles.with_osl
+

Modified: trunk/blender/intern/cycles/blender/addon/enums.py
===================================================================
--- trunk/blender/intern/cycles/blender/addon/enums.py	2012-11-03 14:31:55 UTC (rev 51835)
+++ trunk/blender/intern/cycles/blender/addon/enums.py	2012-11-03 14:32:13 UTC (rev 51836)
@@ -60,3 +60,4 @@
     ('FISHEYE_EQUIDISTANT', "Fisheye Equidistant", "Ideal for fulldomes, ignore the sensor dimensions"),
     ('FISHEYE_EQUISOLID', "Fisheye Equisolid", "Similar to most fisheye modern lens, take sensor dimensions into consideration"),
     )
+

Modified: trunk/blender/intern/cycles/kernel/CMakeLists.txt
===================================================================
--- trunk/blender/intern/cycles/kernel/CMakeLists.txt	2012-11-03 14:31:55 UTC (rev 51835)
+++ trunk/blender/intern/cycles/kernel/CMakeLists.txt	2012-11-03 14:32:13 UTC (rev 51836)
@@ -134,6 +134,7 @@
 
 if(WITH_CYCLES_OSL)
 	add_subdirectory(osl)
+	add_subdirectory(shaders)
 endif()
 
 # CPU module

Modified: trunk/blender/intern/cycles/kernel/closure/bsdf_microfacet.h
===================================================================
--- trunk/blender/intern/cycles/kernel/closure/bsdf_microfacet.h	2012-11-03 14:31:55 UTC (rev 51835)
+++ trunk/blender/intern/cycles/kernel/closure/bsdf_microfacet.h	2012-11-03 14:32:13 UTC (rev 51836)
@@ -45,13 +45,10 @@
 __device int bsdf_microfacet_ggx_setup(ShaderClosure *sc)
 {
 	float ag = sc->data0;
-	float eta = sc->data1;
 
 	float m_ag = clamp(ag, 1e-4f, 1.0f);
-	float m_eta = eta;
 
 	sc->data0 = m_ag;
-	sc->data1 = m_eta;
 	sc->type = CLOSURE_BSDF_MICROFACET_GGX_ID;
 
 	return SD_BSDF|SD_BSDF_HAS_EVAL|SD_BSDF_GLOSSY;
@@ -82,7 +79,6 @@
 __device float3 bsdf_microfacet_ggx_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf)
 {
 	float m_ag = sc->data0;
-	//float m_eta = sc->data1;
 	int m_refractive = sc->type == CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID;
 	float3 N = sc->N;
 
@@ -155,7 +151,6 @@
 __device int bsdf_microfacet_ggx_sample(const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf)
 {
 	float m_ag = sc->data0;
-	float m_eta = sc->data1;
 	int m_refractive = sc->type == CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID;
 	float3 N = sc->N;
 
@@ -221,6 +216,7 @@
 #ifdef __RAY_DIFFERENTIALS__
 			float3 dRdx, dRdy, dTdx, dTdy;
 #endif
+			float m_eta = sc->data1;
 			bool inside;
 			fresnel_dielectric(m_eta, m, I, &R, &T,
 #ifdef __RAY_DIFFERENTIALS__
@@ -274,12 +270,9 @@
 __device int bsdf_microfacet_beckmann_setup(ShaderClosure *sc)
 {
 	float ab = sc->data0;
-	float eta = sc->data1;
 	float m_ab = clamp(ab, 1e-4f, 1.0f);
-	float m_eta = eta;
 
 	sc->data0 = m_ab;
-	sc->data1 = m_eta;
 
 	sc->type = CLOSURE_BSDF_MICROFACET_BECKMANN_ID;
 	return SD_BSDF|SD_BSDF_HAS_EVAL|SD_BSDF_GLOSSY;
@@ -309,7 +302,6 @@
 __device float3 bsdf_microfacet_beckmann_eval_reflect(const ShaderClosure *sc, const float3 I, const float3 omega_in, float *pdf)
 {
 	float m_ab = sc->data0;
-	//float m_eta = sc->data1;
 	int m_refractive = sc->type == CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID;
 	float3 N = sc->N;
 
@@ -386,7 +378,6 @@
 __device int bsdf_microfacet_beckmann_sample(const ShaderClosure *sc, float3 Ng, float3 I, float3 dIdx, float3 dIdy, float randu, float randv, float3 *eval, float3 *omega_in, float3 *domega_in_dx, float3 *domega_in_dy, float *pdf)
 {
 	float m_ab = sc->data0;
-	float m_eta = sc->data1;
 	int m_refractive = sc->type == CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID;
 	float3 N = sc->N;
 
@@ -456,6 +447,7 @@
 #ifdef __RAY_DIFFERENTIALS__
 			float3 dRdx, dRdy, dTdx, dTdy;
 #endif
+			float m_eta = sc->data1;
 			bool inside;
 			fresnel_dielectric(m_eta, m, I, &R, &T,
 #ifdef __RAY_DIFFERENTIALS__

Modified: trunk/blender/intern/cycles/kernel/kernel_triangle.h
===================================================================
--- trunk/blender/intern/cycles/kernel/kernel_triangle.h	2012-11-03 14:31:55 UTC (rev 51835)
+++ trunk/blender/intern/cycles/kernel/kernel_triangle.h	2012-11-03 14:32:13 UTC (rev 51836)
@@ -68,6 +68,17 @@
 #endif
 }
 
+/* Return 3 triangle vertex locations */
+__device_inline void triangle_vertices(KernelGlobals *kg, int tri_index, float3 P[3])
+{
+	/* load triangle vertices */
+	float3 tri_vindex = float4_to_float3(kernel_tex_fetch(__tri_vindex, tri_index));
+
+	P[0] = float4_to_float3(kernel_tex_fetch(__tri_verts, __float_as_int(tri_vindex.x)));
+	P[1] = float4_to_float3(kernel_tex_fetch(__tri_verts, __float_as_int(tri_vindex.y)));
+	P[2] = float4_to_float3(kernel_tex_fetch(__tri_verts, __float_as_int(tri_vindex.z)));
+}
+
 __device_inline float3 triangle_smooth_normal(KernelGlobals *kg, int tri_index, float u, float v)
 {
 	/* load triangle vertices */

Modified: trunk/blender/intern/cycles/kernel/osl/CMakeLists.txt
===================================================================
--- trunk/blender/intern/cycles/kernel/osl/CMakeLists.txt	2012-11-03 14:31:55 UTC (rev 51835)
+++ trunk/blender/intern/cycles/kernel/osl/CMakeLists.txt	2012-11-03 14:32:13 UTC (rev 51836)
@@ -34,4 +34,3 @@
 
 add_library(cycles_kernel_osl ${SRC} ${HEADER_SRC})
 
-add_subdirectory(nodes)

Deleted: trunk/blender/intern/cycles/kernel/osl/nodes/CMakeLists.txt
===================================================================
--- trunk/blender/intern/cycles/kernel/osl/nodes/CMakeLists.txt	2012-11-03 14:31:55 UTC (rev 51835)
+++ trunk/blender/intern/cycles/kernel/osl/nodes/CMakeLists.txt	2012-11-03 14:32:13 UTC (rev 51836)
@@ -1,96 +0,0 @@
-
-# OSL node shaders
-
-set(SRC_OSL
-	node_add_closure.osl
-	node_attribute.osl
-	node_background.osl
-	node_brick_texture.osl
-	node_bump.osl
-	node_camera.osl
-	node_checker_texture.osl
-	node_combine_rgb.osl
-	node_convert_from_color.osl
-	node_convert_from_float.osl
-	node_convert_from_int.osl
-	node_convert_from_normal.osl
-	node_convert_from_point.osl
-	node_convert_from_vector.osl
-	node_diffuse_bsdf.osl
-	node_emission.osl
-	node_environment_texture.osl
-	node_fresnel.osl
-	node_gamma.osl
-	node_gradient_texture.osl
-	node_brightness.osl
-	node_geometry.osl
-	node_glass_bsdf.osl
-	node_glossy_bsdf.osl
-	node_holdout.osl
-	node_hsv.osl
-	node_image_texture.osl
-	node_invert.osl
-	node_layer_weight.osl
-	node_light_path.osl
-	node_light_falloff.osl
-	node_magic_texture.osl
-	node_mapping.osl
-	node_math.osl
-	node_mix.osl
-	node_mix_closure.osl
-	node_musgrave_texture.osl
-	node_normal.osl
-	node_noise_texture.osl
-	node_object_info.osl
-	node_output_displacement.osl
-	node_output_surface.osl
-	node_output_volume.osl
-	node_particle_info.osl
-	node_rgb_ramp.osl
-	node_separate_rgb.osl
-	node_set_normal.osl
-	node_sky_texture.osl
-	node_texture_coordinate.osl
-	node_translucent_bsdf.osl
-	node_transparent_bsdf.osl
-	node_value.osl
-	node_vector_math.osl
-	node_velvet_bsdf.osl
-	node_voronoi_texture.osl
-	node_ward_bsdf.osl
-	node_wave_texture.osl
-)
-
-set(SRC_OSL_HEADERS
-	node_texture.h
-	node_color.h
-	node_fresnel.h
-	stdosl.h
-	oslutil.h
-)
-
-set(SRC_OSO
-
-)
-
-# TODO, add a module to compile OSL
-foreach(_file ${SRC_OSL})
-	set(_OSL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${_file})
-	string(REPLACE ".osl" ".oso" _OSO_FILE ${_OSL_FILE})  # TODO, replace extension only
-	string(REPLACE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} _OSO_FILE ${_OSO_FILE})
-	add_custom_command(
-		OUTPUT ${_OSO_FILE} 
-		COMMAND ${OSL_COMPILER} -O2 ${_OSL_FILE}
-		DEPENDS ${_OSL_FILE} ${SRC_OSL_HEADERS})
-	list(APPEND SRC_OSO
-		${_OSO_FILE}
-	)
-	
-	unset(_OSL_FILE)
-	unset(_OSO_FILE)
-endforeach()
-

@@ Diff output truncated at 10240 characters. @@


More information about the Bf-blender-cvs mailing list