2#ifndef _TINYPBRT_MATERIAL_H_
3#define _TINYPBRT_MATERIAL_H_
#define TPBRT_API
Definition export.h:18
tpbrt_error_t
Error type (used as result type where success = TPBRT_ERROR_NONE = 0).
Definition error.h:20
tpbrt_error_t tpbrt_get_material_by_handle(const tpbrt_materials_list_t *materials, tpbrt_material_handle_t handle, const tpbrt_material_t **material)
Returns pointer to material to which handle is provided.
tpbrt_material_type_t
Material types.
Definition material.h:26
tpbrt_material_bump_map_type_t
Material bump map types.
Definition material.h:68
tpbrt_idx_t tpbrt_material_idx_t
Material index type.
Definition fwd.h:328
tpbrt_material_subsurface_scattering_value_t
Subsurface material scattering value type.
Definition material.h:307
tpbrt_error_t tpbrt_get_material_by_name(const tpbrt_materials_list_t *materials, tpbrt_string_t name, const tpbrt_material_t **material)
Returns pointer to material with given name.
tpbrt_material_conductor_value_type_t
Conductor material value type.
Definition material.h:140
@ TPBRT_MATERIAL_TYPE_DIFFUSE
Diffuse.
Definition material.h:36
@ TPBRT_MATERIAL_TYPE_COATED_DIFFUSE
Coated diffuse.
Definition material.h:28
@ TPBRT_MATERIAL_TYPE_SUBSURFACE
Subsurface.
Definition material.h:48
@ TPBRT_MATERIAL_TYPE_MIX
Mix.
Definition material.h:46
@ TPBRT_MATERIAL_TYPE_DIELECTRIC
Dielectric.
Definition material.h:34
@ TPBRT_MATERIAL_TYPE_THIN_DIELECTRIC
Thin Dielectric.
Definition material.h:50
@ TPBRT_MATERIAL_TYPE_DIFFUSE_TRANSMISSION
Diffuse transmission.
Definition material.h:38
@ TPBRT_MATERIAL_TYPE_MAX_NUM
Count of available material types.
Definition material.h:52
@ TPBRT_MATERIAL_TYPE_MEASURED
Measured.
Definition material.h:44
@ TPBRT_MATERIAL_TYPE_COATED_CONDUCTOR
Coated conductor.
Definition material.h:30
@ TPBRT_MATERIAL_TYPE_CONDUCTOR
Conductor.
Definition material.h:32
@ TPBRT_MATERIAL_TYPE_INTERFACE
Interface.
Definition material.h:42
@ TPBRT_MATERIAL_TYPE_HAIR
Hair.
Definition material.h:40
@ TPBRT_MATERIAL_BUMP_MAP_TYPE_DISPLACEMENT
Displacement as bump map.
Definition material.h:72
@ TPBRT_MATERIAL_BUMP_MAP_TYPE_MAX_NUM
Count of available material bump map types.
Definition material.h:76
@ TPBRT_MATERIAL_BUMP_MAP_TYPE_NORMAL_MAP
Normal map as bump map.
Definition material.h:74
@ TPBRT_MATERIAL_BUMP_MAP_TYPE_NONE
No bump map.
Definition material.h:70
@ TPBRT_MATERIAL_SUBSURFACE_SCATTERING_VALUE_MAX_NUM
Count of available material scattering values.
Definition material.h:313
@ TPBRT_MATERIAL_SUBSURFACE_SCATTERING_VALUE_SIGMA
Uses sigma_s and sigma_a values.
Definition material.h:309
@ TPBRT_MATERIAL_SUBSURFACE_SCATTERING_VALUE_BUILTIN
Uses builtin as sigma_s and sigma_a values.
Definition material.h:311
@ TPBRT_MATERIAL_CONDUCTOR_VALUE_TYPE_ETA_K
Conductor material value defined as 'eta' and 'k' values.
Definition material.h:142
@ TPBRT_MATERIAL_CONDUCTOR_VALUE_TYPE_MAX_NUM
Count of available conductor material value types.
Definition material.h:146
@ TPBRT_MATERIAL_CONDUCTOR_VALUE_TYPE_REFLECTANCE
Conductor material value defined as 'reflectance' value.
Definition material.h:144
float tpbrt_float_t
Float type.
Definition fwd.h:83
size_t tpbrt_size_t
Size type.
Definition fwd.h:93
uint32_t tpbrt_uint_t
Unsigned int type.
Definition fwd.h:78
uint8_t tpbrt_bool_t
Bool type.
Definition fwd.h:68
tpbrt_scattering_builtin_t
Scattering builtins.
Definition scattering.h:20
Material bump map parameters.
Definition material.h:83
tpbrt_material_bump_map_type_t type
Bump map value type.
Definition material.h:93
tpbrt_string_t normal_map
Filename for an image to use to specify a normal map.
Definition material.h:89
tpbrt_texture_handle_t displacement
Float-valued texture specifying surface height offsets that are used for bump mapping.
Definition material.h:87
union tpbrt_material_bump_map_params_t::@9 as
Value dependent on type value.
Coated conductor material parameters.
Definition material.h:153
union tpbrt_material_coated_conductor_params_t::@10 as
Value dependent on value_type value.
tpbrt_material_roughness_params_t conductor_roughness_params
Conductor roughness parameters.
Definition material.h:180
tpbrt_uint_t max_depth
Maximum number of bounces of light to model when modeling light scattering among the interface,...
Definition material.h:161
tpbrt_spectrum_t reflectance
As an alternative to specifying the conductor's index of refraction and extinction coefficient,...
Definition material.h:176
tpbrt_spectrum_t eta
The conductor's index of refraction.
Definition material.h:170
tpbrt_spectrum_t k
The conductor's exctinction coefficient.
Definition material.h:172
tpbrt_uint_t n_samples
Number of independent samples to take when performing Monte Carlo integration of light scattering bet...
Definition material.h:163
tpbrt_float_t thickness
Thickness of the medium between the two layers.
Definition material.h:184
tpbrt_material_bump_map_params_t bump_map
Bump map parameters.
Definition material.h:155
tpbrt_texture_handle_t albedo
Scattering albedo of the medium between the interface and the diffuse base layer. Must be less than o...
Definition material.h:157
tpbrt_material_roughness_params_t interface_roughness_params
Interface roughness parameters.
Definition material.h:182
tpbrt_texture_handle_t g
Henyey-Greenstein asymmetry parameter ranging from -1 to 1 that describes the distribution of scatter...
Definition material.h:159
tpbrt_material_conductor_value_type_t value_type
Conductor's value type.
Definition material.h:186
struct tpbrt_material_coated_conductor_params_t::@10::@11 conductor
Holds conductor 'eta' and 'k' values.
Coated diffuse material parameters.
Definition material.h:115
tpbrt_float_t thickness
Thickness of the medium between the two layers.
Definition material.h:133
tpbrt_texture_handle_t albedo
Scattering albedo of the medium between the interface and the diffuse base layer. Must be less than o...
Definition material.h:119
tpbrt_texture_handle_t eta
Index of refraction of the medium inside the surface.
Definition material.h:123
tpbrt_material_bump_map_params_t bump_map
Bump map parameters.
Definition material.h:117
tpbrt_texture_handle_t reflectance
Reflectance of the base diffuse layer.
Definition material.h:129
tpbrt_texture_handle_t g
Henyey-Greenstein asymmetry parameter ranging from -1 to 1 that describes the distribution of scatter...
Definition material.h:121
tpbrt_material_roughness_params_t roughness_params
Roughness parameters.
Definition material.h:131
tpbrt_uint_t max_depth
Maximum number of bounces of light to model when modeling light scattering among the interface,...
Definition material.h:125
tpbrt_uint_t n_samples
Number of independent samples to take when performing Monte Carlo integration of light scattering bet...
Definition material.h:127
Conductor material parameters.
Definition material.h:193
union tpbrt_material_conductor_params_t::@12 as
Value dependent on value_type value.
tpbrt_material_bump_map_params_t bump_map
Bump map parameters.
Definition material.h:195
tpbrt_material_roughness_params_t roughness_params
Roughness parameters.
Definition material.h:212
tpbrt_texture_handle_t reflectance
Average reflectance of the conductor. Plausible values of "eta" and "k" are computed based on the ref...
Definition material.h:208
tpbrt_material_conductor_value_type_t value_type
Conductor's value type.
Definition material.h:214
tpbrt_texture_handle_t k
The conductor's wavelength-dependent absorption coefficient.
Definition material.h:204
struct tpbrt_material_conductor_params_t::@12::@13 conductor
Holds conductor 'eta' and 'k' values.
tpbrt_texture_handle_t eta
The wavelength-dependent index of refraction of the conductor.
Definition material.h:202
Dielectric material parameters.
Definition material.h:221
tpbrt_texture_handle_t eta
Index of refraction of the medium inside the surface or Wavelength-dependent index of refraction of t...
Definition material.h:225
tpbrt_material_roughness_params_t roughness_params
Roughness parameters.
Definition material.h:227
tpbrt_material_bump_map_params_t bump_map
Bump map parameters.
Definition material.h:223
Diffuse material parameters.
Definition material.h:234
tpbrt_texture_handle_t reflectance
The reflectivity of the surface. Must be between 0 and 1.
Definition material.h:238
tpbrt_material_bump_map_params_t bump_map
Bump map parameters.
Definition material.h:236
Diffuse transmission material parameters.
Definition material.h:245
tpbrt_texture_handle_t transmittance
The transmissivity of the surface.
Definition material.h:251
tpbrt_texture_handle_t reflectance
The reflectivity of the surface.
Definition material.h:249
tpbrt_texture_handle_t scale
A scale factor that is applied to both the reflectance and transmittance values.
Definition material.h:253
tpbrt_material_bump_map_params_t bump_map
Bump map parameters.
Definition material.h:247
Hair material parameters.
Definition material.h:260
tpbrt_texture_handle_t pheomelanin
Concentration of the pheomelanin pigment in the hair. Pheomelanin makes red hair red.
Definition material.h:270
tpbrt_texture_handle_t beta_m
Longitudinal roughness of the hair. Should be between 0 and 1. This roughness controls the size and s...
Definition material.h:274
tpbrt_material_bump_map_params_t bump_map
Bump map parameters.
Definition material.h:262
tpbrt_texture_handle_t sigma_a
Absorption coefficient of the medium inside the hair. This absorption coefficient is normalized such ...
Definition material.h:264
tpbrt_texture_handle_t alpha
Angle of scales on the hair surface, in degrees.
Definition material.h:278
tpbrt_texture_handle_t beta_n
Azimuthal roughness of the hair. Should be between 0 and 1.
Definition material.h:276
tpbrt_texture_handle_t reflectance
If specified, a value of the absorption coefficient is computed using an approximation that leads to ...
Definition material.h:266
tpbrt_texture_handle_t eta
Index of refraction of the hair medium.
Definition material.h:272
tpbrt_texture_handle_t eumelanin
Concentration of the eumelanin pigment in the hair. Blonde hair has concentrations around 0....
Definition material.h:268
Material handle.
Definition material.h:59
tpbrt_material_idx_t material_idx
Material index.
Definition material.h:61
Measured material parameters.
Definition material.h:285
tpbrt_string_t file_name
Name of file storing measured BRDF data.
Definition material.h:289
tpbrt_material_bump_map_params_t bump_map
Bump map parameters.
Definition material.h:287
Mix material parameters.
Definition material.h:296
tpbrt_texture_handle_t amount
Weighting factor for the blend between materials. A value of zero corresponds to just the first mater...
Definition material.h:300
tpbrt_material_handle_t materials[2]
Handles of two materials to mix between.
Definition material.h:298
Material roughness parameters.
Definition material.h:100
tpbrt_texture_handle_t u_roughness
For surfaces with anisotropic roughness distributions, microfacet roughness in the u direction.
Definition material.h:104
tpbrt_texture_handle_t roughness
Overall surface roughness, modeled using the Trowbridge-Reitz (GGX) microfacet distribution....
Definition material.h:102
tpbrt_texture_handle_t v_roughness
For surfaces with anisotropic roughness distributions, microfacet roughness in the v direction.
Definition material.h:106
tpbrt_bool_t remap_roughness
If true, roughness values are expected to be between 0 and 1, and are remapped to microfacet distribu...
Definition material.h:108
Subsurface material parameters.
Definition material.h:342
tpbrt_material_bump_map_params_t bump_map
Bump map parameters.
Definition material.h:344
tpbrt_texture_handle_t g
Henyey-Greenstein asymmetry parameter, which ranges from -1 to 1, going from completely backwards-sca...
Definition material.h:348
tpbrt_material_roughness_params_t roughness_params
Roughness parameters.
Definition material.h:356
tpbrt_texture_handle_t eta
Index of refraction of the scattering volume. Note that wavelength-dependent indices of refraction ar...
Definition material.h:346
tpbrt_float_t scale
Scale factor that is applied to sigma_a and sigma_s. This is particularly useful when the scene is no...
Definition material.h:358
tpbrt_material_subsurface_scattering_t scattering
Scattering parameters.
Definition material.h:352
tpbrt_texture_handle_t reflectance
Average reflectance of the volume. If specified, absorption and scattering coefficients are computed ...
Definition material.h:354
tpbrt_texture_handle_t mfp
Mean free path of light in the volume, specified in meters. (Used only if "reflectance" is specified....
Definition material.h:350
Subsurface material scattering.
Definition material.h:320
union tpbrt_material_subsurface_scattering_t::@14 as
Scattering value dependent on type value.
tpbrt_texture_handle_t s
Scattering coefficient of the volume, measured in mm^-1.
Definition material.h:327
tpbrt_scattering_builtin_t builtin
Name of measured subsurface scattering coefficients.
Definition material.h:331
tpbrt_texture_handle_t a
Absorption coefficient of the volume, measured in mm^-1.
Definition material.h:325
tpbrt_material_subsurface_scattering_value_t type
Scattering value type.
Definition material.h:335
struct tpbrt_material_subsurface_scattering_t::@14::@15 sigma
PBRT material representation.
Definition material.h:376
tpbrt_material_thin_dielectric_params_t thin_dielectric
Thin dielectric material parameters.
Definition material.h:405
tpbrt_material_type_t type
Material value type.
Definition material.h:409
tpbrt_material_dielectric_params_t dielectric
Dielectric material parameters.
Definition material.h:391
tpbrt_material_mix_params_t mix
Mix material parameters.
Definition material.h:401
tpbrt_material_conductor_params_t conductor
Conductor material parameters.
Definition material.h:389
union tpbrt_material_t::@16 as
Value dependent on type value.
tpbrt_material_hair_params_t hair
Hair material parameters.
Definition material.h:397
tpbrt_material_coated_conductor_params_t coated_conductor
Coated conductor material parameters.
Definition material.h:387
tpbrt_material_diffuse_transmission_params_t diffuse_transmission
Diffuse transmission material parameters.
Definition material.h:395
tpbrt_string_t name
Material name (if it is not named material name is empty).
Definition material.h:380
tpbrt_material_subsurface_params_t subsurface
Subsurface material parameters.
Definition material.h:403
tpbrt_material_coated_diffuse_params_t coated_diffuse
Coated diffuse material parameters.
Definition material.h:385
tpbrt_material_diffuse_params_t diffuse
Diffuse material parameters.
Definition material.h:393
tpbrt_material_measured_params_t measured
Measured material parameters.
Definition material.h:399
tpbrt_material_idx_t idx
Material index.
Definition material.h:378
Thin dielectric material parameters.
Definition material.h:365
tpbrt_material_bump_map_params_t bump_map
Bump map parameters.
Definition material.h:367
tpbrt_texture_handle_t eta
Index of refraction of the medium inside the surface or Wavelength-dependent index of refraction of t...
Definition material.h:369
List of materials.
Definition material.h:416
tpbrt_name_index_t names
Names indexes.
Definition material.h:422
tpbrt_size_t count
Number of materials in list.
Definition material.h:420
tpbrt_material_t * materials
Materials list data.
Definition material.h:418
Keeps name indexes for faster lookups.
Definition common.h:42
PBRT Spectrum representation.
Definition color.h:166
Simple string representation (not always terminated with '\0', the size determines the length of the ...
Definition common.h:20
Texture handle.
Definition texture.h:39