2 * Copyright 2011-2013 Blender Foundation
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License
19 /* note: the interfaces here are just as an example, need to figure
20 * out the right functions and parameters to use */
22 /* ISOTROPIC VOLUME CLOSURE */
24 ccl_device int volume_isotropic_setup(ShaderClosure *sc, float density)
26 sc->type = CLOSURE_VOLUME_ISOTROPIC_ID;
32 ccl_device float3 volume_isotropic_eval_phase(const ShaderClosure *sc, const float3 omega_in, const float3 omega_out)
34 return make_float3(1.0f, 1.0f, 1.0f);
37 /* TRANSPARENT VOLUME CLOSURE */
39 ccl_device int volume_transparent_setup(ShaderClosure *sc, float density)
41 sc->type = CLOSURE_VOLUME_TRANSPARENT_ID;
47 ccl_device float3 volume_transparent_eval_phase(const ShaderClosure *sc, const float3 omega_in, const float3 omega_out)
49 return make_float3(1.0f, 1.0f, 1.0f);
54 ccl_device float3 volume_eval_phase(KernelGlobals *kg, const ShaderClosure *sc, const float3 omega_in, const float3 omega_out)
59 case CLOSURE_VOLUME_ISOTROPIC_ID:
60 eval = volume_isotropic_eval_phase(sc, omega_in, omega_out);
62 case CLOSURE_VOLUME_TRANSPARENT_ID:
63 eval = volume_transparent_eval_phase(sc, omega_in, omega_out);
66 eval = make_float3(0.0f, 0.0f, 0.0f);