2#ifndef _TINYPBRT_TEXTURE_H_
3#define _TINYPBRT_TEXTURE_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
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_texture_wrap_t
Texture wrap types.
Definition texture.h:189
tpbrt_texture_mapping_spherical_params_t tpbrt_texture_mapping_cylindrical_params_t
Cylindrical texture mapping parameters.
Definition texture.h:354
tpbrt_texture_fbm_params_t tpbrt_texture_windy_params_t
Windy texture parameters.
Definition texture.h:183
tpbrt_texture_fbm_params_t tpbrt_texture_wrinkled_params_t
Wrinkled texture parameters.
Definition texture.h:178
tpbrt_texture_type_t
Textures types.
Definition texture.h:56
tpbrt_texture_filter_t
Texture filter types.
Definition texture.h:204
tpbrt_idx_t tpbrt_texture_idx_t
Texture index type.
Definition fwd.h:247
tpbrt_error_t tpbrt_get_texture_by_name(const tpbrt_textures_list_t *textures, tpbrt_string_t name, const tpbrt_texture_t **texture)
Returns pointer to texture with given name.
tpbrt_texture_encoding_t
Texture encoding types.
Definition texture.h:221
tpbrt_texture_class_t
Texture classes.
Definition texture.h:69
tpbrt_texture_mapping_t
Texture mapping types.
Definition texture.h:313
tpbrt_texture_handle_value_type_t
Texture handle value types.
Definition texture.h:26
tpbrt_error_t tpbrt_get_texture_by_handle(const tpbrt_textures_list_t *textures, const tpbrt_texture_handle_t *handle, const tpbrt_texture_t **texture)
Returns pointer to texture to which handle is provided.
@ TPBRT_TEXTURE_WRAP_MAX_NUM
Count of available texture wrap types.
Definition texture.h:197
@ TPBRT_TEXTURE_WRAP_REPEAT
Simply tiles the texture.
Definition texture.h:191
@ TPBRT_TEXTURE_WRAP_BLACK
Returns black when outside the legal range.
Definition texture.h:193
@ TPBRT_TEXTURE_WRAP_CLAMP
Always returns the nearest border texel.
Definition texture.h:195
@ TPBRT_TEXTURE_TYPE_FLOAT
Float texture.
Definition texture.h:58
@ TPBRT_TEXTURE_TYPE_MAX_NUM
Count of available texture types.
Definition texture.h:62
@ TPBRT_TEXTURE_TYPE_SPECTRUM
Spectrum texture.
Definition texture.h:60
@ TPBRT_TEXTURE_FILTER_BILINEAR
Does bilinear sampling of a single MIP level.
Definition texture.h:206
@ TPBRT_TEXTURE_FILTER_TRILINEAR
Does trilinear interpolation between two MIP levels.
Definition texture.h:210
@ TPBRT_TEXTURE_FILTER_EWA
Uses the high quality but much slower elliptically weighted average algorithm.
Definition texture.h:208
@ TPBRT_TEXTURE_FILTER_POINT
Point sampling.
Definition texture.h:212
@ TPBRT_TEXTURE_FILTER_MAX_NUM
Count of available texture filter types.
Definition texture.h:214
@ TPBRT_TEXTURE_ENCODING_MAX_NUM
Count of available texture encoding types.
Definition texture.h:229
@ TPBRT_TEXTURE_ENCODING_SRGB
Applies the sRGB nonlinear mapping.
Definition texture.h:223
@ TPBRT_TEXTURE_ENCODING_GAMMA
Applies a gamma correction curve with the specified exponent.
Definition texture.h:227
@ TPBRT_TEXTURE_ENCODING_LINEAR
Directly maps them, dividing their values by 255.
Definition texture.h:225
@ TPBRT_TEXTURE_CLASS_WRINKLED
Wrinkled texture.
Definition texture.h:95
@ TPBRT_TEXTURE_CLASS_CONSTANT
Constant texture.
Definition texture.h:75
@ TPBRT_TEXTURE_CLASS_MIX
Mix texture.
Definition texture.h:87
@ TPBRT_TEXTURE_CLASS_BILERP
Bilerp texture.
Definition texture.h:71
@ TPBRT_TEXTURE_CLASS_PTEX
PTEX texture.
Definition texture.h:89
@ TPBRT_TEXTURE_CLASS_MAX_NUM
Count of available texture classes.
Definition texture.h:97
@ TPBRT_TEXTURE_CLASS_DOTS
Dots texture.
Definition texture.h:79
@ TPBRT_TEXTURE_CLASS_SCALE
Scale texture.
Definition texture.h:91
@ TPBRT_TEXTURE_CLASS_FBM
FBM texture.
Definition texture.h:81
@ TPBRT_TEXTURE_CLASS_WINDY
Windy texture.
Definition texture.h:93
@ TPBRT_TEXTURE_CLASS_MARBLE
Marble texture.
Definition texture.h:85
@ TPBRT_TEXTURE_CLASS_DIRECTION_MIX
Direction mix texture.
Definition texture.h:77
@ TPBRT_TEXTURE_CLASS_IMAGE_MAP
Image map texture.
Definition texture.h:83
@ TPBRT_TEXTURE_CLASS_CHECKER_BOARD
Checker board texture.
Definition texture.h:73
@ TPBRT_TEXTURE_MAPPING_UV
Based on the surface's (u,v) parameterization.
Definition texture.h:315
@ TPBRT_TEXTURE_MAPPING_SPHERICAL
Spherical mapping.
Definition texture.h:317
@ TPBRT_TEXTURE_MAPPING_PLANAR
Planar mapping.
Definition texture.h:321
@ TPBRT_TEXTURE_MAPPING_CYLINDRICAL
Cylindrical mapping.
Definition texture.h:319
@ TPBRT_TEXTURE_MAPPING_MAX_NUM
Count of available texture mapping types.
Definition texture.h:323
@ TPBRT_TEXTURE_HANDLE_VALUE_TYPE_SPECTRUM
Spectrum.
Definition texture.h:30
@ TPBRT_TEXTURE_HANDLE_VALUE_TYPE_MAX_NUM
Count of available texture handle value types.
Definition texture.h:32
@ TPBRT_TEXTURE_HANDLE_VALUE_TYPE_TEXTURE_IDX
Texture index.
Definition texture.h:28
Keeps name indexes for faster lookups.
Definition common.h:42
Optional float value.
Definition math.h:20
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
Bilerp texture parameters.
Definition texture.h:104
tpbrt_texture_handle_t v00
First of the four values to be bilinearly interpolated between.
Definition texture.h:106
tpbrt_texture_handle_t v10
Third of the four values to be bilinearly interpolated between.
Definition texture.h:110
tpbrt_texture_handle_t v01
Second of the four values to be bilinearly interpolated between.
Definition texture.h:108
tpbrt_texture_handle_t v11
Fourth of the four values to be bilinearly interpolated between.
Definition texture.h:112
Checkerboard texture parameters.
Definition texture.h:119
tpbrt_texture_handle_t tex1
The texture to use for even checks.
Definition texture.h:121
tpbrt_texture_handle_t tex2
The texture to use for odd checks.
Definition texture.h:123
tpbrt_uint_t dimension
Sets the dimension of the checkerboard texture. Legal values are 2 and 3.
Definition texture.h:125
Constant texture parameters.
Definition texture.h:132
tpbrt_texture_handle_t value
The constant value of this texture.
Definition texture.h:134
Direction mix texture parameters.
Definition texture.h:141
tpbrt_texture_handle_t tex1
One of the two textures to be mixed.
Definition texture.h:143
tpbrt_vec_t dir
Vector with with the dot product of the surface normal is computed.
Definition texture.h:147
tpbrt_texture_handle_t tex2
The other texture to be mixed. These two textures must be of the same type (float or spectrum).
Definition texture.h:145
Dots texture parameters.
Definition texture.h:154
tpbrt_texture_handle_t outside
One of the textures to use for coloring the dots and the background.
Definition texture.h:158
tpbrt_texture_handle_t inside
One of the textures to use for coloring the dots and the background.
Definition texture.h:156
FBM texture parameters.
Definition texture.h:165
tpbrt_transform_handle_t transform
CTM from when the texture was defined.
Definition texture.h:171
tpbrt_uint_t octaves
The maximum number of octaves of noise to use in spectral synthesis.
Definition texture.h:167
tpbrt_float_t roughness
The "bumpiness" of the resulting texture.
Definition texture.h:169
Texture handle.
Definition texture.h:39
tpbrt_texture_idx_t texture_idx
Texture index.
Definition texture.h:43
tpbrt_texture_handle_value_type_t value_type
Texture handle value type.
Definition texture.h:49
union tpbrt_texture_handle_t::@24 as
Value dependent on value_type value.
tpbrt_spectrum_t spectrum
Spectrum.
Definition texture.h:45
Image map texture parameters.
Definition texture.h:236
tpbrt_string_t file_name
The filename of the image to load. Currently pbrt supports TGA, PFM, and EXR format images.
Definition texture.h:238
tpbrt_bool_t invert
If true, then given a texture value x, returns 1-x instead.
Definition texture.h:252
tpbrt_float_t scale
Scale factor to apply to value looked up in texture.
Definition texture.h:242
tpbrt_texture_encoding_t encoding
Specification of how to convert 8-bit color values to floating point values between 0 and 1.
Definition texture.h:250
tpbrt_float_t max_anisotropy
The maximum elliptical eccentricity for the EWA algorithm.
Definition texture.h:240
tpbrt_texture_wrap_t wrap
What to do with texture coordinates that fall outside the legal [0,1] range.
Definition texture.h:246
tpbrt_texture_filter_t filter
Filter function to use for anti-aliasing texture lookups.
Definition texture.h:248
tpbrt_opt_float_t gamma
Gamma exponent.
Definition texture.h:244
Planar texture mapping parameters.
Definition texture.h:361
tpbrt_vec_t v2
v2 is one of two vectors that define a planar mapping.
Definition texture.h:369
tpbrt_vec_t v1
v1 is one of two vectors that define a planar mapping.
Definition texture.h:367
tpbrt_float_t u_delta
An offset to be applied to the u texture coordinates. This offset is applied after any scaling from "...
Definition texture.h:363
tpbrt_float_t v_delta
An offset to be applied to the v texture coordinates. This offset is applied after any scaling from "...
Definition texture.h:365
Spherical texture mapping parameters.
Definition texture.h:345
tpbrt_transform_handle_t transform
The current transformation matrix when the associated texture is specified gives the rendering space ...
Definition texture.h:347
UV texture mapping parameters.
Definition texture.h:330
tpbrt_float_t u_delta
An offset to be applied to the u texture coordinates. This offset is applied after any scaling from "...
Definition texture.h:336
tpbrt_float_t u_scale
Scaling factor to be applied to the u texture coordinates.
Definition texture.h:332
tpbrt_float_t v_scale
Scaling factor to be applied to the v texture coordinates.
Definition texture.h:334
tpbrt_float_t v_delta
An offset to be applied to the v texture coordinates. This offset is applied after any scaling from "...
Definition texture.h:338
Marble texture parameters.
Definition texture.h:259
tpbrt_float_t scale
A scaling factor to apply to the noise function inputs.
Definition texture.h:265
tpbrt_uint_t octaves
The maximum number of octaves of noise to use in spectral synthesis.
Definition texture.h:261
tpbrt_float_t variation
A scaling factor to apply to the noise function output.
Definition texture.h:267
tpbrt_float_t roughness
The "bumpiness" of the resulting texture.
Definition texture.h:263
Mix texture parameters.
Definition texture.h:274
tpbrt_texture_handle_t tex1
One of the two textures to be mixed.
Definition texture.h:276
tpbrt_texture_handle_t tex2
The other texture to be mixed. These two textures must be of the same type (float or spectrum).
Definition texture.h:278
tpbrt_texture_handle_t amount
The amount to use when linearly interpolating between the two mix textures.
Definition texture.h:280
PTEX texture parameters.
Definition texture.h:287
tpbrt_float_t scale
Scale factor applied to texture values.
Definition texture.h:293
tpbrt_opt_float_t gamma
Gamma exponent.
Definition texture.h:289
tpbrt_string_t file_name
Filename of the Ptex texture to use.
Definition texture.h:291
tpbrt_texture_encoding_t encoding
Specifies how to convert 8-bit color values from the texture to floating point values between 0 and 1...
Definition texture.h:295
Scale texture parameters.
Definition texture.h:302
tpbrt_texture_handle_t tex
Texture to be scaled.
Definition texture.h:304
tpbrt_texture_handle_t scale
Scale factor by which to multiply the values returned by "tex".
Definition texture.h:306
PBRT texture representation.
Definition texture.h:376
tpbrt_texture_wrinkled_params_t wrinkled
Wrinkled texture parameters.
Definition texture.h:415
tpbrt_string_t name
Texture name.
Definition texture.h:386
tpbrt_texture_type_t type
Texture type.
Definition texture.h:380
union tpbrt_texture_t::@26 as
Value dependent on tex_class value.
tpbrt_texture_mapping_uv_params_t uv
UV texture mapping parameters.
Definition texture.h:391
union tpbrt_texture_t::@25 mapping_as
Value dependent on mapping value.
tpbrt_texture_fbm_params_t fbm
FBM texture parameters.
Definition texture.h:413
tpbrt_texture_checkerboard_params_t checkerboard
Checkerboard texture parameters.
Definition texture.h:405
tpbrt_texture_scale_params_t scale
Scale texture parameters.
Definition texture.h:427
tpbrt_texture_image_map_params_t image_map
Image map texture parameters.
Definition texture.h:419
tpbrt_texture_constant_params_t constant
Constant texture parameters.
Definition texture.h:407
tpbrt_texture_dots_params_t dots
Dots texture parameters.
Definition texture.h:411
tpbrt_texture_direction_mix_params_t direction_mix
Direction mix texture parameters.
Definition texture.h:409
tpbrt_texture_mapping_t mapping
Texture mapping.
Definition texture.h:384
tpbrt_texture_class_t tex_class
Texture class.
Definition texture.h:382
tpbrt_texture_mapping_cylindrical_params_t cylindrical
Cylindrical texture mapping parameters.
Definition texture.h:395
tpbrt_texture_bilerp_params_t bilerp
Bilerp texture parameters.
Definition texture.h:403
tpbrt_texture_windy_params_t windy
Windy texture parameters.
Definition texture.h:417
tpbrt_texture_mapping_planar_params_t planar
Planar texture mapping parameters.
Definition texture.h:397
tpbrt_texture_mix_params_t mix
Mix texture parameters.
Definition texture.h:423
tpbrt_texture_marble_params_t marble
Marble texture parameters.
Definition texture.h:421
tpbrt_texture_ptex_params_t ptex
PTEX texture parameters.
Definition texture.h:425
tpbrt_texture_mapping_spherical_params_t spherical
Spherical texture mapping parameters.
Definition texture.h:393
tpbrt_texture_idx_t idx
Texture index.
Definition texture.h:378
List of textures.
Definition texture.h:435
tpbrt_texture_t * textures
Textures list data.
Definition texture.h:437
tpbrt_size_t count
Number of textures in list.
Definition texture.h:439
tpbrt_name_index_t names
Names indexes.
Definition texture.h:441
3 component vector.
Definition math.h:98