Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/closure/bsdf_microfacet_multi.h
| /* | /* | ||||
| * Copyright 2011-2016 Blender Foundation | * Copyright 2011-2016 Blender Foundation | ||||
| * | * | ||||
| * Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
| * you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
| * You may obtain a copy of the License at | * You may obtain a copy of the License at | ||||
| * | * | ||||
| * http://www.apache.org/licenses/LICENSE-2.0 | * http://www.apache.org/licenses/LICENSE-2.0 | ||||
| * | * | ||||
| * Unless required by applicable law or agreed to in writing, software | * Unless required by applicable law or agreed to in writing, software | ||||
| * distributed under the License is distributed on an "AS IS" BASIS, | * distributed under the License is distributed on an "AS IS" BASIS, | ||||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
| * See the License for the specific language governing permissions and | * See the License for the specific language governing permissions and | ||||
| * limitations under the License. | * limitations under the License. | ||||
| */ | */ | ||||
| #pragma once | |||||
| CCL_NAMESPACE_BEGIN | CCL_NAMESPACE_BEGIN | ||||
| /* Most of the code is based on the supplemental implementations from | /* Most of the code is based on the supplemental implementations from | ||||
| * https://eheitzresearch.wordpress.com/240-2/. */ | * https://eheitzresearch.wordpress.com/240-2/. */ | ||||
| /* === GGX Microfacet distribution functions === */ | /* === GGX Microfacet distribution functions === */ | ||||
| /* Isotropic GGX microfacet distribution */ | /* Isotropic GGX microfacet distribution */ | ||||
| ▲ Show 20 Lines • Show All 436 Lines • ▼ Show 20 Lines | return mf_eval_glossy(localI, | ||||
| bsdf->alpha_x, | bsdf->alpha_x, | ||||
| bsdf->alpha_y, | bsdf->alpha_y, | ||||
| lcg_state, | lcg_state, | ||||
| bsdf->ior, | bsdf->ior, | ||||
| use_fresnel, | use_fresnel, | ||||
| bsdf->extra->cspec0); | bsdf->extra->cspec0); | ||||
| } | } | ||||
| ccl_device int bsdf_microfacet_multi_ggx_sample(KernelGlobals *kg, | ccl_device int bsdf_microfacet_multi_ggx_sample(const KernelGlobals *kg, | ||||
| const ShaderClosure *sc, | const ShaderClosure *sc, | ||||
| float3 Ng, | float3 Ng, | ||||
| float3 I, | float3 I, | ||||
| float3 dIdx, | float3 dIdx, | ||||
| float3 dIdy, | float3 dIdy, | ||||
| float randu, | float randu, | ||||
| float randv, | float randv, | ||||
| float3 *eval, | float3 *eval, | ||||
| ▲ Show 20 Lines • Show All 145 Lines • ▼ Show 20 Lines | return mf_eval_glass(localI, | ||||
| bsdf->alpha_x, | bsdf->alpha_x, | ||||
| bsdf->alpha_y, | bsdf->alpha_y, | ||||
| lcg_state, | lcg_state, | ||||
| bsdf->ior, | bsdf->ior, | ||||
| use_fresnel, | use_fresnel, | ||||
| bsdf->extra->cspec0); | bsdf->extra->cspec0); | ||||
| } | } | ||||
| ccl_device int bsdf_microfacet_multi_ggx_glass_sample(KernelGlobals *kg, | ccl_device int bsdf_microfacet_multi_ggx_glass_sample(const KernelGlobals *kg, | ||||
| const ShaderClosure *sc, | const ShaderClosure *sc, | ||||
| float3 Ng, | float3 Ng, | ||||
| float3 I, | float3 I, | ||||
| float3 dIdx, | float3 dIdx, | ||||
| float3 dIdy, | float3 dIdy, | ||||
| float randu, | float randu, | ||||
| float randv, | float randv, | ||||
| float3 *eval, | float3 *eval, | ||||
| ▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines | |||||