mesh Element Reference

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

Inheritance diagram for mesh:

shape

List of all members.

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:

"scene" : {
// declare the same sphere centered at the origin two different ways
"shape" : { "type" : "sphere" },
"sphere" : { },

// declare a mesh
"mesh" : {
"path" : "path/to/mesh.obj", // ply or obj mesh
"name" : "myMesh", // optionally specify a name
},

// declare a translated mesh instance with a different material
"bsdf" : { "type" : "diffuse", "kd" : [ 1, 0, 0 ], },
"medium" : { "ior" : 1.49 },

"translate" : [ 0, 5, 0 ],
"shape" : { "instance" : "myMesh" },
},
},
},

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).
typestring
optionalfalse

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

typestring
optionaltrue
defaultkdTree

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.
typestring
optionaltrue
defaultsplitPlaneSAH

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..)
typestring
optionaltrue
defaultnone

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.

typeunsigned integer
optionaltrue
default3

unsigned int mesh::kdMaxDepth

Maximum depth of tree.

typeunsigned integer
optionaltrue
default24

unsigned int mesh::kdNoThreads

number of threads to spawn during tree construction

Note:
TODO; currently single-threaded construction
typeunsigned integer
optionaltrue
default1

SAH relative cost of traversal.

typereal scalar
optionaltrue
default1

SAH empty cell bias factor.

typereal scalar
optionaltrue
default0.9


Generated on 28 Feb 2009 for MiltonScenefileFormat by doxygen 1.5.6