Blender  V3.3
mis.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  *
3  * Adapted from Open Shading Language
4  * Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al.
5  * All Rights Reserved.
6  *
7  * Modifications Copyright 2011-2022 Blender Foundation. */
8 
9 #pragma once
10 
12 
13 /* Multiple importance sampling utilities. */
14 
15 ccl_device float balance_heuristic(float a, float b)
16 {
17  return (a) / (a + b);
18 }
19 
20 ccl_device float balance_heuristic_3(float a, float b, float c)
21 {
22  return (a) / (a + b + c);
23 }
24 
25 ccl_device float power_heuristic(float a, float b)
26 {
27  return (a * a) / (a * a + b * b);
28 }
29 
30 ccl_device float power_heuristic_3(float a, float b, float c)
31 {
32  return (a * a) / (a * a + b * b + c * c);
33 }
34 
35 ccl_device float max_heuristic(float a, float b)
36 {
37  return (a > b) ? 1.0f : 0.0f;
38 }
39 
#define ccl_device
Definition: cuda/compat.h:32
#define CCL_NAMESPACE_END
Definition: cuda/compat.h:9
ccl_device float power_heuristic_3(float a, float b, float c)
Definition: mis.h:30
ccl_device float max_heuristic(float a, float b)
Definition: mis.h:35
ccl_device float balance_heuristic_3(float a, float b, float c)
Definition: mis.h:20
CCL_NAMESPACE_BEGIN ccl_device float balance_heuristic(float a, float b)
Definition: mis.h:15
ccl_device float power_heuristic(float a, float b)
Definition: mis.h:25
static unsigned c
Definition: RandGen.cpp:83
static unsigned a[3]
Definition: RandGen.cpp:78
static const pxr::TfToken b("b", pxr::TfToken::Immortal)