39#ifdef __KERNEL_DEBUG_NAN__
41 kernel_assert(!
"Cycles displacement with non-finite value detected");
64 const float ray_time = 0.5f;
79#ifdef __KERNEL_DEBUG_NAN__
81 kernel_assert(!
"Cycles background with non-finite value detected");
91 output[offset * 3 + 0] += color_rgb.
x;
92 output[offset * 3 + 1] += color_rgb.
y;
93 output[offset * 3 + 2] += color_rgb.
z;
142 shader_setup_from_volume(&sd, &ray,
in.object);
148 sd.num_closure_left = 0;
157 const int shader =
in.object;
164 const int num_samples = volume_is_homogeneous(kg, entry) ? 1 : 16;
168 const Transform tfm = need_transformation ?
178 sd.P = ray.
P + rand_p * voxel_size;
179 if (need_transformation) {
187 volume_shader_eval_entry<
false,
191 const float sigma =
reduce_max(sd.closure_transparent_extinction);
192 const float emission =
reduce_max(sd.closure_emission_background);
194 extrema =
merge(extrema,
fmaxf(sigma, emission));
199 output[offset * 2 + 0] = extrema.
min / scale;
200 output[offset * 2 + 1] = extrema.
max / scale;
reduce_max(value.rgb)") DEFINE_VALUE("REDUCE(lhs
ccl_device float3 equirectangular_to_direction(const float u, const float v)
#define kernel_assert(cond)
#define kernel_data_fetch(name, index)
#define KERNEL_FEATURE_NODE_MASK_SURFACE_SHADOW
const ThreadKernelGlobalsCPU * KernelGlobals
#define KERNEL_FEATURE_NODE_MASK_VOLUME
#define KERNEL_FEATURE_NODE_LIGHT_PATH
#define KERNEL_FEATURE_NODE_MASK_SURFACE_LIGHT
#define KERNEL_FEATURE_NODE_RAYTRACE
#define CCL_NAMESPACE_END
CCL_NAMESPACE_BEGIN ccl_device void displacement_shader_eval(KernelGlobals kg, ConstIntegratorGenericState state, ccl_private ShaderData *sd)
constexpr T clamp(T, U, U) RET
ccl_device void kernel_volume_density_evaluate(KernelGlobals kg, ccl_global const KernelShaderEvalInput *input, ccl_global float *output, const int offset)
ccl_device void kernel_curve_shadow_transparency_evaluate(KernelGlobals kg, const ccl_global KernelShaderEvalInput *input, ccl_global float *output, const int offset)
CCL_NAMESPACE_BEGIN ccl_device void kernel_displace_evaluate(KernelGlobals kg, const ccl_global KernelShaderEvalInput *input, ccl_global float *output, const int offset)
ccl_device void kernel_background_evaluate(KernelGlobals kg, const ccl_global KernelShaderEvalInput *input, ccl_global float *output, const int offset)
ccl_device_inline float object_volume_density(KernelGlobals kg, const int object)
ccl_device_inline Transform object_fetch_transform(KernelGlobals kg, const int object, enum ObjectTransform type)
ccl_device_inline void object_inverse_dir_transform(KernelGlobals kg, const ccl_private ShaderData *sd, ccl_private float3 *D)
@ SD_IS_VOLUME_SHADER_EVAL
@ PRNG_BAKE_VOLUME_DENSITY_EVAL
@ PATH_RAY_IMPORTANCE_BAKE
@ SD_OBJECT_TRANSFORM_APPLIED
ccl_device_inline float3 spectrum_to_rgb(Spectrum s)
ccl_device_inline uint lcg_state_init(const uint rng_hash, const uint rng_offset, const uint sample, const uint scramble)
OrientationBounds merge(const OrientationBounds &cone_a, const OrientationBounds &cone_b)
ccl_device_inline float ensure_finite(const float v)
ccl_device_inline bool isfinite_safe(const float f)
CCL_NAMESPACE_BEGIN ccl_device_inline float3 zero_float3()
ccl_device void shader_setup_from_displace(KernelGlobals kg, ccl_private ShaderData *ccl_restrict sd, const int object, const int prim, const float u, const float v)
ccl_device_inline void shader_setup_from_background(KernelGlobals kg, ccl_private ShaderData *ccl_restrict sd, const float3 ray_P, const float3 ray_D, const float ray_time)
ccl_device float3 sobol_burley_sample_3D(uint index, const uint dimension_set, uint seed, const uint shuffled_index_mask)
#define INTEGRATOR_STATE_NULL
ccl_device void surface_shader_eval(KernelGlobals kg, ConstIntegratorGenericState state, ccl_private ShaderData *ccl_restrict sd, ccl_global float *ccl_restrict buffer, const uint32_t path_flag, bool use_caustics_storage=false)
ccl_device Spectrum surface_shader_transparency(const ccl_private ShaderData *sd)
ccl_device Spectrum surface_shader_background(const ccl_private ShaderData *sd)