File: PrincipledShared.h

package info (click to toggle)
ospray 3.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,048 kB
  • sloc: cpp: 80,569; ansic: 951; sh: 805; makefile: 170; python: 69
file content (169 lines) | stat: -rw-r--r-- 3,524 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
// Copyright 2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

#pragma once

#include "MediumShared.h"
#include "render/MaterialShared.h"
#include "texture/TextureParamShared.h"

#ifdef __cplusplus
namespace ispc {
#endif // __cplusplus

struct Principled
{
  Material super;

  vec3f baseColor;
  TextureParam baseColorMap;

  // metallic reflectivity at grazing angle (90 deg) / edge tint
  vec3f edgeColor;
  TextureParam edgeColorMap;

  float metallic;
  TextureParam metallicMap;

  // diffuse weight in [0, 1]
  float diffuse;
  TextureParam diffuseMap;

  // specular weight in [0, 1]
  float specular;
  TextureParam specularMap;

  // index of refraction
  float ior;
  TextureParam iorMap;

  // specular transmission in [0, 1]
  float transmission;
  TextureParam transmissionMap;

  vec3f transmissionColor;
  TextureParam transmissionColorMap;

  float transmissionDepth;
  TextureParam transmissionDepthMap;

  // roughness in [0, 1]; 0 = ideally smooth (mirror)
  float roughness;
  TextureParam roughnessMap;

  // degree of anisotropy in [0, 1]; 0 = isotropic, 1 = maximally anisotropic
  float anisotropy;
  TextureParam anisotropyMap;

  // anisotropic rotation in [0, 1];
  float rotation;
  TextureParam rotationMap;

  // default normal map for all layers
  float normal; // scale
  TextureParam normalMap;
  linear2f normalRot;

  // base normal map (overrides default normal)
  float baseNormal; // scale
  TextureParam baseNormalMap;
  linear2f baseNormalRot;

  // dielectric clear coat weight in [0, 1]
  float coat;
  TextureParam coatMap;

  // dielectric clear coat index of refraction
  float coatIor;
  TextureParam coatIorMap;

  vec3f coatColor;
  TextureParam coatColorMap;

  float coatThickness;
  TextureParam coatThicknessMap;

  float coatRoughness;
  TextureParam coatRoughnessMap;

  // clear coat normal map (overrides default normal)
  float coatNormal; // scale
  TextureParam coatNormalMap;
  linear2f coatNormalRot;

  // sheen weight in [0, 1]
  float sheen;
  TextureParam sheenMap;

  vec3f sheenColor;
  TextureParam sheenColorMap;

  // sheen tint in [0, 1]
  float sheenTint;
  TextureParam sheenTintMap;

  float sheenRoughness;
  TextureParam sheenRoughnessMap;

  // cut-out opacity in [0, 1]
  float opacity;
  TextureParam opacityMap;

  // solid or thin mode flag
  bool thin;

  // diffuse transmission in [0, 2] (thin only)
  float backlight;
  TextureParam backlightMap;

  // thickness (thin only)
  float thickness;
  TextureParam thicknessMap;

  Medium outsideMedium;

  vec3f emission;
  TextureParam emissionMap;

#ifdef __cplusplus
  Principled()
      : baseColor(0.8f),
        edgeColor(1.f),
        metallic(0.f),
        diffuse(1.f),
        specular(1.f),
        ior(1.f),
        transmission(0.f),
        transmissionColor(1.f),
        transmissionDepth(1.f),
        roughness(0.f),
        anisotropy(0.f),
        rotation(0.f),
        normal(1.f),
        normalRot(one),
        baseNormal(1.f),
        baseNormalRot(one),
        coat(0.f),
        coatIor(1.5f),
        coatColor(1.f),
        coatThickness(1.f),
        coatRoughness(0.f),
        coatNormal(1.f),
        coatNormalRot(one),
        sheen(0.f),
        sheenColor(1.f),
        sheenTint(0.f),
        sheenRoughness(0.2f),
        opacity(1.f),
        thin(false),
        backlight(0.f),
        thickness(1.f),
        emission(0.f)
  {
    super.type = ispc::MATERIAL_TYPE_PRINCIPLED;
  }
};
} // namespace ispc
#else
};
#endif // __cplusplus