~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to intern/cycles/kernel/closure/bsdf.h

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-02-19 11:24:23 UTC
  • mfrom: (14.2.23 sid)
  • Revision ID: package-import@ubuntu.com-20140219112423-rkmaz2m7ha06d4tk
Tags: 2.69-3ubuntu1
* Merge with Debian; remaining changes:
  - Configure without OpenImageIO on armhf, as it is not available on
    Ubuntu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright 2011, Blender Foundation.
3
 
 *
4
 
 * This program is free software; you can redistribute it and/or
5
 
 * modify it under the terms of the GNU General Public License
6
 
 * as published by the Free Software Foundation; either version 2
7
 
 * of the License, or (at your option) any later version.
8
 
 *
9
 
 * This program is distributed in the hope that it will be useful,
10
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 
 * GNU General Public License for more details.
13
 
 *
14
 
 * You should have received a copy of the GNU General Public License
15
 
 * along with this program; if not, write to the Free Software Foundation,
16
 
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
2
 * Copyright 2011-2013 Blender Foundation
 
3
 *
 
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
 
7
 *
 
8
 * http://www.apache.org/licenses/LICENSE-2.0
 
9
 *
 
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
17
15
 */
18
16
 
19
17
#include "../closure/bsdf_ashikhmin_velvet.h"
30
28
#endif
31
29
#include "../closure/bsdf_westin.h"
32
30
#include "../closure/bsdf_toon.h"
 
31
#include "../closure/bsdf_hair.h"
 
32
#ifdef __SUBSURFACE__
33
33
#include "../closure/bssrdf.h"
 
34
#endif
34
35
 
35
36
CCL_NAMESPACE_BEGIN
36
37
 
45
46
 
46
47
        switch(sc->type) {
47
48
                case CLOSURE_BSDF_DIFFUSE_ID:
 
49
                case CLOSURE_BSDF_BSSRDF_ID:
48
50
                        label = bsdf_diffuse_sample(sc, sd->Ng, sd->I, sd->dI.dx, sd->dI.dy, randu, randv,
49
51
                                eval, omega_in, &domega_in->dx, &domega_in->dy, pdf);
50
52
                        break;
113
115
                        label = bsdf_westin_sheen_sample(sc, sd->Ng, sd->I, sd->dI.dx, sd->dI.dy, randu, randv,
114
116
                                eval, omega_in, &domega_in->dx, &domega_in->dy, pdf);
115
117
                        break;
 
118
                case CLOSURE_BSDF_HAIR_REFLECTION_ID:
 
119
                        label = bsdf_hair_reflection_sample(sc, sd->Ng, sd->I, sd->dI.dx, sd->dI.dy, randu, randv,
 
120
                                eval, omega_in, &domega_in->dx, &domega_in->dy, pdf);
 
121
                        break;
 
122
                case CLOSURE_BSDF_HAIR_TRANSMISSION_ID:
 
123
                        label = bsdf_hair_transmission_sample(sc, sd->Ng, sd->I, sd->dI.dx, sd->dI.dy, randu, randv,
 
124
                                eval, omega_in, &domega_in->dx, &domega_in->dy, pdf);
 
125
                        break;
116
126
#endif
117
127
                default:
118
128
                        label = LABEL_NONE;
134
144
        if(dot(sd->Ng, omega_in) >= 0.0f) {
135
145
                switch(sc->type) {
136
146
                        case CLOSURE_BSDF_DIFFUSE_ID:
 
147
                        case CLOSURE_BSDF_BSSRDF_ID:
137
148
                                eval = bsdf_diffuse_eval_reflect(sc, sd->I, omega_in, pdf);
138
149
                                break;
139
150
#ifdef __SVM__
186
197
                        case CLOSURE_BSDF_WESTIN_SHEEN_ID:
187
198
                                eval = bsdf_westin_sheen_eval_reflect(sc, sd->I, omega_in, pdf);
188
199
                                break;
 
200
                        case CLOSURE_BSDF_HAIR_REFLECTION_ID:
 
201
                                eval = bsdf_hair_reflection_eval_reflect(sc, sd->I, omega_in, pdf);
 
202
                                break;
 
203
                        case CLOSURE_BSDF_HAIR_TRANSMISSION_ID:
 
204
                                eval = bsdf_hair_transmission_eval_reflect(sc, sd->I, omega_in, pdf);
 
205
                                break;
189
206
#endif
190
207
                        default:
191
208
                                eval = make_float3(0.0f, 0.0f, 0.0f);
195
212
        else {
196
213
                switch(sc->type) {
197
214
                        case CLOSURE_BSDF_DIFFUSE_ID:
 
215
                        case CLOSURE_BSDF_BSSRDF_ID:
198
216
                                eval = bsdf_diffuse_eval_transmit(sc, sd->I, omega_in, pdf);
199
217
                                break;
200
218
#ifdef __SVM__
241
259
                        case CLOSURE_BSDF_WESTIN_SHEEN_ID:
242
260
                                eval = bsdf_westin_sheen_eval_transmit(sc, sd->I, omega_in, pdf);
243
261
                                break;
 
262
                        case CLOSURE_BSDF_HAIR_REFLECTION_ID:
 
263
                                eval = bsdf_hair_reflection_eval_transmit(sc, sd->I, omega_in, pdf);
 
264
                                break;
 
265
                        case CLOSURE_BSDF_HAIR_TRANSMISSION_ID:
 
266
                                eval = bsdf_hair_transmission_eval_transmit(sc, sd->I, omega_in, pdf);
 
267
                                break;
244
268
#endif
245
269
                        default:
246
270
                                eval = make_float3(0.0f, 0.0f, 0.0f);
262
286
 
263
287
        switch(sc->type) {
264
288
                case CLOSURE_BSDF_DIFFUSE_ID:
 
289
                case CLOSURE_BSDF_BSSRDF_ID:
265
290
                        bsdf_diffuse_blur(sc, roughness);
266
291
                        break;
267
292
#ifdef __SVM__
314
339
                case CLOSURE_BSDF_WESTIN_SHEEN_ID:
315
340
                        bsdf_westin_sheen_blur(sc, roughness);
316
341
                        break;
 
342
                case CLOSURE_BSDF_HAIR_REFLECTION_ID:
 
343
                case CLOSURE_BSDF_HAIR_TRANSMISSION_ID:
 
344
                        bsdf_hair_reflection_blur(sc, roughness);
 
345
                        break;
317
346
#endif
318
347
                default:
319
348
                        break;