2#ifndef _TINYPBRT_SHAPE_H_
3#define _TINYPBRT_SHAPE_H_
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_shape_curve_degree_t
Curve shape degree.
Definition shape.h:64
tpbrt_shape_curve_type_t
Curve shape type.
Definition shape.h:75
tpbrt_shape_type_t
Shape types.
Definition shape.h:26
tpbrt_shape_curve_basis_t
Curve shape basis.
Definition shape.h:51
@ TPBRT_SHAPE_CURVE_DEGREE_3
3 Degree.
Definition shape.h:68
@ TPBRT_SHAPE_CURVE_DEGREE_2
2 Degree.
Definition shape.h:66
@ TPBRT_SHAPE_CURVE_TYPE_FLAT
Curve is always oriented to face the incident ray.
Definition shape.h:77
@ TPBRT_SHAPE_CURVE_TYPE_RIBBON
Curve has a fixed orientation.
Definition shape.h:81
@ TPBRT_SHAPE_CURVE_TYPE_CYLINDER
Alternative includes a shading normal that causes the curve to appear to have a cylindrical cross sec...
Definition shape.h:79
@ TPBRT_SHAPE_CURVE_TYPE_MAX_NUM
Count of available curve types.
Definition shape.h:83
@ TPBRT_SHAPE_TYPE_BILINEAR_MESH
Bilinear mesh.
Definition shape.h:28
@ TPBRT_SHAPE_TYPE_SPHERE
Sphere.
Definition shape.h:36
@ TPBRT_SHAPE_TYPE_PLY_MESH
Ply file mesh.
Definition shape.h:40
@ TPBRT_SHAPE_TYPE_LOOP_SUBDIV
Loop subdivision.
Definition shape.h:42
@ TPBRT_SHAPE_TYPE_CYLINDER
Cylinder.
Definition shape.h:32
@ TPBRT_SHAPE_TYPE_TRIANGLE_MESH
Triangle mesh.
Definition shape.h:38
@ TPBRT_SHAPE_TYPE_MAX_NUM
Count of available shape types.
Definition shape.h:44
@ TPBRT_SHAPE_TYPE_DISK
Disk.
Definition shape.h:34
@ TPBRT_SHAPE_TYPE_CURVE
Curve.
Definition shape.h:30
@ TPBRT_SHAPE_CURVE_BASIS_BEZIER
Bezier curve.
Definition shape.h:53
@ TPBRT_SHAPE_CURVE_BASIS_BSPLINE
BSpline curve.
Definition shape.h:55
@ TPBRT_SHAPE_CURVE_BASIS_MAX_NUM
Count of available curve shape basis.
Definition shape.h:57
Area light handle.
Definition light.h:207
Material handle.
Definition material.h:59
Optional float value.
Definition math.h:20
Bilinear mesh parameters.
Definition shape.h:90
tpbrt_point2_array_t uv
Per-vertex texture coordinates.
Definition shape.h:98
tpbrt_normal_array_t n
Per-vertex normals. If present, shading normals will be computed from these values.
Definition shape.h:96
tpbrt_uint_array_t indices
The array of integer offsets into the per-vertex data arrays (P, and any of N, S, or uv that are pres...
Definition shape.h:92
tpbrt_point3_array_t p
The vertex positions of the bilinear mesh.
Definition shape.h:94
Curve shape parameters.
Definition shape.h:105
tpbrt_shape_curve_type_t type
Which curve variant is used.
Definition shape.h:123
tpbrt_float_t width
Width of the curve.
Definition shape.h:111
tpbrt_opt_float_t width0
Width of the curve at the start point. If specified, these override the "width" parameter.
Definition shape.h:113
tpbrt_shape_curve_basis_t basis
Curve spline basis.
Definition shape.h:119
tpbrt_normal_t n[2]
For "ribbon" curves, these normals are respectively used at endpoints of the curve to orient the surf...
Definition shape.h:109
tpbrt_opt_float_t width1
Width of the curve at the end point. If specified, these override the "width" parameter.
Definition shape.h:115
tpbrt_point3_t p[4]
Control points for the cubic Bezier spline that goes along the center of the curve shape.
Definition shape.h:107
tpbrt_uint_t split_depth
Number of times the curve is split in half into sub-curves at startup time. Splitting curves increase...
Definition shape.h:117
tpbrt_shape_curve_degree_t degree
Degree of the curve's spline.
Definition shape.h:121
Cylinder shape parameters.
Definition shape.h:130
tpbrt_float_t z_min
The height of the cylinder's bottom along the z axis.
Definition shape.h:134
tpbrt_float_t radius
The cylinder's radius.
Definition shape.h:132
tpbrt_float_t phi_max
The maximum extent of the cylinder in phi (in spherical coordinates).
Definition shape.h:138
tpbrt_float_t z_max
The height of the cylinder's top along the z axis.
Definition shape.h:136
Disk shape parameters.
Definition shape.h:145
tpbrt_float_t inner_radius
The inner radius of the disk (if nonzero, the disk is an annulus).
Definition shape.h:151
tpbrt_float_t phi_max
The maximum extent of the disk in phi (in spherical coordinates).
Definition shape.h:153
tpbrt_float_t height
The position of the disk along the z axis.
Definition shape.h:147
tpbrt_float_t radius
The outer radius of the disk.
Definition shape.h:149
Loop subdiv parameters.
Definition shape.h:205
tpbrt_point_array_t p
Vertex positions for the base mesh. This is the same as for the triangle mesh primitive.
Definition shape.h:209
tpbrt_uint_t levels
The number of levels of refinement to compute in the subdivision algorithm.
Definition shape.h:211
tpbrt_uint_array_t indices
Indices for the base mesh. Indexing is the same as for the triangle mesh primitive.
Definition shape.h:207
Ply file mesh parameters.
Definition shape.h:192
tpbrt_texture_handle_t displacement
Specifies a texture used to displace the vertices of the mesh. The mesh will be adaptively tessellate...
Definition shape.h:196
tpbrt_float_t edge_length
Maximum length (in world space) of an edge of a triangle mesh that is being displaced....
Definition shape.h:198
tpbrt_string_t file_name
File from which the PLY-format mesh is loaded. If the file name's extension is ".gz",...
Definition shape.h:194
Sphere shape parameters.
Definition shape.h:160
tpbrt_float_t radius
The sphere's radius.
Definition shape.h:162
tpbrt_float_t phi_max
The maximum extent of the sphere in phi (in spherical coordinates).
Definition shape.h:168
tpbrt_float_t z_min
The height of the lower clipping plane along the z axis.
Definition shape.h:164
tpbrt_float_t z_max
The height of the upper clipping plane along the z axis.
Definition shape.h:166
PBRT shape representation.
Definition shape.h:218
tpbrt_shape_cylinder_params_t cylinder
Cylinder shape parameters.
Definition shape.h:243
tpbrt_media_handle_t exterior_media_handle
Exterior media handle.
Definition shape.h:230
tpbrt_transform_animated_t transform
Animated transform.
Definition shape.h:222
tpbrt_area_light_handle_t area_light
Area light handle.
Definition shape.h:226
tpbrt_texture_handle_t alpha
Handle to texture.
Definition shape.h:220
tpbrt_shape_disk_params_t disk
Disk shape parameters.
Definition shape.h:245
tpbrt_shape_loop_subdiv_params_t loop_subdiv
Loop subdiv parameters.
Definition shape.h:253
tpbrt_shape_ply_mesh_params_t ply_mesh
Ply mesh file parameters.
Definition shape.h:251
tpbrt_shape_curve_params_t curve
Curve shape parameters.
Definition shape.h:241
tpbrt_material_handle_t material
Material handle.
Definition shape.h:224
tpbrt_shape_type_t type
Shape value type.
Definition shape.h:232
tpbrt_bool_t reverse_orientation
If true, shape orientation is reversed (inside becomes outside).
Definition shape.h:234
tpbrt_media_handle_t interior_media_handle
Interior media handle.
Definition shape.h:228
tpbrt_shape_triangle_mesh_params_t triangle_mesh
Triangle mesh parameters.
Definition shape.h:249
tpbrt_shape_sphere_params_t sphere
Sphere shape parameters.
Definition shape.h:247
tpbrt_shape_bilinear_mesh_params_t bilinear_mesh
Bilinear mesh parameters.
Definition shape.h:239
union tpbrt_shape_t::@23 as
Value dependent on type value.
Triangle mesh parameters.
Definition shape.h:175
tpbrt_vec3_array_t s
Per-vertex tangents.
Definition shape.h:183
tpbrt_point2_array_t uv
Per-vertex texture coordinates.
Definition shape.h:185
tpbrt_point3_array_t p
The vertex positions of the triangle mesh.
Definition shape.h:179
tpbrt_uint_array_t indices
The array of integer offsets into the per-vertex data arrays (P, and any of N, S, or uv that are pres...
Definition shape.h:177
tpbrt_normal_array_t n
Per-vertex normals. If present, shading normals will be computed from these values.
Definition shape.h:181
List of shapes.
Definition shape.h:261
tpbrt_size_t count
Number of shapes in list.
Definition shape.h:265
tpbrt_shape_t * shapes
Shapes list data.
Definition shape.h:263
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
Array of uint values.
Definition math.h:53
Array of 2 component vectors.
Definition math.h:159
Array of 3 component vectors.
Definition math.h:170
3 component vector.
Definition math.h:98