mesh Element Reference
Loads a mesh from an external file. More...

Attributes | |
| string | path |
| Path to obj or ply mesh to load. | |
| string | spatialAccel |
| Acceleration data structure for accelerating ray-object intersection queries and visibility tests that are prominent in many rendering algorithms. | |
| string | kdSplitPlaneType |
| Split plane generation method. | |
| string | kdSplitAxisType |
| Split axis selection method. | |
| unsigned int | kdMinPrimitives |
| Minimum number of primitives s.t. a leaf cell will automatically be created (below this number, further subdivision either won't help or requires too much memory. | |
| unsigned int | kdMaxDepth |
| Maximum depth of tree. | |
| unsigned int | kdNoThreads |
| number of threads to spawn during tree construction | |
| real_t | kdCostTraversal |
| SAH relative cost of traversal. | |
| real_t | kdEmptyBias |
| SAH empty cell bias factor. | |
Detailed Description
Loads a mesh from an external file.Milton supports loading meshes in obj and ply formats. Each distinct mesh will have its own, internal acceleration data structure, and as such, when specifying a mesh in the scenefile, you may add hints to the acceleration data structure to customize its performance towards a particular mesh.
- Note:
- Meshes are great candidates for instancing, where you load a 'master' mesh once, give it a name, and then have multiple, lightweight copies of that one master mesh called instances by referencing the master mesh's name. Any scene node may be instanced in Milton, but in practice, it is generally only useful (and tested..) to instance meshes because each instance would otherwise cost so much in terms of memory and speed during rendering.
mesh corresponds to the underlying Milton class 'Mesh.'
Example usage:
Attribute Documentation
| string mesh::path |
Path to obj or ply mesh to load.
- Note:
- If path specified is relative, it must be with respect to the executable's current working directory (generally this will be the directory where you invoke your executable from).
| type | string |
| optional | false |
| string mesh::spatialAccel |
Acceleration data structure for accelerating ray-object intersection queries and visibility tests that are prominent in many rendering algorithms.
Available spatialAccel variants include: naive (no acceleration) and kdTree (default)
- Note:
- spatialAccel corresponds to the underlying Milton class 'SpatialAccel.'
'naive' spatialAccel corresponds to linear traversal through all primitives when calculating the closest positive intersection between a ray and a set of primitives
| type | string |
| optional | true |
| default | kdTree |
| string mesh::kdSplitPlaneType |
Split plane generation method.
Available variants include: splitPlaneMiddle, splitPlaneMedian, and splitPlaneSAH.
- Note:
- A kd-Tree constructed with splitPlaneMiddle and splitAxisRoundRobin is equivalent to a standard octree, but for ray tracing purposes, the surface area heuristic (splitPlaneSAH, the default) is generally preferred for its ability to concentrate efforts in dense regions of the scene.
| type | string |
| optional | true |
| default | splitPlaneSAH |
| string mesh::kdSplitAxisType |
Split axis selection method.
Available variants include: splitAxisRoundRobin and splitAxisLongestExtent
- Note:
- If splitPlaneSAH is selected, kdSplitAxisType will be ignored, and the split axis at each node will be selected according to the minimum expected SAH cost (with a few optimization-oriented exceptions..)
| type | string |
| optional | true |
| default | none |
| unsigned int mesh::kdMinPrimitives |
Minimum number of primitives s.t. a leaf cell will automatically be created (below this number, further subdivision either won't help or requires too much memory.
| type | unsigned integer |
| optional | true |
| default | 3 |
| unsigned int mesh::kdMaxDepth |
Maximum depth of tree.
| type | unsigned integer |
| optional | true |
| default | 24 |
| unsigned int mesh::kdNoThreads |
number of threads to spawn during tree construction
- Note:
- TODO; currently single-threaded construction
| type | unsigned integer |
| optional | true |
| default | 1 |
| real_t mesh::kdCostTraversal |
SAH relative cost of traversal.
| type | real scalar |
| optional | true |
| default | 1 |
| real_t mesh::kdEmptyBias |
SAH empty cell bias factor.
| type | real scalar |
| optional | true |
| default | 0.9 |
Generated on 28 Feb 2009 for MiltonScenefileFormat by
1.5.6