00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "kdtree.h"
00025
00026 #include "dynload.h"
00027 #include "paramset.h"
00028 #include "light.h"
00029 #include "shape.h"
00030 #include "material.h"
00031 #include "texture.h"
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #include "cone.h"
00045 #include "cylinder.h"
00046 #include "disk.h"
00047 #include "heightfield.h"
00048 #include "hyperboloid.h"
00049 #include "loopsubdiv.h"
00050 #include "nurbs.h"
00051 #include "paraboloid.h"
00052 #include "sphere.h"
00053 #include "barytrianglemesh.h"
00054 #include "waldtrianglemesh.h"
00055 #include "plymesh.h"
00056 #include "lenscomponent.h"
00057
00058 #include "lowdiscrepancy.h"
00059 #include "halton.h"
00060 #include "random.h"
00061 #include "metrosampler.h"
00062 #include "erpt.h"
00063
00064 #include "environment.h"
00065 #include "orthographic.h"
00066 #include "perspective.h"
00067 #include "realistic.h"
00068
00069 #include "fleximage.h"
00070
00071 #include "box.h"
00072 #include "gaussian.h"
00073 #include "mitchell.h"
00074 #include "sinc.h"
00075 #include "triangle.h"
00076
00077 #include "directlighting.h"
00078 #include "path.h"
00079 #include "path2.h"
00080 #include "particletracing.h"
00081 #include "bidirectional.h"
00082 #include "exphotonmap.h"
00083
00084 #include "emission.h"
00085 #include "single.h"
00086
00087 #include "distant.h"
00088 #include "goniometric.h"
00089 #include "infinitesample.h"
00090 #include "infinite.h"
00091 #include "point.h"
00092 #include "projection.h"
00093 #include "spot.h"
00094 #include "sun.h"
00095 #include "sky.h"
00096
00097 #include "glass.h"
00098 #include "roughglass.h"
00099 #include "matte.h"
00100 #include "mattetranslucent.h"
00101 #include "mirror.h"
00102 #include "plastic.h"
00103 #include "shinymetal.h"
00104 #include "substrate.h"
00105 #include "carpaint.h"
00106 #include "metal.h"
00107 #include "null.h"
00108 #include "mixmaterial.h"
00109
00110 #include "bilerp.h"
00111 #include "checkerboard.h"
00112 #include "constant.h"
00113 #include "dots.h"
00114 #include "fbm.h"
00115 #include "imagemap.h"
00116 #include "marble.h"
00117 #include "mix.h"
00118 #include "scale.h"
00119 #include "uv.h"
00120 #include "windy.h"
00121 #include "wrinkled.h"
00122 #include "harlequin.h"
00123 #include "blender_musgrave.h"
00124 #include "blender_marble.h"
00125 #include "blender_wood.h"
00126 #include "blender_clouds.h"
00127 #include "blender_blend.h"
00128 #include "blender_distortednoise.h"
00129 #include "blender_noise.h"
00130 #include "blender_magic.h"
00131 #include "blender_stucci.h"
00132 #include "blender_voronoi.h"
00133
00134 #include "contrast.h"
00135 #include "highcontrast.h"
00136 #include "maxwhite.h"
00137 #include "nonlinear.h"
00138 #include "reinhard.h"
00139
00140 #include "exponential.h"
00141 #include "homogeneous.h"
00142 #include "volumegrid.h"
00143
00144 #include "grid.h"
00145 #include "unsafekdtreeaccel.h"
00146 #include "tabreckdtreeaccel.h"
00147 #include "bruteforce.h"
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167 using std::map;
00168
00169 namespace lux {
00170
00171
00172 boost::shared_ptr<Shape> MakeShape(const string &name,
00173 const Transform &object2world,
00174 bool reverseOrientation,
00175 const ParamSet ¶mSet,
00176 map<string, boost::shared_ptr<Texture<float> > > *floatTextures) {
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187 if(name=="cone")
00188 return boost::shared_ptr<Shape>(Cone::CreateShape(object2world, reverseOrientation, paramSet));
00189 if(name=="cylinder")
00190 return boost::shared_ptr<Shape>(Cylinder::CreateShape(object2world, reverseOrientation, paramSet));
00191 if(name=="disk")
00192 return boost::shared_ptr<Shape>(Disk::CreateShape(object2world, reverseOrientation, paramSet));
00193 if(name=="heightfield")
00194 return boost::shared_ptr<Shape>(Heightfield::CreateShape(object2world, reverseOrientation, paramSet));
00195 if(name=="hyperboloid")
00196 return boost::shared_ptr<Shape>(Hyperboloid::CreateShape(object2world, reverseOrientation, paramSet));
00197 if(name=="loopsubdiv")
00198 return boost::shared_ptr<Shape>(LoopSubdiv::CreateShape(object2world, reverseOrientation, paramSet, floatTextures));
00199 if(name=="nurbs")
00200 return boost::shared_ptr<Shape>(NURBS::CreateShape(object2world, reverseOrientation, paramSet));
00201 if(name=="paraboloid")
00202 return boost::shared_ptr<Shape>(Paraboloid::CreateShape(object2world, reverseOrientation, paramSet));
00203 if(name=="sphere")
00204 return boost::shared_ptr<Shape>(Sphere::CreateShape(object2world, reverseOrientation, paramSet));
00205 if(name=="barytrianglemesh")
00206 return boost::shared_ptr<Shape>(BaryTriangleMesh::CreateShape(object2world, reverseOrientation, paramSet));
00207 if((name=="waldtrianglemesh") || (name=="trianglemesh"))
00208 return boost::shared_ptr<Shape>(WaldTriangleMesh::CreateShape(object2world, reverseOrientation, paramSet));
00209 if(name=="plymesh")
00210 return boost::shared_ptr<Shape>(PlyMesh::CreateShape(object2world, reverseOrientation, paramSet));
00211 if(name=="lenscomponent")
00212 return boost::shared_ptr<Shape>(LensComponent::CreateShape(object2world, reverseOrientation, paramSet));
00213
00214 std::stringstream ss;
00215 ss<<"Static loading of shape '"<<name<<"' failed.";
00216 luxError(LUX_BUG, LUX_ERROR, ss.str().c_str());
00217 boost::shared_ptr<Shape> o;
00218 return o;
00219 }
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247 boost::shared_ptr<Material> MakeMaterial(const string &name,
00248 const Transform &mtl2world,
00249 const TextureParams &mp) {
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259 if(name=="glass") {
00260 boost::shared_ptr<Material> ret = boost::shared_ptr<Material>(Glass::CreateMaterial(mtl2world, mp));
00261 mp.ReportUnused();
00262 return ret;
00263 }
00264 if(name=="roughglass") {
00265 boost::shared_ptr<Material> ret = boost::shared_ptr<Material>(RoughGlass::CreateMaterial(mtl2world, mp));
00266 mp.ReportUnused();
00267 return ret;
00268 }
00269 if(name=="matte") {
00270 boost::shared_ptr<Material> ret = boost::shared_ptr<Material>(Matte::CreateMaterial(mtl2world, mp));
00271 mp.ReportUnused();
00272 return ret;
00273 }
00274 if(name=="mattetranslucent") {
00275 boost::shared_ptr<Material> ret = boost::shared_ptr<Material>(MatteTranslucent::CreateMaterial(mtl2world, mp));
00276 mp.ReportUnused();
00277 return ret;
00278 }
00279 if(name=="mirror") {
00280 boost::shared_ptr<Material> ret = boost::shared_ptr<Material>(Mirror::CreateMaterial(mtl2world, mp));
00281 mp.ReportUnused();
00282 return ret;
00283 }
00284 if(name=="plastic") {
00285 boost::shared_ptr<Material> ret = boost::shared_ptr<Material>(Plastic::CreateMaterial(mtl2world, mp));
00286 mp.ReportUnused();
00287 return ret;
00288 }
00289 if(name=="shinymetal") {
00290 boost::shared_ptr<Material> ret = boost::shared_ptr<Material>(ShinyMetal::CreateMaterial(mtl2world, mp));
00291 mp.ReportUnused();
00292 return ret;
00293 }
00294 if(name=="substrate") {
00295 boost::shared_ptr<Material> ret = boost::shared_ptr<Material>(Substrate::CreateMaterial(mtl2world, mp));
00296 mp.ReportUnused();
00297 return ret;
00298 }
00299 if(name=="carpaint") {
00300 boost::shared_ptr<Material> ret = boost::shared_ptr<Material>(CarPaint::CreateMaterial(mtl2world, mp));
00301 mp.ReportUnused();
00302 return ret;
00303 }
00304 if(name=="metal") {
00305 boost::shared_ptr<Material> ret = boost::shared_ptr<Material>(Metal::CreateMaterial(mtl2world, mp));
00306 mp.ReportUnused();
00307 return ret;
00308 }
00309 if(name=="null")
00310 {
00311 boost::shared_ptr<Material> ret = boost::shared_ptr<Material>(Null::CreateMaterial(mtl2world, mp));
00312 mp.ReportUnused();
00313 return ret;
00314 }
00315 if(name=="mix")
00316 {
00317 boost::shared_ptr<Material> ret = boost::shared_ptr<Material>(MixMaterial::CreateMaterial(mtl2world, mp));
00318 mp.ReportUnused();
00319 return ret;
00320 }
00321
00322
00323
00324 std::stringstream ss;
00325 ss<<"Static loading of material '"<<name<<"' failed.";
00326 luxError(LUX_BUG, LUX_ERROR, ss.str().c_str());
00327 boost::shared_ptr<Material> o;
00328 return o;
00329 }
00330
00331 boost::shared_ptr< Texture<float> > MakeFloatTexture(const string &name,
00332 const Transform &tex2world, const TextureParams &tp) {
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342 if(name=="bilerp") {
00343 boost::shared_ptr<Texture<float> > ret = boost::shared_ptr<Texture<float> >(BilerpTexture<float>::CreateFloatTexture(tex2world, tp));
00344 tp.ReportUnused();
00345 return ret;
00346 }
00347 if(name=="checkerboard") {
00348 boost::shared_ptr<Texture<float> > ret = boost::shared_ptr<Texture<float> >(Checkerboard::CreateFloatTexture(tex2world, tp));
00349 tp.ReportUnused();
00350 return ret;
00351 }
00352 if(name=="constant") {
00353 boost::shared_ptr<Texture<float> > ret = boost::shared_ptr<Texture<float> >(Constant::CreateFloatTexture(tex2world, tp));
00354 tp.ReportUnused();
00355 return ret;
00356 }
00357 if(name=="dots") {
00358 boost::shared_ptr<Texture<float> > ret = boost::shared_ptr<Texture<float> >(DotsTexture<float>::CreateFloatTexture(tex2world, tp));
00359 tp.ReportUnused();
00360 return ret;
00361 }
00362 if(name=="fbm") {
00363 boost::shared_ptr<Texture<float> > ret = boost::shared_ptr<Texture<float> >(FBmTexture<float>::CreateFloatTexture(tex2world, tp));
00364 tp.ReportUnused();
00365 return ret;
00366 }
00367 if(name=="imagemap") {
00368 boost::shared_ptr<Texture<float> > ret = boost::shared_ptr<Texture<float> >(ImageTexture<float>::CreateFloatTexture(tex2world, tp));
00369 tp.ReportUnused();
00370 return ret;
00371 }
00372 if(name=="marble") {
00373 boost::shared_ptr<Texture<float> > ret = boost::shared_ptr<Texture<float> >(MarbleTexture::CreateFloatTexture(tex2world, tp));
00374 tp.ReportUnused();
00375 return ret;
00376 }
00377 if(name=="mix") {
00378 boost::shared_ptr<Texture<float> > ret = boost::shared_ptr<Texture<float> >(MixTexture<float>::CreateFloatTexture(tex2world, tp));
00379 tp.ReportUnused();
00380 return ret;
00381 }
00382 if(name=="scale") {
00383 boost::shared_ptr<Texture<float> > ret = boost::shared_ptr<Texture<float> >(ScaleTexture<float, float>::CreateFloatTexture(tex2world, tp));
00384 tp.ReportUnused();
00385 return ret;
00386 }
00387 if(name=="uv") {
00388 boost::shared_ptr<Texture<float> > ret = boost::shared_ptr<Texture<float> >(UVTexture::CreateFloatTexture(tex2world, tp));
00389 tp.ReportUnused();
00390 return ret;
00391 }
00392 if(name=="windy") {
00393 boost::shared_ptr<Texture<float> > ret = boost::shared_ptr<Texture<float> >(WindyTexture<float>::CreateFloatTexture(tex2world, tp));
00394 tp.ReportUnused();
00395 return ret;
00396 }
00397 if(name=="wrinkled") {
00398 boost::shared_ptr<Texture<float> > ret = boost::shared_ptr<Texture<float> >(WrinkledTexture<float>::CreateFloatTexture(tex2world, tp));
00399 tp.ReportUnused();
00400 return ret;
00401 }
00402 if(name=="blender_musgrave") {
00403 boost::shared_ptr<Texture<float> > ret = boost::shared_ptr<Texture<float> >(BlenderMusgraveTexture3D<float>::CreateFloatTexture(tex2world, tp));
00404 tp.ReportUnused();
00405 return ret;
00406 }
00407 if(name=="blender_marble") {
00408 boost::shared_ptr<Texture<float> > ret = boost::shared_ptr<Texture<float> >(BlenderMarbleTexture3D<float>::CreateFloatTexture(tex2world, tp));
00409 tp.ReportUnused();
00410 return ret;
00411 }
00412 if(name=="blender_wood") {
00413 boost::shared_ptr<Texture<float> > ret = boost::shared_ptr<Texture<float> >(BlenderWoodTexture3D<float>::CreateFloatTexture(tex2world, tp));
00414 tp.ReportUnused();
00415 return ret;
00416 }
00417 if(name=="blender_clouds") {
00418 boost::shared_ptr<Texture<float> > ret = boost::shared_ptr<Texture<float> >(BlenderCloudsTexture3D<float>::CreateFloatTexture(tex2world, tp));
00419 tp.ReportUnused();
00420 return ret;
00421 }
00422 if(name=="blender_blend") {
00423 boost::shared_ptr<Texture<float> > ret = boost::shared_ptr<Texture<float> >(BlenderBlendTexture3D<float>::CreateFloatTexture(tex2world, tp));
00424 tp.ReportUnused();
00425 return ret;
00426 }
00427 if(name=="blender_distortednoise") {
00428 boost::shared_ptr<Texture<float> > ret = boost::shared_ptr<Texture<float> >(BlenderDistortedNoiseTexture3D<float>::CreateFloatTexture(tex2world, tp));
00429 tp.ReportUnused();
00430 return ret;
00431 }
00432 if(name=="blender_stucci") {
00433 boost::shared_ptr<Texture<float> > ret = boost::shared_ptr<Texture<float> >(BlenderStucciTexture3D<float>::CreateFloatTexture(tex2world, tp));
00434 tp.ReportUnused();
00435 return ret;
00436 }
00437 if(name=="blender_noise") {
00438 boost::shared_ptr<Texture<float> > ret = boost::shared_ptr<Texture<float> >(BlenderNoiseTexture3D<float>::CreateFloatTexture(tex2world, tp));
00439 tp.ReportUnused();
00440 return ret;
00441 }
00442 if(name=="blender_magic") {
00443 boost::shared_ptr<Texture<float> > ret = boost::shared_ptr<Texture<float> >(BlenderMagicTexture3D<float>::CreateFloatTexture(tex2world, tp));
00444 tp.ReportUnused();
00445 return ret;
00446 }
00447 if(name=="blender_voronoi") {
00448 boost::shared_ptr<Texture<float> > ret = boost::shared_ptr<Texture<float> >(BlenderVoronoiTexture3D<float>::CreateFloatTexture(tex2world, tp));
00449 tp.ReportUnused();
00450 return ret;
00451 }
00452
00453 std::stringstream ss;
00454 ss<<"Static loading of texture '"<<name<<"' failed.";
00455 luxError(LUX_BUG, LUX_ERROR, ss.str().c_str());
00456 boost::shared_ptr<Texture<float> > o;
00457 return o;
00458 }
00459
00460 boost::shared_ptr<Texture<Spectrum> > MakeSpectrumTexture(const string &name,
00461 const Transform &tex2world, const TextureParams &tp) {
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471 if(name=="bilerp") {
00472 boost::shared_ptr<Texture<Spectrum> > ret = boost::shared_ptr<Texture<Spectrum> >(BilerpTexture<Spectrum>::CreateSpectrumTexture(tex2world, tp));
00473 tp.ReportUnused();
00474 return ret;
00475 }
00476 if(name=="checkerboard") {
00477 boost::shared_ptr<Texture<Spectrum> > ret = boost::shared_ptr<Texture<Spectrum> >(Checkerboard::CreateSpectrumTexture(tex2world, tp));
00478 tp.ReportUnused();
00479 return ret;
00480 }
00481 if(name=="constant") {
00482 boost::shared_ptr<Texture<Spectrum> > ret = boost::shared_ptr<Texture<Spectrum> >(Constant::CreateSpectrumTexture(tex2world, tp));
00483 tp.ReportUnused();
00484 return ret;
00485 }
00486 if(name=="dots") {
00487 boost::shared_ptr<Texture<Spectrum> > ret = boost::shared_ptr<Texture<Spectrum> >(DotsTexture<Spectrum>::CreateSpectrumTexture(tex2world, tp));
00488 tp.ReportUnused();
00489 return ret;
00490 }
00491 if(name=="fbm") {
00492 boost::shared_ptr<Texture<Spectrum> > ret = boost::shared_ptr<Texture<Spectrum> >(FBmTexture<Spectrum>::CreateSpectrumTexture(tex2world, tp));
00493 tp.ReportUnused();
00494 return ret;
00495 }
00496 if(name=="imagemap") {
00497 boost::shared_ptr<Texture<Spectrum> > ret = boost::shared_ptr<Texture<Spectrum> >(ImageTexture<Spectrum>::CreateSpectrumTexture(tex2world, tp));
00498 tp.ReportUnused();
00499 return ret;
00500 }
00501 if(name=="marble") {
00502 boost::shared_ptr<Texture<Spectrum> > ret = boost::shared_ptr<Texture<Spectrum> >(MarbleTexture::CreateSpectrumTexture(tex2world, tp));
00503 tp.ReportUnused();
00504 return ret;
00505 }
00506 if(name=="mix") {
00507 boost::shared_ptr<Texture<Spectrum> > ret = boost::shared_ptr<Texture<Spectrum> >(MixTexture<Spectrum>::CreateSpectrumTexture(tex2world, tp));
00508 tp.ReportUnused();
00509 return ret;
00510 }
00511 if(name=="scale") {
00512 boost::shared_ptr<Texture<Spectrum> > ret = boost::shared_ptr<Texture<Spectrum> >(ScaleTexture<Spectrum, Spectrum>::CreateSpectrumTexture(tex2world, tp));
00513 tp.ReportUnused();
00514 return ret;
00515 }
00516 if(name=="uv") {
00517 boost::shared_ptr<Texture<Spectrum> > ret = boost::shared_ptr<Texture<Spectrum> >(UVTexture::CreateSpectrumTexture(tex2world, tp));
00518 tp.ReportUnused();
00519 return ret;
00520 }
00521 if(name=="windy") {
00522 boost::shared_ptr<Texture<Spectrum> > ret = boost::shared_ptr<Texture<Spectrum> >(WindyTexture<Spectrum>::CreateSpectrumTexture(tex2world, tp));
00523 tp.ReportUnused();
00524 return ret;
00525 }
00526 if(name=="wrinkled") {
00527 boost::shared_ptr<Texture<Spectrum> > ret = boost::shared_ptr<Texture<Spectrum> >(WrinkledTexture<Spectrum>::CreateSpectrumTexture(tex2world, tp));
00528 tp.ReportUnused();
00529 return ret;
00530 }
00531 if(name=="harlequin") {
00532 boost::shared_ptr<Texture<Spectrum> > ret = boost::shared_ptr<Texture<Spectrum> >(HarlequinTexture::CreateSpectrumTexture(tex2world, tp));
00533 tp.ReportUnused();
00534 return ret;
00535 }
00536 if(name=="blender_musgrave") {
00537 boost::shared_ptr<Texture<Spectrum> > ret = boost::shared_ptr<Texture<Spectrum> >(BlenderMusgraveTexture3D<Spectrum>::CreateSpectrumTexture(tex2world, tp));
00538 tp.ReportUnused();
00539 return ret;
00540 }
00541 if(name=="blender_marble") {
00542 boost::shared_ptr<Texture<Spectrum> > ret = boost::shared_ptr<Texture<Spectrum> >(BlenderMarbleTexture3D<Spectrum>::CreateSpectrumTexture(tex2world, tp));
00543 tp.ReportUnused();
00544 return ret;
00545 }
00546 if(name=="blender_wood") {
00547 boost::shared_ptr<Texture<Spectrum> > ret = boost::shared_ptr<Texture<Spectrum> >(BlenderWoodTexture3D<Spectrum>::CreateSpectrumTexture(tex2world, tp));
00548 tp.ReportUnused();
00549 return ret;
00550 }
00551 if(name=="blender_clouds") {
00552 boost::shared_ptr<Texture<Spectrum> > ret = boost::shared_ptr<Texture<Spectrum> >(BlenderCloudsTexture3D<Spectrum>::CreateSpectrumTexture(tex2world, tp));
00553 tp.ReportUnused();
00554 return ret;
00555 }
00556 if(name=="blender_blend") {
00557 boost::shared_ptr<Texture<Spectrum> > ret = boost::shared_ptr<Texture<Spectrum> >(BlenderBlendTexture3D<Spectrum>::CreateSpectrumTexture(tex2world, tp));
00558 tp.ReportUnused();
00559 return ret;
00560 }
00561 if(name=="blender_distortednoise") {
00562 boost::shared_ptr<Texture<Spectrum> > ret = boost::shared_ptr<Texture<Spectrum> >(BlenderDistortedNoiseTexture3D<Spectrum>::CreateSpectrumTexture(tex2world, tp));
00563 tp.ReportUnused();
00564 return ret;
00565 }
00566 if(name=="blender_stucci") {
00567 boost::shared_ptr<Texture<Spectrum> > ret = boost::shared_ptr<Texture<Spectrum> >(BlenderStucciTexture3D<Spectrum>::CreateSpectrumTexture(tex2world, tp));
00568 tp.ReportUnused();
00569 return ret;
00570 }
00571 if(name=="blender_noise") {
00572 boost::shared_ptr<Texture<Spectrum> > ret = boost::shared_ptr<Texture<Spectrum> >(BlenderNoiseTexture3D<Spectrum>::CreateSpectrumTexture(tex2world, tp));
00573 tp.ReportUnused();
00574 return ret;
00575 }
00576 if(name=="blender_magic") {
00577 boost::shared_ptr<Texture<Spectrum> > ret = boost::shared_ptr<Texture<Spectrum> >(BlenderMagicTexture3D<Spectrum>::CreateSpectrumTexture(tex2world, tp));
00578 tp.ReportUnused();
00579 return ret;
00580 }
00581 if(name=="blender_voronoi") {
00582 boost::shared_ptr<Texture<Spectrum> > ret = boost::shared_ptr<Texture<Spectrum> >(BlenderVoronoiTexture3D<Spectrum>::CreateSpectrumTexture(tex2world, tp));
00583 tp.ReportUnused();
00584 return ret;
00585 }
00586
00587 std::stringstream ss;
00588 ss<<"Static loading of spectrum texture '"<<name<<"' failed.";
00589 luxError(LUX_BUG, LUX_ERROR, ss.str().c_str());
00590 boost::shared_ptr<Texture<Spectrum> > o;
00591 return o;
00592 }
00593
00594 Light *MakeLight(const string &name,
00595 const Transform &light2world, const ParamSet ¶mSet) {
00596
00597
00598
00599
00600
00601
00602
00603 if(name=="distant") {
00604 Light *ret = DistantLight::CreateLight(light2world, paramSet);
00605 paramSet.ReportUnused();
00606 return ret;
00607 }
00608 if(name=="goniometric") {
00609 Light *ret = GonioPhotometricLight::CreateLight(light2world, paramSet);
00610 paramSet.ReportUnused();
00611 return ret;
00612 }
00613 if(name=="infinitesample") {
00614 Light *ret = InfiniteAreaLightIS::CreateLight(light2world, paramSet);
00615 paramSet.ReportUnused();
00616 return ret;
00617 }
00618 if(name=="infinite") {
00619 Light *ret = InfiniteAreaLight::CreateLight(light2world, paramSet);
00620 paramSet.ReportUnused();
00621 return ret;
00622 }
00623 if(name=="point") {
00624 Light *ret = PointLight::CreateLight(light2world, paramSet);
00625 paramSet.ReportUnused();
00626 return ret;
00627 }
00628 if(name=="projection") {
00629 Light *ret = ProjectionLight::CreateLight(light2world, paramSet);
00630 paramSet.ReportUnused();
00631 return ret;
00632 }
00633 if(name=="spot") {
00634 Light *ret = SpotLight::CreateLight(light2world, paramSet);
00635 paramSet.ReportUnused();
00636 return ret;
00637 }
00638 if(name=="sun") {
00639 Light *ret = SunLight::CreateLight(light2world, paramSet);
00640 paramSet.ReportUnused();
00641 return ret;
00642 }
00643 if(name=="sky") {
00644 Light *ret = SkyLight::CreateLight(light2world, paramSet);
00645 paramSet.ReportUnused();
00646 return ret;
00647 }
00648
00649 std::stringstream ss;
00650 ss<<"Static loading of light '"<<name<<"' failed.";
00651 luxError(LUX_BUG, LUX_ERROR, ss.str().c_str());
00652 return NULL;
00653 }
00654
00655 AreaLight *MakeAreaLight(const string &name,
00656 const Transform &light2world, const ParamSet ¶mSet,
00657 const boost::shared_ptr<Shape> &shape) {
00658
00659
00660
00661
00662
00663
00664
00665
00666
00667 if(name=="area") {
00668 AreaLight *ret = AreaLight::CreateAreaLight(light2world, paramSet, shape);
00669 paramSet.ReportUnused();
00670 return ret;
00671 }
00672
00673
00674 std::stringstream ss;
00675 ss<<"Static loading of area light '"<<name<<"' failed.";
00676 luxError(LUX_BUG, LUX_ERROR, ss.str().c_str());
00677 return NULL;
00678 }
00679
00680 VolumeRegion *MakeVolumeRegion(const string &name,
00681 const Transform &volume2world, const ParamSet ¶mSet) {
00682
00683
00684
00685
00686
00687
00688
00689
00690
00691 if(name=="exponential") {
00692 VolumeRegion *ret = ExponentialDensity::CreateVolumeRegion(volume2world, paramSet);
00693 paramSet.ReportUnused();
00694 return ret;
00695 }
00696 if(name=="homogeneous") {
00697 VolumeRegion *ret = HomogeneousVolume::CreateVolumeRegion(volume2world, paramSet);
00698 paramSet.ReportUnused();
00699 return ret;
00700 }
00701 if(name=="volumegrid") {
00702 VolumeRegion *ret = VolumeGrid::CreateVolumeRegion(volume2world, paramSet);
00703 paramSet.ReportUnused();
00704 return ret;
00705 }
00706
00707
00708 std::stringstream ss;
00709 ss<<"Static loading of volume region '"<<name<<"' failed.";
00710 luxError(LUX_BUG, LUX_ERROR, ss.str().c_str());
00711 return NULL;
00712 }
00713
00714 SurfaceIntegrator *MakeSurfaceIntegrator(const string &name,
00715 const ParamSet ¶mSet) {
00716
00717
00718
00719
00720
00721
00722
00723
00724
00725 if(name=="directlighting") {
00726 SurfaceIntegrator *ret=DirectLighting::CreateSurfaceIntegrator(paramSet);
00727 paramSet.ReportUnused();
00728 return ret;
00729 }
00730 if(name=="path") {
00731 SurfaceIntegrator *ret=PathIntegrator::CreateSurfaceIntegrator(paramSet);
00732 paramSet.ReportUnused();
00733 return ret;
00734 }
00735 if(name=="path2") {
00736 SurfaceIntegrator *ret=Path2Integrator::CreateSurfaceIntegrator(paramSet);
00737 paramSet.ReportUnused();
00738 return ret;
00739 }
00740 if(name=="particletracing") {
00741 SurfaceIntegrator *ret=ParticleTracingIntegrator::CreateSurfaceIntegrator(paramSet);
00742 paramSet.ReportUnused();
00743 return ret;
00744 }
00745 if(name=="bidirectional") {
00746 SurfaceIntegrator *ret=BidirIntegrator::CreateSurfaceIntegrator(paramSet);
00747 paramSet.ReportUnused();
00748 return ret;
00749 }
00750 if(name=="exphotonmap") {
00751 SurfaceIntegrator *ret=ExPhotonIntegrator::CreateSurfaceIntegrator(paramSet);
00752 paramSet.ReportUnused();
00753 return ret;
00754 }
00755
00756
00757
00758
00759
00760
00761
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771
00772
00773
00774 std::stringstream ss;
00775 ss<<"Static loading of surface integrator '"<<name<<"' failed.";
00776 luxError(LUX_BUG, LUX_ERROR, ss.str().c_str());
00777 return NULL;
00778 }
00779
00780 VolumeIntegrator *MakeVolumeIntegrator(const string &name,
00781 const ParamSet ¶mSet) {
00782
00783
00784
00785
00786
00787
00788
00789
00790
00791
00792 if(name=="single") {
00793 VolumeIntegrator *ret=SingleScattering::CreateVolumeIntegrator(paramSet);
00794 paramSet.ReportUnused();
00795 return ret;
00796 }
00797
00798 if(name=="emission") {
00799 VolumeIntegrator *ret=EmissionIntegrator::CreateVolumeIntegrator(paramSet);
00800 paramSet.ReportUnused();
00801 return ret;
00802 }
00803
00804
00805 std::stringstream ss;
00806 ss<<"Static loading of volume integrator '"<<name<<"' failed.";
00807 luxError(LUX_BUG, LUX_ERROR, ss.str().c_str());
00808 return NULL;
00809 }
00810
00811 Primitive *MakeAccelerator(const string &name, const vector<Primitive* > &prims, const ParamSet ¶mSet) {
00812
00813
00814
00815
00816
00817
00818
00819
00820
00821
00822
00823 if(name=="unsafekdtree") {
00824 Primitive* ret=UnsafeKdTreeAccel::CreateAccelerator(prims, paramSet);
00825 paramSet.ReportUnused();
00826 return ret;
00827 }
00828 if((name=="tabreckdtree") || (name=="kdtree")) {
00829 Primitive* ret=TaBRecKdTreeAccel::CreateAccelerator(prims, paramSet);
00830 paramSet.ReportUnused();
00831 return ret;
00832 }
00833 if(name=="grid") {
00834 Primitive* ret=GridAccel::CreateAccelerator(prims, paramSet);
00835 paramSet.ReportUnused();
00836 return ret;
00837 }
00838
00839 if(name=="none") {
00840 Primitive* ret=BruteForceAccel::CreateAccelerator(prims, paramSet);
00841 paramSet.ReportUnused();
00842 return ret;
00843 }
00844
00845
00846 std::stringstream ss;
00847 ss<<"Static loading of accelerator '"<<name<<"' failed.";
00848 luxError(LUX_BUG, LUX_ERROR, ss.str().c_str());
00849 return NULL;
00850 }
00851
00852 Camera *MakeCamera(const string &name,
00853 const ParamSet ¶mSet,
00854 const Transform &world2cam, Film *film) {
00855
00856
00857
00858
00859
00860
00861
00862
00863 if(name=="environment") {
00864 Camera *ret=EnvironmentCamera::CreateCamera(paramSet, world2cam, film);
00865 paramSet.ReportUnused();
00866 return ret;
00867 }
00868 if(name=="orthographic") {
00869 Camera *ret=OrthoCamera::CreateCamera(paramSet, world2cam, film);
00870 paramSet.ReportUnused();
00871 return ret;
00872 }
00873 if(name=="perspective") {
00874 Camera *ret=PerspectiveCamera::CreateCamera(paramSet, world2cam, film);
00875 paramSet.ReportUnused();
00876 return ret;
00877 }
00878 if(name=="realistic") {
00879 Camera *ret=RealisticCamera::CreateCamera(paramSet, world2cam, film);
00880 paramSet.ReportUnused();
00881 return ret;
00882 }
00883
00884
00885 std::stringstream ss;
00886 ss<<"Static loading of camera '"<<name<<"' failed.";
00887 luxError(LUX_BUG, LUX_ERROR, ss.str().c_str());
00888 return NULL;
00889 }
00890
00891 Sampler *MakeSampler(const string &name,
00892 const ParamSet ¶mSet, const Film *film) {
00893
00894
00895
00896
00897
00898
00899
00900
00901
00902 if(name=="lowdiscrepancy") {
00903 Sampler *ret=LDSampler::CreateSampler(paramSet, film);
00904 paramSet.ReportUnused();
00905 return ret;
00906 }
00907 if(name=="random") {
00908 Sampler *ret=RandomSampler::CreateSampler(paramSet, film);
00909 paramSet.ReportUnused();
00910 return ret;
00911 }
00912 if(name=="halton") {
00913 Sampler *ret=HaltonSampler::CreateSampler(paramSet, film);
00914 paramSet.ReportUnused();
00915 return ret;
00916 }
00917 if(name=="metropolis") {
00918 Sampler *ret=MetropolisSampler::CreateSampler(paramSet, film);
00919 paramSet.ReportUnused();
00920 return ret;
00921 }
00922 if(name=="erpt") {
00923 Sampler *ret=ERPTSampler::CreateSampler(paramSet, film);
00924 paramSet.ReportUnused();
00925 return ret;
00926 }
00927
00928
00929
00930
00931
00932
00933
00934
00935
00936
00937
00938
00939
00940
00941
00942
00943
00944
00945
00946 std::stringstream ss;
00947 ss<<"Static loading of sampler '"<<name<<"' failed.";
00948 luxError(LUX_BUG, LUX_ERROR, ss.str().c_str());
00949 return NULL;
00950 }
00951
00952 Filter *MakeFilter(const string &name,
00953 const ParamSet ¶mSet) {
00954
00955
00956
00957
00958
00959
00960
00961
00962 if(name=="box") {
00963 Filter *ret=BoxFilter::CreateFilter(paramSet);
00964 paramSet.ReportUnused();
00965 return ret;
00966 }
00967
00968 if(name=="gaussian") {
00969 Filter *ret=GaussianFilter::CreateFilter(paramSet);
00970 paramSet.ReportUnused();
00971 return ret;
00972 }
00973
00974 if(name=="mitchell") {
00975 Filter *ret=MitchellFilter::CreateFilter(paramSet);
00976 paramSet.ReportUnused();
00977 return ret;
00978 }
00979
00980 if(name=="sinc") {
00981 Filter *ret=LanczosSincFilter::CreateFilter(paramSet);
00982 paramSet.ReportUnused();
00983 return ret;
00984 }
00985
00986 if(name=="triangle") {
00987 Filter *ret=TriangleFilter::CreateFilter(paramSet);
00988 paramSet.ReportUnused();
00989 return ret;
00990 }
00991
00992
00993 std::stringstream ss;
00994 ss<<"Static loading of fiter '"<<name<<"' failed.";
00995 luxError(LUX_BUG, LUX_ERROR, ss.str().c_str());
00996 return NULL;
00997 }
00998
00999 ToneMap *MakeToneMap(const string &name,
01000 const ParamSet ¶mSet) {
01001
01002
01003
01004
01005
01006
01007
01008 if(name=="contrast") {
01009 ToneMap *ret=ContrastOp::CreateToneMap(paramSet);
01010 paramSet.ReportUnused();
01011 return ret;
01012 }
01013 if(name=="highcontrast") {
01014 ToneMap *ret=HighContrastOp::CreateToneMap(paramSet);
01015 paramSet.ReportUnused();
01016 return ret;
01017 }
01018 if(name=="maxwhite") {
01019 ToneMap *ret=MaxWhiteOp::CreateToneMap(paramSet);
01020 paramSet.ReportUnused();
01021 return ret;
01022 }
01023 if(name=="nonlinear") {
01024 ToneMap *ret=NonLinearOp::CreateToneMap(paramSet);
01025 paramSet.ReportUnused();
01026 return ret;
01027 }
01028 if(name=="reinhard") {
01029 ToneMap *ret=ReinhardOp::CreateToneMap(paramSet);
01030 paramSet.ReportUnused();
01031 return ret;
01032 }
01033
01034
01035 std::stringstream ss;
01036 ss<<"Static loading of tonemap '"<<name<<"' failed.";
01037 luxError(LUX_BUG, LUX_ERROR, ss.str().c_str());
01038 return NULL;
01039 }
01040
01041 Film *MakeFilm(const string &name,
01042 const ParamSet ¶mSet, Filter *filter) {
01043
01044
01045
01046
01047
01048
01049
01050
01051
01052
01053 if((name == "fleximage") || (name == "multiimage")) {
01054 Film *ret = FlexImageFilm::CreateFilm(paramSet, filter);
01055 paramSet.ReportUnused();
01056 return ret;
01057 }
01058
01059
01060
01061
01062
01063
01064
01065
01066
01067
01068
01069
01070
01071 std::stringstream ss;
01072 ss<<"Static loading of film '"<<name<<"' failed.";
01073 luxError(LUX_BUG, LUX_ERROR, ss.str().c_str());
01074 return NULL;
01075 }
01076
01077 }
01078