Welcome to mirror list, hosted at ThFree Co, Russian Federation.

CMakeLists.txt « shaders « osl « kernel « cycles « intern - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c79af3f6112944097a50a8cf7c502c999800a942 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# SPDX-License-Identifier: Apache-2.0
# Copyright 2011-2022 Blender Foundation

# OSL node shaders

set(SRC_OSL
  node_add_closure.osl
  node_ambient_occlusion.osl
  node_anisotropic_bsdf.osl
  node_attribute.osl
  node_background.osl
  node_bevel.osl
  node_brick_texture.osl
  node_brightness.osl
  node_bump.osl
  node_camera.osl
  node_checker_texture.osl
  node_clamp.osl
  node_combine_color.osl
  node_combine_rgb.osl
  node_combine_hsv.osl
  node_combine_xyz.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_displacement.osl
  node_vector_displacement.osl
  node_emission.osl
  node_environment_texture.osl
  node_float_curve.osl
  node_fresnel.osl
  node_gamma.osl
  node_geometry.osl
  node_glass_bsdf.osl
  node_glossy_bsdf.osl
  node_gradient_texture.osl
  node_hair_info.osl
  node_point_info.osl
  node_scatter_volume.osl
  node_absorption_volume.osl
  node_principled_volume.osl
  node_holdout.osl
  node_hsv.osl
  node_ies_light.osl
  node_image_texture.osl
  node_invert.osl
  node_layer_weight.osl
  node_light_falloff.osl
  node_light_path.osl
  node_magic_texture.osl
  node_map_range.osl
  node_mapping.osl
  node_math.osl
  node_mix.osl
  node_mix_closure.osl
  node_mix_color.osl
  node_mix_float.osl
  node_mix_vector.osl
  node_mix_vector_non_uniform.osl
  node_musgrave_texture.osl
  node_noise_texture.osl
  node_normal.osl
  node_normal_map.osl
  node_object_info.osl
  node_output_displacement.osl
  node_output_surface.osl
  node_output_volume.osl
  node_particle_info.osl
  node_refraction_bsdf.osl
  node_rgb_curves.osl
  node_rgb_ramp.osl
  node_separate_color.osl
  node_separate_rgb.osl
  node_separate_hsv.osl
  node_separate_xyz.osl
  node_set_normal.osl
  node_sky_texture.osl
  node_subsurface_scattering.osl
  node_tangent.osl
  node_texture_coordinate.osl
  node_toon_bsdf.osl
  node_translucent_bsdf.osl
  node_transparent_bsdf.osl
  node_value.osl
  node_vector_curves.osl
  node_vector_math.osl
  node_vector_map_range.osl
  node_vector_rotate.osl
  node_vector_transform.osl
  node_velvet_bsdf.osl
  node_vertex_color.osl
  node_voronoi_texture.osl
  node_voxel_texture.osl
  node_wavelength.osl
  node_blackbody.osl
  node_wave_texture.osl
  node_white_noise_texture.osl
  node_wireframe.osl
  node_hair_bsdf.osl
  node_principled_hair_bsdf.osl
  node_uv_map.osl
  node_principled_bsdf.osl
  node_rgb_to_bw.osl
)

# 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_color_blend.h
  node_fresnel.h
  node_hash.h
  node_math.h
  node_noise.h
  node_ramp_util.h
  stdcycles.h
  ${SRC_OSL_HEADER_DIST}
)

set(SRC_OSO

)

# TODO, add a module to compile OSL
foreach(_file ${SRC_OSL})
  set(_OSL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${_file})
  set_source_files_properties(${_file} PROPERTIES HEADER_FILE_ONLY TRUE)
  string(REPLACE ".osl" ".oso" _OSO_FILE ${_OSL_FILE})
  string(REPLACE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} _OSO_FILE ${_OSO_FILE})
  add_custom_command(
    OUTPUT ${_OSO_FILE}
    COMMAND ${OSL_COMPILER} -q -O2  -I"${CMAKE_CURRENT_SOURCE_DIR}" -I"${OSL_SHADER_DIR}" -o ${_OSO_FILE} ${_OSL_FILE}
    DEPENDS ${_OSL_FILE} ${SRC_OSL_HEADERS} ${OSL_COMPILER})
  list(APPEND SRC_OSO
    ${_OSO_FILE}
  )

  unset(_OSL_FILE)
  unset(_OSO_FILE)
endforeach()

add_custom_target(cycles_osl_shaders ALL DEPENDS ${SRC_OSO} ${SRC_OSL_HEADERS} ${OSL_COMPILER} SOURCES ${SRC_OSL})
cycles_set_solution_folder(cycles_osl_shaders)

# CMAKE_CURRENT_SOURCE_DIR is already included in OSO paths
delayed_install("" "${SRC_OSO}" ${CYCLES_INSTALL_PATH}/shader)
delayed_install("${CMAKE_CURRENT_SOURCE_DIR}" "${SRC_OSL_HEADERS}" ${CYCLES_INSTALL_PATH}/shader)