Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/osl/osl_closures.h
| Show First 20 Lines • Show All 143 Lines • ▼ Show 20 Lines | \ | ||||
| void setup() \ | void setup() \ | ||||
| { \ | { \ | ||||
| sc.prim = NULL; \ | sc.prim = NULL; \ | ||||
| m_shaderdata_flag = bsdf_##lower##_setup(&sc); \ | m_shaderdata_flag = bsdf_##lower##_setup(&sc); \ | ||||
| } \ | } \ | ||||
| \ | \ | ||||
| void blur(float roughness) \ | void blur(float roughness) \ | ||||
| { \ | { \ | ||||
| bsdf_##svmlower##_blur(&sc, roughness); \ | |||||
| } \ | } \ | ||||
| \ | \ | ||||
| float3 eval_reflect(const float3 &omega_out, const float3 &omega_in, float& pdf) const \ | float3 eval_reflect(const float3 &omega_out, const float3 &omega_in, float& pdf) const \ | ||||
| { \ | { \ | ||||
| return bsdf_##svmlower##_eval_reflect(&sc, omega_out, omega_in, &pdf); \ | pdf = 0; \ | ||||
| return make_float3(0, 0, 0); \ | |||||
| } \ | } \ | ||||
| \ | \ | ||||
| float3 eval_transmit(const float3 &omega_out, const float3 &omega_in, float& pdf) const \ | float3 eval_transmit(const float3 &omega_out, const float3 &omega_in, float& pdf) const \ | ||||
| { \ | { \ | ||||
| return bsdf_##svmlower##_eval_transmit(&sc, omega_out, omega_in, &pdf); \ | pdf = 0; \ | ||||
| return make_float3(0, 0, 0); \ | |||||
| } \ | } \ | ||||
| \ | \ | ||||
| int sample(const float3 &Ng, \ | int sample(const float3 &Ng, \ | ||||
| const float3 &omega_out, const float3 &domega_out_dx, const float3 &domega_out_dy, \ | const float3 &omega_out, const float3 &domega_out_dx, const float3 &domega_out_dy, \ | ||||
| float randu, float randv, \ | float randu, float randv, \ | ||||
| float3 &omega_in, float3 &domega_in_dx, float3 &domega_in_dy, \ | float3 &omega_in, float3 &domega_in_dx, float3 &domega_in_dy, \ | ||||
| float &pdf, float3 &eval) const \ | float &pdf, float3 &eval) const \ | ||||
| { \ | { \ | ||||
| return bsdf_##svmlower##_sample(&sc, Ng, omega_out, domega_out_dx, domega_out_dy, \ | pdf = 0; \ | ||||
| randu, randv, &eval, &omega_in, &domega_in_dx, &domega_in_dy, &pdf); \ | return LABEL_NONE; \ | ||||
| } \ | } \ | ||||
| }; \ | }; \ | ||||
| \ | \ | ||||
| static ClosureParam *bsdf_##lower##_params() \ | static ClosureParam *bsdf_##lower##_params() \ | ||||
| { \ | { \ | ||||
| static ClosureParam params[] = { | static ClosureParam params[] = { | ||||
| /* parameters */ | /* parameters */ | ||||
| ▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines | |||||