2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
# OSL node shaders
|
|
|
|
|
2011-11-08 20:27:37 +00:00
|
|
|
set(SRC_OSL
|
2011-04-27 11:58:34 +00:00
|
|
|
node_add_closure.osl
|
|
|
|
node_attribute.osl
|
|
|
|
node_background.osl
|
2012-09-05 00:59:04 +00:00
|
|
|
node_brick_texture.osl
|
2011-04-27 11:58:34 +00:00
|
|
|
node_bump.osl
|
2011-12-02 20:36:13 +00:00
|
|
|
node_camera.osl
|
2012-06-03 00:02:24 +00:00
|
|
|
node_checker_texture.osl
|
2012-09-02 15:07:51 +00:00
|
|
|
node_combine_rgb.osl
|
2011-04-27 11:58:34 +00:00
|
|
|
node_convert_from_color.osl
|
|
|
|
node_convert_from_float.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
|
2011-12-16 20:35:06 +00:00
|
|
|
node_gamma.osl
|
2012-06-02 17:10:59 +00:00
|
|
|
node_gradient_texture.osl
|
2012-01-24 16:32:31 +00:00
|
|
|
node_brightness.osl
|
2011-04-27 11:58:34 +00:00
|
|
|
node_geometry.osl
|
|
|
|
node_glass_bsdf.osl
|
|
|
|
node_glossy_bsdf.osl
|
2012-09-03 14:08:03 +00:00
|
|
|
node_holdout.osl
|
2011-12-02 16:57:37 +00:00
|
|
|
node_hsv.osl
|
2011-04-27 11:58:34 +00:00
|
|
|
node_image_texture.osl
|
2011-12-03 23:05:35 +00:00
|
|
|
node_invert.osl
|
2011-04-27 11:58:34 +00:00
|
|
|
node_light_path.osl
|
|
|
|
node_magic_texture.osl
|
|
|
|
node_mapping.osl
|
|
|
|
node_math.osl
|
|
|
|
node_mix.osl
|
|
|
|
node_mix_closure.osl
|
|
|
|
node_musgrave_texture.osl
|
2011-12-16 18:15:07 +00:00
|
|
|
node_normal.osl
|
2011-04-27 11:58:34 +00:00
|
|
|
node_noise_texture.osl
|
|
|
|
node_output_displacement.osl
|
2011-10-12 23:03:12 +00:00
|
|
|
node_output_surface.osl
|
|
|
|
node_output_volume.osl
|
2012-09-02 15:07:51 +00:00
|
|
|
node_separate_rgb.osl
|
2011-04-27 11:58:34 +00:00
|
|
|
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
|
2012-06-02 19:14:14 +00:00
|
|
|
node_wave_texture.osl
|
2011-11-08 20:27:37 +00:00
|
|
|
)
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-11-08 20:27:37 +00:00
|
|
|
set(SRC_OSL_HEADERS
|
2011-04-27 11:58:34 +00:00
|
|
|
node_texture.h
|
2011-11-10 06:05:22 +00:00
|
|
|
node_color.h
|
|
|
|
node_fresnel.h
|
2011-11-08 20:27:37 +00:00
|
|
|
stdosl.h
|
2012-09-02 13:34:12 +00:00
|
|
|
oslutil.h
|
2011-11-08 20:27:37 +00:00
|
|
|
)
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-11-08 20:27:37 +00:00
|
|
|
set(SRC_OSO
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-11-08 20:27:37 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# 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})
|
2011-08-16 16:15:34 +00:00
|
|
|
add_custom_command(
|
2011-11-08 20:27:37 +00:00
|
|
|
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)
|
2011-08-16 16:15:34 +00:00
|
|
|
endforeach()
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-11-08 20:27:37 +00:00
|
|
|
add_custom_target(shader ALL DEPENDS ${SRC_OSO} ${SRC_OSL_HEADERS})
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2012-09-03 11:38:22 +00:00
|
|
|
# CMAKE_CURRENT_SOURCE_DIR is already included in OSO paths
|
|
|
|
delayed_install("" "${SRC_OSO}" ${CYCLES_INSTALL_PATH}/shader)
|