From efe33e9212bc842f16ffe8e76b980cb1c31a7bd6 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Sat, 20 Oct 2012 14:04:13 -0400 Subject: [PATCH] OCD: remove trailing spaces from all files --- include/mitsuba/bidir/common.h | 12 +- include/mitsuba/bidir/edge.h | 106 +- include/mitsuba/bidir/geodist2.h | 12 +- include/mitsuba/bidir/manifold.h | 12 +- include/mitsuba/bidir/mempool.h | 4 +- include/mitsuba/bidir/mut_bidir.h | 10 +- include/mitsuba/bidir/mut_caustic.h | 6 +- include/mitsuba/bidir/mut_lens.h | 6 +- include/mitsuba/bidir/mut_manifold.h | 8 +- include/mitsuba/bidir/mut_mchain.h | 6 +- include/mitsuba/bidir/mutator.h | 18 +- include/mitsuba/bidir/path.h | 118 +- include/mitsuba/bidir/pathsampler.h | 28 +- include/mitsuba/bidir/rsampler.h | 6 +- include/mitsuba/bidir/util.h | 14 +- include/mitsuba/bidir/vertex.h | 226 +- include/mitsuba/core/aabb.h | 40 +- include/mitsuba/core/aabb_sse.h | 18 +- include/mitsuba/core/appender.h | 4 +- include/mitsuba/core/atomic.h | 12 +- include/mitsuba/core/barray.h | 52 +- include/mitsuba/core/bitmap.h | 156 +- include/mitsuba/core/brent.h | 24 +- include/mitsuba/core/bsphere.h | 4 +- include/mitsuba/core/chisquare.h | 22 +- include/mitsuba/core/class.h | 8 +- include/mitsuba/core/cobject.h | 14 +- include/mitsuba/core/formatter.h | 6 +- include/mitsuba/core/frame.h | 8 +- include/mitsuba/core/fresolver.h | 14 +- include/mitsuba/core/half.h | 20 +- include/mitsuba/core/kdtree.h | 222 +- include/mitsuba/core/lock.h | 20 +- include/mitsuba/core/logger.h | 28 +- include/mitsuba/core/lrucache.h | 30 +- include/mitsuba/core/matrix.h | 24 +- include/mitsuba/core/matrix.inl | 28 +- include/mitsuba/core/mempool.h | 10 +- include/mitsuba/core/mstream.h | 12 +- include/mitsuba/core/netobject.h | 18 +- include/mitsuba/core/normal.h | 6 +- include/mitsuba/core/object.h | 12 +- include/mitsuba/core/octree.h | 32 +- include/mitsuba/core/platform.h | 10 +- include/mitsuba/core/plugin.h | 30 +- include/mitsuba/core/pmf.h | 66 +- include/mitsuba/core/point.h | 86 +- include/mitsuba/core/properties.h | 16 +- include/mitsuba/core/qmc.h | 36 +- include/mitsuba/core/quad.h | 42 +- include/mitsuba/core/quat.h | 18 +- include/mitsuba/core/random.h | 24 +- include/mitsuba/core/ray.h | 38 +- include/mitsuba/core/ref.h | 20 +- include/mitsuba/core/rfilter.h | 34 +- include/mitsuba/core/sched.h | 190 +- include/mitsuba/core/sched_remote.h | 14 +- include/mitsuba/core/sfcurve.h | 2 +- include/mitsuba/core/shvector.h | 28 +- include/mitsuba/core/simplecache.h | 14 +- include/mitsuba/core/spectrum.h | 80 +- include/mitsuba/core/sse.h | 8 +- include/mitsuba/core/ssemath.h | 2 +- include/mitsuba/core/ssevector.h | 2 +- include/mitsuba/core/sshstream.h | 30 +- include/mitsuba/core/sstream.h | 8 +- include/mitsuba/core/statistics.h | 34 +- include/mitsuba/core/stl.h | 6 +- include/mitsuba/core/stream.h | 54 +- include/mitsuba/core/thread.h | 14 +- include/mitsuba/core/timer.h | 4 +- include/mitsuba/core/tls.h | 20 +- include/mitsuba/core/transform.h | 16 +- include/mitsuba/core/triangle.h | 32 +- include/mitsuba/core/util.h | 138 +- include/mitsuba/core/vector.h | 58 +- include/mitsuba/core/version.h | 16 +- include/mitsuba/core/vmf.h | 10 +- include/mitsuba/core/warp.h | 10 +- include/mitsuba/core/zstream.h | 2 +- include/mitsuba/hw/basicshader.h | 4 +- include/mitsuba/hw/device.h | 8 +- include/mitsuba/hw/font.h | 2 +- include/mitsuba/hw/glprogram.h | 6 +- include/mitsuba/hw/glrenderer.h | 20 +- include/mitsuba/hw/gltexture.h | 18 +- include/mitsuba/hw/glxrenderer.h | 2 +- include/mitsuba/hw/gpugeometry.h | 2 +- include/mitsuba/hw/gpuprogram.h | 42 +- include/mitsuba/hw/gputexture.h | 44 +- include/mitsuba/hw/nsgldevice.h | 6 +- include/mitsuba/hw/nsglsession.h | 2 +- include/mitsuba/hw/renderer.h | 24 +- include/mitsuba/hw/session.h | 2 +- include/mitsuba/hw/shadow.h | 6 +- include/mitsuba/hw/viewer.h | 12 +- include/mitsuba/hw/vpl.h | 68 +- include/mitsuba/hw/wgldevice.h | 4 +- include/mitsuba/hw/wglsession.h | 2 +- include/mitsuba/hw/x11device.h | 2 +- include/mitsuba/hw/x11session.h | 4 +- include/mitsuba/render/bsdf.h | 140 +- include/mitsuba/render/common.h | 56 +- include/mitsuba/render/emitter.h | 150 +- include/mitsuba/render/film.h | 20 +- include/mitsuba/render/gatherproc.h | 8 +- include/mitsuba/render/gkdtree.h | 336 +- include/mitsuba/render/imageblock.h | 24 +- include/mitsuba/render/imageproc.h | 6 +- include/mitsuba/render/integrator.h | 108 +- include/mitsuba/render/irrcache.h | 24 +- include/mitsuba/render/medium.h | 26 +- include/mitsuba/render/mipmap.h | 106 +- include/mitsuba/render/noise.h | 14 +- include/mitsuba/render/particleproc.h | 26 +- include/mitsuba/render/phase.h | 42 +- include/mitsuba/render/photon.h | 10 +- include/mitsuba/render/photonmap.h | 28 +- include/mitsuba/render/range.h | 4 +- include/mitsuba/render/records.inl | 16 +- include/mitsuba/render/renderjob.h | 14 +- include/mitsuba/render/renderproc.h | 4 +- include/mitsuba/render/renderqueue.h | 12 +- include/mitsuba/render/sahkdtree2.h | 58 +- include/mitsuba/render/sahkdtree3.h | 156 +- include/mitsuba/render/sampler.h | 58 +- include/mitsuba/render/scene.h | 274 +- include/mitsuba/render/scenehandler.h | 14 +- include/mitsuba/render/sensor.h | 136 +- include/mitsuba/render/shader.h | 24 +- include/mitsuba/render/shape.h | 80 +- include/mitsuba/render/skdtree.h | 54 +- include/mitsuba/render/spiral.h | 2 +- include/mitsuba/render/subsurface.h | 8 +- include/mitsuba/render/testcase.h | 6 +- include/mitsuba/render/texture.h | 2 +- include/mitsuba/render/track.h | 32 +- include/mitsuba/render/triaccel.h | 2 +- include/mitsuba/render/triaccel_sse.h | 26 +- include/mitsuba/render/trimesh.h | 34 +- include/mitsuba/render/util.h | 4 +- include/mitsuba/render/volume.h | 4 +- include/mitsuba/render/vpl.h | 10 +- src/bsdfs/blendbsdf.cpp | 24 +- src/bsdfs/bump.cpp | 24 +- src/bsdfs/coating.cpp | 66 +- src/bsdfs/conductor.cpp | 84 +- src/bsdfs/dielectric.cpp | 64 +- src/bsdfs/difftrans.cpp | 24 +- src/bsdfs/diffuse.cpp | 40 +- src/bsdfs/hk.cpp | 70 +- src/bsdfs/ior.h | 6 +- src/bsdfs/irawan.cpp | 98 +- src/bsdfs/mask.cpp | 18 +- src/bsdfs/microfacet.h | 62 +- src/bsdfs/mixturebsdf.cpp | 24 +- src/bsdfs/null.cpp | 8 +- src/bsdfs/phong.cpp | 54 +- src/bsdfs/plastic.cpp | 86 +- src/bsdfs/roughcoating.cpp | 90 +- src/bsdfs/roughconductor.cpp | 128 +- src/bsdfs/roughdielectric.cpp | 160 +- src/bsdfs/roughdiffuse.cpp | 86 +- src/bsdfs/roughplastic.cpp | 152 +- src/bsdfs/rtrans.h | 82 +- src/bsdfs/thindielectric.cpp | 34 +- src/bsdfs/twosided.cpp | 24 +- src/bsdfs/ward.cpp | 68 +- src/converter/collada.cpp | 108 +- src/converter/converter.cpp | 12 +- src/converter/mtsimport.cpp | 26 +- src/converter/obj.cpp | 24 +- src/emitters/area.cpp | 30 +- src/emitters/collimated.cpp | 12 +- src/emitters/constant.cpp | 42 +- src/emitters/directional.cpp | 22 +- src/emitters/envmap.cpp | 120 +- src/emitters/point.cpp | 22 +- src/emitters/sky.cpp | 74 +- src/emitters/spot.cpp | 30 +- src/emitters/sun.cpp | 64 +- src/emitters/sunsky.cpp | 40 +- src/emitters/sunsky/skymodel.cpp | 146 +- src/emitters/sunsky/skymodel.h | 52 +- src/emitters/sunsky/skymodeldata.h | 86 +- src/emitters/sunsky/sunmodel.h | 74 +- src/films/hdrfilm.cpp | 60 +- src/films/ldrfilm.cpp | 52 +- src/films/mfilm.cpp | 32 +- src/films/tiledhdrfilm.cpp | 56 +- src/integrators/bdpt/bdpt.cpp | 46 +- src/integrators/bdpt/bdpt.h | 4 +- src/integrators/bdpt/bdpt_proc.cpp | 50 +- src/integrators/bdpt/bdpt_wr.cpp | 10 +- src/integrators/bdpt/bdpt_wr.h | 12 +- src/integrators/direct/ao.cpp | 14 +- src/integrators/direct/direct.cpp | 42 +- src/integrators/erpt/erpt.cpp | 46 +- src/integrators/erpt/erpt.h | 2 +- src/integrators/erpt/erpt_proc.cpp | 36 +- src/integrators/misc/adaptive.cpp | 44 +- src/integrators/misc/irrcache.cpp | 48 +- src/integrators/misc/irrcache_proc.cpp | 14 +- src/integrators/misc/irrcache_proc.h | 4 +- src/integrators/mlt/mlt.cpp | 82 +- src/integrators/mlt/mlt.h | 2 +- src/integrators/mlt/mlt_proc.cpp | 38 +- src/integrators/path/path.cpp | 62 +- src/integrators/path/volpath.cpp | 70 +- src/integrators/photonmapper/bre.cpp | 2 +- src/integrators/photonmapper/bre.h | 6 +- src/integrators/photonmapper/photonmapper.cpp | 82 +- src/integrators/photonmapper/ppm.cpp | 60 +- src/integrators/photonmapper/sppm.cpp | 54 +- src/integrators/pssmlt/pssmlt.cpp | 104 +- src/integrators/pssmlt/pssmlt_proc.cpp | 42 +- src/integrators/pssmlt/pssmlt_sampler.cpp | 6 +- src/integrators/pssmlt/pssmlt_sampler.h | 12 +- src/integrators/ptracer/ptracer.cpp | 42 +- src/integrators/ptracer/ptracer_proc.cpp | 30 +- src/integrators/ptracer/ptracer_proc.h | 22 +- src/integrators/vpl/vpl.cpp | 24 +- src/libbidir/common.cpp | 4 +- src/libbidir/edge.cpp | 56 +- src/libbidir/manifold.cpp | 56 +- src/libbidir/mut_bidir.cpp | 50 +- src/libbidir/mut_caustic.cpp | 46 +- src/libbidir/mut_lens.cpp | 32 +- src/libbidir/mut_manifold.cpp | 136 +- src/libbidir/mut_mchain.cpp | 44 +- src/libbidir/path.cpp | 64 +- src/libbidir/pathsampler.cpp | 96 +- src/libbidir/rsampler.cpp | 4 +- src/libbidir/util.cpp | 22 +- src/libbidir/verification.cpp | 10 +- src/libbidir/vertex.cpp | 114 +- src/libcore/appender.cpp | 6 +- src/libcore/bitmap.cpp | 146 +- src/libcore/brent.cpp | 10 +- src/libcore/chisquare.cpp | 12 +- src/libcore/class.cpp | 2 +- src/libcore/fmtconv.cpp | 134 +- src/libcore/formatter.cpp | 2 +- src/libcore/fresolver.cpp | 2 +- src/libcore/fstream.cpp | 38 +- src/libcore/lock.cpp | 6 +- src/libcore/logger.cpp | 14 +- src/libcore/mmap.cpp | 26 +- src/libcore/mstream.cpp | 6 +- src/libcore/object.cpp | 6 +- src/libcore/platform_darwin.mm | 6 +- src/libcore/platform_win32.cpp | 4 +- src/libcore/plugin.cpp | 6 +- src/libcore/properties.cpp | 18 +- src/libcore/qmc.cpp | 4216 ++++++++--------- src/libcore/quad.cpp | 106 +- src/libcore/random.cpp | 40 +- src/libcore/rfilter.cpp | 2 +- src/libcore/sched.cpp | 51 +- src/libcore/sched_remote.cpp | 34 +- src/libcore/serialization.cpp | 4 +- src/libcore/shvector.cpp | 26 +- src/libcore/spectrum.cpp | 34 +- src/libcore/ssemath.cpp | 36 +- src/libcore/sshstream.cpp | 12 +- src/libcore/sstream.cpp | 28 +- src/libcore/statistics.cpp | 14 +- src/libcore/stream.cpp | 12 +- src/libcore/thread.cpp | 8 +- src/libcore/timer.cpp | 2 +- src/libcore/tls.cpp | 22 +- src/libcore/transform.cpp | 28 +- src/libcore/triangle.cpp | 10 +- src/libcore/util.cpp | 66 +- src/libcore/vmf.cpp | 4 +- src/libcore/warp.cpp | 6 +- src/libcore/zstream.cpp | 2 +- src/libhw/basicshader.cpp | 30 +- src/libhw/data/shaders.h | 40 +- src/libhw/data/vera14_dsc.h | 368 +- src/libhw/data/vera14_png.h | 1490 +++--- src/libhw/data/veramono14_dsc.h | 268 +- src/libhw/data/veramono14_png.h | 1396 +++--- src/libhw/device.cpp | 4 +- src/libhw/font.cpp | 2 +- src/libhw/glgeometry.cpp | 8 +- src/libhw/glprogram.cpp | 14 +- src/libhw/glrenderer.cpp | 62 +- src/libhw/glsync.cpp | 2 +- src/libhw/gltexture.cpp | 96 +- src/libhw/glxdevice.cpp | 2 +- src/libhw/glxrenderer.cpp | 2 +- src/libhw/gpuprogram.cpp | 6 +- src/libhw/gputexture.cpp | 12 +- src/libhw/nsgldevice.mm | 14 +- src/libhw/nsglrenderer.mm | 2 +- src/libhw/nsglsession.mm | 6 +- src/libhw/renderer.cpp | 2 +- src/libhw/shadow.cpp | 18 +- src/libhw/viewer.cpp | 4 +- src/libhw/vpl.cpp | 62 +- src/libhw/wgldevice.cpp | 22 +- src/libhw/wglrenderer.cpp | 6 +- src/libhw/wglsession.cpp | 8 +- src/libhw/x11device.cpp | 8 +- src/libhw/x11session.cpp | 8 +- src/libpython/base.h | 4 +- src/libpython/core.cpp | 40 +- src/libpython/render.cpp | 2 +- src/librender/bsdf.cpp | 10 +- src/librender/emitter.cpp | 6 +- src/librender/film.cpp | 8 +- src/librender/gatherproc.cpp | 20 +- src/librender/imageblock.cpp | 10 +- src/librender/imageproc.cpp | 4 +- src/librender/integrator.cpp | 26 +- src/librender/intersection.cpp | 4 +- src/librender/irrcache.cpp | 32 +- src/librender/medium.cpp | 4 +- src/librender/noise.cpp | 44 +- src/librender/particleproc.cpp | 46 +- src/librender/phase.cpp | 6 +- src/librender/photon.cpp | 8 +- src/librender/photonmap.cpp | 18 +- src/librender/rectwu.cpp | 4 +- src/librender/renderjob.cpp | 16 +- src/librender/renderproc.cpp | 12 +- src/librender/renderqueue.cpp | 8 +- src/librender/sampler.cpp | 8 +- src/librender/scene.cpp | 102 +- src/librender/scenehandler.cpp | 28 +- src/librender/sensor.cpp | 22 +- src/librender/shader.cpp | 6 +- src/librender/shape.cpp | 22 +- src/librender/skdtree.cpp | 48 +- src/librender/subsurface.cpp | 2 +- src/librender/texture.cpp | 8 +- src/librender/track.cpp | 26 +- src/librender/trimesh.cpp | 108 +- src/librender/vpl.cpp | 8 +- src/medium/heterogeneous.cpp | 120 +- src/medium/homogeneous.cpp | 38 +- src/medium/materials.h | 4 +- src/medium/maxexp.h | 22 +- src/mitsuba/mitsuba.cpp | 26 +- src/mitsuba/mtssrv.cpp | 20 +- src/mitsuba/mtsutil.cpp | 6 +- src/mtsgui/aboutdlg.cpp | 4 +- src/mtsgui/addserverdlg.cpp | 6 +- src/mtsgui/breakpad.mm | 2 +- src/mtsgui/common.h | 12 +- src/mtsgui/glwidget.cpp | 98 +- src/mtsgui/glwidget.h | 8 +- src/mtsgui/importdlg.cpp | 4 +- src/mtsgui/loaddlg.cpp | 12 +- src/mtsgui/logwidget.cpp | 10 +- src/mtsgui/logwidget.h | 8 +- src/mtsgui/main.cpp | 24 +- src/mtsgui/mainwindow.cpp | 128 +- src/mtsgui/mainwindow.h | 8 +- src/mtsgui/preview.cpp | 52 +- src/mtsgui/preview.h | 6 +- src/mtsgui/previewsettingsdlg.cpp | 8 +- src/mtsgui/previewsettingsdlg.h | 2 +- src/mtsgui/previewsettingsdlg_cocoa.h | 2 +- src/mtsgui/previewsettingsdlg_cocoa_impl.mm | 4 +- src/mtsgui/programsettingsdlg.cpp | 4 +- src/mtsgui/programsettingsdlg.h | 14 +- src/mtsgui/rendersettingsdlg.cpp | 40 +- src/mtsgui/save.cpp | 20 +- src/mtsgui/sceneimporter.cpp | 6 +- src/mtsgui/sceneimporter.h | 2 +- src/mtsgui/sceneloader.cpp | 4 +- src/mtsgui/sceneloader.h | 6 +- src/mtsgui/server.cpp | 28 +- src/mtsgui/server.h | 4 +- src/mtsgui/simdtonemap.cpp | 10 +- src/mtsgui/simdtonemap.h | 2 +- src/mtsgui/symlinks_auth.cpp | 4 +- src/mtsgui/tabbar.cpp | 2 +- src/mtsgui/test_simdtonemap.cpp | 18 +- src/mtsgui/updatedlg.cpp | 8 +- src/mtsgui/upgrade.cpp | 22 +- src/mtsgui/xmltreemodel.cpp | 18 +- src/mtsgui/xmltreemodel.h | 4 +- src/phase/hg.cpp | 16 +- src/phase/isotropic.cpp | 12 +- src/phase/kkay.cpp | 12 +- src/phase/microflake.cpp | 18 +- src/phase/microflake_fiber.h | 18 +- src/phase/mixturephase.cpp | 14 +- src/phase/rayleigh.cpp | 6 +- src/rfilters/box.cpp | 12 +- src/rfilters/catmullrom.cpp | 8 +- src/rfilters/gaussian.cpp | 10 +- src/rfilters/lanczos.cpp | 14 +- src/rfilters/mitchell.cpp | 12 +- src/rfilters/tent.cpp | 8 +- src/samplers/faure.cpp | 6 +- src/samplers/faure.h | 8 +- src/samplers/halton.cpp | 66 +- src/samplers/hammersley.cpp | 46 +- src/samplers/independent.cpp | 14 +- src/samplers/ldsampler.cpp | 40 +- src/samplers/sobol.cpp | 46 +- src/samplers/stratified.cpp | 24 +- src/sensors/fluencemeter.cpp | 8 +- src/sensors/irradiancemeter.cpp | 22 +- src/sensors/orthographic.cpp | 26 +- src/sensors/perspective.cpp | 68 +- src/sensors/radiancemeter.cpp | 12 +- src/sensors/spherical.cpp | 6 +- src/sensors/telecentric.cpp | 46 +- src/sensors/thinlens.cpp | 78 +- src/shapes/animatedinstance.cpp | 14 +- src/shapes/cylinder.cpp | 36 +- src/shapes/disk.cpp | 8 +- src/shapes/hair.cpp | 110 +- src/shapes/hair.h | 18 +- src/shapes/instance.cpp | 14 +- src/shapes/instance.h | 10 +- src/shapes/obj.cpp | 72 +- src/shapes/ply.cpp | 100 +- src/shapes/rectangle.cpp | 14 +- src/shapes/serialized.cpp | 32 +- src/shapes/shapegroup.cpp | 12 +- src/shapes/shapegroup.h | 6 +- src/shapes/sphere.cpp | 46 +- src/subsurface/bluenoise.cpp | 10 +- src/subsurface/bluenoise.h | 6 +- src/subsurface/dipole.cpp | 84 +- src/subsurface/irrproc.cpp | 10 +- src/subsurface/irrproc.h | 12 +- src/subsurface/irrtree.cpp | 2 +- src/subsurface/irrtree.h | 4 +- src/tests/test_chisquare.cpp | 66 +- src/tests/test_dgeom.cpp | 18 +- src/tests/test_kd.cpp | 14 +- src/tests/test_la.cpp | 8 +- src/tests/test_quad.cpp | 4 +- src/tests/test_random.cpp | 19 +- src/tests/test_rtrans.cpp | 16 +- src/tests/test_samplers.cpp | 2 +- src/tests/test_sh.cpp | 2 +- src/tests/test_spectrum.cpp | 8 +- src/textures/bitmap.cpp | 94 +- src/textures/checkerboard.cpp | 20 +- src/textures/curvature.cpp | 8 +- src/textures/gridtexture.cpp | 16 +- src/textures/scale.cpp | 8 +- src/textures/vertexcolors.cpp | 10 +- src/textures/wireframe.cpp | 14 +- src/utils/addimages.cpp | 10 +- src/utils/cylclip.cpp | 14 +- src/utils/kdbench.cpp | 24 +- src/utils/rdielprec.cpp | 12 +- src/utils/tonemap.cpp | 36 +- src/volume/constvolume.cpp | 6 +- src/volume/gridvolume.cpp | 56 +- src/volume/hgridvolume.cpp | 12 +- src/volume/volcache.cpp | 36 +- 461 files changed, 11128 insertions(+), 11132 deletions(-) diff --git a/include/mitsuba/bidir/common.h b/include/mitsuba/bidir/common.h index 526bbf3c..46e101ea 100644 --- a/include/mitsuba/bidir/common.h +++ b/include/mitsuba/bidir/common.h @@ -30,17 +30,17 @@ MTS_NAMESPACE_BEGIN #if MTS_BD_DEBUG == 1 #define BDAssert(expr) SAssert(expr) #else -#define BDAssert(expr) +#define BDAssert(expr) #endif #define MAX(a, b) ((a) > (b) ? (a) : (b)) /** - * \brief Data record associated with path endpoints (aka supernodes) + * \brief Data record associated with path endpoints (aka supernodes) * in the path-space framework * - * This record stores the desired time value when starting a new path. - * For sensor subpaths, it optionally specifies the desired pixel + * This record stores the desired time value when starting a new path. + * For sensor subpaths, it optionally specifies the desired pixel * position of the path. * * \ingroup libbidir @@ -50,10 +50,10 @@ struct EndpointRecord { Float time; /// Create a new endpoint record for a given time value - inline EndpointRecord(Float time) + inline EndpointRecord(Float time) : time(time) { } - /// Create a new endpoint record for a given time value + /// Create a new endpoint record for a given time value inline EndpointRecord(Float time, const Point2 &uv) : time(time) { } diff --git a/include/mitsuba/bidir/edge.h b/include/mitsuba/bidir/edge.h index a705ae1f..1d77c097 100644 --- a/include/mitsuba/bidir/edge.h +++ b/include/mitsuba/bidir/edge.h @@ -27,10 +27,10 @@ MTS_NAMESPACE_BEGIN /** * \brief Bidirectional path edge data structure * - * The path edge data structure is responsible for representing the transport of + * The path edge data structure is responsible for representing the transport of * light between pairs of scattering or emission events. - * Amongst other things, it keeps track of the medium that fills the space between - * adjacent vertices of a \ref Path. Furthermore, it can be used to evaluate and + * Amongst other things, it keeps track of the medium that fills the space between + * adjacent vertices of a \ref Path. Furthermore, it can be used to evaluate and * sample the visibility and transmittance functions of the scene. * * Although they do not correspond to any real transport, this implementation @@ -45,7 +45,7 @@ MTS_NAMESPACE_BEGIN */ struct MTS_EXPORT_BIDIR PathEdge { /* ==================================================================== */ - //! @{ \name Enumerations and Fields + //! @{ \name Enumerations and Fields /* ==================================================================== */ /// Pointer to the medium that contains this edge (where \c NULL is vacuum) @@ -59,7 +59,7 @@ struct MTS_EXPORT_BIDIR PathEdge { /** * \brief Length of this edge in world-space distance units * - * Note that edges adjacent to supernodes have length zero to + * Note that edges adjacent to supernodes have length zero to * mark them as such. */ Float length; @@ -84,14 +84,14 @@ struct MTS_EXPORT_BIDIR PathEdge { /** * \brief Medium sampling density of the adjacent vertices * - * This field stores the probability of sampling the preceding and + * This field stores the probability of sampling the preceding and * successive path vertices using the sampling technique implemented by * the function \ref PathEdge::sampleNext(). Depending on whether or not * they are medium interactions, this eintries either store a density per * unit length or a discrete probability. */ Float pdf[ETransportModes]; - + //! @} /* ==================================================================== */ @@ -100,7 +100,7 @@ struct MTS_EXPORT_BIDIR PathEdge { /* ==================================================================== */ /** - * \brief Given a ray \c ray, sample a distance in this direction and + * \brief Given a ray \c ray, sample a distance in this direction and * fill the edge data structure, as well as its target vertex with content. * * \param scene @@ -114,24 +114,24 @@ struct MTS_EXPORT_BIDIR PathEdge { * endpoint of the edge. The sampling routine will then determine * the other endpoint. * \param succ - * Pointer to an unused vertex data structure, which will be filled - * with information about the successor vertex + * Pointer to an unused vertex data structure, which will be filled + * with information about the successor vertex * \param mode * Specifies whether radiance or importance is being transported * \return \c true on success */ - bool sampleNext(const Scene *scene, Sampler *sampler, + bool sampleNext(const Scene *scene, Sampler *sampler, const PathVertex *pred, const Ray &ray, PathVertex *next, ETransportMode mode); /** * \brief Create a perturbed successor vertex and edge * - * This function behaves similar to \ref sampleNext() in that it - * generates a successor edge and vertex. + * This function behaves similar to \ref sampleNext() in that it + * generates a successor edge and vertex. * - * The main difference is that the desired direction, distance, and - * type of the successor vertex are all specified, which makes the + * The main difference is that the desired direction, distance, and + * type of the successor vertex are all specified, which makes the * sampling process completely deterministic. This is useful for * implementing path-space perturbation strategies. * @@ -147,15 +147,15 @@ struct MTS_EXPORT_BIDIR PathEdge { * Specifies the desired distance between the current vertex and \c succ * (this only applies when desiredType=EMediumInteraction) * \param desiredType - * Specifies the desired vertex type of \c succ. + * Specifies the desired vertex type of \c succ. * \param succ - * Pointer to an unused vertex data structure, which will be filled - * with information about the successor vertex + * Pointer to an unused vertex data structure, which will be filled + * with information about the successor vertex * \param mode * Specifies whether radiance or importance is being transported * \return \c true on success */ - bool perturbDirection(const Scene *scene, const PathVertex *pred, + bool perturbDirection(const Scene *scene, const PathVertex *pred, const Ray &ray, Float dist, PathVertex::EVertexType desiredType, PathVertex *next, ETransportMode mode); @@ -187,7 +187,7 @@ struct MTS_EXPORT_BIDIR PathEdge { * * This function computes the product of certain terms that are cached * in this edge and its adjacent vertices. The \c what parameter specifies - * the terms to be included; it must be a combination of the flags + * the terms to be included; it must be a combination of the flags * in the enumeration \ref ECachedValues. * * \remark This function assumes that \c pred and \c succ are the @@ -199,28 +199,28 @@ struct MTS_EXPORT_BIDIR PathEdge { * \param succ * The successor vertex of this edge */ - Spectrum evalCached(const PathVertex *pred, const PathVertex *succ, + Spectrum evalCached(const PathVertex *pred, const PathVertex *succ, unsigned int what) const; /** * \brief Compute the density of a successor node * - * This function computes the hypothetical transport-related sampling density - * of a given successor node conditioned on a specified predecessor when - * using the sampling technique implemented by \ref sampleNext(). Depending - * on whether or not the successor node is a medium interaction, the returned + * This function computes the hypothetical transport-related sampling density + * of a given successor node conditioned on a specified predecessor when + * using the sampling technique implemented by \ref sampleNext(). Depending + * on whether or not the successor node is a medium interaction, the returned * value is either a density per unit length or a discrete probability. * - * Note: this function only computes terms associated with the transport - * between vertices -- to account for the vertices themselves, + * Note: this function only computes terms associated with the transport + * between vertices -- to account for the vertices themselves, * refer to \ref PathEdge::evalPdf. * * \param scene * Pointer to the underlying scene * \param pred - * Pointer to the preceding vertex + * Pointer to the preceding vertex * \param succ - * Pointer to the successor vertex + * Pointer to the successor vertex * * \return The computed probability density */ @@ -234,9 +234,9 @@ struct MTS_EXPORT_BIDIR PathEdge { * transmittance between an arbitrary pair of nodes, \c pred and \c succ. * * \param pred - * Pointer to the preceding vertex + * Pointer to the preceding vertex * \param succ - * Pointer to the successor vertex + * Pointer to the successor vertex * * \return A spectrally varying transmittance value */ @@ -246,9 +246,9 @@ struct MTS_EXPORT_BIDIR PathEdge { * \brief Return the transmittance value associated with this edge * * \param pred - * Pointer to the preceding vertex + * Pointer to the preceding vertex * \param succ - * Pointer to the successor vertex + * Pointer to the successor vertex * * \return A spectrally varying transmittance value */ @@ -259,13 +259,13 @@ struct MTS_EXPORT_BIDIR PathEdge { * term over an edge */ Float evalCosine(const PathVertex *pred, const PathVertex *succ, const PathVertex *base) const; - + //! @} /* ==================================================================== */ /* ==================================================================== */ - //! @{ \name Miscellaneous + //! @{ \name Miscellaneous /* ==================================================================== */ /** @@ -274,7 +274,7 @@ struct MTS_EXPORT_BIDIR PathEdge { * * This function re-evaluates a series of quantities associated with * this edge and compares them to locally cached values. - * If any mismatch is found, the function sends debug output to a + * If any mismatch is found, the function sends debug output to a * specified output stream and returns \c false. * * \param scene @@ -288,7 +288,7 @@ struct MTS_EXPORT_BIDIR PathEdge { * \param os * Target output stream for error messages */ - bool verify(const Scene *scene, const PathVertex *adjL, + bool verify(const Scene *scene, const PathVertex *adjL, const PathVertex *adjE, ETransportMode mode, std::ostream &os) const; /** @@ -315,19 +315,19 @@ struct MTS_EXPORT_BIDIR PathEdge { * throughput or an inconsistency has been detected. */ bool connect(const Scene *scene, const PathEdge *predEdge, - const PathVertex *vs, const PathVertex *vt, + const PathVertex *vs, const PathVertex *vt, const PathEdge *succEdge); /** * \brief Create a connection path between two vertices * - * This function is conceptually similar to \ref connect(). - * However, instead of a single edge, it potentially generates + * This function is conceptually similar to \ref connect(). + * However, instead of a single edge, it potentially generates * an entire connection path, where intermediate vertices are - * either index-matched medium transitions or other surface + * either index-matched medium transitions or other surface * scattering events of type \ref BSDF::ENull. * - * This is important to support efficient direct illumination sampling + * This is important to support efficient direct illumination sampling * through such surfaces (e.g. a heterogeneous medium or a leaf with * textured alpha transparency). * @@ -364,22 +364,22 @@ struct MTS_EXPORT_BIDIR PathEdge { * collapse it into a single edge that summarizes its properties * * This function can be thought of as being half-way in between - * \c connect() and \c pathConnect(). Like \c pathConnect(), it + * \c connect() and \c pathConnect(). Like \c pathConnect(), it * potentially generates an entire connection path between the * specified endpoints, where intermediate vertices are - * either index-matched medium transitions or other surface + * either index-matched medium transitions or other surface * scattering events of type \ref BSDF::ENull. * - * This is important to support efficient direct illumination sampling + * This is important to support efficient direct illumination sampling * through such surfaces (e.g. a heterogeneous medium or a leaf with * textured alpha transparency). * * However, this variant does not return the intermediate vertices * and edges -- instead, everything is collapsed into a single * edge that captures the aggregate weight and probability densities. - * - * This function is used by bidirectional path tracing, since it creates - * connections through index-matched boundaries but does not require + * + * This function is used by bidirectional path tracing, since it creates + * connections through index-matched boundaries but does not require * explicit knowledge about the associated path vertices. * * \param scene @@ -394,7 +394,7 @@ struct MTS_EXPORT_BIDIR PathEdge { * \param succEdge * Pointer to an edge between \c vt and its successor * (which is not needed by this function) - * \param interactions + * \param interactions * Specifies the maximum permissible number of index-matched medium * transitions or \ref BSDF::ENull scattering events on the way * to the light source. (interactions<0 means arbitrarily many). @@ -404,8 +404,8 @@ struct MTS_EXPORT_BIDIR PathEdge { * \return \c true upon success, \c false when there is no * throughput or an inconsistency has been detected. */ - bool pathConnectAndCollapse(const Scene *scene, const PathEdge *predEdge, - const PathVertex *vs, const PathVertex *vt, + bool pathConnectAndCollapse(const Scene *scene, const PathEdge *predEdge, + const PathVertex *vs, const PathVertex *vt, const PathEdge *succEdge, int &interactions); /// Create a deep copy of this edge @@ -413,7 +413,7 @@ struct MTS_EXPORT_BIDIR PathEdge { /// Compare this edge against another edge bool operator==(const PathEdge &edge) const; - + /// Compare this edge against another edge inline bool operator!=(const PathEdge &edge) const { return !operator==(edge); @@ -421,7 +421,7 @@ struct MTS_EXPORT_BIDIR PathEdge { /// Return a string representation of the information stored in this vertex std::string toString() const; - + //! @} /* ==================================================================== */ }; diff --git a/include/mitsuba/bidir/geodist2.h b/include/mitsuba/bidir/geodist2.h index d3cf9938..4ea7a59d 100644 --- a/include/mitsuba/bidir/geodist2.h +++ b/include/mitsuba/bidir/geodist2.h @@ -27,7 +27,7 @@ MTS_NAMESPACE_BEGIN /** * \brief Clamped two-tailed geometric distribution * - * This class implements a specialized clamped two-tailed geometric + * This class implements a specialized clamped two-tailed geometric * distribution with support for sample generation and evaluation * of the probability mass and cumulative distribution functions. * @@ -42,10 +42,10 @@ MTS_NAMESPACE_BEGIN * * where \f$b\in\mathbb{R}\f$ is the base parameter of the distribution, * \f$[l,r]\subseteq\mathbb{Z}\f$ denotes the domain of the probability - * mass function, \f$o\in\mathbb{Z}\f$ is offset, and \f$c\f$ is a suitably - * chosen normalization constant. + * mass function, \f$o\in\mathbb{Z}\f$ is offset, and \f$c\f$ is a suitably + * chosen normalization constant. * - * This function is used to propose bidirectional mutations; see the + * This function is used to propose bidirectional mutations; see the * MLT writeup for details. * * \author Wenzel Jakob @@ -90,9 +90,9 @@ public: return (R(i) - m_offset) / m_normalization; } - /// Draw a position according to the probability mass function + /// Draw a position according to the probability mass function inline int sample(Float xi) const { - return std::max(m_start, + return std::max(m_start, Rinv(xi * m_normalization + m_offset)) + m_center; } diff --git a/include/mitsuba/bidir/manifold.h b/include/mitsuba/bidir/manifold.h index a5b703d7..00a1f19d 100644 --- a/include/mitsuba/bidir/manifold.h +++ b/include/mitsuba/bidir/manifold.h @@ -38,14 +38,14 @@ public: SpecularManifold(const Scene *scene, int maxIterations = -1); /** - * \brief Initialize the specular manifold with the specified + * \brief Initialize the specular manifold with the specified * path segment */ bool init(const Path &path, int start, int end); /** * \brief Update the provided path segment based on the stored - * specular manifold configuration + * specular manifold configuration */ bool update(Path &path, int start, int end); @@ -98,7 +98,7 @@ private: /* Position and partials */ Point p; Vector dpdu, dpdv; - + /* Normal and partials */ Normal n, gn; Vector dndu, dndv; @@ -109,7 +109,7 @@ private: /* Further information about the vertex */ Float eta; const Object *object; - + /* Scratch space for matrix assembly */ Matrix2x2 a, b, c, u; @@ -118,8 +118,8 @@ private: /// Initialize certain fields to zero by default inline SimpleVertex(EType type, const Point &p) : - degenerate(false), type(type), p(p), dpdu(0.0f), - dpdv(0.0f), n(0.0f), dndu(0.0f), dndv(0.0f), + degenerate(false), type(type), p(p), dpdu(0.0f), + dpdv(0.0f), n(0.0f), dndu(0.0f), dndv(0.0f), m(0.0f), eta(1.0f), object(NULL) { } /// Map a tangent space displacement into world space diff --git a/include/mitsuba/bidir/mempool.h b/include/mitsuba/bidir/mempool.h index d3fae243..3e6ed814 100644 --- a/include/mitsuba/bidir/mempool.h +++ b/include/mitsuba/bidir/mempool.h @@ -29,7 +29,7 @@ MTS_NAMESPACE_BEGIN class MemoryPool { public: /// Create a new memory pool with aninitial set of 128 entries - MemoryPool(size_t nEntries = 128) + MemoryPool(size_t nEntries = 128) : m_vertexPool(nEntries), m_edgePool(nEntries) { } /// Destruct the memory pool and release all entries @@ -72,7 +72,7 @@ public: inline size_t edgeSize() { return m_edgePool.size(); } - + /// Return the currently allocated amount of storage for vertices inline size_t vertexSize() { return m_vertexPool.size(); diff --git a/include/mitsuba/bidir/mut_bidir.h b/include/mitsuba/bidir/mut_bidir.h index b6ada1fe..4450225d 100644 --- a/include/mitsuba/bidir/mut_bidir.h +++ b/include/mitsuba/bidir/mut_bidir.h @@ -27,8 +27,8 @@ MTS_NAMESPACE_BEGIN /** * \brief Bidirectional mutatation strategy * - * This class implements a slightly extended version of the bidirectional - * mutation proposed by Veach. The main change is that it builds on top of + * This class implements a slightly extended version of the bidirectional + * mutation proposed by Veach. The main change is that it builds on top of * a two-tailed geometric distribution that is used to sample path * configuration proposals in a more flexible manner. * @@ -50,11 +50,11 @@ public: * A memory pool used to allocate new path vertices and edges * * \param kmin - * Minimum number of edges in newly proposed paths. This can + * Minimum number of edges in newly proposed paths. This can * be used to exclude direct illumination. * * \param kmax - * Minimum number of edges in newly proposed paths. + * Minimum number of edges in newly proposed paths. */ BidirectionalMutator(const Scene *scene, Sampler *sampler, MemoryPool &pool, int kmin, int kmax); @@ -75,7 +75,7 @@ public: MTS_DECLARE_CLASS() protected: /** - * \brief Compute the probability mass associated with one + * \brief Compute the probability mass associated with one * of the internally implemented mutation strategies */ Float pmfMutation(const Path &source, const MutationRecord &muRec) const; diff --git a/include/mitsuba/bidir/mut_caustic.h b/include/mitsuba/bidir/mut_caustic.h index 40cb1339..4b0e277f 100644 --- a/include/mitsuba/bidir/mut_caustic.h +++ b/include/mitsuba/bidir/mut_caustic.h @@ -51,7 +51,7 @@ public: * Minimum jump distance in fractional pixel coordinates * * \param coveredArea - * Approximate fractional image plane area that is + * Approximate fractional image plane area that is * reachable using the caustic perturbation */ CausticPerturbation(const Scene *scene, Sampler *sampler, @@ -62,9 +62,9 @@ public: EMutationType getType() const; Float suitability(const Path &path) const; - bool sampleMutation(Path &source, Path &proposal, + bool sampleMutation(Path &source, Path &proposal, MutationRecord &muRec); - Float Q(const Path &source, const Path &proposal, + Float Q(const Path &source, const Path &proposal, const MutationRecord &muRec) const; void accept(const MutationRecord &muRec); diff --git a/include/mitsuba/bidir/mut_lens.h b/include/mitsuba/bidir/mut_lens.h index 38fc33a5..cec00727 100644 --- a/include/mitsuba/bidir/mut_lens.h +++ b/include/mitsuba/bidir/mut_lens.h @@ -51,7 +51,7 @@ public: * Minimum jump distance in fractional pixel coordinates * * \param coveredArea - * Approximate fractional image plane area that is + * Approximate fractional image plane area that is * reachable using the lens perturbation */ LensPerturbation(const Scene *scene, Sampler *sampler, @@ -62,9 +62,9 @@ public: EMutationType getType() const; Float suitability(const Path &path) const; - bool sampleMutation(Path &source, Path &proposal, + bool sampleMutation(Path &source, Path &proposal, MutationRecord &muRec); - Float Q(const Path &source, const Path &proposal, + Float Q(const Path &source, const Path &proposal, const MutationRecord &muRec) const; void accept(const MutationRecord &muRec); diff --git a/include/mitsuba/bidir/mut_manifold.h b/include/mitsuba/bidir/mut_manifold.h index 045094f2..fa89e997 100644 --- a/include/mitsuba/bidir/mut_manifold.h +++ b/include/mitsuba/bidir/mut_manifold.h @@ -48,7 +48,7 @@ public: * A memory pool used to allocate new path vertices and edges */ ManifoldPerturbation(const Scene *scene, Sampler *sampler, - MemoryPool &pool, + MemoryPool &pool, Float probFactor, bool enableOffsetManifolds, bool enableSpecularMedia, @@ -60,9 +60,9 @@ public: EMutationType getType() const; Float suitability(const Path &path) const; - bool sampleMutation(Path &source, Path &proposal, + bool sampleMutation(Path &source, Path &proposal, MutationRecord &muRec); - Float Q(const Path &source, const Path &proposal, + Float Q(const Path &source, const Path &proposal, const MutationRecord &muRec) const; void accept(const MutationRecord &muRec); @@ -75,7 +75,7 @@ protected: virtual ~ManifoldPerturbation(); /// Helper function for choosing mutation strategies - bool sampleMutationRecord(const Path &source, + bool sampleMutationRecord(const Path &source, int &a, int &b, int &c, int &step); Float nonspecularProbSurface(Float alpha) const; diff --git a/include/mitsuba/bidir/mut_mchain.h b/include/mitsuba/bidir/mut_mchain.h index bb4af638..d8e68c5e 100644 --- a/include/mitsuba/bidir/mut_mchain.h +++ b/include/mitsuba/bidir/mut_mchain.h @@ -51,7 +51,7 @@ public: * Minimum jump distance in fractional pixel coordinates * * \param coveredArea - * Approximate fractional image plane area that is + * Approximate fractional image plane area that is * reachable using the lens perturbation */ MultiChainPerturbation(const Scene *scene, Sampler *sampler, @@ -62,9 +62,9 @@ public: EMutationType getType() const; Float suitability(const Path &path) const; - bool sampleMutation(Path &source, Path &proposal, + bool sampleMutation(Path &source, Path &proposal, MutationRecord &muRec); - Float Q(const Path &source, const Path &proposal, + Float Q(const Path &source, const Path &proposal, const MutationRecord &muRec) const; void accept(const MutationRecord &muRec); diff --git a/include/mitsuba/bidir/mutator.h b/include/mitsuba/bidir/mutator.h index 459957ec..ee28e3e3 100644 --- a/include/mitsuba/bidir/mutator.h +++ b/include/mitsuba/bidir/mutator.h @@ -60,21 +60,21 @@ public: * * \param proposal * Path data structure to be filled with the proposed mutated path - * - * \param muRec + * + * \param muRec * Data record that describes the sampled mutation strategy * - * \return \a true upon success. When the sampling step is - * unsuccessful (this could happen due to various + * \return \a true upon success. When the sampling step is + * unsuccessful (this could happen due to various * reasons), the function returns false. */ - virtual bool sampleMutation(Path &source, Path &proposal, + virtual bool sampleMutation(Path &source, Path &proposal, MutationRecord &muRec) = 0; /** * \brief For a pair of paths, this function computes the inverse - * transition probability (matching the Q term in [Veach 97]) + * transition probability (matching the Q term in [Veach 97]) * * \param source * A path data structure containing the original path @@ -82,7 +82,7 @@ public: * \param proposal * A path data structure containing the proposed mutated path * - * \param muRec + * \param muRec * Data record that describes the mutation strategy, which * transformed \c source to \c proposal. */ @@ -117,8 +117,8 @@ struct MTS_EXPORT_BIDIR MutationRecord { int extra[5]; inline MutationRecord() { } - inline MutationRecord(Mutator::EMutationType type, int l, - int m, int ka, const Spectrum &weight) + inline MutationRecord(Mutator::EMutationType type, int l, + int m, int ka, const Spectrum &weight) : type(type), l(l), m(m), ka(ka), weight(weight) { } MutationRecord reverse() const { diff --git a/include/mitsuba/bidir/path.h b/include/mitsuba/bidir/path.h index 7fc76879..d676f2d3 100644 --- a/include/mitsuba/bidir/path.h +++ b/include/mitsuba/bidir/path.h @@ -29,14 +29,14 @@ MTS_NAMESPACE_BEGIN /** * \brief Bidirectional path data structure * - * In the path-space light transport framework, a path is represented as a - * linear sequence of interactions (expressed using vertices) and transport + * In the path-space light transport framework, a path is represented as a + * linear sequence of interactions (expressed using vertices) and transport * (expressed using edges). * * The \ref Path data structure is responsible for the storage of this - * information. It also contains useful utility functions, for instance + * information. It also contains useful utility functions, for instance * to perform a random walk, or to splice and connect path segments. - * + * * \sa PathVertex * \sa PathEdge * @@ -51,13 +51,13 @@ public: /* ==================================================================== */ //! @{ \name Path construction /* ==================================================================== */ - + /// Create a new, empty path inline Path() { } /// Create a new path of the specified size inline Path(size_t size) : m_vertices(size) { } - + /// Copy constructor inline Path(const Path &path) : m_vertices(path.m_vertices), m_edges(path.m_edges) { } @@ -65,7 +65,7 @@ public: /** * \brief Initialize the path with an endpoint vertex * - * This function clears the path and initializes it with a single + * This function clears the path and initializes it with a single * endpoint vertex of the type implied by the \c mode parameter. * * \param scene @@ -78,7 +78,7 @@ public: * Reference to a memory pool that will be used to release * and allocate edges and vertices. */ - void initialize(const Scene *scene, Float time, + void initialize(const Scene *scene, Float time, ETransportMode mode, MemoryPool &pool); /** @@ -92,16 +92,16 @@ public: * Desired number of random walk steps (-1=infinite) * \param rrStart * Depth to start using russian roulette - * (-1=never, 0=starting at the first + * (-1=never, 0=starting at the first * bounce, and so on) * \param mode * Denotes whether radiance or importance are being transported * \param pool - * Reference to a memory pool that will be used to allocate + * Reference to a memory pool that will be used to allocate * edges and vertices. * \return The number of successful steps performed by the random walk. */ - int randomWalk(const Scene *scene, Sampler *sampler, + int randomWalk(const Scene *scene, Sampler *sampler, int nSteps, int rrStart, ETransportMode mode, MemoryPool &pool); @@ -120,21 +120,21 @@ public: * sensor subpath * \param rrStart * Depth to start using russian roulette - * (-1=never, 0=starting at the first + * (-1=never, 0=starting at the first * bounce, and so on) * \param pool - * Reference to a memory pool that will be used to allocate + * Reference to a memory pool that will be used to allocate * edges and vertices. * \return The number of successful steps performed by the random walk. */ - int randomWalkFromPixel(const Scene *scene, Sampler *sampler, - int nSteps, const Point2i &pixelPosition, int rrStart, + int randomWalkFromPixel(const Scene *scene, Sampler *sampler, + int nSteps, const Point2i &pixelPosition, int rrStart, MemoryPool &pool); /** * \brief Perform two random walks on an emitter and sensor subpath * - * This function is almost identical to calling \ref randomWalk() twice + * This function is almost identical to calling \ref randomWalk() twice * in sequence. The main difference is that it performs the random * walk steps in a staggered order (i.e. one step on the emitter subpath, * one step on the sensor subpath, and so on..), which is important for @@ -163,25 +163,25 @@ public: * sensor subpath * \param rrStart * Depth to start using russian roulette - * (-1=never, 0=starting at the first + * (-1=never, 0=starting at the first * bounce, and so on) * \param pool - * Reference to a memory pool that will be used to allocate + * Reference to a memory pool that will be used to allocate * edges and vertices. * \return The number of successful steps performed by the random walk * on the emitter and sensor subpath, respectively. */ - static std::pair alternatingRandomWalkFromPixel(const Scene *scene, - Sampler *sampler, Path &emitterPath, int nEmitterSteps, + static std::pair alternatingRandomWalkFromPixel(const Scene *scene, + Sampler *sampler, Path &emitterPath, int nEmitterSteps, Path &sensorPath, int nSensorSteps, const Point2i &pixelPosition, int rrStart, MemoryPool &pool); /** - * \brief Verify the cached values stored in this path + * \brief Verify the cached values stored in this path * * This function re-evaluates a series of quantities associated with * each vertex and edge and compares them to locally cached values. - * If any mismatch is found, the function sends debug output to a + * If any mismatch is found, the function sends debug output to a * specified output stream and returns \c false. * * \param scene @@ -203,7 +203,7 @@ public: /** * \brief Return the number of vertices stored in this path * - * For a nonempty path, the number of vertices is always equal + * For a nonempty path, the number of vertices is always equal * To \ref edgeCount()+1. */ inline size_t vertexCount() const { @@ -213,7 +213,7 @@ public: /** * \brief Return the number of edges stored in this path * - * For a nonempty path, the number of vertices is always equal + * For a nonempty path, the number of vertices is always equal * To \ref vertexCount()-1. */ inline size_t edgeCount() const { @@ -231,9 +231,9 @@ public: /// Return an vertex by its index inline PathVertexPtr &vertex(size_t index) { #if MTS_BD_DEBUG == 1 - if (index >= m_vertices.size()) + if (index >= m_vertices.size()) SLog(EError, "Path vertex index " SIZE_T_FMT - " is out of bounds, array size: " SIZE_T_FMT, + " is out of bounds, array size: " SIZE_T_FMT, index, m_vertices.size()); #endif return m_vertices[index]; @@ -242,9 +242,9 @@ public: /// Return an vertex by its index (const version) inline const PathVertexPtr &vertex(size_t index) const { #if MTS_BD_DEBUG == 1 - if (index >= m_vertices.size()) + if (index >= m_vertices.size()) SLog(EError, "Path vertex index " SIZE_T_FMT - " is out of bounds, array size: " SIZE_T_FMT, + " is out of bounds, array size: " SIZE_T_FMT, index, m_vertices.size()); #endif return m_vertices[index]; @@ -252,7 +252,7 @@ public: /// Return an vertex by its index (or NULL if out of bounds) inline PathVertexPtr vertexOrNull(size_t index) { - if (index >= m_vertices.size()) + if (index >= m_vertices.size()) return NULL; return m_vertices[index]; } @@ -267,9 +267,9 @@ public: /// Return an edge by its index inline PathEdgePtr &edge(size_t index) { #if MTS_BD_DEBUG == 1 - if (index >= m_edges.size()) + if (index >= m_edges.size()) SLog(EError, "Path edge index " SIZE_T_FMT - " is out of bounds, array size: " SIZE_T_FMT, + " is out of bounds, array size: " SIZE_T_FMT, index, m_edges.size()); #endif return m_edges[index]; @@ -278,9 +278,9 @@ public: /// Return an edge by its index (const version) inline const PathEdgePtr &edge(size_t index) const { #if MTS_BD_DEBUG == 1 - if (index >= m_edges.size()) + if (index >= m_edges.size()) SLog(EError, "Path edge index " SIZE_T_FMT - " is out of bounds, array size: " SIZE_T_FMT, + " is out of bounds, array size: " SIZE_T_FMT, index, m_edges.size()); #endif return m_edges[index]; @@ -288,24 +288,24 @@ public: /// Return an edge by its index (or \c NULL if out of bounds) inline PathEdgePtr edgeOrNull(size_t index) { - if (index >= m_edges.size()) + if (index >= m_edges.size()) return NULL; return m_edges[index]; } /// Return an edge by its index (or \c NULL if out of bounds, const version) inline PathEdgePtr edgeOrNull(size_t index) const { - if (index >= m_edges.size()) + if (index >= m_edges.size()) return NULL; return m_edges[index]; } - + //! @} /* ==================================================================== */ /* ==================================================================== */ - //! @{ \name Miscellaneous + //! @{ \name Miscellaneous /* ==================================================================== */ /** @@ -320,11 +320,11 @@ public: inline Spectrum getPrefixSuffixWeight(int l, int m) const { Spectrum weight(1.0f); - for (int s=0; sweight[EImportance] + for (int s=0; sweight[EImportance] * m_edges[s]->weight[EImportance]; - for (int t=length(); t>m; --t) + for (int t=length(); t>m; --t) weight *= m_vertices[t]->weight[ERadiance] * m_edges[t-1]->weight[ERadiance]; @@ -344,7 +344,7 @@ public: return false; for (size_t i=0; itype != p.vertex(i)->type || + if (m_vertices[i]->type != p.vertex(i)->type || m_vertices[i]->isConnectable() != p.vertex(i)->isConnectable()) return false; } @@ -365,11 +365,11 @@ public: Spectrum weight(1.0f); int k = length(); - for (int s=0; sweight[EImportance] + for (int s=0; sweight[EImportance] * m_edges[s]->weight[EImportance]; - weight = weight + weight = weight * m_vertices[k]->weight[ERadiance] * m_vertices[k-1]->weight[ERadiance] * m_edges[k-1]->weight[ERadiance]; @@ -379,15 +379,15 @@ public: } /** - * \brief Compute the multiple importance sampling weight of the (s,t) + * \brief Compute the multiple importance sampling weight of the (s,t) * sampling strategy in BDPT. * - * This implementation uses the power heuristic with exponent 2 and - * repeatedly evaluates equation (10.9) from Eric Veach's PhD thesis to - * compute the weight in an efficient and numerically stable manner. + * This implementation uses the power heuristic with exponent 2 and + * repeatedly evaluates equation (10.9) from Eric Veach's PhD thesis to + * compute the weight in an efficient and numerically stable manner. * * The function completely ignores the effects of russian roulette, since - * this allows for a more efficient implementation. The resulting estimator + * this allows for a more efficient implementation. The resulting estimator * is still unbiased despite this apparent inaccuracy. * * \param scene @@ -396,7 +396,7 @@ public: * Reference to the emitter subpath * \param connectionEdge * Pointer to an edge data structure associated with the - * transport between emitterSubpath[s] and + * transport between emitterSubpath[s] and * sensorSubpath[t]. * \param sensorSubpath * Reference to the sensor subpath @@ -404,19 +404,19 @@ public: * Number of steps to take along the emitter subpath * \param t * Number of steps to take along the sensor subpath - * \param direct + * \param direct * When the parameter \c direct is set to \c true, the implementation * accounts for the fact that specialized direct sampling strategies * are used for paths with s==1 and t==1. * \param lightImage * Denotes whether or not rendering strategies that require a 'light image' - * (specifically, those with t==0 or t==1) are included + * (specifically, those with t==0 or t==1) are included * in the rendering process. */ - static Float miWeight(const Scene *scene, - const Path &emitterSubpath, + static Float miWeight(const Scene *scene, + const Path &emitterSubpath, const PathEdge *connectionEdge, - const Path &sensorSubpath, int s, int t, + const Path &sensorSubpath, int s, int t, bool direct, bool lightImage); /** @@ -494,7 +494,7 @@ public: /// Compare this path against another path bool operator==(const Path &path) const; - + /// Compare this path against another path inline bool operator!=(const Path &path) const { return !operator==(path); @@ -503,10 +503,10 @@ public: /// Create a deep copy of this path void clone(Path &target, MemoryPool &pool) const; - /// Return a string representation of the path + /// Return a string representation of the path std::string toString() const; - - /// Return a basic string summary of the path + + /// Return a basic string summary of the path std::string summarize() const; //! @} diff --git a/include/mitsuba/bidir/pathsampler.h b/include/mitsuba/bidir/pathsampler.h index 124514ed..172f8a01 100644 --- a/include/mitsuba/bidir/pathsampler.h +++ b/include/mitsuba/bidir/pathsampler.h @@ -26,11 +26,11 @@ MTS_NAMESPACE_BEGIN /** - * \brief Implements a sampling strategy that is able to produce paths using + * \brief Implements a sampling strategy that is able to produce paths using * bidirectional path tracing or unidirectional volumetric path tracing. * - * This versatile class does the heavy lifting under the hood of Mitsuba's - * PSSMLT implementation. It is also used to provide the Veach-MLT + * This versatile class does the heavy lifting under the hood of Mitsuba's + * PSSMLT implementation. It is also used to provide the Veach-MLT * implementation with a luminance estimate and seed paths. * * \author Wenzel Jakob @@ -47,7 +47,7 @@ public: */ typedef boost::function PathCallback; - /// Specifies the sampling algorithm that is internally used + /// Specifies the sampling algorithm that is internally used enum ETechnique { /// Bidirectional path tracing EBidirectional, @@ -92,15 +92,15 @@ public: * * \param sampleDirect * When this parameter is set to true, specialized direct - * sampling strategies are used for s=1 and t=1 paths. - * + * sampling strategies are used for s=1 and t=1 paths. + * * \param lightImage * Denotes whether or not rendering strategies that require a 'light image' - * (specifically, those with t==0 or t==1) are included + * (specifically, those with t==0 or t==1) are included * in the rendering process. */ - PathSampler(ETechnique technique, const Scene *scene, Sampler *emitterSampler, - Sampler *sensorSampler, Sampler *directSampler, int maxDepth, int rrDepth, + PathSampler(ETechnique technique, const Scene *scene, Sampler *emitterSampler, + Sampler *sensorSampler, Sampler *directSampler, int maxDepth, int rrDepth, bool excludeDirectIllum, bool sampleDirect, bool lightImage = true); /** @@ -126,7 +126,7 @@ public: * * This function is similar to \ref sampleSplats(), but instead of * returning only the contribution of the samples paths in the form of - * screen-space "splats", it returns the actual paths by invoking a + * screen-space "splats", it returns the actual paths by invoking a * specified callback function multiple times. * * This function is currently only implemented for the bidirectional @@ -138,7 +138,7 @@ public: * value Point2i(-1) results in uniform sampling in screen space. * * \param pathCallback - * A callback function that will be invoked once for each + * A callback function that will be invoked once for each * path generated by the BDPT sampling strategy. The first argument * specifies the path importance weight. */ @@ -164,7 +164,7 @@ public: * A vector of resulting MLT seeds * \return The average luminance over the image plane */ - Float generateSeeds(size_t sampleCount, size_t seedCount, + Float generateSeeds(size_t sampleCount, size_t seedCount, bool fineGrained, std::vector &seeds); /** @@ -211,7 +211,7 @@ protected: /** * \brief Stores information required to re-create a seed path (e.g. for MLT) * - * This class makes it possible to transmit a path over the network or store + * This class makes it possible to transmit a path over the network or store * it locally, while requiring very little storage to do so. This is done by * describing a path using an index into a random number stream, which allows * to generate it cheaply when needed. @@ -355,7 +355,7 @@ struct MTS_EXPORT_BIDIR SplatList { * This function divides all splats so that they have unit * luminance (though it leaves the \c luminance field untouched). * When given an optional importance map in 2-stage MLT approaches, - * it divides the splat values by the associated importance + * it divides the splat values by the associated importance * map values */ void normalize(const Bitmap *importanceMap = NULL); diff --git a/include/mitsuba/bidir/rsampler.h b/include/mitsuba/bidir/rsampler.h index 8836df7a..8ef4684e 100644 --- a/include/mitsuba/bidir/rsampler.h +++ b/include/mitsuba/bidir/rsampler.h @@ -25,12 +25,12 @@ MTS_NAMESPACE_BEGIN /** - * \brief Specialized sampler implementation used to seed MLT-style algorithm. + * \brief Specialized sampler implementation used to seed MLT-style algorithm. * * Allows to query for the current sample index, which can later be used to rewind - * back to this state. In the case of MLT, this makes it possible to sample paths + * back to this state. In the case of MLT, this makes it possible to sample paths * approximately proportional to their contribution without actually having - * to store millions of path. Note that `rewinding' is naive -- it just + * to store millions of path. Note that `rewinding' is naive -- it just * resets & regenerates the whole random number sequence, which might be slow. * * \ingroup libbidir diff --git a/include/mitsuba/bidir/util.h b/include/mitsuba/bidir/util.h index ec3998c6..83119166 100644 --- a/include/mitsuba/bidir/util.h +++ b/include/mitsuba/bidir/util.h @@ -34,17 +34,17 @@ public: /** * \brief Render the direct illumination component of a scene * - * The function is made available here, since it is used + * The function is made available here, since it is used * by both Keleman-style and Veach-style MLT. */ - static ref renderDirectComponent(Scene *scene, int sceneResID, - int sensorResID, RenderQueue *queue, const RenderJob *job, + static ref renderDirectComponent(Scene *scene, int sceneResID, + int sensorResID, RenderQueue *queue, const RenderJob *job, size_t directSamples); /** - * \brief Execute the first pass of a 2-pass MLT scheme. + * \brief Execute the first pass of a 2-pass MLT scheme. * - * The function is made available here, since it is used + * The function is made available here, since it is used * by both Keleman-style and Veach-style MLT. * * \param scene @@ -58,7 +58,7 @@ public: * Pointer to the render queue associated with the original job * * \param sizeFactor - * Size reduction factor to use when rendering the + * Size reduction factor to use when rendering the * luminance image * * \param nestedJob @@ -71,7 +71,7 @@ public: /// Restores the measure of a path vertex after going out of scope struct RestoreMeasureHelper { - RestoreMeasureHelper(PathVertex *vertex) + RestoreMeasureHelper(PathVertex *vertex) : vertex(vertex), measure(vertex->measure) { } ~RestoreMeasureHelper() { vertex->measure = measure; } PathVertex *vertex; diff --git a/include/mitsuba/bidir/vertex.h b/include/mitsuba/bidir/vertex.h index b0a931b6..2fc641f2 100644 --- a/include/mitsuba/bidir/vertex.h +++ b/include/mitsuba/bidir/vertex.h @@ -34,12 +34,12 @@ MTS_NAMESPACE_BEGIN * or Veach-style Metropolis Light Transport. * * This data structure can describe a several different types of interactions, - * including surface and medium scattering events, as well as emission events - * by a light source or a sensor (in the bidirectional framework, the response + * including surface and medium scattering events, as well as emission events + * by a light source or a sensor (in the bidirectional framework, the response * of a sensor is treated as an emitted quantity) * * A path vertex only describes what happens at the location of a scattering - * or emission event -- what happens in between such interactions is + * or emission event -- what happens in between such interactions is * captured in a separate data structure named \ref PathEdge. * * \author Wenzel Jakob @@ -47,12 +47,12 @@ MTS_NAMESPACE_BEGIN */ struct MTS_EXPORT_BIDIR PathVertex { /* ==================================================================== */ - //! @{ \name Enumerations and Fields + //! @{ \name Enumerations and Fields /* ==================================================================== */ /// Denotes the size of the auxiliary data section associated with each node enum { - EDataSize = MAX(MAX(sizeof(Intersection), + EDataSize = MAX(MAX(sizeof(Intersection), sizeof(MediumSamplingRecord)), MAX( sizeof(PositionSamplingRecord), sizeof(EndpointRecord))) }; @@ -60,7 +60,7 @@ struct MTS_EXPORT_BIDIR PathVertex { /** * \brief What kind of vertex is this (e.g. medium, surface, emitter)? * - * The two special 'supernode' types are used as path endpoints, which greatly + * The two special 'supernode' types are used as path endpoints, which greatly * simplifies the control flow of various functions in this data structure and the * MLT/BDPT implementations. */ @@ -71,7 +71,7 @@ struct MTS_EXPORT_BIDIR PathVertex { ESensorSupernode = 1, /// Special emitter 'supernode' -- just before the emitter sample EEmitterSupernode = 2, - /// Sampled position on the surface of a sensor + /// Sampled position on the surface of a sensor ESensorSample = 4, /// Sampled position on the surface of an emitter EEmitterSample = 8, @@ -94,14 +94,14 @@ struct MTS_EXPORT_BIDIR PathVertex { uint8_t type : 7; /** - * \brief Denotes whether this vertex \a only supports + * \brief Denotes whether this vertex \a only supports * sampling from degenerate distributions. * * It's useful to cache this information, since it allows - * to quickly determine when certain pairs of vertices + * to quickly determine when certain pairs of vertices * cannot be deterministically connected. * - * Examples of degenerate vertices are surface interactions with + * Examples of degenerate vertices are surface interactions with * dielectric boundaries and certain special cases. For instance, the * sensor supernode can be degenerate when the used sensor does not * cover any area (e.g. because it is a point camera). @@ -113,15 +113,15 @@ struct MTS_EXPORT_BIDIR PathVertex { * probability densities stored in \ref pdf. * * Certain vertices use sampling methods, whose probability - * mass lies on domains that have different associated - * measures. An example would be a surface interaction with + * mass lies on domains that have different associated + * measures. An example would be a surface interaction with * a smooth plastic material, where the specular reflection - * component is degenerate and the glossy reflection component + * component is degenerate and the glossy reflection component * is non-degenerate. * * This attribute stores the actual measure (an enumeration - * item of type \ref EMeasure) and therefore clarifies whether - * or not a degenerate component was sampled. When no sampling + * item of type \ref EMeasure) and therefore clarifies whether + * or not a degenerate component was sampled. When no sampling * event was generated yet, it is undefined. * * Currently, only three values are permissible: @@ -134,7 +134,7 @@ struct MTS_EXPORT_BIDIR PathVertex { /** * \brief When the current vertex supports sampling * from several components (this currently only applies - * to %BSDF lobes), this attribute records the type + * to %BSDF lobes), this attribute records the type * sampled component. * * Otherwise, it will be set to zero. @@ -145,8 +145,8 @@ struct MTS_EXPORT_BIDIR PathVertex { * \brief Measurement contribution weight * * This field stores the terms of the path-space measurement contribution - * function that are coupled to this specific vertex, divided by the - * density of the adjacent vertices in the radiance and importance transport + * function that are coupled to this specific vertex, divided by the + * density of the adjacent vertices in the radiance and importance transport * directions (hence, it is an array with two entries). * * More precisely, it stores @@ -163,9 +163,9 @@ struct MTS_EXPORT_BIDIR PathVertex { * G(\mathbf{x}_i\leftrightarrow\mathbf{x}_{i-1})\,p_A(\mathbf{x}_{i+1}\to * \mathbf{x}_i\to\mathbf{x}_{i-1})^{-1} * \f] - * + * * Where \f$G\f$ is the geometric term, \f$p_A\f$ is an area density, and - * increasing indices are closer to the sensor. Generally much cancellation + * increasing indices are closer to the sensor. Generally much cancellation * will occur in the above expressions. For instance, for a surface * iteractions, this is equal to the BRDF times a cosine foreshortening * factor divided by the solid angle density of the default sampling @@ -179,13 +179,13 @@ struct MTS_EXPORT_BIDIR PathVertex { /** * \brief Area density of the two adjacent vertices * - * This field stores the density of the predecessor and sucessor nodes - * with respect of the sampling technique implemented by \ref sampleNext(). + * This field stores the density of the predecessor and sucessor nodes + * with respect of the sampling technique implemented by \ref sampleNext(). * The measure of this value is specified by the \ref measure field - * (generally, it is the density per unit area). + * (generally, it is the density per unit area). * - * When one of the adjacent vertices is a medium interaction (i.e. it is - * not located on a surface), the stored probability will specify the density + * When one of the adjacent vertices is a medium interaction (i.e. it is + * not located on a surface), the stored probability will specify the density * on a hypothetical surface oriented perpendicularly to the transport * direction. * @@ -207,7 +207,7 @@ struct MTS_EXPORT_BIDIR PathVertex { * which wreaks havoc with strict aliasing (and hence it is disabled * for all bidirectional code). * - * Once C++11 is widely supported across all target platforms, this + * Once C++11 is widely supported across all target platforms, this * should be replaced by an unrestricted union. */ uint8_t data[EDataSize]; @@ -220,13 +220,13 @@ struct MTS_EXPORT_BIDIR PathVertex { /* ==================================================================== */ /** - * \brief Generate a path endpoint that can be used to start + * \brief Generate a path endpoint that can be used to start * a random walk * * \param scene * Pointer to the underlying scene * \param mode - * Specifies the desired mode of transport, i.e. radiance or + * Specifies the desired mode of transport, i.e. radiance or * importance transport * \param time * Denotes the time value that will be associated with this @@ -235,7 +235,7 @@ struct MTS_EXPORT_BIDIR PathVertex { void makeEndpoint(const Scene *scene, Float time, ETransportMode mode); /** - * \brief Sample the next vertex in a random walk using the default + * \brief Sample the next vertex in a random walk using the default * sampling technique implemented by the current vertex. * * Given a vertex, its predecessor, as well as the edge in between them, @@ -250,12 +250,12 @@ struct MTS_EXPORT_BIDIR PathVertex { * \param predEdge * Edge to the preceding edge (if any) and \c NULL otherwise * \param succEdge - * Pointer to an unused edge data structure, which will be filled + * Pointer to an unused edge data structure, which will be filled * with information about the edge between the current vertex and * the newly sampled successor. * \param succ - * Pointer to an unused vertex data structure, which will be filled - * with information about the successor vertex + * Pointer to an unused vertex data structure, which will be filled + * with information about the successor vertex * \param mode * Specifies whether radiance or importance is being transported * \param russianRoulette @@ -270,21 +270,21 @@ struct MTS_EXPORT_BIDIR PathVertex { * \return \c true on success */ bool sampleNext(const Scene *scene, Sampler *sampler, - const PathVertex *pred, const PathEdge *predEdge, - PathEdge *succEdge, PathVertex *succ, + const PathVertex *pred, const PathEdge *predEdge, + PathEdge *succEdge, PathVertex *succ, ETransportMode mode, bool russianRoulette = false, Spectrum *throughput = NULL); /** * \brief \a Direct sampling: given the current vertex as a reference - * sample an emitter (or sensor) position that has a nonzero emission + * sample an emitter (or sensor) position that has a nonzero emission * (or response) towards it. * * This can be seen as a generalization of direct illumination sampling * that can be used for both emitter and sensor endpoints. * * Ideally, the implementation should importance sample the product of - * the emission or response profile and the geometry term between the + * the emission or response profile and the geometry term between the * reference point and the sampled position. In practice, one of these * usually has to be sacrificed. * @@ -303,11 +303,11 @@ struct MTS_EXPORT_BIDIR PathVertex { * sampled sensor or emitter position * \param mode * Specifies whether radiance or importance is being transported - * \return The emitted radiance or importance divided by the + * \return The emitted radiance or importance divided by the * sample probability per unit area per unit solid angle. */ - Spectrum sampleDirect(const Scene *scene, Sampler *sampler, - PathVertex *endpoint, PathEdge *edge, PathVertex *sample, + Spectrum sampleDirect(const Scene *scene, Sampler *sampler, + PathVertex *endpoint, PathEdge *edge, PathVertex *sample, ETransportMode mode) const; /** @@ -316,8 +316,8 @@ struct MTS_EXPORT_BIDIR PathVertex { * * This function samples the spatial and directional components of the sensor * and is similar to calling \ref sampleNext() two times in sequence starting - * from a sensor supernode. The main difference is that the resulting subpath - * passes through a specified pixel position, which is important to implement + * from a sensor supernode. The main difference is that the resulting subpath + * passes through a specified pixel position, which is important to implement * algorithms that parallelize rendering of images by processing it in separate * blocks. If this function is called once for every pixel in the output * image, the resulting path distribution is identical to what would have @@ -332,17 +332,17 @@ struct MTS_EXPORT_BIDIR PathVertex { * Pointer to a sample generator * \param pixelPosition * Specifies the desired pixel position - * \param e0 + * \param e0 * Pointer to the first edge on the sensor subpath - * \param e0 + * \param e0 * Pointer to the first edge on the sensor subpath - * \param v1 + * \param v1 * Pointer to the second vertex on the sensor subpath - * \param v2 + * \param v2 * Pointer to the third vertex on the sensor subpath - * \return The number of successful sampling operations (i.e. - * \c 0 if sensor sampling failed, \c 1 if no surface/medium - * interaction was encountered, or \c 2 if all data structures + * \return The number of successful sampling operations (i.e. + * \c 0 if sensor sampling failed, \c 1 if no surface/medium + * interaction was encountered, or \c 2 if all data structures * were successfully filled) */ int sampleSensor(const Scene *scene, Sampler *sampler, const Point2i &pixelPosition, @@ -351,11 +351,11 @@ struct MTS_EXPORT_BIDIR PathVertex { /** * \brief Create a perturbed successor vertex and edge * - * This function behaves similar to \ref sampleNext() in that it - * generates a successor edge and vertex. + * This function behaves similar to \ref sampleNext() in that it + * generates a successor edge and vertex. * - * The main difference is that the desired direction, distance, and - * type of the successor vertex are all specified, which makes the + * The main difference is that the desired direction, distance, and + * type of the successor vertex are all specified, which makes the * sampling process completely deterministic. This is useful for * implementing path-space perturbation strategies. * @@ -368,25 +368,25 @@ struct MTS_EXPORT_BIDIR PathVertex { * \param predEdge * Edge to the preceding edge (if any) and \c NULL otherwise * \param succEdge - * Pointer to an unused edge data structure, which will be filled + * Pointer to an unused edge data structure, which will be filled * with information about the edge between the current vertex and * the new successor. * \param succ - * Pointer to an unused vertex data structure, which will be filled - * with information about the successor vertex + * Pointer to an unused vertex data structure, which will be filled + * with information about the successor vertex * \param d * Specifies the desired outgoing direction at the current vertex * \param dist * Specifies the desired distance between the current vertex and \c succ * (this only applies when desiredType=EMediumInteraction) * \param desiredType - * Specifies the desired vertex type of \c succ. + * Specifies the desired vertex type of \c succ. * \param mode * Specifies whether radiance or importance is being transported * \return \c true on success */ - bool perturbDirection(const Scene *scene, const PathVertex *pred, - const PathEdge *predEdge, PathEdge *succEdge, PathVertex *succ, + bool perturbDirection(const Scene *scene, const PathVertex *pred, + const PathEdge *predEdge, PathEdge *succEdge, PathVertex *succ, const Vector &d, Float dist, EVertexType desiredType, ETransportMode mode); /** @@ -399,12 +399,12 @@ struct MTS_EXPORT_BIDIR PathVertex { * \brief Propagate a perturbation through an ideally specular interaction * * This function behaves similar to \ref sampleNext() and \ref - * perturbDirection() in that it generates a successor edge and vertex. + * perturbDirection() in that it generates a successor edge and vertex. * * The main difference is that it only works for specular interactions, * where the requested type of interaction (reflection/refraction) is * additionally specified, which makese the sampling process completely - * deterministic. This is useful for implementing path-space + * deterministic. This is useful for implementing path-space * perturbation strategies. For now, it is only used by the perturbations * of Veach and Guibas. * @@ -417,29 +417,29 @@ struct MTS_EXPORT_BIDIR PathVertex { * \param predEdge * Edge to the preceding edge (if any) and \c NULL otherwise * \param succEdge - * Pointer to an unused edge data structure, which will be filled + * Pointer to an unused edge data structure, which will be filled * with information about the edge between the current vertex and * the new successor. * \param dist * Specifies the desired distance between the current vertex and \c succ * (this only applies when desiredType=EMediumInteraction) * \param desiredType - * Specifies the desired vertex type of \c succ. + * Specifies the desired vertex type of \c succ. * \param componentType * Specifies the desired type of scattering interaction (equivalent * to \ref BSDF::typeMask) * \param succ - * Pointer to an unused vertex data structure, which will be filled - * with information about the successor vertex + * Pointer to an unused vertex data structure, which will be filled + * with information about the successor vertex * \param dist - * Specifies the desired distance between the current vertex and + * Specifies the desired distance between the current vertex and * \c succ (this only applies to medium interactions) * \param mode * Specifies whether radiance or importance is being transported * \return \c true on success */ - bool propagatePerturbation(const Scene *scene, const PathVertex *pred, - const PathEdge *predEdge, PathEdge *succEdge, PathVertex *succ, + bool propagatePerturbation(const Scene *scene, const PathVertex *pred, + const PathEdge *predEdge, PathEdge *succEdge, PathVertex *succ, unsigned int componentType, Float dist, EVertexType desiredType, ETransportMode mode); @@ -455,12 +455,12 @@ struct MTS_EXPORT_BIDIR PathVertex { * that are associated with this vertex. * * Compute a single term of the contribution weighting function associated - * with the current node given a predecessor and successor node. + * with the current node given a predecessor and successor node. * * Note: this function only accounts for the factor associated with this * specific vertex -- to account for an adjacent edge, refer to * \ref PathEdge::eval. - * + * * \param scene * Pointer to the underlying scene * \param pred @@ -471,23 +471,23 @@ struct MTS_EXPORT_BIDIR PathVertex { * Specifies whether radiance or importance is being transported * \param measure * Specifies the measure of the queried component. This is necessary - * to handle mixture scattering functions, whose components are + * to handle mixture scattering functions, whose components are * defined on spaces with different measures. * \return The contribution weighting factor */ - Spectrum eval(const Scene *scene, const PathVertex *pred, + Spectrum eval(const Scene *scene, const PathVertex *pred, const PathVertex *succ, ETransportMode mode, EMeasure measure = EArea) const; /** * \brief Compute the density of a successor node * - * This function computes the hypothetical scattering-related sampling density - * of a given successor node when using the sampling technique implemented by - * \ref sampleNext(). Since this technique conditions on a predecessor vertex, + * This function computes the hypothetical scattering-related sampling density + * of a given successor node when using the sampling technique implemented by + * \ref sampleNext(). Since this technique conditions on a predecessor vertex, * it must also be provided here. The desired measure (e.g. area/solid angle/discrete) * can be provided as an extra parameter. - * - * Note: this function only computes probability associated with the + * + * Note: this function only computes probability associated with the * vertices -- to account for edges, refer to \ref PathEdge::evalPdf. * * \param scene @@ -500,11 +500,11 @@ struct MTS_EXPORT_BIDIR PathVertex { * Specifies whether radiance or importance is being transported * \param measure * Specifies the measure of the queried component. This is necessary - * to handle mixture scattering functions, whose components are + * to handle mixture scattering functions, whose components are * defined on spaces with different measures. * \return The computed probability density */ - Float evalPdf(const Scene *scene, const PathVertex *pred, + Float evalPdf(const Scene *scene, const PathVertex *pred, const PathVertex *succ, ETransportMode mode, EMeasure measure = EArea) const; /** @@ -523,11 +523,11 @@ struct MTS_EXPORT_BIDIR PathVertex { * An emitter or sensor sample * \param measure * Specifies the measure of the queried component. This is necessary - * to handle scattering functions, whose components are + * to handle scattering functions, whose components are * defined on spaces with different measures. * \return The density of \c sample conditioned on this vertex. */ - Float evalPdfDirect(const Scene *scene, const PathVertex *sample, + Float evalPdfDirect(const Scene *scene, const PathVertex *sample, ETransportMode mode, EMeasure measure = EArea) const; /** @@ -545,7 +545,7 @@ struct MTS_EXPORT_BIDIR PathVertex { * \return * The medium between \c this and \c succ */ - const Medium *getTargetMedium(const PathEdge *predEdge, + const Medium *getTargetMedium(const PathEdge *predEdge, const PathVertex *succ) const; /** @@ -558,7 +558,7 @@ struct MTS_EXPORT_BIDIR PathVertex { * \return * The medium containing the ray (this->getPosition(), d) */ - const Medium *getTargetMedium(const PathEdge *predEdge, + const Medium *getTargetMedium(const PathEdge *predEdge, const Vector &d) const; //! @} @@ -572,7 +572,7 @@ struct MTS_EXPORT_BIDIR PathVertex { inline EVertexType getType() const { return (EVertexType) type; } /** - * \brief Return the position associated with this vertex + * \brief Return the position associated with this vertex * * Throws an exception when called on a supernode */ @@ -580,34 +580,34 @@ struct MTS_EXPORT_BIDIR PathVertex { /// Check if the vertex lies on a surface inline bool isOnSurface() const { - return (type == ESurfaceInteraction) || ((type == EEmitterSample || + return (type == ESurfaceInteraction) || ((type == EEmitterSample || type == ESensorSample) && static_cast( getPositionSamplingRecord().object)->getType() & AbstractEmitter::EOnSurface); } /** * \brief Returns whether or not this vertex describes a "null" scattering interaction. - * - * A null interaction is a degenerate scattering event with a Dirac delta peak in the - * forward direction. Apart from a potential influence on their weight, particles + * + * A null interaction is a degenerate scattering event with a Dirac delta peak in the + * forward direction. Apart from a potential influence on their weight, particles * will pass through such an interface unchanged. */ - inline bool isNullInteraction() const { + inline bool isNullInteraction() const { return type == ESurfaceInteraction && componentType == BSDF::ENull; } /** - * \brief Returns whether or not this vertex describes a diffuse surface + * \brief Returns whether or not this vertex describes a diffuse surface * scattering interaction. */ - inline bool isDiffuseInteraction() const { - return type == ESurfaceInteraction && + inline bool isDiffuseInteraction() const { + return type == ESurfaceInteraction && (componentType == BSDF::EDiffuseReflection || componentType == BSDF::EDiffuseTransmission); } /** * \brief Returns whether or not this vertex describes a 100% absorbing surface - * + * * Such is the case on emitters/sensors that don't have an explicit BSDF assigned * to them. It is useful to be able to query this to avoid some useless connection * attempts involving these vertices. @@ -731,7 +731,7 @@ struct MTS_EXPORT_BIDIR PathVertex { inline bool isDegenerate() const { return degenerate; } /** - * \brief Returns whether or not this vertex can be deterministically + * \brief Returns whether or not this vertex can be deterministically * connected to other vertices. * * This is the case when \ref degenerate == false and @@ -746,7 +746,7 @@ struct MTS_EXPORT_BIDIR PathVertex { * \param v * Pointer to the target vertex * - * \return \c true upon success (i.e. when the point is in the + * \return \c true upon success (i.e. when the point is in the * sensor's field of view) */ bool updateSamplePosition(const PathVertex *succ); @@ -762,7 +762,7 @@ struct MTS_EXPORT_BIDIR PathVertex { * Reference to a 2D point that will be set to the fractional * pixel coordinates associated with \c succ. * - * \return \c true upon success (i.e. when the point is in the + * \return \c true upon success (i.e. when the point is in the * sensor's field of view) */ bool getSamplePosition(const PathVertex *succ, Point2 &result) const; @@ -771,7 +771,7 @@ struct MTS_EXPORT_BIDIR PathVertex { /* ==================================================================== */ /* ==================================================================== */ - //! @{ \name Miscellaneous + //! @{ \name Miscellaneous /* ==================================================================== */ /** @@ -779,8 +779,8 @@ struct MTS_EXPORT_BIDIR PathVertex { * * Sometimes it is necessary to cast a vertex into a different type. * An example when this occurs is when a surface interaction vertex - * lies on the surface of an emitter or a sensor. In such a situation, - * it may be useful to retroactively turn it into an emitter or sensor + * lies on the surface of an emitter or a sensor. In such a situation, + * it may be useful to retroactively turn it into an emitter or sensor * sample vertex located at the same position. This function allows * to do precisely that. * @@ -788,7 +788,7 @@ struct MTS_EXPORT_BIDIR PathVertex { * A pointer to the underlying scene * \param desired * Desired type after the cast - * \return \c true on success. When returning \c false, the + * \return \c true on success. When returning \c false, the * function did not make any changes. */ bool cast(const Scene *scene, EVertexType desired); @@ -814,39 +814,39 @@ struct MTS_EXPORT_BIDIR PathVertex { * \param os * Target output stream for error messages */ - bool verify(const Scene *scene, const PathVertex *adjL, + bool verify(const Scene *scene, const PathVertex *adjL, const PathVertex *adjE, ETransportMode mode, std::ostream &os) const; /** * \brief Given the specified predecessor and successor, update * the cached values stored in this vertex - * + * * \param pred * Pointer to the predecessor vertex (if any) and \c NULL otherwise * \param succ * Pointer to the successor vertex (if any) and \c NULL otherwise * \param mode - * Specifies the direction of light transport + * Specifies the direction of light transport * \return \c false when there is no throughput */ - bool update(const Scene *scene, const PathVertex *pred, + bool update(const Scene *scene, const PathVertex *pred, const PathVertex *succ, ETransportMode mode, EMeasure measure = EArea); /** * \brief Create a connection between two disconnected subpaths * * This function can be used to connect two seperately created emitter - * and sensor subpaths so that they can be merged into a \ref Path data - * structure. The function checks that the vertices \c vs and \c vt are - * mutually visible, and that there is a nonzero throughput between them. - * If that is the case, it updates the cached values stored in \c vs, + * and sensor subpaths so that they can be merged into a \ref Path data + * structure. The function checks that the vertices \c vs and \c vt are + * mutually visible, and that there is a nonzero throughput between them. + * If that is the case, it updates the cached values stored in \c vs, * \c edge, and \c vt. * * The expected order of the parameters in path-space is *
 	 * (pred) -> predEdge -> (vs) -> edge -> (vt) -> succEdge -> (succ)
 	 * 
- * where entries in parentheses denote vertices, + * where entries in parentheses denote vertices, * \c pred is the closer to the light source, and \c succ * is the closer to the sensor. * @@ -875,15 +875,15 @@ struct MTS_EXPORT_BIDIR PathVertex { * \return \c true upon success, \c false when there is no * throughput or an inconsistency has been detected. */ - static bool connect(const Scene *scene, + static bool connect(const Scene *scene, const PathVertex *pred, const PathEdge *predEdge, - PathVertex *vs, PathEdge *edge, PathVertex *vt, + PathVertex *vs, PathEdge *edge, PathVertex *vt, const PathEdge *succEdge, const PathVertex *succ); /// Like the above, but can be used to connect delta endpoints - static bool connect(const Scene *scene, + static bool connect(const Scene *scene, const PathVertex *pred, const PathEdge *predEdge, - PathVertex *vs, PathEdge *edge, PathVertex *vt, + PathVertex *vs, PathEdge *edge, PathVertex *vt, const PathEdge *succEdge, const PathVertex *succ, EMeasure vsMeasure, EMeasure vtMeasure); @@ -895,7 +895,7 @@ struct MTS_EXPORT_BIDIR PathVertex { /// Compare this vertex against another vertex bool operator==(const PathVertex &vertex) const; - + /// Compare this vertex against another vertex inline bool operator!=(const PathVertex &vertex) const { return !operator==(vertex); diff --git a/include/mitsuba/core/aabb.h b/include/mitsuba/core/aabb.h index db414a62..38396aae 100644 --- a/include/mitsuba/core/aabb.h +++ b/include/mitsuba/core/aabb.h @@ -39,10 +39,10 @@ template struct TAABB { typedef typename T::VectorType VectorType; typedef TRay RayType; - /** + /** * \brief Create a new invalid bounding box - * - * Initializes the components of the minimum + * + * Initializes the components of the minimum * and maximum position to \f$\infty\f$ and \f$-\infty\f$, * respectively. */ @@ -57,14 +57,14 @@ template struct TAABB { } /// Create a collapsed AABB from a single point - inline TAABB(const PointType &p) + inline TAABB(const PointType &p) : min(p), max(p) { } /// Create a bounding box from two positions inline TAABB(const PointType &min, const PointType &max) : min(min), max(max) { #if defined(MTS_DEBUG) - for (int i=0; i struct TAABB { } } - /** + /** * \brief Mark the bounding box as invalid. - * - * This operation sets the components of the minimum + * + * This operation sets the components of the minimum * and maximum position to \f$\infty\f$ and \f$-\infty\f$, * respectively. */ @@ -149,7 +149,7 @@ template struct TAABB { /// Axis-aligned bounding box overlap test inline bool overlaps(const TAABB &aabb) const { - for (int i=0; i aabb.max[i]) return false; return true; @@ -212,14 +212,14 @@ template struct TAABB { /// Return whether this bounding box is valid inline bool isValid() const { - for (int i=0; i struct TAABB { return oss.str(); } - PointType min; ///< Component-wise minimum - PointType max; ///< Component-wise maximum + PointType min; ///< Component-wise minimum + PointType max; ///< Component-wise maximum }; /** * \brief Axis-aligned bounding box data structure in three dimensions - * + * * Maintains a component-wise minimum and maximum position and provides * various convenience functions to query or change them. * @@ -341,10 +341,10 @@ template struct TAABB { */ struct AABB : public TAABB { public: - /** + /** * \brief Create a new invalid bounding box - * - * Initializes the components of the minimum + * + * Initializes the components of the minimum * and maximum position to \f$\infty\f$ and \f$-\infty\f$, * respectively. */ @@ -357,12 +357,12 @@ public: inline AABB(const Point &p) : TAABB(p) { } /// Create a bounding box from two positions - inline AABB(const PointType &min, const PointType &max) + inline AABB(const PointType &min, const PointType &max) : TAABB(min, max) { } /// Construct from a TAABB - inline AABB(const TAABB &aabb) + inline AABB(const TAABB &aabb) : TAABB(aabb) { } /// Calculate the surface area of the bounding box @@ -388,7 +388,7 @@ public: #ifdef MTS_SSE /** - * \brief Intersect against a packet of four rays. + * \brief Intersect against a packet of four rays. * \return \c false if none of the rays intersect. */ FINLINE bool rayIntersectPacket(const RayPacket4 &ray, RayInterval4 &interval) const; diff --git a/include/mitsuba/core/aabb_sse.h b/include/mitsuba/core/aabb_sse.h index fa66178d..dd2d31b4 100644 --- a/include/mitsuba/core/aabb_sse.h +++ b/include/mitsuba/core/aabb_sse.h @@ -28,16 +28,16 @@ MTS_NAMESPACE_BEGIN /** - * NaN-aware slab test using SSE by Thierry Berger-Perrin (Intersects - * against 4 rays simultaneously). Returns false if none of the rays + * NaN-aware slab test using SSE by Thierry Berger-Perrin (Intersects + * against 4 rays simultaneously). Returns false if none of the rays * intersect. */ -FINLINE bool AABB::rayIntersectPacket(const RayPacket4 &ray, +FINLINE bool AABB::rayIntersectPacket(const RayPacket4 &ray, RayInterval4 &interval) const { const __m128 xl1 = _mm_mul_ps(ray.dRcp[0].ps, _mm_sub_ps(_mm_set1_ps(min.x), ray.o[0].ps)), - xl2 = _mm_mul_ps(ray.dRcp[0].ps, + xl2 = _mm_mul_ps(ray.dRcp[0].ps, _mm_sub_ps(_mm_set1_ps(max.x), ray.o[0].ps)), xl1a = _mm_min_ps(xl1, SSEConstants::p_inf.ps), xl2a = _mm_min_ps(xl2, SSEConstants::p_inf.ps), @@ -49,9 +49,9 @@ FINLINE bool AABB::rayIntersectPacket(const RayPacket4 &ray, lmin = _mm_min_ps(xl1b, xl2b); const __m128 - yl1 = _mm_mul_ps(ray.dRcp[1].ps, + yl1 = _mm_mul_ps(ray.dRcp[1].ps, _mm_sub_ps(_mm_set1_ps(min.y), ray.o[1].ps)), - yl2 = _mm_mul_ps(ray.dRcp[1].ps, + yl2 = _mm_mul_ps(ray.dRcp[1].ps, _mm_sub_ps(_mm_set1_ps(max.y), ray.o[1].ps)), yl1a = _mm_min_ps(yl1, SSEConstants::p_inf.ps), yl2a = _mm_min_ps(yl2, SSEConstants::p_inf.ps), @@ -62,11 +62,11 @@ FINLINE bool AABB::rayIntersectPacket(const RayPacket4 &ray, lmin = _mm_max_ps(_mm_min_ps(yl1b,yl2b), lmin); const __m128 - zl1 = _mm_mul_ps(ray.dRcp[2].ps, + zl1 = _mm_mul_ps(ray.dRcp[2].ps, _mm_sub_ps(_mm_set1_ps(min.z), ray.o[2].ps)), - zl2 = _mm_mul_ps(ray.dRcp[2].ps, + zl2 = _mm_mul_ps(ray.dRcp[2].ps, _mm_sub_ps(_mm_set1_ps(max.z), ray.o[2].ps)), - zl1a = _mm_min_ps(zl1, SSEConstants::p_inf.ps), + zl1a = _mm_min_ps(zl1, SSEConstants::p_inf.ps), zl2a = _mm_min_ps(zl2, SSEConstants::p_inf.ps), zl1b = _mm_max_ps(zl1, SSEConstants::n_inf.ps), zl2b = _mm_max_ps(zl2, SSEConstants::n_inf.ps); diff --git a/include/mitsuba/core/appender.h b/include/mitsuba/core/appender.h index d3f663e3..d8df144d 100644 --- a/include/mitsuba/core/appender.h +++ b/include/mitsuba/core/appender.h @@ -47,7 +47,7 @@ public: * \remark The \c ptr argument is missing in the Python bindings */ virtual void logProgress(Float progress, const std::string &name, - const std::string &formatted, const std::string &eta, + const std::string &formatted, const std::string &eta, const void *ptr) = 0; MTS_DECLARE_CLASS() @@ -97,7 +97,7 @@ private: bool m_lastMessageWasProgress; }; -/** \brief %Appender implementation, which writes directly +/** \brief %Appender implementation, which writes directly * to an UNIX-style unbuffered file descriptor. * * \ingroup libcore diff --git a/include/mitsuba/core/atomic.h b/include/mitsuba/core/atomic.h index f0f35a7a..096b9d47 100644 --- a/include/mitsuba/core/atomic.h +++ b/include/mitsuba/core/atomic.h @@ -40,7 +40,7 @@ MTS_NAMESPACE_BEGIN /** * \brief Atomically attempt to exchange a pointer with another value - * + * * \param v Pointer to the pointer in question * \param oldValue Last known value of the destination \a v * \param newValue Replacement value for the destination \a v @@ -55,7 +55,7 @@ template inline bool atomicCompareAndExchangePtr(T **v, T *newValue reinterpret_cast(v), newValue, oldValue) == oldValue; #else return _InterlockedCompareExchange( - reinterpret_cast(v), + reinterpret_cast(v), reinterpret_cast(newValue), reinterpret_cast(oldValue)) == reinterpret_cast(oldValue); #endif #else @@ -65,11 +65,11 @@ template inline bool atomicCompareAndExchangePtr(T **v, T *newValue /* Use the following workaround for clang and icl (Linux/Mac OS) */ #if __SIZEOF_POINTER__ == 8 || defined(__LP64__) return __sync_bool_compare_and_swap( - reinterpret_cast(v), reinterpret_cast(oldValue), + reinterpret_cast(v), reinterpret_cast(oldValue), reinterpret_cast(newValue)); #else return __sync_bool_compare_and_swap( - reinterpret_cast(v), reinterpret_cast(oldValue), + reinterpret_cast(v), reinterpret_cast(oldValue), reinterpret_cast(newValue)); #endif #endif @@ -78,7 +78,7 @@ template inline bool atomicCompareAndExchangePtr(T **v, T *newValue /** * \brief Atomically attempt to exchange a 32-bit integer with another value - * + * * \param v Pointer to the memory region in question * \param oldValue Last known value of the destination \a v * \param newValue Replacement value for the destination \a v @@ -97,7 +97,7 @@ inline bool atomicCompareAndExchange(volatile int32_t *v, int32_t newValue, int3 /** * \brief Atomically attempt to exchange a 64-bit integer with another value - * + * * \param v Pointer to the memory region in question * \param oldValue Last known value of the destination \a v * \param newValue Replacement value for the destination \a v diff --git a/include/mitsuba/core/barray.h b/include/mitsuba/core/barray.h index 8fabc01e..a42f20c4 100644 --- a/include/mitsuba/core/barray.h +++ b/include/mitsuba/core/barray.h @@ -27,8 +27,8 @@ MTS_NAMESPACE_BEGIN /** * \brief Blocked generic 2D array data type * - * This class implements a blocked 2D array for cache-efficient - * access to two-dimensional data. + * This class implements a blocked 2D array for cache-efficient + * access to two-dimensional data. */ template class BlockedArray { public: @@ -38,20 +38,20 @@ public: BlockedArray() : m_data(NULL), m_size(-1), m_owner(false) { } /** - * \brief Allocate memory for a new blocked array of + * \brief Allocate memory for a new blocked array of * the specified width and height */ - BlockedArray(const Vector2i &size) : m_data(NULL), + BlockedArray(const Vector2i &size) : m_data(NULL), m_size(-1), m_owner(false) { alloc(size); } /** - * \brief Allocate memory for a blocked array of + * \brief Allocate memory for a blocked array of * the specified width and height */ void alloc(const Vector2i &size) { - if (m_data && m_owner) + if (m_data && m_owner) delete[] m_data; m_xBlocks = (size.x + blockSize - 1) / blockSize; @@ -59,7 +59,7 @@ public: m_data = (Value *) allocAligned(m_xBlocks * m_yBlocks * blockSize * blockSize * sizeof(Value)); m_owner = true; /* We own this pointer */ - m_size = size; + m_size = size; } /** @@ -76,7 +76,7 @@ public: m_yBlocks = (size.y + blockSize - 1) / blockSize; m_data = (Value *) ptr; m_owner = false; /* We do not own this pointer */ - m_size = size; + m_size = size; } /** @@ -94,13 +94,13 @@ public: /** * \brief Initialize the contents of the blocked array with values * from a non-blocked source in row-major order and collect component-wise - * minimum, maximum, and average information. + * minimum, maximum, and average information. * * Assumes that \c AltValue is some kind of \c TVector or \c TSpectrum instance. * * \remark This function performs type casts when Value != AltValue */ - template void init(const AltValue *data, + template void init(const AltValue *data, AltValue &min_, AltValue &max_, AltValue &avg_) { typedef typename AltValue::Scalar Scalar; @@ -128,7 +128,7 @@ public: /** * \brief Copy the contents of the blocked array to a non-blocked * destination buffer in row-major order. - * + * * This is effectively the opposite of \ref init(). * * \remark This function performs type casts when Value != AltValue @@ -143,9 +143,9 @@ public: /** * \brief Zero out unused memory portions * - * This is useful in case we want to write the internal representation to - * disk and avoid accessing uninitialized memory (otherwise, valgrind - * or other similar tools will complain..) + * This is useful in case we want to write the internal representation to + * disk and avoid accessing uninitialized memory (otherwise, valgrind + * or other similar tools will complain..) */ void cleanup() { size_t unusedColsRight = m_xBlocks * blockSize - m_size.x, @@ -194,7 +194,7 @@ public: inline Value &operator()(int x, int y) { size_t xb = getBlock(x), yb = getBlock(y), xo = getOffset(x), yo = getOffset(y); - + return m_data[ // Offset to block blockSize * blockSize * (xb + yb * m_xBlocks) + @@ -224,7 +224,7 @@ public: protected: /// Determine the index of the block which contains the given global index inline size_t getBlock(int a) const { return (size_t) (a >> logblockSize); } - + /// Determine the offset within the block that contains the given global index inline size_t getOffset(int a) const { return (size_t) (a & (blockSize - 1)); } private: @@ -247,25 +247,25 @@ public: LinearArray() : m_data(NULL), m_size(-1), m_owner(false) { } /** - * \brief Allocate memory for a new linear array of + * \brief Allocate memory for a new linear array of * the specified width and height */ - LinearArray(const Vector2i &size) : m_data(NULL), + LinearArray(const Vector2i &size) : m_data(NULL), m_size(-1), m_owner(false) { alloc(size); } /** - * \brief Allocate memory for a linear array of + * \brief Allocate memory for a linear array of * the specified width and height */ void alloc(const Vector2i &size) { - if (m_data && m_owner) + if (m_data && m_owner) delete[] m_data; size_t arraySize = (size_t) size.x * (size_t) size.y * sizeof(Value); m_data = (Value *) allocAligned(arraySize); - m_size = size; + m_size = size; } /* @@ -280,7 +280,7 @@ public: m_data = (Value *) ptr; m_owner = false; /* We do not own this pointer */ - m_size = size; + m_size = size; } /** @@ -299,13 +299,13 @@ public: /** * \brief Initialize the contents of the linear array with values * from a non-blocked source in row-major order and collect component-wise - * minimum, maximum, and average information. + * minimum, maximum, and average information. * * Assumes that \c AltValue is some kind of \c TVector or \c TSpectrum instance. * * \remark This function performs type casts when Value != AltValue */ - template void init(const AltValue *data, + template void init(const AltValue *data, AltValue &min_, AltValue &max_, AltValue &avg_) { typedef typename AltValue::Scalar Scalar; @@ -313,7 +313,7 @@ public: min(+std::numeric_limits::infinity()), max(-std::numeric_limits::infinity()), avg((Scalar) 0); - + Value *ptr = m_data; for (int y=0; yValue != AltValue diff --git a/include/mitsuba/core/bitmap.h b/include/mitsuba/core/bitmap.h index 80f5273b..d7f58d73 100644 --- a/include/mitsuba/core/bitmap.h +++ b/include/mitsuba/core/bitmap.h @@ -28,10 +28,10 @@ MTS_NAMESPACE_BEGIN /** - * \brief General-purpose bitmap class with read and write support + * \brief General-purpose bitmap class with read and write support * for several common file formats. * - * This class handles loading of PNG, JPEG, BMP, TGA, as well as + * This class handles loading of PNG, JPEG, BMP, TGA, as well as * OpenEXR files, and it supports writing of PNG, JPEG and OpenEXR files. * * PNG and OpenEXR files are optionally annotated with string-valued @@ -92,14 +92,14 @@ public: * Note that you can use this class to load, save, and access bitmasks -- however, * many of the manipulation operations (i.e. \ref crop(), \ref accumulate(), etc.) * do not currently handle them. - * + * * Default gamma value: linear (1.0) */ EBitmask = 0, /** * \brief 8-bit unsigned integer (\c uint8_t) component encoding - * + * * Default gamma value: sRGB (approx. 2.2) */ EUInt8, @@ -124,7 +124,7 @@ public: * Default gamma value: linear (1.0) */ EFloat16, - + /** * \brief 32-bit floating point (\c float) HDR component encoding * @@ -145,7 +145,7 @@ public: EInvalid, /** - * \brief Floating point (\c float or \c double depending on the + * \brief Floating point (\c float or \c double depending on the * compilation settings) HDR component encoding * * Default gamma value: linear (1.0) @@ -178,13 +178,13 @@ public: * * The following is supported: *
    - *
  • Loading and saving of \ref Eloat16 / \ref EFloat32/ \ref + *
  • Loading and saving of \ref Eloat16 / \ref EFloat32/ \ref * EUInt32 bitmaps with all supported RGB/Luminance/Alpha combinations
  • *
  • Loading and saving of spectral bitmaps *
  • Loading and saving of XYZ tristimulus bitmaps *
  • Loading and saving of string-valued metadata fields
  • *
- * + * * The following is not supported: *
    *
  • Saving of tiled images, tile-based read access
  • @@ -251,7 +251,7 @@ public: }; /** - * \brief Create a bitmap of the specified type and allocate + * \brief Create a bitmap of the specified type and allocate * the necessary amount of memory * * \param pFmt @@ -296,10 +296,10 @@ public: /// Return the bitmap component format for a specified type template inline static EComponentFormat componentFormat(); - /// Return the pixel format of this bitmap + /// Return the pixel format of this bitmap inline EPixelFormat getPixelFormat() const { return m_pixelFormat; } - /// Return the component format of this bitmap + /// Return the component format of this bitmap inline EComponentFormat getComponentFormat() const { return m_componentFormat; } /// Return the bitmap's resolution in pixels @@ -335,35 +335,35 @@ public: * this function throws an exception. */ int getBytesPerComponent() const; - + /** * \brief Return the number of bytes per pixel * * When the component format is set to \c EBitmask, * this function throws an exception. */ - inline int getBytesPerPixel() const { + inline int getBytesPerPixel() const { return getBytesPerComponent() * getChannelCount(); } /// Return the bitmap size in bytes size_t getBufferSize() const; /** - * \brief Return the spectral color value associated with + * \brief Return the spectral color value associated with * a given pixel. - * + * * When this is not a spectrum image, conversions are applied * as appropriate. * * \remark This function is provided here for convenience and * debugging purposes. Its use is discouraged, particularly for - * performance critical code (direct buffer access will be + * performance critical code (direct buffer access will be * faster by at least an order of magnitude) */ Spectrum getPixel(const Point2i &pos) const; /** - * \brief Set the spectral color value associated with + * \brief Set the spectral color value associated with * a given pixel. * * When this is not a spectrum image, conversions are applied @@ -371,7 +371,7 @@ public: * * \remark This function is provided here for convenience and * debugging purposes. Its use is discouraged, particularly for - * performance critical code (direct buffer access will be + * performance critical code (direct buffer access will be * faster by at least order of magnitude) */ void setPixel(const Point2i &pos, const Spectrum &value); @@ -394,10 +394,10 @@ public: void drawRect(const Point2i &offset, const Vector2i &size, const Spectrum &value); /** - * \brief Color balancing: apply the given scale factors to the + * \brief Color balancing: apply the given scale factors to the * red, green, and blue channels of the image * - * When the image is not an \c EFloat16, \c EFloat32, or + * When the image is not an \c EFloat16, \c EFloat32, or * \c EFloat64-based RGB/RGBA image, the function throws an exception */ void colorBalance(Float r, Float g, Float b); @@ -414,7 +414,7 @@ public: /// Create an identical copy ref clone() const; - + /// Clear the bitmap to zero void clear(); @@ -433,7 +433,7 @@ public: * the lowest and 9 denoting the highest compression). Note that * saving files with the highest compression will be very slow. * For JPEG files, this denotes the desired quality (between 0 and 100, - * the latter being best). The default argument (-1) uses compression + * the latter being best). The default argument (-1) uses compression * 5 for PNG and 100 for JPEG files. * * \param channelNames @@ -456,7 +456,7 @@ public: /** * \brief Convert the bitmap into another pixel and/or component format * - * This helper function can be used to efficiently convert a bitmap + * This helper function can be used to efficiently convert a bitmap * between different underlying representations. For instance, it can * translate a 24-bit sRGB bitmap to a linear spectrum-valued representation * based on half-, single- or double-precision floating point-backed storage. @@ -473,12 +473,12 @@ public: * of the desired component format. *
  • The clamped gamma-corrected value is then written to * the new bitmap
  • - * + * * If the pixel formats differ, this function will also perform basic - * conversions (e.g. spectrum to rgb, luminance to uniform spectrum + * conversions (e.g. spectrum to rgb, luminance to uniform spectrum * values, etc.) * - * Note that the alpha channel is assumed to be linear in both + * Note that the alpha channel is assumed to be linear in both * the source and target bitmap, hence it won't be affected by * any gamma-related transformations. * @@ -498,13 +498,13 @@ public: * specifies how ambiguities in this highly under-constrained problem * should be resolved. */ - void convert(Bitmap *target, Float multiplier = 1.0f, + void convert(Bitmap *target, Float multiplier = 1.0f, Spectrum::EConversionIntent intent = Spectrum::EReflectance) const; /** * \brief Convert the bitmap into another pixel and/or component format * - * This helper function can be used to efficiently convert a bitmap + * This helper function can be used to efficiently convert a bitmap * between different underlying representations. For instance, it can * translate a 24-bit sRGB bitmap to a linear spectrum-valued representation * based on half-, single- or double-precision floating point-backed storage. @@ -521,19 +521,19 @@ public: * of the desired component format. *
  • The clamped gamma-corrected value is then written to * the new bitmap
  • - * + * * If the pixel formats differ, this function will also perform basic - * conversions (e.g. spectrum to rgb, luminance to uniform spectrum + * conversions (e.g. spectrum to rgb, luminance to uniform spectrum * values, etc.) * - * Note that the alpha channel is assumed to be linear in both + * Note that the alpha channel is assumed to be linear in both * the source and target bitmap, hence it won't be affected by * any gamma-related transformations. - * - * \remark This convert() variant usually returns a new - * bitmap instance. When the conversion would just involve copying - * the original bitmap, the function becomes a no-op and returns - * the current instance. + * + * \remark This convert() variant usually returns a new + * bitmap instance. When the conversion would just involve copying + * the original bitmap, the function becomes a no-op and returns + * the current instance. * * \ref pixelFormat * Specifies the desired pixel format @@ -552,14 +552,14 @@ public: * specifies how ambiguities in this highly under-constrained problem * should be resolved. */ - ref convert(EPixelFormat pixelFormat, EComponentFormat componentFormat, - Float gamma = 1.0f, Float multiplier = 1.0f, + ref convert(EPixelFormat pixelFormat, EComponentFormat componentFormat, + Float gamma = 1.0f, Float multiplier = 1.0f, Spectrum::EConversionIntent intent = Spectrum::EReflectance); /** * \brief Convert the bitmap into another pixel and/or component format * - * This helper function can be used to efficiently convert a bitmap + * This helper function can be used to efficiently convert a bitmap * between different underlying representations. For instance, it can * translate a 24-bit sRGB bitmap to a linear spectrum-valued representation * based on half-, single- or double-precision floating point-backed storage. @@ -576,12 +576,12 @@ public: * of the desired component format. *
  • The clamped gamma-corrected value is then written to * the new bitmap
  • - * + * * If the pixel formats differ, this function will also perform basic - * conversions (e.g. spectrum to rgb, luminance to uniform spectrum + * conversions (e.g. spectrum to rgb, luminance to uniform spectrum * values, etc.) * - * Note that the alpha channel is assumed to be linear in both + * Note that the alpha channel is assumed to be linear in both * the source and target bitmap, hence it won't be affected by * any gamma-related transformations. * @@ -608,8 +608,8 @@ public: * should be resolved. */ void convert(void *target, - EPixelFormat pixelFormat, EComponentFormat componentFormat, - Float gamma = 1.0f, Float multiplier = 1.0f, + EPixelFormat pixelFormat, EComponentFormat componentFormat, + Float gamma = 1.0f, Float multiplier = 1.0f, Spectrum::EConversionIntent intent = Spectrum::EReflectance) const; /** @@ -617,25 +617,25 @@ public: * * This function *
      - *
    1. Computes and stores the maximum and log-average luminance of the image - * If the \c logAvgLuminace and \c maxLuminance parameters are nonzero, it is - * assumed that these have already been computed, and this step is omitted. - * Explicitly specifying them can be useful to prevent flickering when tonemapping + *
    2. Computes and stores the maximum and log-average luminance of the image + * If the \c logAvgLuminace and \c maxLuminance parameters are nonzero, it is + * assumed that these have already been computed, and this step is omitted. + * Explicitly specifying them can be useful to prevent flickering when tonemapping * multiple frames of an animation.
    3. * - *
    4. Converts the image to xyY, applies Reinhard's photographic tonemapper in this + *
    5. Converts the image to xyY, applies Reinhard's photographic tonemapper in this * space, and then transforms the result back to its original * representation (i.e. RGB or XYZ). The global version of the - * tonemapping algorithm is used (i.e. the one without automatic + * tonemapping algorithm is used (i.e. the one without automatic * dodging and burning).
    6. *
    * * The key parameter specifies whether a low-key or high-key image is - * desired. The value must be in the interval [0,1]. A good starting + * desired. The value must be in the interval [0,1]. A good starting * point is a middle-grey, i.e. key=0.18. * * When burn=0, the entire image is re-mapped into the displayable range. This - * may not always be desireable -- for instance, one might choose to let a highlight + * may not always be desireable -- for instance, one might choose to let a highlight * burn out, and this is achieved by choosing burn in (0, 1]. * * For reference, see @@ -643,8 +643,8 @@ public: * Peter Shirley, and James Fewerda, in ACM Transactions on Graphics 2002, Vol. 21, 3 * * \remark The implementation assumes that the image has a RGB(A), XYZ(A), or Luminance(Alpha) - * pixel format, that gamma=1, and that it uses a EFloat16/EFloat32/EFloat64 - * component format. The conversion process is destructive in the sense that it overwrites + * pixel format, that gamma=1, and that it uses a EFloat16/EFloat32/EFloat64 + * component format. The conversion process is destructive in the sense that it overwrites * the original image. */ void tonemapReinhard(Float &logAvgLuminance, Float &maxLuminance, @@ -663,13 +663,13 @@ public: * \brief Separate out one of the color channels in the * bitmap and return it as a separate luminance bitmap * - * When this is already a single-channel bitmap, the function + * When this is already a single-channel bitmap, the function * returns a pointer to the current instance. */ ref separateChannel(int channelIndex); /** - * \brief Merges multiple luminance-valued bitmaps into + * \brief Merges multiple luminance-valued bitmaps into * a proper multi-channel bitmap. * * \param fmt The desired pixel format of the combined bitmap @@ -696,7 +696,7 @@ public: * bitmap != this. * * \remark This function throws an exception when the bitmaps - * use different component formats or channels, or when the + * use different component formats or channels, or when the * component format is \ref EBitmask. */ void accumulate(const Bitmap *bitmap, const Point2i &offset); @@ -705,15 +705,15 @@ public: * \brief Up- or down-sample this image to a different resolution * * Uses the provided reconstruction filter and observes the specified - * horizontal and vertical boundary conditions when looking up data + * horizontal and vertical boundary conditions when looking up data * outside of the input domain. * * A maximum and maximum image value can be specified to prevent to prevent * out-of-range values that are created by the resampling process. */ - void resample(const ReconstructionFilter *rfilter, - ReconstructionFilter::EBoundaryCondition bch, - ReconstructionFilter::EBoundaryCondition bcv, + void resample(const ReconstructionFilter *rfilter, + ReconstructionFilter::EBoundaryCondition bch, + ReconstructionFilter::EBoundaryCondition bcv, Bitmap *target, Float minValue = 0.0f, Float maxValue = 1.0f) const; @@ -721,13 +721,13 @@ public: * \brief Up- or down-sample this image to a different resolution * * Uses the provided reconstruction filter and observes the specified - * horizontal and vertical boundary conditions when looking up data + * horizontal and vertical boundary conditions when looking up data * outside of the input domain. * * A maximum and maximum image value can be specified to prevent to prevent * out-of-range values that are created by the resampling process. */ - ref resample(const ReconstructionFilter *rfilter, + ref resample(const ReconstructionFilter *rfilter, ReconstructionFilter::EBoundaryCondition bch, ReconstructionFilter::EBoundaryCondition bcv, const Vector2i &size, Float minValue = 0.0f, @@ -748,7 +748,7 @@ public: /// Set a string-valued metadata field void setString(const std::string &key, const std::string &value); - + /// Return a string-valued metadata field std::string getString(const std::string &key) const; @@ -769,20 +769,20 @@ public: //! @} // ====================================================================== - + // ====================================================================== //! @{ \name Bitmap raster data accessors // ====================================================================== /// Access the underlying raster inline void *getData() { return m_data; } - + /// Access the underlying bit raster (const version) inline const void *getData() const { return m_data; } /// Access the underlying raster (for uint8 bitmaps) inline uint8_t *getUInt8Data() { return m_data; } - + /// Access the underlying bit raster (for uint8 bitmaps, const version) inline const uint8_t *getUInt8Data() const { return m_data; } @@ -844,7 +844,7 @@ protected: /// Write a file using the PNG file format void writePNG(Stream *stream, int compression) const; - + /// Read a file stored using the JPEG file format void readJPEG(Stream *stream); @@ -872,7 +872,7 @@ protected: /// Read a file stored using the TGA file format void readTGA(Stream *stream); - + /// Read a file stored using the BMP file format void readBMP(Stream *stream); @@ -909,7 +909,7 @@ protected: * \remark This is not a color management system. Depending on the * target type, out-of-gamut values may be clipped component-wise. * If a luminance scale factor is applied, that is also done component-wise - * (instead of scaling in a space that is based on human perception, such + * (instead of scaling in a space that is based on human perception, such * as xyY or CIELab). If this and smarter gamut remapping are needed, * a library such as lcms2 will be more appropriate. * @@ -927,7 +927,7 @@ public: * \brief Transform pixels based on the conversion implemented * by this class * - * Note that the alpha channel is assumed to be linear in both + * Note that the alpha channel is assumed to be linear in both * the source and target bitmap, hence it won't be affected by * Gamma-related transformations. * @@ -941,8 +941,8 @@ public: * Pointer to the first pixel of the source bitmap * \param destFormat * Pixel format of the destination bitmap - * \param destGamma - * Gamma value associated with pixels from the destination + * \param destGamma + * Gamma value associated with pixels from the destination * bitmap. Special values: 1.0 denotes a linear space, and -1.0 * corresponds to sRGB. * \param dest @@ -950,7 +950,7 @@ public: * \param count * How many pixels should be transformed? * \ref multiplier - * An optional multiplicative factor that will be applied to all + * An optional multiplicative factor that will be applied to all * color/luminance/spectrum values in linear space (alpha and weight * values will not be affected). * \ref intent @@ -960,9 +960,9 @@ public: * \sa getConversion() */ virtual void convert( - Bitmap::EPixelFormat sourceFormat, Float sourceGamma, const void *_source, - Bitmap::EPixelFormat destFormat, Float destGamma, void *_dest, - size_t count, Float multiplier = 1.0f, + Bitmap::EPixelFormat sourceFormat, Float sourceGamma, const void *_source, + Bitmap::EPixelFormat destFormat, Float destGamma, void *_dest, + size_t count, Float multiplier = 1.0f, Spectrum::EConversionIntent intent = Spectrum::EReflectance) const= 0; /** @@ -1003,7 +1003,7 @@ namespace detail { template <> inline Bitmap::EComponentFormat cfmt() { return Bitmap::EFloat64; } }; -template inline Bitmap::EComponentFormat Bitmap::componentFormat() { +template inline Bitmap::EComponentFormat Bitmap::componentFormat() { return detail::cfmt(); } diff --git a/include/mitsuba/core/brent.h b/include/mitsuba/core/brent.h index 97745e60..b7aecbc4 100644 --- a/include/mitsuba/core/brent.h +++ b/include/mitsuba/core/brent.h @@ -28,7 +28,7 @@ MTS_NAMESPACE_BEGIN /** * \brief Brent's method nonlinear zero finder * - * The implementation is transcribed from the Apache Commons + * The implementation is transcribed from the Apache Commons * Java implementation. The supplied function is required to be * continuous, but not necessarily smooth. * @@ -60,7 +60,7 @@ public: }; /** - * \brief Create a new Brent-style solver with the + * \brief Create a new Brent-style solver with the * specified accuracy requirements * * \param maxIterations @@ -69,16 +69,16 @@ public: * Absolute accuracy requirement -- the iterations will stop * when |f(x)| < absAccuracy. * \param absAccuracyPos - * Absolute accuracy requirement of the position -- the + * Absolute accuracy requirement of the position -- the * iterations will stop when |minX-maxX| < absAccuracyPos. * \param absAccuracyPos * Absolute accuracy requirement of the position -- the * iterations will stop when |minX-maxX|/minX < relAccuracyPos. */ - inline BrentSolver(size_t maxIterations = 100, + inline BrentSolver(size_t maxIterations = 100, Float absAccuracy = 1e-6f, Float absAccuracyPos = 1e-6f, - Float relAccuracyPos = 1e-6f) + Float relAccuracyPos = 1e-6f) : m_maxIterations(maxIterations), m_absAccuracy(absAccuracy), m_absAccuracyPos(absAccuracyPos), @@ -87,8 +87,8 @@ public: /** * \brief Find a zero in the given interval. * - * Requires that the values of the function at the endpoints - * have opposite signs. + * Requires that the values of the function at the endpoints + * have opposite signs. * * \param min the lower bound for the interval. * \param max the upper bound for the interval. @@ -100,14 +100,14 @@ public: /** * \brief Find a zero in the given interval with an initial guess * - * Requires that the values of the function at the endpoints - * have opposite signs (note that it is allowed to have endpoints - * with the same sign if the initial point has opposite sign + * Requires that the values of the function at the endpoints + * have opposite signs (note that it is allowed to have endpoints + * with the same sign if the initial point has opposite sign * function-wise). * * \param min the lower bound for the interval. * \param max the upper bound for the interval. - * \param initial the start value to use (must be set to min + * \param initial the start value to use (must be set to min * if no initial point is known) * \return the value where the function is zero */ @@ -136,7 +136,7 @@ protected: Float m_absAccuracy; Float m_absAccuracyPos; Float m_relAccuracyPos; -}; +}; MTS_NAMESPACE_END diff --git a/include/mitsuba/core/bsphere.h b/include/mitsuba/core/bsphere.h index 4c46d747..079ac830 100644 --- a/include/mitsuba/core/bsphere.h +++ b/include/mitsuba/core/bsphere.h @@ -48,7 +48,7 @@ struct BSphere { } /// Copy constructor - inline BSphere(const BSphere &boundingSphere) + inline BSphere(const BSphere &boundingSphere) : center(boundingSphere.center), radius(boundingSphere.radius) { } @@ -61,7 +61,7 @@ struct BSphere { inline void expandBy(const Point p) { radius = std::max(radius, (p-center).length()); } - + /// Check whether the specified point is inside or on the sphere inline bool contains(const Point p) const { return (p - center).length() <= radius; diff --git a/include/mitsuba/core/chisquare.h b/include/mitsuba/core/chisquare.h index ea335c03..e907b55e 100644 --- a/include/mitsuba/core/chisquare.h +++ b/include/mitsuba/core/chisquare.h @@ -59,7 +59,7 @@ MTS_NAMESPACE_BEGIN * \endcode * * the code in this class might be used as follows - * + * * \code * MyDistribution myDistrInstance; * ChiSquare chiSqr; @@ -109,9 +109,9 @@ public: * Number of samples to be used when computing the bin * values. The default is \c thetaBins*phiBins*5000 */ - ChiSquare(int thetaBins = 10, int phiBins = 0, + ChiSquare(int thetaBins = 10, int phiBins = 0, int numTests = 1, size_t sampleCount = 0); - + /// Get the log level inline ELogLevel getLogLevel() const { return m_logLevel; } @@ -119,17 +119,17 @@ public: inline void setLogLevel(ELogLevel logLevel) { m_logLevel = logLevel; } /** - * \brief Set the tolerance threshold for bins with very low + * \brief Set the tolerance threshold for bins with very low * aggregate probabilities * - * When the Chi-square test integrates the supplied probability + * When the Chi-square test integrates the supplied probability * density function over the support of a bin and determines that - * the aggregate bin probability is zero, the test would ordinarily - * fail if as much as one sample is placed in that bin in the - * subsequent sampling step. However, due to various numerical - * errors in a system based on finite-precision arithmetic, it - * may be a good idea to tolerate at least a few samples without - * immediately rejecting the null hypothesis. This parameter + * the aggregate bin probability is zero, the test would ordinarily + * fail if as much as one sample is placed in that bin in the + * subsequent sampling step. However, due to various numerical + * errors in a system based on finite-precision arithmetic, it + * may be a good idea to tolerate at least a few samples without + * immediately rejecting the null hypothesis. This parameter * sets this threshold. The default value is \c number-of-samples*1e-4f */ inline void setTolerance(Float tolerance) { m_tolerance = tolerance; } diff --git a/include/mitsuba/core/class.h b/include/mitsuba/core/class.h index 4734f179..85e2567e 100644 --- a/include/mitsuba/core/class.h +++ b/include/mitsuba/core/class.h @@ -56,7 +56,7 @@ public: * \param instPtr Pointer to an instantiation function * \param unSerPtr Pointer to an unserialization function */ - Class(const std::string &name, bool abstract, const std::string &superClassName, + Class(const std::string &name, bool abstract, const std::string &superClassName, void *instPtr = NULL, void *unSerPtr = NULL); /// Return the name of the represented class @@ -134,7 +134,7 @@ private: #define MTS_CLASS(x) x::m_theClass /** - * \brief This macro must be used in the initial definition in + * \brief This macro must be used in the initial definition in * classes that derive from \ref Object. * * This is needed for the basic RTTI support provided by Mitsuba objects. @@ -158,7 +158,7 @@ private: #define MTS_DECLARE_CLASS() \ virtual const Class *getClass() const; \ public: \ - static Class *m_theClass; + static Class *m_theClass; /** * \brief Creates basic RTTI support for a class @@ -227,7 +227,7 @@ public: \ /** * \brief Creates basic RTTI support for a class. To be used when the class - * can be unserialized from a binary data stream as well as instantiated + * can be unserialized from a binary data stream as well as instantiated * by a constructor that does not take any arguments. * * This macro or one of its variants should be invoked in the main diff --git a/include/mitsuba/core/cobject.h b/include/mitsuba/core/cobject.h index d3c71f6d..09e250d9 100644 --- a/include/mitsuba/core/cobject.h +++ b/include/mitsuba/core/cobject.h @@ -26,7 +26,7 @@ MTS_NAMESPACE_BEGIN -/** \brief Generic serializable object, which supports construction +/** \brief Generic serializable object, which supports construction * from a Properties instance. * * All plugins in Mitsuba derive from ConfigurableObject. This mechanism @@ -40,7 +40,7 @@ MTS_NAMESPACE_BEGIN class MTS_EXPORT_CORE ConfigurableObject : public SerializableObject { public: /** - * \brief Notify the \ref ConfigurableObject instance about + * \brief Notify the \ref ConfigurableObject instance about * its parent object * * The default implementation does nothing. @@ -67,7 +67,7 @@ public: inline void setID(const std::string &name) { m_properties.setID(name); } /** - * \brief Return the properties object that was originally used to + * \brief Return the properties object that was originally used to * create this instance * * This feature mainly of use for editors and other graphical @@ -80,18 +80,18 @@ public: protected: /// Virtual destructor virtual ~ConfigurableObject() { } - + /// Construct a configurable object - inline ConfigurableObject(const Properties &props) + inline ConfigurableObject(const Properties &props) : SerializableObject(), m_properties(props) { } - + /// Unserialize a configurable object ConfigurableObject(Stream *stream, InstanceManager *manager); protected: Properties m_properties; }; -/** \brief This macro creates the binary interface, which Mitsuba +/** \brief This macro creates the binary interface, which Mitsuba * requires to load a plugin. * * \ingroup libcore diff --git a/include/mitsuba/core/formatter.h b/include/mitsuba/core/formatter.h index 9e217c52..e1985249 100644 --- a/include/mitsuba/core/formatter.h +++ b/include/mitsuba/core/formatter.h @@ -33,7 +33,7 @@ enum ELogLevel { EError = 400 ///< Error message, causes an exception to be thrown }; -/** \brief Abstract interface for converting log information into +/** \brief Abstract interface for converting log information into * a human-readable format * * \ingroup libcore @@ -51,7 +51,7 @@ public: */ virtual std::string format(ELogLevel logLevel, const Class *theClass, - const Thread *thread, const std::string &text, + const Thread *thread, const std::string &text, const char *file, int line) = 0; MTS_DECLARE_CLASS() @@ -69,7 +69,7 @@ public: DefaultFormatter(); std::string format(ELogLevel logLevel, const Class *theClass, - const Thread *thread, const std::string &text, + const Thread *thread, const std::string &text, const char *file, int line); /// Should date information be included? The default is yes. diff --git a/include/mitsuba/core/frame.h b/include/mitsuba/core/frame.h index 47745e6c..d968b9b9 100644 --- a/include/mitsuba/core/frame.h +++ b/include/mitsuba/core/frame.h @@ -62,7 +62,7 @@ struct Frame { t = Vector(stream); n = Normal(stream); } - + /// Serialize to a binary data stream inline void serialize(Stream *stream) const { s.serialize(stream); @@ -84,7 +84,7 @@ struct Frame { return s * v.x + t * v.y + n * v.z; } - /** \brief Assuming that the given direction is in the local coordinate + /** \brief Assuming that the given direction is in the local coordinate * system, return the cosine of the angle between the normal and v */ inline static Float cosTheta(const Vector &v) { return v.z; @@ -114,7 +114,7 @@ struct Frame { return 1.0f - v.z * v.z; } - /** \brief Assuming that the given direction is in the local coordinate + /** \brief Assuming that the given direction is in the local coordinate * system, return the sine of the phi parameter in spherical coordinates */ inline static Float sinPhi(const Vector &v) { Float sinTheta = Frame::sinTheta(v); @@ -123,7 +123,7 @@ struct Frame { return clamp(v.y / sinTheta, (Float) -1.0f, (Float) 1.0f); } - /** \brief Assuming that the given direction is in the local coordinate + /** \brief Assuming that the given direction is in the local coordinate * system, return the cosine of the phi parameter in spherical coordinates */ inline static Float cosPhi(const Vector &v) { Float sinTheta = Frame::sinTheta(v); diff --git a/include/mitsuba/core/fresolver.h b/include/mitsuba/core/fresolver.h index 0a227f08..f2a7ff85 100644 --- a/include/mitsuba/core/fresolver.h +++ b/include/mitsuba/core/fresolver.h @@ -29,10 +29,10 @@ MTS_NAMESPACE_BEGIN /** * \brief File resolution helper - * - * FileResolver is a convenience class that allows searching for files + * + * FileResolver is a convenience class that allows searching for files * within a set of specifiable search paths in a cross-platform - * compatible manner (similar to the $PATH variable on various + * compatible manner (similar to the $PATH variable on various * operating systems). * * \ingroup libcore @@ -43,15 +43,15 @@ public: /** * \brief Create a new file resolver with the default settings * - * Create a new file resolver containing the current working + * Create a new file resolver containing the current working * directory as the initial search path. */ FileResolver(); /** * \brief Resolve a file using the stored list of search paths - * - * Go through the list of search paths and try to resolve the + * + * Go through the list of search paths and try to resolve the * supplied path with respect to each one. If everything fails, * the path is returned as-is. */ @@ -59,7 +59,7 @@ public: /** * \brief Resolve a file using the stored list of search paths - * + * * In comparison to \ref resolve(), this funtion returns all * matches instead of only the first one. * diff --git a/include/mitsuba/core/half.h b/include/mitsuba/core/half.h index 9d4ff92a..a022d6a6 100644 --- a/include/mitsuba/core/half.h +++ b/include/mitsuba/core/half.h @@ -8,9 +8,9 @@ // // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas // Digital Ltd. LLC -// +// // All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -22,8 +22,8 @@ // distribution. // * Neither the name of Industrial Light & Magic nor the names of // its contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// +// from this software without specific prior written permission. +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -311,9 +311,9 @@ MTS_EXPORT_CORE void printBits (char c[35], float f); // floating point number, whose bits are arranged as follows: // // 31 (msb) -// | +// | // | 30 23 -// | | | +// | | | // | | | 22 0 (lsb) // | | | | | // X XXXXXXXX XXXXXXXXXXXXXXXXXXXXXXX @@ -357,7 +357,7 @@ MTS_EXPORT_CORE void printBits (char c[35], float f); // Here is the bit-layout for a half number, h: // // 15 (msb) -// | +// | // | 14 10 // | | | // | | | 9 0 (lsb) @@ -562,7 +562,7 @@ half::round (unsigned int n) const // Other inline functions //----------------------- -inline half +inline half half::operator - () const { half h; @@ -651,7 +651,7 @@ half::operator /= (float f) } -inline bool +inline bool half::isFinite () const { unsigned short e = (_h >> 10) & 0x001f; @@ -701,7 +701,7 @@ half::isInfinity () const } -inline bool +inline bool half::isNegative () const { return (_h & 0x8000) != 0; diff --git a/include/mitsuba/core/kdtree.h b/include/mitsuba/core/kdtree.h index f0990ad4..de21446d 100644 --- a/include/mitsuba/core/kdtree.h +++ b/include/mitsuba/core/kdtree.h @@ -28,13 +28,13 @@ MTS_NAMESPACE_BEGIN /** * \brief Simple kd-tree node for use with \ref PointKDTree. * - * This class is an example of how one might write a space-efficient kd-tree - * node that is compatible with the \ref PointKDTree class. The implementation - * supports associating a custom data record with each node and works up to + * This class is an example of how one might write a space-efficient kd-tree + * node that is compatible with the \ref PointKDTree class. The implementation + * supports associating a custom data record with each node and works up to * 16 dimensions. * * \tparam _PointType Underlying point data type (e.g. \ref TPoint3) - * \tparam _DataRecord Custom storage that should be associated with each + * \tparam _DataRecord Custom storage that should be associated with each * tree node * * \ingroup libcore @@ -51,7 +51,7 @@ template struct SimpleKDNode { ELeafFlag = 0x10, EAxisMask = 0x0F }; - + static const bool leftBalancedLayout = false; PointType position; @@ -60,18 +60,18 @@ template struct SimpleKDNode { uint8_t flags; /// Initialize a KD-tree node - inline SimpleKDNode() : position((Scalar) 0), + inline SimpleKDNode() : position((Scalar) 0), right(0), data(), flags(0) { } /// Initialize a KD-tree node with the given data record - inline SimpleKDNode(const DataRecord &data) : position((Scalar) 0), + inline SimpleKDNode(const DataRecord &data) : position((Scalar) 0), right(0), data(data), flags(0) { } - /// Given the current node's index, return the index of the right child + /// Given the current node's index, return the index of the right child inline IndexType getRightIndex(IndexType self) const { return right; } /// Given the current node's index, set the right child index inline void setRightIndex(IndexType self, IndexType value) { right = value; } - /// Given the current node's index, return the index of the left child + /// Given the current node's index, return the index of the left child inline IndexType getLeftIndex(IndexType self) const { return self + 1; } /// Given the current node's index, set the left child index inline void setLeftIndex(IndexType self, IndexType value) { @@ -84,10 +84,10 @@ template struct SimpleKDNode { /// Check whether this is a leaf node inline bool isLeaf() const { return flags & (uint8_t) ELeafFlag; } /// Specify whether this is a leaf node - inline void setLeaf(bool value) { - if (value) - flags |= (uint8_t) ELeafFlag; - else + inline void setLeaf(bool value) { + if (value) + flags |= (uint8_t) ELeafFlag; + else flags &= (uint8_t) ~ELeafFlag; } @@ -118,7 +118,7 @@ template struct SimpleKDNode { * that there is no need to store node pointers within nodes. * * \tparam _PointType Underlying point data type (e.g. \ref TPoint3) - * \tparam _DataRecord Custom storage that should be associated with each + * \tparam _DataRecord Custom storage that should be associated with each * tree node * * \ingroup libcore @@ -145,10 +145,10 @@ template struct LeftBalancedKDNode { /// Initialize a KD-tree node inline LeftBalancedKDNode() : position((Scalar) 0), data(), flags(0) { } /// Initialize a KD-tree node with the given data record - inline LeftBalancedKDNode(const DataRecord &data) : position((Scalar) 0), + inline LeftBalancedKDNode(const DataRecord &data) : position((Scalar) 0), data(data), flags(0) { } - /// Given the current node's index, return the index of the left child + /// Given the current node's index, return the index of the left child inline IndexType getLeftIndex(IndexType self) const { return 2 * self + 1; } /// Given the current node's index, set the left child index inline void setLeftIndex(IndexType self, IndexType value) { @@ -158,7 +158,7 @@ template struct LeftBalancedKDNode { #endif } - /// Given the current node's index, return the index of the right child + /// Given the current node's index, return the index of the right child inline IndexType getRightIndex(IndexType self) const { return 2 * self + 2; } /// Given the current node's index, set the right child index inline void setRightIndex(IndexType self, IndexType value) { @@ -171,10 +171,10 @@ template struct LeftBalancedKDNode { /// Check whether this is a leaf node inline bool isLeaf() const { return flags & (uint8_t) ELeafFlag; } /// Specify whether this is a leaf node - inline void setLeaf(bool value) { - if (value) - flags |= (uint8_t) ELeafFlag; - else + inline void setLeaf(bool value) { + if (value) + flags |= (uint8_t) ELeafFlag; + else flags &= (uint8_t) ~ELeafFlag; } @@ -205,7 +205,7 @@ template struct LeftBalancedKDNode { * data layout of the nodes themselves. * * Note that this class is meant for point data only --- for things that - * have some kind of spatial extent, the classes \ref GenericKDTree and + * have some kind of spatial extent, the classes \ref GenericKDTree and * \ref ShapeKDTree will be more appropriate. * * \tparam _NodeType Underlying node data structure. See \ref SimpleKDNode as @@ -227,22 +227,22 @@ public: enum EHeuristic { /// Create a balanced tree by splitting along the median EBalanced = 0, - + /// Create a left-balanced tree ELeftBalanced, /** - * \brief Use the sliding midpoint tree construction rule. This + * \brief Use the sliding midpoint tree construction rule. This * ensures that cells do not become overly elongated. */ ESlidingMidpoint, /** * \brief Choose the split plane by optimizing a cost heuristic - * based on the ratio of voxel volumes. + * based on the ratio of voxel volumes. * - * Note that Mitsuba's implementation of this heuristic is not - * particularly optimized --- the tree construction construction + * Note that Mitsuba's implementation of this heuristic is not + * particularly optimized --- the tree construction construction * runs time O(n (log n)^2) instead of O(n log n). */ EVoxelVolume @@ -260,7 +260,7 @@ public: std::string toString() const { std::ostringstream oss; - oss << "SearchResult[distance=" << std::sqrt(distSquared) + oss << "SearchResult[distance=" << std::sqrt(distSquared) << ", index=" << index << "]"; return oss.str(); } @@ -272,7 +272,7 @@ public: }; /// Comparison functor for nearest-neighbor search queries - struct SearchResultComparator : public + struct SearchResultComparator : public std::binary_function { public: inline bool operator()(const SearchResult &a, const SearchResult &b) const { @@ -281,7 +281,7 @@ public: }; public: - /** + /** * \brief Create an empty KD-tree that can hold the specified * number of points */ @@ -344,8 +344,8 @@ public: timer->reset(); /* Instead of shuffling around the node data itself, only modify - an indirection table initially. Once the tree construction - is done, this table will contain a indirection that can then + an indirection table initially. Once the tree construction + is done, this table will contain a indirection that can then be applied to the data in one pass */ std::vector indirection(m_nodes.size()); for (size_t i=0; i permutation(m_nodes.size()); - buildLB(0, 1, indirection.begin(), indirection.begin(), + buildLB(0, 1, indirection.begin(), indirection.begin(), indirection.end(), permutation); constructionTime = timer->getMilliseconds(); timer->reset(); @@ -381,16 +381,16 @@ public: * \brief Run a k-nearest-neighbor search query * * \param p Search position - * \param sqrSearchRadius - * Specifies the squared maximum search radius. This parameter can be used + * \param sqrSearchRadius + * Specifies the squared maximum search radius. This parameter can be used * to restrict the k-nn query to a subset of the data -- it that is not * desired, simply set it to positive infinity. After the query - * finishes, the parameter value will correspond to the (potentially lower) - * maximum query radius that was necessary to ensure that the number of + * finishes, the parameter value will correspond to the (potentially lower) + * maximum query radius that was necessary to ensure that the number of * results did not exceed \c k. * \param k Maximum number of search results - * \param results Target array for search results. Must - * contain storage for at least \c k+1 entries! + * \param results Target array for search results. Must + * contain storage for at least \c k+1 entries! * (one extra entry is needed for shuffling data around) * \return The number of search results (equal to \c k or less) */ @@ -409,15 +409,15 @@ public: while (stackPos > 0) { const NodeType &node = m_nodes[index]; IndexType nextIndex; - + /* Recurse on inner nodes */ if (!node.isLeaf()) { Float distToPlane = p[node.getAxis()] - node.getPosition()[node.getAxis()]; - + bool searchBoth = distToPlane*distToPlane <= sqrSearchRadius; if (distToPlane > 0) { - /* The search query is located on the right side of the split. + /* The search query is located on the right side of the split. Search this side first. */ if (hasRightChild(index)) { if (searchBoth) @@ -429,7 +429,7 @@ public: nextIndex = stack[--stackPos]; } } else { - /* The search query is located on the left side of the split. + /* The search query is located on the left side of the split. Search this side first. */ if (searchBoth && hasRightChild(index)) stack[stackPos++] = node.getRightIndex(index); @@ -439,12 +439,12 @@ public: } else { nextIndex = stack[--stackPos]; } - + /* Check if the current point is within the query's search radius */ const Float pointDistSquared = (node.getPosition() - p).lengthSquared(); - + if (pointDistSquared < sqrSearchRadius) { - /* Switch to a max-heap when the available search + /* Switch to a max-heap when the available search result space is exhausted */ if (resultCount < k) { /* There is still room, just add the point to @@ -453,17 +453,17 @@ public: } else { if (!isHeap) { /* Establish the max-heap property */ - std::make_heap(results, results + resultCount, + std::make_heap(results, results + resultCount, SearchResultComparator()); isHeap = true; } SearchResult *end = results + resultCount + 1; - + /* Add the new point, remove the one that is farthest away */ results[resultCount] = SearchResult(pointDistSquared, index); std::push_heap(results, end, SearchResultComparator()); std::pop_heap(results, end, SearchResultComparator()); - + /* Reduce the search radius accordingly */ sqrSearchRadius = results[0].distSquared; } @@ -478,17 +478,17 @@ public: * \brief Run a k-nearest-neighbor search query and record statistics * * \param p Search position - * \param sqrSearchRadius - * Specifies the squared maximum search radius. This parameter can be used + * \param sqrSearchRadius + * Specifies the squared maximum search radius. This parameter can be used * to restrict the k-nn query to a subset of the data -- it that is not * desired, simply set it to positive infinity. After the query - * finishes, the parameter value will correspond to the (potentially lower) - * maximum query radius that was necessary to ensure that the number of + * finishes, the parameter value will correspond to the (potentially lower) + * maximum query radius that was necessary to ensure that the number of * results did not exceed \c k. * \param k Maximum number of search results * \param results - * Target array for search results. Must contain - * storage for at least \c k+1 entries! (one + * Target array for search results. Must contain + * storage for at least \c k+1 entries! (one * extra entry is needed for shuffling data around) * \return The number of used traversal steps */ @@ -509,15 +509,15 @@ public: const NodeType &node = m_nodes[index]; ++traversalSteps; IndexType nextIndex; - + /* Recurse on inner nodes */ if (!node.isLeaf()) { Float distToPlane = p[node.getAxis()] - node.getPosition()[node.getAxis()]; - + bool searchBoth = distToPlane*distToPlane <= sqrSearchRadius; if (distToPlane > 0) { - /* The search query is located on the right side of the split. + /* The search query is located on the right side of the split. Search this side first. */ if (hasRightChild(index)) { if (searchBoth) @@ -529,7 +529,7 @@ public: nextIndex = stack[--stackPos]; } } else { - /* The search query is located on the left side of the split. + /* The search query is located on the left side of the split. Search this side first. */ if (searchBoth && hasRightChild(index)) stack[stackPos++] = node.getRightIndex(index); @@ -539,12 +539,12 @@ public: } else { nextIndex = stack[--stackPos]; } - + /* Check if the current point is within the query's search radius */ const Float pointDistSquared = (node.getPosition() - p).lengthSquared(); - + if (pointDistSquared < sqrSearchRadius) { - /* Switch to a max-heap when the available search + /* Switch to a max-heap when the available search result space is exhausted */ if (resultCount < k) { /* There is still room, just add the point to @@ -553,16 +553,16 @@ public: } else { if (!isHeap) { /* Establish the max-heap property */ - std::make_heap(results, results + resultCount, + std::make_heap(results, results + resultCount, SearchResultComparator()); isHeap = true; } - + /* Add the new point, remove the one that is farthest away */ results[resultCount] = SearchResult(pointDistSquared, index); std::push_heap(results, results + resultCount + 1, SearchResultComparator()); std::pop_heap(results, results + resultCount + 1, SearchResultComparator()); - + /* Reduce the search radius accordingly */ sqrSearchRadius = results[0].distSquared; } @@ -579,13 +579,13 @@ public: * \param p Search position * \param k Maximum number of search results * \param results - * Target array for search results. Must contain - * storage for at least \c k+1 entries! (one + * Target array for search results. Must contain + * storage for at least \c k+1 entries! (one * extra entry is needed for shuffling data around) * \return The number of used traversal steps */ - inline size_t nnSearch(const PointType &p, size_t k, + inline size_t nnSearch(const PointType &p, size_t k, SearchResult *results) const { Float searchRadiusSqr = std::numeric_limits::infinity(); return nnSearch(p, searchRadiusSqr, k, results); @@ -600,7 +600,7 @@ public: * * \param p Search position * \param functor Functor to be called on each search result - * \param searchRadius Search radius + * \param searchRadius Search radius * \return The number of functor invocations */ template size_t executeModifier(const PointType &p, @@ -616,16 +616,16 @@ public: while (stackPos > 0) { NodeType &node = m_nodes[index]; IndexType nextIndex; - + /* Recurse on inner nodes */ if (!node.isLeaf()) { - Float distToPlane = p[node.getAxis()] + Float distToPlane = p[node.getAxis()] - node.getPosition()[node.getAxis()]; - + bool searchBoth = distToPlane*distToPlane <= distSquared; if (distToPlane > 0) { - /* The search query is located on the right side of the split. + /* The search query is located on the right side of the split. Search this side first. */ if (hasRightChild(index)) { if (searchBoth) @@ -637,7 +637,7 @@ public: nextIndex = stack[--stackPos]; } } else { - /* The search query is located on the left side of the split. + /* The search query is located on the left side of the split. Search this side first. */ if (searchBoth && hasRightChild(index)) stack[stackPos++] = node.getRightIndex(index); @@ -647,10 +647,10 @@ public: } else { nextIndex = stack[--stackPos]; } - + /* Check if the current point is within the query's search radius */ const Float pointDistSquared = (node.getPosition() - p).lengthSquared(); - + if (pointDistSquared < distSquared) { functor(node); ++found; @@ -669,7 +669,7 @@ public: * * \param p Search position * \param functor Functor to be called on each search result - * \param searchRadius Search radius + * \param searchRadius Search radius * \return The number of functor invocations */ template size_t executeQuery(const PointType &p, @@ -685,16 +685,16 @@ public: while (stackPos > 0) { const NodeType &node = m_nodes[index]; IndexType nextIndex; - + /* Recurse on inner nodes */ if (!node.isLeaf()) { - Float distToPlane = p[node.getAxis()] + Float distToPlane = p[node.getAxis()] - node.getPosition()[node.getAxis()]; - + bool searchBoth = distToPlane*distToPlane <= distSquared; if (distToPlane > 0) { - /* The search query is located on the right side of the split. + /* The search query is located on the right side of the split. Search this side first. */ if (hasRightChild(index)) { if (searchBoth) @@ -706,7 +706,7 @@ public: nextIndex = stack[--stackPos]; } } else { - /* The search query is located on the left side of the split. + /* The search query is located on the left side of the split. Search this side first. */ if (searchBoth && hasRightChild(index)) stack[stackPos++] = node.getRightIndex(index); @@ -719,7 +719,7 @@ public: /* Check if the current point is within the query's search radius */ const Float pointDistSquared = (node.getPosition() - p).lengthSquared(); - + if (pointDistSquared < distSquared) { ++found; functor(node); @@ -736,7 +736,7 @@ public: * * \param p Search position * \param results Index list of search results - * \param searchRadius Search radius + * \param searchRadius Search radius * \return The number of functor invocations */ size_t search(const PointType &p, Float searchRadius, std::vector &results) const { @@ -751,16 +751,16 @@ public: while (stackPos > 0) { const NodeType &node = m_nodes[index]; IndexType nextIndex; - + /* Recurse on inner nodes */ if (!node.isLeaf()) { Float distToPlane = p[node.getAxis()] - node.getPosition()[node.getAxis()]; - + bool searchBoth = distToPlane*distToPlane <= distSquared; if (distToPlane > 0) { - /* The search query is located on the right side of the split. + /* The search query is located on the right side of the split. Search this side first. */ if (hasRightChild(index)) { if (searchBoth) @@ -772,7 +772,7 @@ public: nextIndex = stack[--stackPos]; } } else { - /* The search query is located on the left side of the split. + /* The search query is located on the left side of the split. Search this side first. */ if (searchBoth && hasRightChild(index)) stack[stackPos++] = node.getRightIndex(index); @@ -782,11 +782,11 @@ public: } else { nextIndex = stack[--stackPos]; } - + /* Check if the current point is within the query's search radius */ const Float pointDistSquared = (node.getPosition() - p).lengthSquared(); - - if (pointDistSquared < distSquared) { + + if (pointDistSquared < distSquared) { ++found; results.push_back(index); } @@ -797,10 +797,10 @@ public: } /** - * \brief Return whether or not the inner node of the + * \brief Return whether or not the inner node of the * specified index has a right child node. * - * This function is available for convenience and abstracts away some + * This function is available for convenience and abstracts away some * details about the underlying node representation. */ inline bool hasRightChild(IndexType index) const { @@ -813,7 +813,7 @@ public: protected: struct CoordinateOrdering : public std::binary_function { public: - inline CoordinateOrdering(const std::vector &nodes, int axis) + inline CoordinateOrdering(const std::vector &nodes, int axis) : m_nodes(nodes), m_axis(axis) { } inline bool operator()(const IndexType &i1, const IndexType &i2) const { return m_nodes[i1].getPosition()[m_axis] < m_nodes[i2].getPosition()[m_axis]; @@ -825,7 +825,7 @@ protected: struct LessThanOrEqual : public std::unary_function { public: - inline LessThanOrEqual(const std::vector &nodes, int axis, Scalar value) + inline LessThanOrEqual(const std::vector &nodes, int axis, Scalar value) : m_nodes(nodes), m_axis(axis), m_value(value) { } inline bool operator()(const IndexType &i) const { return m_nodes[i].getPosition()[m_axis] <= m_value; @@ -838,9 +838,9 @@ protected: /** * Given a number of entries, this method calculates the number of nodes - * nodes on the left subtree of a left-balanced tree. There are two main + * nodes on the left subtree of a left-balanced tree. There are two main * cases here: - * + * * 1) It is possible to completely fill the left subtree * 2) It doesn't work - the last level contains too few nodes, e.g : * O @@ -848,21 +848,21 @@ protected: * O O * / * O - * + * * The function assumes that "count" > 1. */ inline IndexType leftSubtreeSize(IndexType count) const { /* Layer 0 contains one node */ IndexType p = 1; - + /* Traverse downwards until the first incompletely filled tree level is encountered */ while (2*p <= count) p *= 2; - + /* Calculate the number of filled slots in the last level */ IndexType remaining = count - p + 1; - + if (2*remaining < p) { /* Case 2: The last level contains too few nodes. Remove overestimate from the left subtree node count and add @@ -876,7 +876,7 @@ protected: /// Left-balanced tree construction routine void buildLB(IndexType idx, size_t depth, typename std::vector::iterator base, - typename std::vector::iterator rangeStart, + typename std::vector::iterator rangeStart, typename std::vector::iterator rangeEnd, typename std::vector &permutation) { m_depth = std::max(depth, m_depth); @@ -920,10 +920,10 @@ protected: /// Default tree construction routine void build(size_t depth, typename std::vector::iterator base, - typename std::vector::iterator rangeStart, + typename std::vector::iterator rangeStart, typename std::vector::iterator rangeEnd) { m_depth = std::max(depth, m_depth); - + IndexType count = (IndexType) (rangeEnd-rangeStart); SAssert(count > 0); @@ -940,7 +940,7 @@ protected: case EBalanced: { split = rangeStart + count/2; axis = m_aabb.getLargestAxis(); - std::nth_element(rangeStart, split, rangeEnd, + std::nth_element(rangeStart, split, rangeEnd, CoordinateOrdering(m_nodes, axis)); }; break; @@ -957,7 +957,7 @@ protected: /* Sliding midpoint rule: find a split that is close to the spatial median */ axis = m_aabb.getLargestAxis(); - Scalar midpoint = (Scalar) 0.5f + Scalar midpoint = (Scalar) 0.5f * (m_aabb.max[axis]+m_aabb.min[axis]); size_t nLT = std::count_if(rangeStart, rangeEnd, @@ -975,18 +975,18 @@ protected: CoordinateOrdering(m_nodes, axis)); }; break; - + case EVoxelVolume: { Float bestCost = std::numeric_limits::infinity(); for (int dim=0; dim::iterator it = rangeStart+1; + for (typename std::vector::iterator it = rangeStart+1; it != rangeEnd; ++it) { ++numLeft; --numRight; Float pos = m_nodes[*it].getPosition()[dim]; @@ -1011,10 +1011,10 @@ protected: splitNode.setAxis(axis); splitNode.setLeaf(false); - if (split+1 != rangeEnd) + if (split+1 != rangeEnd) splitNode.setRightIndex((IndexType) (rangeStart - base), (IndexType) (split + 1 - base)); - else + else splitNode.setRightIndex((IndexType) (rangeStart - base), 0); splitNode.setLeftIndex((IndexType) (rangeStart - base), diff --git a/include/mitsuba/core/lock.h b/include/mitsuba/core/lock.h index c94a9b0e..ec1ff85b 100644 --- a/include/mitsuba/core/lock.h +++ b/include/mitsuba/core/lock.h @@ -79,7 +79,7 @@ public: /** * \brief Temporarily wait for the flag to be set to true - * + * * Similar to \ref wait(), but also uses a time value given * in milliseconds. A return value of \c false signals * that a timeout has occurred. @@ -106,31 +106,31 @@ private: class MTS_EXPORT_CORE ConditionVariable : public Object { public: /** - * \brief Create a new condition variable. Also takes a + * \brief Create a new condition variable. Also takes a * mutex, which is later used by wait(). If none is specified, * a new mutex instance will be created. */ ConditionVariable(Mutex *mutex = NULL); /** - * \brief Send a signal, which wakes up at least one of - * the waiting threads. - * - * The calling thread does not have to hold the lock, - * but more predictable scheduling will occur if this is the + * \brief Send a signal, which wakes up at least one of + * the waiting threads. + * + * The calling thread does not have to hold the lock, + * but more predictable scheduling will occur if this is the * case. */ void signal(); /** - * \brief Send a signal, which wakes up any waiting threads. + * \brief Send a signal, which wakes up any waiting threads. * * The calling thread does not have to hold the lock, but more * predictable scheduling will occur if this is the case. */ void broadcast(); - /** + /** * \brief Wait for a signal and release the lock in the meanwhile. * * Assumes that the lock specified in the constructor has @@ -224,7 +224,7 @@ public: inline bool operator!() const { return !ownsLock(); } - + inline bool ownsLock() const { return is_locked; } diff --git a/include/mitsuba/core/logger.h b/include/mitsuba/core/logger.h index f5b645bd..0a2ad6b1 100644 --- a/include/mitsuba/core/logger.h +++ b/include/mitsuba/core/logger.h @@ -63,13 +63,13 @@ MTS_NAMESPACE_BEGIN /*! \addtogroup libcore */ /*! @{ */ -/// Assert that a condition is true (to be used \a inside of classes that derive from \ref Object) +/// Assert that a condition is true (to be used \a inside of classes that derive from \ref Object) #define Assert(cond) do { \ if (!(cond)) Log(EError, "Assertion \"%s\" failed in %s:%i", \ #cond, __FILE__, __LINE__); \ } while (0) -/// ``Static'' assertion (to be used \a outside of classes that derive from \ref Object) +/// ``Static'' assertion (to be used \a outside of classes that derive from \ref Object) #define SAssert(cond) do { \ if (!(cond)) SLog(EError, "Assertion \"%s\" failed in %s:%i", \ #cond, __FILE__, __LINE__); \ @@ -95,13 +95,13 @@ MTS_NAMESPACE_BEGIN /*! @} */ -/** +/** * \headerfile mitsuba/core/logger.h mitsuba/mitsuba.h * \brief Responsible for processing log messages - * - * Upon receiving a log message, the Logger class invokes + * + * Upon receiving a log message, the Logger class invokes * a Formatter to convert it into a human-readable form. - * Following that, it sends this information to every + * Following that, it sends this information to every * registered Appender. * * \ingroup libcore @@ -122,8 +122,8 @@ public: * \note This function is not exposed in the Python bindings. * Instead, please use \cc mitsuba.core.Log */ - void log(ELogLevel level, const Class *theClass, - const char *fileName, int lineNumber, + void log(ELogLevel level, const Class *theClass, + const char *fileName, int lineNumber, const char *fmt, ...); /** @@ -145,7 +145,7 @@ public: void setLogLevel(ELogLevel level); /** - * \brief Set the error log level (this level and anything + * \brief Set the error log level (this level and anything * above will throw exceptions). * * The value provided here can be used for instance to turn @@ -157,7 +157,7 @@ public: /// Return the current log level inline ELogLevel getLogLevel() const { return m_logLevel; } - + /// Return the current error level inline ELogLevel getErrorLevel() const { return m_errorLevel; } @@ -175,7 +175,7 @@ public: /// Return one of the appenders inline Appender *getAppender(size_t index) { return m_appenders[index]; } - + /// Return one of the appenders inline const Appender *getAppender(size_t index) const { return m_appenders[index]; } @@ -184,7 +184,7 @@ public: /// Return the logger's formatter implementation inline Formatter *getFormatter() { return m_formatter; } - + /** * \brief Return the contents of the log file as a string (if it exists) * @@ -197,7 +197,7 @@ public: /// Initialize logging static void staticInitialization(); - + /// Shutdown logging static void staticShutdown(); @@ -213,7 +213,7 @@ private: std::vector m_appenders; size_t m_warningCount; }; - + MTS_NAMESPACE_END #endif /* __MITSUBA_CORE_LOGGER_H_ */ diff --git a/include/mitsuba/core/lrucache.h b/include/mitsuba/core/lrucache.h index 87f6ef83..18e7bb74 100644 --- a/include/mitsuba/core/lrucache.h +++ b/include/mitsuba/core/lrucache.h @@ -39,17 +39,17 @@ MTS_NAMESPACE_BEGIN * The original code is under the following license: * *
    - * Copyright (c) 2010, Tim Day  
    - * Permission to use, copy, modify, and/or distribute this software for any 
    - * purpose with or without fee is hereby granted, provided that the above 
    - * copyright notice and this permission notice appear in all copies. 
    - *  
    - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 
    - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 
    - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 
    - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 
    - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 
    - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 
    + * Copyright (c) 2010, Tim Day 
    + * Permission to use, copy, modify, and/or distribute this software for any
    + * purpose with or without fee is hereby granted, provided that the above
    + * copyright notice and this permission notice appear in all copies.
    + *
    + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
    + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
    + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
    + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
    + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
    + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
      * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
      * 
    * @@ -85,11 +85,11 @@ public: typename cache_type::right_iterator src = m_cache.right.begin(); if (m_cleanupFunction) { - while (src != m_cache.right.end()) + while (src != m_cache.right.end()) m_cleanupFunction((*src++).info); } } - + bool isFull() const { return m_cache.size() == m_capacity; } @@ -97,7 +97,7 @@ public: // Obtain value of the cached function for k V get(const K& k, bool &hit) { // Attempt to find existing record - const typename cache_type::left_iterator it + const typename cache_type::left_iterator it = m_cache.left.find(k); if (it == m_cache.left.end()) { @@ -127,7 +127,7 @@ public: template void get_keys(IT dst) const { typename cache_type::right_const_reverse_iterator src = m_cache.right.rbegin(); - while (src != m_cache.right.rend()) + while (src != m_cache.right.rend()) *dst++=(*src++).second; } protected: diff --git a/include/mitsuba/core/matrix.h b/include/mitsuba/core/matrix.h index c1fa07f7..dbd5a14b 100644 --- a/include/mitsuba/core/matrix.h +++ b/include/mitsuba/core/matrix.h @@ -34,9 +34,9 @@ template struct Matrix { public: T m[M][N]; - /** + /** * \brief Construct a new MxN matrix without initializing it. - * + * * This construtor is useful when the matrix will either not * be used at all (it might be part of a larger data structure) * or initialized at a later point in time. Always make sure @@ -328,7 +328,7 @@ public: * * Based on the implementation in JAMA. */ - template void cholSolve(const Matrix &B, + template void cholSolve(const Matrix &B, Matrix &X) const; /** @@ -340,11 +340,11 @@ public: * * Based on the implementation in JAMA. */ - template void luSolve(const Matrix &B, + template void luSolve(const Matrix &B, Matrix &X, int piv[M]) const; /** - * \brief Compute the determinant of a decomposed matrix + * \brief Compute the determinant of a decomposed matrix * created by \ref lu() * * \param pivsign The sign of the pivoting permutation returned @@ -355,7 +355,7 @@ public: T luDet(int pivsign) const; /** - * \brief Compute the determinant of a decomposed matrix + * \brief Compute the determinant of a decomposed matrix * created by \ref chol() */ @@ -397,7 +397,7 @@ public: bool invert(Matrix &target) const; /** - * \brief Perform a symmetric eigendecomposition of a square matrix + * \brief Perform a symmetric eigendecomposition of a square matrix * into Q and D. * * Based on the implementation in JAMA. @@ -468,7 +468,7 @@ public: /// Initialize the matrix from two 2D column vectors explicit inline Matrix2x2(const Vector2 &v1, const Vector2 &v2) { m[0][0] = v1.x; m[0][1] = v2.x; - m[1][0] = v1.y; m[1][1] = v2.y; + m[1][0] = v1.y; m[1][1] = v2.y; } /// Unserialize a matrix from a stream @@ -480,7 +480,7 @@ public: /// Initialize with the given values inline Matrix2x2(Float a00, Float a01, Float a10, Float a11) { m[0][0] = a00; m[0][1] = a01; - m[1][0] = a10; m[1][1] = a11; + m[1][0] = a10; m[1][1] = a11; } /// Return the determinant (Faster than Matrix::det) @@ -563,7 +563,7 @@ public: /// Unserialize a matrix from a stream explicit inline Matrix3x3(Stream *stream) : Matrix<3, 3, Float>(stream) { } - + /// Copy constructor inline Matrix3x3(const Matrix<3, 3, Float> &mtx) : Matrix<3, 3, Float>(mtx) { } @@ -717,7 +717,7 @@ struct MTS_EXPORT_CORE Matrix4x4 : public Matrix<4, 4, Float> { }; /// Matrix multiplication (creates a temporary) -template inline Matrix +template inline Matrix operator*(const Matrix &mat1, const Matrix &mat2) { BOOST_STATIC_ASSERT(N1 == M2); Matrix result; @@ -750,7 +750,7 @@ extern MTS_EXPORT_CORE bool eig3(Matrix3x3 &m, Float lambda[3]); /** * \brief Fast non-iterative 3x3 eigenvalue decomposition - * + * * \param m * Matrix in question -- will be replaced with the eigenvectors * \param lambda diff --git a/include/mitsuba/core/matrix.inl b/include/mitsuba/core/matrix.inl index ddde6e1f..4c71d427 100644 --- a/include/mitsuba/core/matrix.inl +++ b/include/mitsuba/core/matrix.inl @@ -1,7 +1,7 @@ MTS_NAMESPACE_BEGIN /* Implementations are based on the public domain JAMA library */ - + template bool Matrix::chol(Matrix &L) const { BOOST_STATIC_ASSERT(M == N); @@ -21,15 +21,15 @@ template bool Matrix::chol(Matrix &L) const if (d <= 0) return false; L.m[j][j] = std::sqrt(std::max(d, (T) 0)); - for (int k = j+1; k < N; k++) + for (int k = j+1; k < N; k++) L.m[j][k] = 0; } return true; } -template template void Matrix::cholSolve(const Matrix &B, - Matrix &X) const { +template template void Matrix::cholSolve(const Matrix &B, + Matrix &X) const { BOOST_STATIC_ASSERT(M == N); memcpy(X.m, B.m, sizeof(T)*M*K); @@ -67,12 +67,12 @@ template bool Matrix::lu(Matrix &LU, // Find pivot. int p = k; for (int i = k+1; i < M; i++) - if (std::abs(LU.m[i][k]) > std::abs(LU.m[p][k])) + if (std::abs(LU.m[i][k]) > std::abs(LU.m[p][k])) p = i; // Exchange if necessary. if (p != k) { - for (int j = 0; j < N; j++) + for (int j = 0; j < N; j++) std::swap(LU.m[p][j], LU.m[k][j]); std::swap(piv[p], piv[k]); pivsign = -pivsign; @@ -93,19 +93,19 @@ template bool Matrix::lu(Matrix &LU, return true; } -template template void Matrix::luSolve(const Matrix &B, - Matrix &X, int piv[M]) const { +template template void Matrix::luSolve(const Matrix &B, + Matrix &X, int piv[M]) const { BOOST_STATIC_ASSERT(M == N); // Copy right hand side with pivoting for (int i=0; i bool Matrix::invert(Matrix &target) } // Symmetric Householder reduction to tridiagonal form. -template void +template void Matrix::tred2(T V[M][N], T d[N], T e[N]) { // This is derived from the Algol procedures tred2 by // Bowdler, Martin, Reinsch, and Wilkinson, Handbook for @@ -202,7 +202,7 @@ template void for (int j = 0; j < N; j++) d[j] = V[N - 1][j]; - + // Householder reduction to tridiagonal form. for (int i = N - 1; i > 0; i--) { // Scale to avoid under/overflow. @@ -225,7 +225,7 @@ template void d[k] /= scale; h += d[k] * d[k]; } - T f = d[i - 1], + T f = d[i - 1], g = std::sqrt(h); if (f > 0) @@ -300,7 +300,7 @@ template void } // Symmetric tridiagonal QL algorithm. -template void +template void Matrix::tql2(T V[M][N], T d[N], T e[N]) { // This is derived from the Algol procedures tql2, by // Bowdler, Martin, Reinsch, and Wilkinson, Handbook for diff --git a/include/mitsuba/core/mempool.h b/include/mitsuba/core/mempool.h index 0b1d3fef..3920560f 100644 --- a/include/mitsuba/core/mempool.h +++ b/include/mitsuba/core/mempool.h @@ -23,7 +23,7 @@ #include MTS_NAMESPACE_BEGIN - + /// Create a new memory pool with an initial set of 128 entries #define MTS_MEMPOOL_GRANULARITY 128 @@ -31,12 +31,12 @@ MTS_NAMESPACE_BEGIN #define MTS_DEBUG_MEMPOOL 0 /** - * \brief Basic memory pool for efficient allocation and deallocation + * \brief Basic memory pool for efficient allocation and deallocation * of objects of the same type. * * This class attempts to keep most instances contiguous in memory, while * having only minimal interaction with the underlying allocator. - * + * * \ingroup libcore */ template class BasicMemoryPool { @@ -82,12 +82,12 @@ public: inline size_t size() const { return m_size; } - + /// Check if every entry has been released bool unused() const { return m_free.size() == m_size; } - + /// Return a human-readable description std::string toString() const { std::ostringstream oss; diff --git a/include/mitsuba/core/mstream.h b/include/mitsuba/core/mstream.h index 5e2b67b0..947b403c 100644 --- a/include/mitsuba/core/mstream.h +++ b/include/mitsuba/core/mstream.h @@ -24,9 +24,9 @@ MTS_NAMESPACE_BEGIN -/** \brief Simple memory buffer-based stream with automatic memory management - * - * The underlying memory storage of this implementation dynamically expands +/** \brief Simple memory buffer-based stream with automatic memory management + * + * The underlying memory storage of this implementation dynamically expands * as data is written to the stream. * * \ingroup libcore @@ -42,7 +42,7 @@ public: /** * \brief Create a memory stream, which operates on a - * pre-allocated buffer. + * pre-allocated buffer. * * A memory stream created in this way will never resize the * underlying buffer. An exception is thrown e.g. when attempting @@ -59,13 +59,13 @@ public: /// Return the underlying data inline uint8_t *getData() { return m_data; } - + /// Return the underlying data (const version) inline const uint8_t *getData() const { return m_data; } /// Return the underlying data at the current position inline uint8_t *getCurrentData() { return m_data + m_pos; } - + /// Return the underlying data at the current position (const version) inline const uint8_t *getCurrentData() const { return m_data + m_pos; } diff --git a/include/mitsuba/core/netobject.h b/include/mitsuba/core/netobject.h index ce585f17..6d00b0f1 100644 --- a/include/mitsuba/core/netobject.h +++ b/include/mitsuba/core/netobject.h @@ -24,15 +24,15 @@ MTS_NAMESPACE_BEGIN -/** \brief Abstract interface for objects that reference shared network +/** \brief Abstract interface for objects that reference shared network * resources. - * - * When a networked object is serialized as part of a parallel process - * executed on multiple machines, the object is first given the - * opportunity to bind named resources to the process (by a call to - * \ref bindUsedResources()). These will then be distributed to all - * participating compute servers. Once unserialized on the remote side, - * \ref wakeup() is called to let the object re-associate with the + * + * When a networked object is serialized as part of a parallel process + * executed on multiple machines, the object is first given the + * opportunity to bind named resources to the process (by a call to + * \ref bindUsedResources()). These will then be distributed to all + * participating compute servers. Once unserialized on the remote side, + * \ref wakeup() is called to let the object re-associate with the * shared resources. * * \ingroup libcore @@ -58,7 +58,7 @@ protected: inline NetworkedObject(const Properties &props) : ConfigurableObject(props) { } /// Unserialize a configurable object - inline NetworkedObject(Stream *stream, InstanceManager *manager) + inline NetworkedObject(Stream *stream, InstanceManager *manager) : ConfigurableObject(stream, manager) { } }; diff --git a/include/mitsuba/core/normal.h b/include/mitsuba/core/normal.h index 3cdb9df6..b53c7f1a 100644 --- a/include/mitsuba/core/normal.h +++ b/include/mitsuba/core/normal.h @@ -28,9 +28,9 @@ MTS_NAMESPACE_BEGIN * \headerfile mitsuba/core/normal.h mitsuba/mitsuba.h * \brief Three-dimensional normal data structure * - * Internally represented using floating point numbers of the chosen + * Internally represented using floating point numbers of the chosen * compile-time precision. The main difference of this data structure - * when compared to \ref TVector3 is in how instances of + * when compared to \ref TVector3 is in how instances of * \ref Normal are treated by linear transformations. * * \ingroup libcore @@ -38,7 +38,7 @@ MTS_NAMESPACE_BEGIN */ struct Normal : public TVector3 { /** \brief Construct a new normal without initializing it. - * + * * This construtor is useful when the normal will either not * be used at all (it might be part of a larger data structure) * or initialized at a later point in time. Always make sure diff --git a/include/mitsuba/core/object.h b/include/mitsuba/core/object.h index b73e0b69..01a619fc 100644 --- a/include/mitsuba/core/object.h +++ b/include/mitsuba/core/object.h @@ -28,7 +28,7 @@ MTS_NAMESPACE_BEGIN * \headerfile mitsuba/core/object.h mitsuba/mitsuba.h * \brief Parent of all Mitsuba classes. * - * Contains functions relevant to every object such as reference counting, + * Contains functions relevant to every object such as reference counting, * limited type introspection and lifetime management. * * \sa ref, Class @@ -37,7 +37,7 @@ MTS_NAMESPACE_BEGIN */ class MTS_EXPORT_CORE Object { public: - /// Construct a new object + /// Construct a new object Object(); /// Return the current reference count @@ -48,10 +48,10 @@ public: */ void incRef() const; - /** \brief Decrease the reference count of - * the object and possibly deallocate it. + /** \brief Decrease the reference count of + * the object and possibly deallocate it. * - * The object will automatically be deallocated once + * The object will automatically be deallocated once * the reference count reaches zero. */ void decRef() const; @@ -70,7 +70,7 @@ public: */ virtual std::string toString() const; - /** \brief Initializes the built-in reference count + /** \brief Initializes the built-in reference count * debugger (if enabled) */ static void staticInitialization(); diff --git a/include/mitsuba/core/octree.h b/include/mitsuba/core/octree.h index 94c2142a..04b9d36e 100644 --- a/include/mitsuba/core/octree.h +++ b/include/mitsuba/core/octree.h @@ -30,9 +30,9 @@ MTS_NAMESPACE_BEGIN /** * \brief Lock-free linked list data structure * - * This class provides a very basic linked list data structure whose primary + * This class provides a very basic linked list data structure whose primary * purpose it is to efficiently service append operations from multiple parallel - * threads. These are internally realized via atomic compare and exchange + * threads. These are internally realized via atomic compare and exchange * operations, meaning that no lock must be acquired. * * \ingroup libcore @@ -79,7 +79,7 @@ private: * This class is currently used to implement BSSRDF evaluation * with irradiance point clouds. * - * The \c Item template parameter must implement a function + * The \c Item template parameter must implement a function * named getPosition() that returns a \ref Point. * * \ingroup libcore @@ -120,7 +120,7 @@ public: * * By default, the maximum tree depth is set to 16 */ - inline StaticOctree(const AABB &aabb, uint32_t maxDepth = 24, uint32_t maxItems = 8) : + inline StaticOctree(const AABB &aabb, uint32_t maxDepth = 24, uint32_t maxItems = 8) : m_aabb(aabb), m_maxDepth(maxDepth), m_maxItems(maxItems), m_root(NULL) { } /// Release all memory @@ -220,7 +220,7 @@ protected: OctreeNode *result = new OctreeNode(); for (int i=0; i<8; i++) { AABB bounds = childBounds(i, aabb, center); - + uint32_t *it = start + nestedCounts[i]; result->children[i] = build(bounds, depth+1, base, temp, start, it); start = it; @@ -243,7 +243,7 @@ protected: /** * \brief Generic multiple-reference octree with support for parallel dynamic updates * - * Based on the excellent implementation in PBRT. Modifications are + * Based on the excellent implementation in PBRT. Modifications are * the addition of a bounding sphere query and support for multithreading. * * This class is currently used to implement irradiance caching. @@ -257,11 +257,11 @@ public: * * By default, the maximum tree depth is set to 24 */ - inline DynamicOctree(const AABB &aabb, uint32_t maxDepth = 24) + inline DynamicOctree(const AABB &aabb, uint32_t maxDepth = 24) : m_aabb(aabb), m_maxDepth(maxDepth) { } - /// Insert an item with the specified cell coverage + /// Insert an item with the specified cell coverage inline void insert(const Item &value, const AABB &coverage) { insert(&m_root, m_aabb, value, coverage, coverage.getExtents().lengthSquared(), 0); @@ -280,7 +280,7 @@ public: return; searchSphere(&m_root, m_aabb, sphere, functor); } - + inline const AABB &getAABB() const { return m_aabb; } private: struct OctreeNode { @@ -313,12 +313,12 @@ private: return childAABB; } - void insert(OctreeNode *node, const AABB &nodeAABB, const Item &value, + void insert(OctreeNode *node, const AABB &nodeAABB, const Item &value, const AABB &coverage, Float diag2, uint32_t depth) { /* Add the data item to the current octree node if the max. tree depth is reached or the data item's coverage area is smaller than the current node size */ - if (depth == m_maxDepth || + if (depth == m_maxDepth || (nodeAABB.getExtents().lengthSquared() < diag2)) { node->data.append(value); return; @@ -352,7 +352,7 @@ private: } /// Internal lookup procedure - const version - template inline void lookup(const OctreeNode *node, + template inline void lookup(const OctreeNode *node, const AABB &nodeAABB, const Point &p, Functor &functor) const { const Point center = nodeAABB.getCenter(); @@ -363,7 +363,7 @@ private: } int child = (p.x > center.x ? 4 : 0) - + (p.y > center.y ? 2 : 0) + + (p.y > center.y ? 2 : 0) + (p.z > center.z ? 1 : 0); OctreeNode *childNode = node->children[child]; @@ -374,8 +374,8 @@ private: } } - template inline void searchSphere(OctreeNode *node, - const AABB &nodeAABB, const BSphere &sphere, + template inline void searchSphere(OctreeNode *node, + const AABB &nodeAABB, const BSphere &sphere, Functor &functor) { const Point center = nodeAABB.getCenter(); @@ -386,7 +386,7 @@ private: } // Potential for much optimization.. - for (int child=0; child<8; ++child) { + for (int child=0; child<8; ++child) { if (node->children[child]) { const AABB childAABB(childBounds(child, nodeAABB, center)); if (childAABB.overlaps(sphere)) diff --git a/include/mitsuba/core/platform.h b/include/mitsuba/core/platform.h index c480df7d..00c9791a 100644 --- a/include/mitsuba/core/platform.h +++ b/include/mitsuba/core/platform.h @@ -66,8 +66,8 @@ #ifdef __MSVC__ #define MTS_DONT_EXPORT // not supported on MSVC #define SIZE_T_FMT "%Iu" - #define BOOST_FILESYSTEM_NO_LIB - #define BOOST_SYSTEM_NO_LIB + #define BOOST_FILESYSTEM_NO_LIB + #define BOOST_SYSTEM_NO_LIB #define MTS_EXPORT __declspec(dllexport) #define MTS_IMPORT __declspec(dllimport) #define MTS_MAY_ALIAS // not supported on Windows @@ -159,7 +159,7 @@ #endif /* Compile with Boost::Filesystem v3 */ -#define BOOST_FILESYSTEM_VERSION 3 +#define BOOST_FILESYSTEM_VERSION 3 #include @@ -186,8 +186,8 @@ extern MTS_EXPORT_CORE void __mts_set_appdefaults(); #define MTS_AUTORELEASE_END() __mts_autorelease_end(); #define MTS_AMBIGUOUS_SIZE_T 1 #else -#define MTS_AUTORELEASE_BEGIN() -#define MTS_AUTORELEASE_END() +#define MTS_AUTORELEASE_BEGIN() +#define MTS_AUTORELEASE_END() #endif MTS_NAMESPACE_END diff --git a/include/mitsuba/core/plugin.h b/include/mitsuba/core/plugin.h index 5ced6744..3d22b1d1 100644 --- a/include/mitsuba/core/plugin.h +++ b/include/mitsuba/core/plugin.h @@ -29,7 +29,7 @@ MTS_NAMESPACE_BEGIN /** * \brief Abstract plugin class -- represents loadable configurable objects * and utilities. - * + * * Please see the \ref ConfigurableObject and \ref Utility classes for * details. * @@ -42,11 +42,11 @@ public: /// Virtual destructor virtual ~Plugin(); - + /// Is this a configurable object plugin or an utility plugin? bool isUtility() const; - /// Return an instance of the class implemented by this plugin + /// Return an instance of the class implemented by this plugin ConfigurableObject *createInstance(const Properties &props) const; /// Return an utility instance (if this is an utility plugin) @@ -54,10 +54,10 @@ public: /// Return a description of this plugin std::string getDescription() const; - + /// Return the path of this plugin const fs::path &getPath() const; - + /// Return a short name of this plugin const std::string &getShortName() const; protected: @@ -74,13 +74,13 @@ private: * \brief The plugin manager is responsible for resolving and * loading external plugins. * - * Ordinarily, this class will be used by making repeated calls to + * Ordinarily, this class will be used by making repeated calls to * the \ref createObject() methods. The generated instances are then * assembled into a final object graph, such as a scene. One such * examples is the \ref SceneHandler class, which parses an XML - * scene file by esentially translating the XML elements into calls + * scene file by esentially translating the XML elements into calls * to \ref createObject(). - * + * * Since this kind of construction method can be tiresome when * dynamically building scenes from Python, this class has an * additional Python-only method \c create(), which works as follows: @@ -130,13 +130,13 @@ public: /** * \brief Instantiate a plugin, verify its type, - * and return the newly created instance. - * + * and return the newly created instance. + * * \param classType Expected type of the plugin. An * exception will be thrown if it turns out not * to derive from this class. * \param props A \ref Properties instance containing - * all information required to find and construct + * all information required to find and construct * the plugin. */ ConfigurableObject *createObject( @@ -146,10 +146,10 @@ public: /** * \brief Instantiate a plugin and return the new - * instance (without verifying its type). - * + * instance (without verifying its type). + * * \param props A \ref Properties instance containing - * all information required to find and construct + * all information required to find and construct * the plugin. */ ConfigurableObject *createObject( @@ -165,7 +165,7 @@ public: MTS_DECLARE_CLASS() protected: PluginManager(); - + /// Destruct and unload all plugins ~PluginManager(); private: diff --git a/include/mitsuba/core/pmf.h b/include/mitsuba/core/pmf.h index ee8a3ba5..55beb52e 100644 --- a/include/mitsuba/core/pmf.h +++ b/include/mitsuba/core/pmf.h @@ -26,10 +26,10 @@ MTS_NAMESPACE_BEGIN /** * \brief Discrete probability distribution - * + * * This data structure can be used to transform uniformly distributed * samples to a stored discrete probability distribution. - * + * * \ingroup libcore */ struct DiscreteDistribution { @@ -103,7 +103,7 @@ public: m_sum = m_cdf[m_cdf.size()-1]; if (m_sum > 0) { m_normalization = 1.0f / m_sum; - for (size_t i=1; i::const_iterator entry = + std::vector::const_iterator entry = std::lower_bound(m_cdf.begin(), m_cdf.end(), sampleValue); size_t index = std::min(m_cdf.size()-2, (size_t) std::max((ptrdiff_t) 0, entry - m_cdf.begin() - 1)); @@ -137,7 +137,7 @@ public: /** * \brief %Transform a uniformly distributed sample to the stored distribution - * + * * \param[in] sampleValue * An uniformly distributed sample on [0,1] * \param[out] pdf @@ -153,7 +153,7 @@ public: /** * \brief %Transform a uniformly distributed sample to the stored distribution - * + * * The original sample is value adjusted so that it can be "reused". * * \param[in, out] sampleValue @@ -169,8 +169,8 @@ public: } /** - * \brief %Transform a uniformly distributed sample. - * + * \brief %Transform a uniformly distributed sample. + * * The original sample is value adjusted so that it can be "reused". * * \param[in,out] @@ -193,7 +193,7 @@ public: */ std::string toString() const { std::ostringstream oss; - oss << "DiscreteDistribution[sum=" << m_sum << ", normalized=" + oss << "DiscreteDistribution[sum=" << m_sum << ", normalized=" << (int) m_normalized << ", cdf={"; for (size_t i=0; i float makeAliasTable( @@ -241,15 +241,15 @@ namespace math { /* Allocate temporary storage for classification purposes */ Index *c = new Index[size], *c_short = c - 1, *c_long = c + size; - + /* Begin by computing the normalization constant */ Scalar sum = 0; for (size_t i=0; i Index sampleAlias( const AliasTableEntry *tbl, Index size, Scalar sample) { Index l = std::min((Index) (sample * size), (Index) (size - 1)); Scalar prob = (Scalar) tbl[l].prob; - + sample = sample * size - l; - + if (prob == 1 || (prob != 0 && sample < prob)) return l; else return tbl[l].index; } - + /** * \brief Generate a sample in constant time using the alias method * - * This variation shifts and scales the uniform random sample so + * This variation shifts and scales the uniform random sample so * that it can be reused for another sampling operation */ template Index sampleAliasReuse( const AliasTableEntry *tbl, Index size, Scalar &sample) { Index l = std::min((Index) (sample * size), (Index) (size - 1)); Scalar prob = (Scalar) tbl[l].prob; - + sample = sample * size - l; - + if (prob == 1 || (prob != 0 && sample < prob)) { sample /= prob; return l; @@ -314,7 +314,7 @@ namespace math { } } }; - + MTS_NAMESPACE_END #endif /* __MITSUBA_CORE_PMF_H_ */ diff --git a/include/mitsuba/core/point.h b/include/mitsuba/core/point.h index b2a9b73d..459fe425 100644 --- a/include/mitsuba/core/point.h +++ b/include/mitsuba/core/point.h @@ -40,7 +40,7 @@ template struct TPoint1 { const static int dim = 1; /** \brief Construct a new point without initializing it. - * + * * This construtor is useful when the point will either not * be used at all (it might be part of a larger data structure) * or initialized at a later point in time. Always make sure @@ -56,13 +56,13 @@ template struct TPoint1 { /// Initialize the point with the specified value TPoint1(T x) : x(x) { } - + /// Initialize the point with the components of another point - template explicit TPoint1(const TPoint1 &p) + template explicit TPoint1(const TPoint1 &p) : x((T) p.x) { } /// Initialize the point with the components of a vector data structure - template explicit TPoint1(const TVector1 &v) + template explicit TPoint1(const TVector1 &v) : x((T) v.x) { } /// Unserialize a point from a binary data stream @@ -82,13 +82,13 @@ template struct TPoint1 { /// Add a vector to this one (e.g. to compute a weighted position) TPoint1& operator+=(const TVector1 &v) { - x += v.x; + x += v.x; return *this; } /// Add a point to this one (e.g. to compute a weighted position) TPoint1& operator+=(const TPoint1 &p) { - x += p.x; + x += p.x; return *this; } @@ -104,7 +104,7 @@ template struct TPoint1 { /// Subtract a vector from this point TPoint1& operator-=(const TVector1 &v) { - x -= v.x; + x -= v.x; return *this; } @@ -115,7 +115,7 @@ template struct TPoint1 { /// Scale the point's coordinates by the given scalar TPoint1 &operator*=(T f) { - x *= f; + x *= f; return *this; } @@ -127,7 +127,7 @@ template struct TPoint1 { /// Divide the point's coordinates by the given scalar and return the result TPoint1 operator/(T f) const { #ifdef MTS_DEBUG - if (f == 0) + if (f == 0) SLog(EWarn, "Point1: Division by zero!"); #endif return TPoint1(x / f); @@ -136,10 +136,10 @@ template struct TPoint1 { /// Divide the point's coordinates by the given scalar TPoint1 &operator/=(T f) { #ifdef MTS_DEBUG - if (f == 0) + if (f == 0) SLog(EWarn, "Point1: Division by zero!"); #endif - x /= f; + x /= f; return *this; } @@ -195,7 +195,7 @@ template inline T distanceSquared(const TPoint1 &p1, const TPoin template <> inline TPoint1 TPoint1::operator/(int s) const { #ifdef MTS_DEBUG - if (s == 0) + if (s == 0) SLog(EWarn, "Point1i: Division by zero!"); #endif return TPoint1(x/s); @@ -203,7 +203,7 @@ template <> inline TPoint1 TPoint1::operator/(int s) const { template <> inline TPoint1 &TPoint1::operator/=(int s) { #ifdef MTS_DEBUG - if (s == 0) + if (s == 0) SLog(EWarn, "Point1i: Division by zero!"); #endif x /= s; @@ -226,7 +226,7 @@ template struct TPoint2 { const static int dim = 2; /** \brief Construct a new point without initializing it. - * + * * This construtor is useful when the point will either not * be used at all (it might be part of a larger data structure) * or initialized at a later point in time. Always make sure @@ -242,13 +242,13 @@ template struct TPoint2 { /// Initialize the point with the specified X, Y and Z components TPoint2(T x, T y) : x(x), y(y) { } - + /// Initialize the point with the components of another point - template explicit TPoint2(const TPoint2 &p) + template explicit TPoint2(const TPoint2 &p) : x((T) p.x), y((T) p.y) { } /// Initialize the point with the components of a vector data structure - template explicit TPoint2(const TVector2 &v) + template explicit TPoint2(const TVector2 &v) : x((T) v.x), y((T) v.y) { } /// Initialize all components of the the point with the specified value @@ -272,7 +272,7 @@ template struct TPoint2 { /// Add a vector to this one (e.g. to compute a weighted position) TPoint2& operator+=(const TVector2 &v) { - x += v.x; y += v.y; + x += v.x; y += v.y; return *this; } @@ -317,7 +317,7 @@ template struct TPoint2 { /// Divide the point's coordinates by the given scalar and return the result TPoint2 operator/(T f) const { #ifdef MTS_DEBUG - if (f == 0) + if (f == 0) SLog(EWarn, "Point2: Division by zero!"); #endif T recip = (T) 1 / f; @@ -327,7 +327,7 @@ template struct TPoint2 { /// Divide the point's coordinates by the given scalar TPoint2 &operator/=(T f) { #ifdef MTS_DEBUG - if (f == 0) + if (f == 0) SLog(EWarn, "Point2: Division by zero!"); #endif T recip = (T) 1 / f; @@ -388,7 +388,7 @@ template inline T distanceSquared(const TPoint2 &p1, const TPoin template <> inline TPoint2 TPoint2::operator/(int s) const { #ifdef MTS_DEBUG - if (s == 0) + if (s == 0) SLog(EWarn, "Point2i: Division by zero!"); #endif return TPoint2(x/s, y/s); @@ -396,7 +396,7 @@ template <> inline TPoint2 TPoint2::operator/(int s) const { template <> inline TPoint2 &TPoint2::operator/=(int s) { #ifdef MTS_DEBUG - if (s == 0) + if (s == 0) SLog(EWarn, "Point2i: Division by zero!"); #endif x /= s; @@ -419,7 +419,7 @@ template struct TPoint3 { const static int dim = 3; /** \brief Construct a new point without initializing it. - * + * * This construtor is useful when the point will either not * be used at all (it might be part of a larger data structure) * or initialized at a later point in time. Always make sure @@ -435,13 +435,13 @@ template struct TPoint3 { /// Initialize the point with the specified X, Y and Z components TPoint3(T x, T y, T z) : x(x), y(y), z(z) { } - + /// Initialize the point with the components of another point - template explicit TPoint3(const TPoint3 &p) + template explicit TPoint3(const TPoint3 &p) : x((T) p.x), y((T) p.y), z((T) p.z) { } /// Initialize the point with the components of a vector data structure - template explicit TPoint3(const TVector3 &v) + template explicit TPoint3(const TVector3 &v) : x((T) v.x), y((T) v.y), z((T) v.z) { } /// Initialize all components of the the point with the specified value @@ -472,7 +472,7 @@ template struct TPoint3 { /// Add a point to this one (e.g. to compute a weighted position) TPoint3& operator+=(const TPoint3 &p) { - x += p.x; y += p.y; z += p.z; + x += p.x; y += p.y; z += p.z; return *this; } @@ -488,7 +488,7 @@ template struct TPoint3 { /// Subtract a vector from this point TPoint3& operator-=(const TVector3 &v) { - x -= v.x; y -= v.y; z -= v.z; + x -= v.x; y -= v.y; z -= v.z; return *this; } @@ -499,7 +499,7 @@ template struct TPoint3 { /// Scale the point's coordinates by the given scalar TPoint3 &operator*=(T f) { - x *= f; y *= f; z *= f; + x *= f; y *= f; z *= f; return *this; } @@ -511,7 +511,7 @@ template struct TPoint3 { /// Divide the point's coordinates by the given scalar and return the result TPoint3 operator/(T f) const { #ifdef MTS_DEBUG - if (f == 0) + if (f == 0) SLog(EWarn, "Point3: Division by zero!"); #endif T recip = (T) 1 / f; @@ -521,11 +521,11 @@ template struct TPoint3 { /// Divide the point's coordinates by the given scalar TPoint3 &operator/=(T f) { #ifdef MTS_DEBUG - if (f == 0) + if (f == 0) SLog(EWarn, "Point3: Division by zero!"); #endif T recip = (T) 1 / f; - x *= recip; y *= recip; z *= recip; + x *= recip; y *= recip; z *= recip; return *this; } @@ -584,7 +584,7 @@ template inline T distanceSquared(const TPoint3 &p1, const TPoin template <> inline TPoint3 TPoint3::operator/(int s) const { #ifdef MTS_DEBUG - if (s == 0) + if (s == 0) SLog(EWarn, "Point3i: Division by zero!"); #endif return TPoint3(x/s, y/s, z/s); @@ -592,7 +592,7 @@ template <> inline TPoint3 TPoint3::operator/(int s) const { template <> inline TPoint3 &TPoint3::operator/=(int s) { #ifdef MTS_DEBUG - if (s == 0) + if (s == 0) SLog(EWarn, "Point3i: Division by zero!"); #endif x /= s; @@ -611,12 +611,12 @@ template struct TPoint4 { typedef TVector4 VectorType; T x, y, z, w; - + /// Number of dimensions const static int dim = 4; /** \brief Construct a new point without initializing it. - * + * * This construtor is useful when the point will either not * be used at all (it might be part of a larger data structure) * or initialized at a later point in time. Always make sure @@ -634,11 +634,11 @@ template struct TPoint4 { TPoint4(T x, T y, T z, T w) : x(x), y(y), z(z), w(w) { } /// Initialize the point with the components of another point - template explicit TPoint4(const TPoint4 &p) + template explicit TPoint4(const TPoint4 &p) : x((T) p.x), y((T) p.y), z((T) p.z), w((T) p.w) { } /// Initialize the point with the components of a vector data structure - template explicit TPoint4(const TVector4 &v) + template explicit TPoint4(const TVector4 &v) : x((T) v.x), y((T) v.y), z((T) v.z), w((T) v.w) { } /// Initialize all components of the the point with the specified value @@ -709,7 +709,7 @@ template struct TPoint4 { /// Divide the point's coordinates by the given scalar and return the result TPoint4 operator/(T f) const { #ifdef MTS_DEBUG - if (f == 0) + if (f == 0) SLog(EWarn, "Point4: Division by zero!"); #endif T recip = (T) 1 / f; @@ -719,7 +719,7 @@ template struct TPoint4 { /// Divide the point's coordinates by the given scalar TPoint4 &operator/=(T f) { #ifdef MTS_DEBUG - if (f == 0) + if (f == 0) SLog(EWarn, "Point4: Division by zero!"); #endif T recip = (T) 1 / f; @@ -759,7 +759,7 @@ template struct TPoint4 { stream->writeElement(z); stream->writeElement(w); } - + /// Return a readable string representation of this point std::string toString() const { std::ostringstream oss; @@ -782,7 +782,7 @@ template inline T distanceSquared(const TPoint4 &p1, const TPoin template <> inline TPoint4 TPoint4::operator/(int s) const { #ifdef MTS_DEBUG - if (s == 0) + if (s == 0) SLog(EWarn, "Point4i: Division by zero!"); #endif return TPoint4(x/s, y/s, z/s, w/s); @@ -790,7 +790,7 @@ template <> inline TPoint4 TPoint4::operator/(int s) const { template <> inline TPoint4 &TPoint4::operator/=(int s) { #ifdef MTS_DEBUG - if (s == 0) + if (s == 0) SLog(EWarn, "Point4i: Division by zero!"); #endif diff --git a/include/mitsuba/core/properties.h b/include/mitsuba/core/properties.h index fdff450a..ab61a577 100644 --- a/include/mitsuba/core/properties.h +++ b/include/mitsuba/core/properties.h @@ -27,10 +27,10 @@ MTS_NAMESPACE_BEGIN struct PropertyElement; -/** \brief Associative parameter map for constructing +/** \brief Associative parameter map for constructing * subclasses of \ref ConfigurableObject. * - * Note that the Python bindings for this class do not implement + * Note that the Python bindings for this class do not implement * the various type-dependent getters and setters. Instead, they * are accessed just like a normal Python map, e.g: * @@ -75,7 +75,7 @@ public: /// Construct an empty property container Properties(); - + /// Construct an empty property container and set the plugin name Properties(const std::string &pluginName); @@ -89,7 +89,7 @@ public: inline void setPluginName(const std::string &name) { m_pluginName = name; } /// Get the associated plugin name inline const std::string &getPluginName() const { return m_pluginName; } - + /// Returns the associated identifier (or the string "unnamed") inline const std::string &getID() const { return m_id; } /// Set the associated identifier @@ -150,7 +150,7 @@ public: Spectrum getSpectrum(const std::string &name) const; /// Get a spectral power distribution (with default) Spectrum getSpectrum(const std::string &name, const Spectrum &defVal) const; - + /// Set a 3d point void setPoint(const std::string &name, const Point &value, bool warnDuplicates = true); /// Get a 3d point @@ -160,7 +160,7 @@ public: /// Set a 3d vector void setVector(const std::string &name, const Vector &value, bool warnDuplicates = true); - /// Get a 3d vector + /// Get a 3d vector Vector getVector(const std::string &name) const; /// Get a 3d vector (with default) Vector getVector(const std::string &name, const Vector &defVal) const; @@ -174,7 +174,7 @@ public: /// Store an array containing the names of all stored properties void putPropertyNames(std::vector &results) const; - + /// Return an array containing the names of all stored properties inline std::vector getPropertyNames() const { std::vector results; @@ -190,7 +190,7 @@ public: /// Verify if a value with the specified name exists bool hasProperty(const std::string &name) const; - + /** * \brief Remove a property with the specified name * \return \c true upon success diff --git a/include/mitsuba/core/qmc.h b/include/mitsuba/core/qmc.h index 8da1e62b..7a9afbbd 100644 --- a/include/mitsuba/core/qmc.h +++ b/include/mitsuba/core/qmc.h @@ -23,7 +23,7 @@ #include MTS_NAMESPACE_BEGIN - + /*! \addtogroup libcore */ /*! @{ */ @@ -40,7 +40,7 @@ extern const int MTS_EXPORT_CORE primeTable[primeTableSize]; /// Van der Corput radical inverse in base 2 with single precision inline float radicalInverse2Single(uint32_t n, uint32_t scramble = 0U) { /* Efficiently reverse the bits in 'n' using binary operations */ -#if defined __GNUC__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) +#if defined __GNUC__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) n = __builtin_bswap32(n); #else n = (n << 16) | (n >> 16); @@ -59,7 +59,7 @@ inline float radicalInverse2Single(uint32_t n, uint32_t scramble = 0U) { /// Van der Corput radical inverse in base 2 with double precision inline double radicalInverse2Double(uint64_t n, uint64_t scramble = 0ULL) { /* Efficiently reverse the bits in 'n' using binary operations */ -#if defined __GNUC__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) +#if defined __GNUC__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) n = __builtin_bswap64(n); #else n = (n << 32) | (n >> 32); @@ -125,7 +125,7 @@ inline Point2 sample02(size_t n) { } /** - * \ref Generate fast and reasonably good pseudorandom numbers using the + * \ref Generate fast and reasonably good pseudorandom numbers using the * Tiny Encryption Algorithm (TEA) by David Wheeler and Roger Needham. * * For details, refer to "GPU Random Numbers via the Tiny Encryption Algorithm" @@ -146,7 +146,7 @@ inline uint64_t sampleTEA(uint32_t v0, uint32_t v1, int rounds = 4) { for (int i=0; i> 5) + 0xC8013EA4); + v0 += ((v1 << 4) + 0xA341316C) ^ (v1 + sum) ^ ((v1 >> 5) + 0xC8013EA4); v1 += ((v0 << 4) + 0xAD90777D) ^ (v0 + sum) ^ ((v0 >> 5) + 0x7E95761E); } @@ -155,7 +155,7 @@ inline uint64_t sampleTEA(uint32_t v0, uint32_t v1, int rounds = 4) { #if defined(DOUBLE_PRECISION) inline Float sampleTEAFloat(uint32_t v0, uint32_t v1, int rounds = 4) { - /* Trick from MTGP: generate an uniformly distributed + /* Trick from MTGP: generate an uniformly distributed single precision number in [1,2) and subtract 1. */ union { uint64_t u; @@ -167,7 +167,7 @@ inline Float sampleTEAFloat(uint32_t v0, uint32_t v1, int rounds = 4) { #else inline Float sampleTEAFloat(uint32_t v0, uint32_t v1, int rounds = 4) { - /* Trick from MTGP: generate an uniformly distributed + /* Trick from MTGP: generate an uniformly distributed single precision number in [1,2) and subtract 1. */ union { uint32_t u; @@ -183,7 +183,7 @@ inline Float sampleTEAFloat(uint32_t v0, uint32_t v1, int rounds = 4) { * * This function is used as a building block to construct Halton and * Hammersley sequences. Roughly, it computes a b-ary representation - * of the input value \c index, mirrors it along the decimal + * of the input value \c index, mirrors it along the decimal * point, and returns the resulting fractional value. */ extern MTS_EXPORT_CORE Float radicalInverse(int base, uint64_t index); @@ -191,13 +191,13 @@ extern MTS_EXPORT_CORE Float radicalInverse(int base, uint64_t index); /** * \brief Calculate a scrambled radical inverse function * - * This function is used as a building block to construct permuted + * This function is used as a building block to construct permuted * Halton and Hammersley sequence variants. It works like the normal - * radical inverse function \ref radicalInverse(), except that every digit - * is run through an extra scrambling permutation specified as array + * radical inverse function \ref radicalInverse(), except that every digit + * is run through an extra scrambling permutation specified as array * of size \c base. */ -extern MTS_EXPORT_CORE Float scrambledRadicalInverse(int base, +extern MTS_EXPORT_CORE Float scrambledRadicalInverse(int base, uint64_t index, uint16_t *perm); /** @@ -211,13 +211,13 @@ extern MTS_EXPORT_CORE Float radicalInverseIncremental(int base, Float x); /** * \brief Calculate a radical inverse function (fast version) * - * This function works similarly to \ref radicalInverse, but is potentially much + * This function works similarly to \ref radicalInverse, but is potentially much * faster. Internally, it relies on optimized implementations of the radical inverse - * functions for the first 1024 prime number bases. For that reason, only works for + * functions for the first 1024 prime number bases. For that reason, only works for * such bases. * * \ref baseIndex - * Prime number index starting at 0 (i.e. 3 would cause 7 to be + * Prime number index starting at 0 (i.e. 3 would cause 7 to be * used as the basis) * \ref perm * Sequence index @@ -227,12 +227,12 @@ extern MTS_EXPORT_CORE Float radicalInverseFast(uint16_t baseIndex, uint64_t ind /** * \brief Calculate a scrambled radical inverse function (fast version) * - * This function is used as a building block to construct permuted + * This function is used as a building block to construct permuted * Halton and Hammersley sequence variants. It works like the fast - * radical inverse function \ref radicalInverseFast(), except that every + * radical inverse function \ref radicalInverseFast(), except that every * digit is run through an extra scrambling permutation. */ -extern MTS_EXPORT_CORE Float scrambledRadicalInverseFast(uint16_t baseIndex, +extern MTS_EXPORT_CORE Float scrambledRadicalInverseFast(uint16_t baseIndex, uint64_t index, uint16_t *perm); //! @} diff --git a/include/mitsuba/core/quad.h b/include/mitsuba/core/quad.h index 257d6210..b8b3fa2f 100644 --- a/include/mitsuba/core/quad.h +++ b/include/mitsuba/core/quad.h @@ -45,12 +45,12 @@ extern MTS_EXPORT_CORE std::pair legendrePD(int l, double x); * \brief Computes the nodes and weights of a Gauss-Legendre quadrature * (aka "Gaussian quadrature") rule with the given number of evaluations. * - * Integration is over the interval \f$[-1, 1]\f$. Gauss-Legendre quadrature - * maximizes the order of exactly integrable polynomials achieves this up to + * Integration is over the interval \f$[-1, 1]\f$. Gauss-Legendre quadrature + * maximizes the order of exactly integrable polynomials achieves this up to * degree \f$2n-1\f$ (where \f$n\f$ is the number of function evaluations). * * This method is numerically well-behaved until about \f$n=200\f$ - * and then becomes progressively less accurate. It is generally not a + * and then becomes progressively less accurate. It is generally not a * good idea to go much higher---in any case, a composite or * adaptive integration scheme will be superior for large \f$n\f$. * @@ -68,15 +68,15 @@ extern MTS_EXPORT_CORE void gaussLegendre(int n, Float *nodes, Float *weights); * \brief Computes the nodes and weights of a Gauss-Lobatto quadrature * rule with the given number of evaluations. * - * Integration is over the interval \f$[-1, 1]\f$. Gauss-Lobatto quadrature - * is preferable to Gauss-Legendre quadrature whenever the endpoints of the - * integration domain should explicitly be included. It maximizes the order - * of exactly integrable polynomials subject to this constraint and achieves - * this up to degree \f$2n-3\f$ (where \f$n\f$ is the number of function + * Integration is over the interval \f$[-1, 1]\f$. Gauss-Lobatto quadrature + * is preferable to Gauss-Legendre quadrature whenever the endpoints of the + * integration domain should explicitly be included. It maximizes the order + * of exactly integrable polynomials subject to this constraint and achieves + * this up to degree \f$2n-3\f$ (where \f$n\f$ is the number of function * evaluations). * * This method is numerically well-behaved until about \f$n=200\f$ - * and then becomes progressively less accurate. It is generally not a + * and then becomes progressively less accurate. It is generally not a * good idea to go much higher---in any case, a composite or * adaptive integration scheme will be superior for large \f$n\f$. * @@ -113,11 +113,11 @@ extern MTS_EXPORT_CORE void gaussLobatto(int n, Float *nodes, Float *weights); * * The original MATLAB version can be downloaded here * http://www.inf.ethz.ch/personal/gander/adaptlob.m - * - * This particular implementation is based on code in QuantLib, + * + * This particular implementation is based on code in QuantLib, * a free-software/open-source library for financial quantitative * analysts and developers - http://quantlib.org/ - * + * * \ingroup libcore */ class MTS_EXPORT_CORE GaussLobattoIntegrator { @@ -173,7 +173,7 @@ protected: Float a, Float b, Float fa, Float fb, Float is, size_t &evals) const; /** - * Compute the absolute error tolerance using a 13-point + * Compute the absolute error tolerance using a 13-point * Gauss-Lobatto rule. */ Float calculateAbsTolerance(const boost::function& f, @@ -191,7 +191,7 @@ protected: }; /** - * \brief Adaptively computes the integral of a multidimensional function using + * \brief Adaptively computes the integral of a multidimensional function using * either a Gauss-Kronod (1D) or a Genz-Malik (>1D) cubature rule. * * This class is a C++ wrapper around the \c cubature code by Steven G. Johnson @@ -227,9 +227,9 @@ public: * \param fDim Number of integrands (i.e. dimensions of the image space) * \param nDim Number of integration dimensions (i.e. dimensions of the * function domain) - * \param maxEvals Maximum number of function evaluations (0 means no + * \param maxEvals Maximum number of function evaluations (0 means no * limit). The error bounds will likely be exceeded when the - * integration is forced to stop prematurely. Note: the actual + * integration is forced to stop prematurely. Note: the actual * number of evaluations may somewhat exceed this value. * \param absError Absolute error requirement (0 to disable) * \param relError Relative error requirement (0 to disable) @@ -238,7 +238,7 @@ public: size_t maxEvals, Float absError = 0, Float relError = 0); /** - * \brief Integrate the function \c f over the rectangular domain + * \brief Integrate the function \c f over the rectangular domain * bounded by \c min and \c max. * * The supplied function should have the interface @@ -255,12 +255,12 @@ public: Float *result, Float *error, size_t *evals = NULL) const; /** - * \brief Integrate the function \c f over the rectangular domain + * \brief Integrate the function \c f over the rectangular domain * bounded by \c min and \c max. * * This function implements a vectorized version of the above * integration function, which is more efficient by evaluating - * the integrant in `batches'. The supplied function should + * the integrant in `batches'. The supplied function should * have the interface * * @@ -269,7 +269,7 @@ public: * * Note that \c in in is not a single point, but an array of \c numPoints points * (length \c numPoints x \c dim), and upon return the values of all \c fDim - * integrands at all \c numPoints points should be stored in \c out + * integrands at all \c numPoints points should be stored in \c out * (length \c fDim x \c numPoints). In particular, out[i*dim + j] is the j-th * coordinate of the i-th point, and the k-th function evaluation (k struct TQuaternion { TQuaternion() : v(0.0f), w(1) { } /** - * Initialize the quaternion with the specified + * Initialize the quaternion with the specified * real and imaginary components */ TQuaternion(const TVector3 &v, T w) : v(v), w(w) { } @@ -74,7 +74,7 @@ template struct TQuaternion { /// Add another quaternions to the current one TQuaternion& operator+=(const TQuaternion &q) { - v += q.v; w += q.w; + v += q.v; w += q.w; return *this; } @@ -91,7 +91,7 @@ template struct TQuaternion { /// Multiply the quaternion by the given scalar TQuaternion &operator*=(T f) { - v *= f; w *= f; + v *= f; w *= f; return *this; } @@ -112,7 +112,7 @@ template struct TQuaternion { SLog(EWarn, "Quaternion: Division by zero!"); #endif T recip = (T) 1 / f; - v *= recip; w *= recip; + v *= recip; w *= recip; return *this; } @@ -148,7 +148,7 @@ template struct TQuaternion { /** * \brief Compute the exponential of a quaternion with - * scalar part w = 0. + * scalar part w = 0. * * Based on code the appendix of * "Quaternion Calculus for Computer Graphics" by Ken Shoemake @@ -157,7 +157,7 @@ template struct TQuaternion { T theta = v.length(); T c = std::cos(theta); - if (theta > Epsilon) + if (theta > Epsilon) return TQuaternion(v * (std::sin(theta) / theta), c); else return TQuaternion(v, c); @@ -189,7 +189,7 @@ template struct TQuaternion { } /** - * \brief Construct an unit quaternion, which rotates unit direction + * \brief Construct an unit quaternion, which rotates unit direction * \a from onto \a to. */ static TQuaternion fromDirectionPair(const Vector &from, const Vector &to) { @@ -255,7 +255,7 @@ template struct TQuaternion { } return TQuaternion(v, w); } - + /** * \brief Construct an unit quaternion matching the supplied * rotation expressed in Euler angles (in radians) @@ -279,7 +279,7 @@ template struct TQuaternion { return qy * qx * qz; case EEulerZYX: return qx * qy * qz; - default: + default: SLog(EError, "Internal error!"); return TQuaternion(); } diff --git a/include/mitsuba/core/random.h b/include/mitsuba/core/random.h index d3eb8ebe..1ee14bee 100644 --- a/include/mitsuba/core/random.h +++ b/include/mitsuba/core/random.h @@ -23,7 +23,7 @@ #include #include -/* +/* SIMD oriented Fast Mersenne Twister (SFMT) pseudorandom number generator http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/ @@ -65,12 +65,12 @@ Springer (2008) 607--622. DOI: 10.1007/978-3-540-74496-2_36 T. Nishimura, ``Tables of 64-bit Mersenne Twisters'' - ACM Transactions on Modeling and + ACM Transactions on Modeling and Computer Simulation 10. (2000) 348--357. M. Matsumoto and T. Nishimura, ``Mersenne Twister: a 623-dimensionally equidistributed uniform pseudorandom number generator'' - ACM Transactions on Modeling and + ACM Transactions on Modeling and Computer Simulation 8. (Jan. 1998) 3--30. * \ingroup libcore */ @@ -79,7 +79,7 @@ MTS_NAMESPACE_BEGIN /** * \brief %Random number generator based on SIMD-oriented Fast Mersenne Twister - * + * * \author Mutsuo Saito and Makoto Matsumoto at Hiroshima University. * * \ingroup libcore @@ -90,7 +90,7 @@ public: /** * \brief Construct a new seeded random generator. * - * Uses the default seed on Windows and '/dev/urandom' + * Uses the default seed on Windows and '/dev/urandom' * on OSX and Linux. */ Random(); @@ -117,18 +117,18 @@ public: /** * \brief Seed the random generator from an array - * \remark This function is currently not exposed + * \remark This function is currently not exposed * by the Python bindings */ void seed(uint64_t *values, uint64_t length); - /// Return an integer on the [0, 2^63-1]-interval + /// Return an integer on the [0, 2^63-1]-interval uint64_t nextULong(); - /// Return an integer on the [0, n)-interval + /// Return an integer on the [0, n)-interval uint32_t nextUInt(uint32_t n); - /// Return an integer on the [0, n)-interval + /// Return an integer on the [0, n)-interval size_t nextSize(size_t n); /// Return a floating point value on the [0, 1) interval @@ -138,16 +138,16 @@ public: Float nextStandardNormal(); /** - * \brief Draw a uniformly distributed permutation and permute the + * \brief Draw a uniformly distributed permutation and permute the * given STL container. * * See Knuth, TAoCP Vol. 2 (3rd 3d), Section 3.4.2. * - * \remark This function is currently not exposed + * \remark This function is currently not exposed * by the Python bindings */ template void shuffle(Iterator it1, Iterator it2) { - for (Iterator it = it2 - 1; it > it1; --it) + for (Iterator it = it2 - 1; it > it1; --it) std::iter_swap(it, it1 + nextSize((size_t) (it-it1))); } diff --git a/include/mitsuba/core/ray.h b/include/mitsuba/core/ray.h index aaf59a32..ae1a81d1 100644 --- a/include/mitsuba/core/ray.h +++ b/include/mitsuba/core/ray.h @@ -38,7 +38,7 @@ template struct TRay { typedef _VectorType VectorType; typedef typename PointType::Scalar Scalar; - /* The somewhat peculiar ordering of the attributes is for + /* The somewhat peculiar ordering of the attributes is for alignment purposes in the 3D case and should not be changed. */ PointType o; ///< Ray origin @@ -49,28 +49,28 @@ template struct TRay { Float time; ///< Time value associated with this ray /// Construct a new ray - inline TRay() : mint(Epsilon), + inline TRay() : mint(Epsilon), maxt(std::numeric_limits::infinity()), time(0) { } /// Copy constructor (1) - inline TRay(const TRay &ray) - : o(ray.o), mint(ray.mint), d(ray.d), maxt(ray.maxt), + inline TRay(const TRay &ray) + : o(ray.o), mint(ray.mint), d(ray.d), maxt(ray.maxt), dRcp(ray.dRcp), time(ray.time) { } /// Copy constructor (2) - inline TRay(const TRay &ray, Scalar mint, Scalar maxt) - : o(ray.o), mint(mint), d(ray.d), maxt(maxt), + inline TRay(const TRay &ray, Scalar mint, Scalar maxt) + : o(ray.o), mint(mint), d(ray.d), maxt(maxt), dRcp(ray.dRcp), time(ray.time) { } /// Construct a new ray, while not specifying a direction yet - inline TRay(const PointType &o, Scalar time) : o(o), mint(Epsilon), + inline TRay(const PointType &o, Scalar time) : o(o), mint(Epsilon), maxt(std::numeric_limits::infinity()), time(time) { } /// Construct a new ray inline TRay(const PointType &o, const VectorType &d, Scalar time) - : o(o), mint(Epsilon), d(d), + : o(o), mint(Epsilon), d(d), maxt(std::numeric_limits::infinity()), time(time) { #ifdef MTS_DEBUG_FP bool state = disableFPExceptions(); @@ -100,7 +100,7 @@ template struct TRay { /// Set the origin inline void setTime(Scalar tval) { time = tval; } - + /// Set the direction and update the reciprocal inline void setDirection(const VectorType &dir) { d = dir; @@ -117,8 +117,8 @@ template struct TRay { /** * \brief Return the position of a point along the ray * - * \remark In the Python bindings, this operator is - * exposed as a function named \c eval -- i.e. + * \remark In the Python bindings, this operator is + * exposed as a function named \c eval -- i.e. * position lookups should be written as \c ray.eval(t) */ inline PointType operator() (Scalar t) const { return o + t * d; } @@ -126,14 +126,14 @@ template struct TRay { /// Return a string representation of this ray inline std::string toString() const { std::ostringstream oss; - oss << "Ray[origin=" << o.toString() << ", direction=" - << d.toString() << ", mint=" << mint + oss << "Ray[origin=" << o.toString() << ", direction=" + << d.toString() << ", mint=" << mint << ", maxt=" << maxt << ", time=" << time << "]"; return oss.str(); } }; -/** \brief %Ray differential -- enhances the basic ray class with +/** \brief %Ray differential -- enhances the basic ray class with information about the rays of adjacent pixels on the view plane \ingroup libcore */ @@ -142,24 +142,24 @@ struct RayDifferential : public Ray { Vector rxDirection, ryDirection; bool hasDifferentials; - inline RayDifferential() + inline RayDifferential() : hasDifferentials(false) { } - inline RayDifferential(const Point &p, const Vector &d, Float time) + inline RayDifferential(const Point &p, const Vector &d, Float time) : Ray(p, d, time), hasDifferentials(false) { } - inline explicit RayDifferential(const Ray &ray) + inline explicit RayDifferential(const Ray &ray) : Ray(ray), hasDifferentials(false) { } - inline RayDifferential(const RayDifferential &ray) + inline RayDifferential(const RayDifferential &ray) : Ray(ray), rxOrigin(ray.rxOrigin), ryOrigin(ray.ryOrigin), rxDirection(ray.rxDirection), ryDirection(ray.ryDirection), hasDifferentials(ray.hasDifferentials) { } - + void scaleDifferential(Float amount) { rxOrigin = o + (rxOrigin - o) * amount; ryOrigin = o + (ryOrigin - o) * amount; diff --git a/include/mitsuba/core/ref.h b/include/mitsuba/core/ref.h index 5673cf66..0d133cc7 100644 --- a/include/mitsuba/core/ref.h +++ b/include/mitsuba/core/ref.h @@ -27,12 +27,12 @@ MTS_NAMESPACE_BEGIN /** * \headerfile mitsuba/core/ref.h mitsuba/mitsuba.h * \brief Reference counting helper - * - * The \a ref refeference template is a simple wrapper to store a + * + * The \a ref refeference template is a simple wrapper to store a * pointer to an object. It takes care of increasing and decreasing * the reference count of the object. When the last reference goes * out of scope, the associated object will be deallocated. - * + * * \author Wenzel Jakob * \ingroup libcore */ @@ -61,7 +61,7 @@ public: ((Object *) m_ptr)->incRef(); return *this; } - + /// Overwrite this reference with a pointer to another object inline ref& operator= (T *ptr) { if (m_ptr == ptr) @@ -76,13 +76,13 @@ public: /// Compare this reference with another reference inline bool operator== (const ref &pref) const { return (m_ptr == pref.m_ptr); } - + /// Compare this reference with another reference inline bool operator!= (const ref &pref) const { return (m_ptr != pref.m_ptr); } - + /// Compare this reference with a pointer inline bool operator== (const T* ptr) const { return (m_ptr == ptr); } - + /// Compare this reference with a pointer inline bool operator!= (const T* ptr) const { return (m_ptr != ptr); } @@ -91,13 +91,13 @@ public: /// Access the object referenced by this reference inline T* operator-> () { return m_ptr; } - + /// Access the object referenced by this reference inline const T* operator-> () const { return m_ptr; } /// Return a C++ reference to the referenced object inline T& operator*() { return *m_ptr; } - + /// Return a C++ reference to the referenced object inline const T& operator*() const { return *m_ptr; } @@ -106,7 +106,7 @@ public: /// Return a pointer to the referenced object inline T* get() { return m_ptr; } - + /// Return a pointer to the referenced object inline const T* get() const { return m_ptr; } diff --git a/include/mitsuba/core/rfilter.h b/include/mitsuba/core/rfilter.h index b0655f5a..219b0ef6 100644 --- a/include/mitsuba/core/rfilter.h +++ b/include/mitsuba/core/rfilter.h @@ -31,7 +31,7 @@ MTS_NAMESPACE_BEGIN * \brief Generic interface to separable image reconstruction filters * * When resampling bitmaps or adding radiance-valued samples to a rendering in - * progress, Mitsuba first convolves them with a so-called image reconstruction + * progress, Mitsuba first convolves them with a so-called image reconstruction * filter. Various kinds are implemented as subclasses of this interface. * * Because image filters are generally too expensive to evaluate for @@ -45,7 +45,7 @@ class MTS_EXPORT_CORE ReconstructionFilter : public ConfigurableObject { public: /** * \brief When resampling data to a different resolution using - * \ref Resample, this enumeration specifies how lookups + * \ref Resample, this enumeration specifies how lookups * outside of the input domain are handled. * * \see Resampler @@ -114,13 +114,13 @@ template struct Resampler { * * \param sourceRes * Source resolution - * \param targetRes - * Desired target resolution + * \param targetRes + * Desired target resolution * \param bc * Boundary conditions that should be observed when looking up samples * outside of the defined input domain. */ - Resampler(const ReconstructionFilter *rfilter, ReconstructionFilter::EBoundaryCondition bc, + Resampler(const ReconstructionFilter *rfilter, ReconstructionFilter::EBoundaryCondition bc, int sourceRes, int targetRes) : m_bc(bc), m_sourceRes(sourceRes), m_targetRes(targetRes) { SAssert(sourceRes > 0 && targetRes > 0); Float filterRadius = rfilter->getRadius(), scale = 1.0f, invScale = 1.0f; @@ -153,7 +153,7 @@ template struct Resampler { Float sum = 0; for (int j=0; j struct Resampler { for (int ch=0; ch struct Resampler { for (int ch=0; ch struct Resampler { for (int ch=0; ch struct Resampler { } /** - * \brief Resample a multi-channel array and clamp the results + * \brief Resample a multi-channel array and clamp the results * to a specified valid range * * This function is preferred if too large positive/negative values @@ -268,7 +268,7 @@ template struct Resampler { * Maximum sample value after resampling */ void resampleAndClamp(const Scalar *source, size_t sourceStride, - Scalar *target, size_t targetStride, int channels, + Scalar *target, size_t targetStride, int channels, Scalar min = (Scalar) 0, Scalar max = (Scalar) 1) { const int taps = m_taps; targetStride = channels * (targetStride - 1); @@ -280,7 +280,7 @@ template struct Resampler { for (int ch=0; ch struct Resampler { for (int ch=0; ch struct Resampler { for (int ch=0; ch createWorkResult() const = 0; /** - * \brief Create a copy of this work processor instance. - * - * \remark In practice, before the cloned work processor + * \brief Create a copy of this work processor instance. + * + * \remark In practice, before the cloned work processor * is actually used, its \ref prepare() method will be called. * Therefore, any state that is initialized in \ref prepeare() * does not have to be copied. @@ -135,25 +135,25 @@ public: virtual ref clone() const = 0; /** - * \brief Called once before processing starts. - * - * This is useful for allocating scratch space or resolving references - * to resource objects. Lengthy computations should be performed in + * \brief Called once before processing starts. + * + * This is useful for allocating scratch space or resolving references + * to resource objects. Lengthy computations should be performed in * process() instead of here, since this this method will be called - * while the central scheduler lock is held. A thrown exception will + * while the central scheduler lock is held. A thrown exception will * lead to the termination of the parallel process. */ virtual void prepare() = 0; /** * \brief Process a work unit and store the computed results. - * - * The active parameter can be used to signal a premature - * stop of the execution flow. In this case, the work result is allowed + * + * The active parameter can be used to signal a premature + * stop of the execution flow. In this case, the work result is allowed * to be undefined (it will simply be ignored). A thrown exception will * lead to the termination of the parallel process. */ - virtual void process(const WorkUnit *workUnit, WorkResult *workResult, + virtual void process(const WorkUnit *workUnit, WorkResult *workResult, const bool &stop) = 0; MTS_DECLARE_CLASS() @@ -162,11 +162,11 @@ protected: virtual ~WorkProcessor() { } /// Protected constructors inline WorkProcessor() { } - inline WorkProcessor(Stream *stream, InstanceManager *manager) + inline WorkProcessor(Stream *stream, InstanceManager *manager) : SerializableObject(stream, manager) { } /** - * \brief Look up a named resource, which has been bound to + * \brief Look up a named resource, which has been bound to * the associated parallel process. * * Throws an exception if the resource is not known / bound. @@ -177,18 +177,18 @@ protected: }; /** - * \brief Abstract parallelizable task. + * \brief Abstract parallelizable task. * - * Instances of this class model a larger piece of work that can be split - * into independent `units' and subsequently farmed out over a cluster or - * processed locally. After the work units have been completed, the results - * are pieced back together to a solution of the original large-scale problem. + * Instances of this class model a larger piece of work that can be split + * into independent `units' and subsequently farmed out over a cluster or + * processed locally. After the work units have been completed, the results + * are pieced back together to a solution of the original large-scale problem. * - * This class implements the core logic running on the central scheduling - * server, i.e. the part that is responsible for generating work units and - * accepting their results. The module that performs the actual computation + * This class implements the core logic running on the central scheduling + * server, i.e. the part that is responsible for generating work units and + * accepting their results. The module that performs the actual computation * is an instance of \ref WorkProcessor, which is also specified here. - * Finally, the this class references `resources', which denote + * Finally, the this class references `resources', which denote * chunks of globally shared read-only data required during execution. * * \ingroup libcore @@ -211,22 +211,22 @@ public: /** * \brief Generate a piece of work. * - * Takes a pre-allocated \ref WorkUnit instance of - * the appropriate sub-type and size (as specified by - * \ref ParallelProcess::getWorkUnitName()) and + * Takes a pre-allocated \ref WorkUnit instance of + * the appropriate sub-type and size (as specified by + * \ref ParallelProcess::getWorkUnitName()) and * fills it with the appropriate content. Returns ESuccess * on success and EFailure or EPause when no more work is - * left -- in that case, the work unit will be ignored and - * the process completed (\ref EFailure) or temporarily - * paused (\ref EPause). When \ref EPause was used, - * resubmission via \ref Scheduler::schedule() will - * be required once more work is available. In some cases, it + * left -- in that case, the work unit will be ignored and + * the process completed (\ref EFailure) or temporarily + * paused (\ref EPause). When \ref EPause was used, + * resubmission via \ref Scheduler::schedule() will + * be required once more work is available. In some cases, it * is useful to distribute 'nearby' pieces of work to the same - * processor -- the \c worker parameter can be used to + * processor -- the \c worker parameter can be used to * implement this. - * This function should run as quickly as possible, since it - * will be executed while the scheduler mutex is held. A - * thrown exception will lead to the termination of the + * This function should run as quickly as possible, since it + * will be executed while the scheduler mutex is held. A + * thrown exception will lead to the termination of the * parallel process. * * \param unit Work unit data structure to be filled @@ -237,7 +237,7 @@ public: /** * \brief Called whenever a work unit has been completed. * - * Note that this function may concurrently be executed by + * Note that this function may concurrently be executed by * multiple threads. Also, processing of work results will * generally be out of order with respect to the creation * in \ref generateWork(). @@ -245,17 +245,17 @@ public: * When a work unit is only partially completed due to * a call to \ref Scheduler::cancel(), the second * parameter is set to true. - * A thrown exception will lead to the termination of + * A thrown exception will lead to the termination of * the parallel process. * * \param result Work result to be processed * \param cancelled Was the associated work unit not fully completed */ - virtual void processResult(const WorkResult *result, + virtual void processResult(const WorkResult *result, bool cancelled) = 0; /** - * \brief Called when the parallel process is canceled by + * \brief Called when the parallel process is canceled by * \ref Scheduler::cancel(). * * The default implementation does nothing. @@ -265,9 +265,9 @@ public: /** * \brief Query the return status of a process after its * execution has finished. - * + * * Returns one of \ref Success, \ref Failure or \ref Unknown. - * (\ref EUnknown means that the process is either still running + * (\ref EUnknown means that the process is either still running * or has never been scheduled). */ inline EStatus getReturnStatus() const { return m_returnStatus; } @@ -281,10 +281,10 @@ public: /** * \brief Bind a resource to this parallel process. * - * Takes a resource ID as given by the scheduler and associates it - * with a name. This name can later be used by the work processor + * Takes a resource ID as given by the scheduler and associates it + * with a name. This name can later be used by the work processor * to access the resource data. - * + * * \param name Process-specific name of the resource * \param id Resource ID as returned by \ref Scheduler::registerResource() * \sa WorkProcessor::getResource @@ -294,8 +294,8 @@ public: /** * \brief Is this process strictly local? * - * If a process is marked as local, it shouldn't be distributed - * to remote processing nodes. The default implementation + * If a process is marked as local, it shouldn't be distributed + * to remote processing nodes. The default implementation * returns false. */ virtual bool isLocal() const; @@ -313,10 +313,10 @@ public: inline const ResourceBindings &getResourceBindings() const { return m_bindings; } /** - * \brief Return a list of plugins required by this parallel process. + * \brief Return a list of plugins required by this parallel process. * * This is required so that remote machines can load the plugins before - * they accept work from this process. The default implementation just + * they accept work from this process. The default implementation just * returns all plugins that are loaded in the current application. */ virtual std::vector getRequiredPlugins(); @@ -324,7 +324,7 @@ public: MTS_DECLARE_CLASS() protected: /// Protected constructor - inline ParallelProcess() : m_returnStatus(EUnknown), + inline ParallelProcess() : m_returnStatus(EUnknown), m_logLevel(EDebug) { } /// Virtual destructor virtual ~ParallelProcess() { } @@ -339,10 +339,10 @@ class Worker; /** * \brief Centralized task scheduler implementation. * - * Accepts parallelizable jobs and distributes their computational load - * both locally and remotely. This is done by associating different types - * of \ref Worker instances with the scheduler. These try to acquire work - * units from the scheduler, which are then executed on the current machine + * Accepts parallelizable jobs and distributes their computational load + * both locally and remotely. This is done by associating different types + * of \ref Worker instances with the scheduler. These try to acquire work + * units from the scheduler, which are then executed on the current machine * or sent to remote nodes over a network connection. * * \ingroup libcore @@ -354,7 +354,7 @@ public: /** * \brief Schedule a parallelizable process for execution. * - * If the scheduler is currently running and idle, its execution + * If the scheduler is currently running and idle, its execution * will begin immediately. Returns \c false if the process * is already scheduled and has not yet terminated and \c true * in any other case. @@ -363,15 +363,15 @@ public: /** * \brief Block until the process has successfully been completed - * or canceled prematurely. + * or canceled prematurely. * - * Returns false if the process does not exist or has already + * Returns false if the process does not exist or has already * finished by the time \ref wait() is invoked. */ bool wait(const ParallelProcess *process); /** - * \brief Cancel the execution of a parallelizable process. + * \brief Cancel the execution of a parallelizable process. * * Upon return, no more work from this process is running. * Returns false if the process does not exist (anymore). @@ -383,21 +383,21 @@ public: /** * \brief Register a serializable resource with the scheduler. * - * A resource should be thought of as a constant state that is shared - * amongst all processing nodes. Resources can be reused by - * subsequent parallel processes, and consequently do not have to be - * re-transmitted over the network. Returns a resource ID, which can be + * A resource should be thought of as a constant state that is shared + * amongst all processing nodes. Resources can be reused by + * subsequent parallel processes, and consequently do not have to be + * re-transmitted over the network. Returns a resource ID, which can be * used to reference the associated data. */ int registerResource(SerializableObject *resource); /** - * \brief Register a \a multiple resource with the scheduler. + * \brief Register a \a multiple resource with the scheduler. * - * \a Multi means that in comparison to the previous method, a separate - * instance is provided for every core. An example where this is useful - * is to distribute random generator state when performing parallel - * Monte Carlo simulations. \c resources must be a vector whose + * \a Multi means that in comparison to the previous method, a separate + * instance is provided for every core. An example where this is useful + * is to distribute random generator state when performing parallel + * Monte Carlo simulations. \c resources must be a vector whose * length is equal to \ref getCoreCount(). */ int registerMultiResource(std::vector &resources); @@ -412,10 +412,10 @@ public: */ void retainResource(int resourceID); - /** - * \brief Unregister a resource from the scheduler - * - * Note that the resource's won't be removed until all processes using + /** + * \brief Unregister a resource from the scheduler + * + * Note that the resource's won't be removed until all processes using * it have terminated) */ void unregisterResource(int id); @@ -446,7 +446,7 @@ public: void start(); /** - * \brief Pause the distribution of work units and shut down all + * \brief Pause the distribution of work units and shut down all * running workers. * * Any currently scheduled work units are still completed. @@ -512,8 +512,8 @@ public: }; /** - * Data structure, which contains a piece of work - * as well as the information required to either execute + * Data structure, which contains a piece of work + * as well as the information required to either execute * it locally or submit it to a processing node over the * network. */ @@ -528,7 +528,7 @@ public: ref workResult; bool stop; - inline Item() : id(-1), workerIndex(-1), coreOffset(-1), + inline Item() : id(-1), workerIndex(-1), coreOffset(-1), proc(NULL), rec(NULL), stop(false) { } @@ -541,12 +541,12 @@ public: int refCount; bool multi; - inline ResourceRecord(SerializableObject *resource) + inline ResourceRecord(SerializableObject *resource) : resources(1), refCount(1), multi(false) { resources[0] = resource; } - inline ResourceRecord(std::vector resources) + inline ResourceRecord(std::vector resources) : resources(resources), refCount(1), multi(true) { } }; @@ -569,7 +569,7 @@ public: const MemoryStream *getResourceStream(int id); /** - * \brief Test whether this is a multi-resource, + * \brief Test whether this is a multi-resource, * i.e. different for every core. */ bool isMultiResource(int id) const; @@ -615,7 +615,7 @@ protected: bool cancel(ParallelProcess *proc, bool reduceInflight); /** - * Internally used to prepare a Scheduler::Item structure + * Internally used to prepare a Scheduler::Item structure * when only the process ID is known. */ inline void setProcessByID(Item &item, int id) { @@ -683,12 +683,12 @@ protected: /// Protected constructor Worker(const std::string &name); - + /* Decrement reference counts to any referenced objects */ virtual void clear(); /// Used internally by the scheduler - virtual void start(Scheduler *scheduler, + virtual void start(Scheduler *scheduler, int workerIndex, int coreOffset); /** @@ -702,7 +702,7 @@ protected: /** * \brief Called to inform a worker that a process has been cancelled * - * Guaranteed to be called while the Scheduler's main lock is held. + * Guaranteed to be called while the Scheduler's main lock is held. */ virtual void signalProcessCancellation(int id) = 0; @@ -731,9 +731,9 @@ protected: void setProcessByID(Scheduler::Item &item, int id) { return m_scheduler->setProcessByID(item, id); } - + /** - * Cancel the currently scheduled parallel process and possibly + * Cancel the currently scheduled parallel process and possibly * reduce the number of in-flight work units * Returns false if the process does not exist (anymore). */ @@ -748,7 +748,7 @@ protected: }; /** - * \brief Acquires work from the scheduler and executes + * \brief Acquires work from the scheduler and executes * it locally. * * \ingroup libcore diff --git a/include/mitsuba/core/sched_remote.h b/include/mitsuba/core/sched_remote.h index 265b3a47..a42acac5 100644 --- a/include/mitsuba/core/sched_remote.h +++ b/include/mitsuba/core/sched_remote.h @@ -51,7 +51,7 @@ class MTS_EXPORT_CORE RemoteWorker : public Worker { friend class RemoteWorkerReader; public: /** - * \brief Construct a new remote worker with the given name and + * \brief Construct a new remote worker with the given name and * communication stream */ RemoteWorker(const std::string &name, Stream *stream); @@ -68,7 +68,7 @@ protected: virtual void clear(); virtual void signalResourceExpiration(int id); virtual void signalProcessCancellation(int id); - virtual void signalProcessTermination(int id); + virtual void signalProcessTermination(int id); virtual void start(Scheduler *scheduler, int workerIndex, int coreOffset); void flush(); @@ -95,7 +95,7 @@ protected: /** * \brief Communication helper thread required by \ref RemoteWorker. - * + * * Constantly waits for finished work units sent by the processing node. */ class MTS_EXPORT_CORE RemoteWorkerReader : public Thread { @@ -136,12 +136,12 @@ public: * \param backend The responsible server-side communication backend * \param proc Work processor instance for use with this process */ - RemoteProcess(int id, ELogLevel logLevel, + RemoteProcess(int id, ELogLevel logLevel, StreamBackend *backend, WorkProcessor *proc); /* ParallelProcess interface implementation */ EStatus generateWork(WorkUnit *unit, int worker); - void processResult(const WorkResult *result, + void processResult(const WorkResult *result, bool cancelled); ref createWorkProcessor() const; void handleCancellation(); @@ -189,7 +189,7 @@ private: /** * \brief Network processing communication backend * - * Attaches to the end of a stream, accepts work units and forwards + * Attaches to the end of a stream, accepts work units and forwards * them to the local scheduler. Can be used to create network processing nodes. * * \ingroup libcore @@ -229,7 +229,7 @@ public: * \param detach * Should the associated thread be joinable or detach instead? */ - StreamBackend(const std::string &name, Scheduler *scheduler, + StreamBackend(const std::string &name, Scheduler *scheduler, const std::string &nodeName, Stream *stream, bool detach); MTS_DECLARE_CLASS() diff --git a/include/mitsuba/core/sfcurve.h b/include/mitsuba/core/sfcurve.h index d55362dc..e599a34c 100644 --- a/include/mitsuba/core/sfcurve.h +++ b/include/mitsuba/core/sfcurve.h @@ -87,7 +87,7 @@ protected: } } - void generate(int order, + void generate(int order, EDirection front, EDirection right, EDirection back, EDirection left) { if (order == 0) { diff --git a/include/mitsuba/core/shvector.h b/include/mitsuba/core/shvector.h index 28ab6b54..ea0931a8 100644 --- a/include/mitsuba/core/shvector.h +++ b/include/mitsuba/core/shvector.h @@ -27,14 +27,14 @@ MTS_NAMESPACE_BEGIN /* Precompute normalization coefficients for the first 10 bands */ -#define SH_NORMTBL_SIZE 10 +#define SH_NORMTBL_SIZE 10 namespace ublas = boost::numeric::ublas; struct SHVector; /** - * \brief Stores the diagonal blocks of a spherical harmonic + * \brief Stores the diagonal blocks of a spherical harmonic * rotation matrix * * \ingroup libcore @@ -52,7 +52,7 @@ struct MTS_EXPORT_CORE SHRotation { /** * \brief Transform a coefficient vector and store the result into - * the given target vector. + * the given target vector. * * The source and target must have the same number of bands. */ @@ -63,9 +63,9 @@ struct MTS_EXPORT_CORE SHRotation { * \brief Stores a truncated real spherical harmonics representation of * an L2-integrable function. * - * Also provides some other useful functionality, such as evaluation, + * Also provides some other useful functionality, such as evaluation, * projection and rotation. - * + * * The Mathematica equivalent of the basis functions implemented here is: * * \code @@ -231,8 +231,8 @@ public: /** * \brief Convolve the SH representation with the supplied kernel. - * - * Based on the Funk-Hecke theorem -- the kernel must be rotationally + * + * Based on the Funk-Hecke theorem -- the kernel must be rotationally * symmetric around the Z-axis. */ void convolve(const SHVector &kernel); @@ -282,7 +282,7 @@ public: } } } - + for (int l=0; l class SimpleCache +template class SimpleCache : protected PrimitiveThreadLocal< std::pair > { protected: typedef std::pair ValueType; diff --git a/include/mitsuba/core/spectrum.h b/include/mitsuba/core/spectrum.h index e13d5469..eb02ba45 100644 --- a/include/mitsuba/core/spectrum.h +++ b/include/mitsuba/core/spectrum.h @@ -60,7 +60,7 @@ public: * \brief Integrate the spectral power distribution * over a given interval and return the average value * - * Unless overridden in a subclass, the integration is done + * Unless overridden in a subclass, the integration is done * using adaptive Gauss-Lobatto quadrature. * * \param lambdaMin @@ -73,7 +73,7 @@ public: * implementation will return zero. */ virtual Float average(Float lambdaMin, Float lambdaMax) const; - + /// \brief Return a string representation virtual std::string toString() const = 0; @@ -84,7 +84,7 @@ public: /** * \brief Spectral power distribution based on Planck's black body law * - * Computes the spectral power distribution of a black body of the + * Computes the spectral power distribution of a black body of the * specified temperature. * * \ingroup libcore @@ -104,11 +104,11 @@ public: /** \brief Return the value of the spectral power distribution * at the given wavelength. * - * The units are Watts per unit surface area (m^-2) + * The units are Watts per unit surface area (m^-2) * per unit wavelength (nm^-1) per steradian (sr^-1) */ virtual Float eval(Float lambda) const; - + /// Return a string representation std::string toString() const; private: @@ -119,7 +119,7 @@ private: * \brief Spectral distribution for rendering participating media * with Rayleigh scattering. * - * This distribution captures the 1/lambda^4 wavelength dependence + * This distribution captures the 1/lambda^4 wavelength dependence * of Rayleigh scattering. It can provide both the scattering and * extinction coefficient needed for simulating planetary * atmospheres with participating media. @@ -138,7 +138,7 @@ public: /** * \brief Create a Rayleigh spectrum instance * - * \param mode Specifies the requested type of spectrum + * \param mode Specifies the requested type of spectrum * \param eta Refractive index of the medium (e.g. air) * \param height Height above sea level (in meters) */ @@ -147,12 +147,12 @@ public: virtual ~RayleighSpectrum() { } /** \brief Evaluate the extinction/scattering coefficient for - * a specified wavelength. + * a specified wavelength. * * The returned value is in units of 1/meter. */ virtual Float eval(Float lambda) const; - + /// Return a string representation std::string toString() const; private: @@ -168,7 +168,7 @@ public: /** \brief Return the value of the spectral power distribution * at the given wavelength. */ - ProductSpectrum(const ContinuousSpectrum &s1, + ProductSpectrum(const ContinuousSpectrum &s1, const ContinuousSpectrum &s2) : m_spec1(s1), m_spec2(s2) { } @@ -179,7 +179,7 @@ public: /// Virtual destructor virtual ~ProductSpectrum() { } - + /// Return a string representation std::string toString() const; private: @@ -191,19 +191,19 @@ private: * \brief Linearly interpolated spectral power distribution * * This class implements a linearly interpolated spectral - * power distribution that is defined over a discrete set of + * power distribution that is defined over a discrete set of * measurements at different wavelengths. Outside of the * specified range, the spectrum is assumed to be zero. Hence, - * at least two entries are required to produce a nonzero + * at least two entries are required to produce a nonzero * spectrum. * * \ingroup libcore - * \ingroup libpython + * \ingroup libpython */ class MTS_EXPORT_CORE InterpolatedSpectrum : public ContinuousSpectrum { public: /** - * \brief Create a new interpolated spectrum with space + * \brief Create a new interpolated spectrum with space * for the specified number of samples */ InterpolatedSpectrum(size_t size = 0); @@ -235,7 +235,7 @@ public: void append(Float lambda, Float value); /** - * \brief This function adds a zero entry before and after + * \brief This function adds a zero entry before and after * the stored wavelength range. * * This is useful when handling datasets that don't fall @@ -258,7 +258,7 @@ public: * \brief Integrate the spectral power distribution * over a given interval and return the average value * - * This method overrides the implementation in + * This method overrides the implementation in * \ref ContinousSpectrum, since the integral can be * analytically computed for linearly interpolated spectra. * @@ -285,7 +285,7 @@ protected: /** * \brief Abstract spectral power distribution data type * - * This class defines a vector-like data type that can be used for + * This class defines a vector-like data type that can be used for * computations involving radiance. A concrete instantiation for the * precision and spectral discretization chosen at compile time is * given by the \ref Spectrum data type. @@ -402,7 +402,7 @@ public: s[i] /= spec.s[i]; return *this; } - + /// Perform a component-wise division by another spectrum inline TSpectrum operator/(const TSpectrum &spec) const { TSpectrum value = *this; @@ -554,7 +554,7 @@ public: for (int i=0; i { public: @@ -700,7 +700,7 @@ public: #endif /** - * \brief Convert from a spectral power distribution to XYZ + * \brief Convert from a spectral power distribution to XYZ * tristimulus values * * In the Python API, this function returns a 3-tuple @@ -712,11 +712,11 @@ public: * \brief Convert XYZ tristimulus into a plausible spectral * power distribution * - * The \ref EConversionIntent parameter can be used to provide more + * The \ref EConversionIntent parameter can be used to provide more * information on how to solve this highly under-constrained problem. * The default is \ref EReflectance. */ - void fromXYZ(Float x, Float y, Float z, + void fromXYZ(Float x, Float y, Float z, EConversionIntent intent = EReflectance); #if SPECTRUM_SAMPLES == 3 @@ -750,12 +750,12 @@ public: * \brief Convert linear RGB colors into a plausible * spectral power distribution * - * The \ref EConversionIntent parameter can be used to provide more + * The \ref EConversionIntent parameter can be used to provide more * information on how to solve this highly under-constrained problem. * The default is \ref EReflectance. */ - void fromLinearRGB(Float r, Float g, Float b, - EConversionIntent intent = EReflectance); + void fromLinearRGB(Float r, Float g, Float b, + EConversionIntent intent = EReflectance); #endif /** @@ -771,7 +771,7 @@ public: * power distribution * * Note that compared to \ref fromLinearRGB, no \c intent parameter - * is available. For sRGB colors, it is assumed that the intent is + * is available. For sRGB colors, it is assumed that the intent is * always \ref EReflectance. */ void fromSRGB(Float r, Float g, Float b); @@ -782,13 +782,13 @@ public: * * Based on code by Bruce Walter and Greg ward. * - * The \ref EConversionIntent parameter can be used to provide more + * The \ref EConversionIntent parameter can be used to provide more * information on how to solve this highly under-constrained problem. * For RGBE values, the default is \ref EIlluminant. */ void fromRGBE(const uint8_t rgbe[4], EConversionIntent intent = EIlluminant); - /// Linear RGBE conversion based on Bruce Walter's and Greg Ward's code + /// Linear RGBE conversion based on Bruce Walter's and Greg Ward's code void toRGBE(uint8_t rgbe[4]) const; /// Initialize with spectral values from a smooth spectrum representation @@ -811,10 +811,10 @@ public: /// Return a string representation std::string toString() const; - /** + /** * \brief Static initialization (should be called once during the * application's initialization phase) - * + * * This function is responsible for choosing the wavelengths * that will be used during rendering. It also pre-integrates * the CIE matching curves so that sampled spectra can @@ -828,8 +828,8 @@ protected: #if SPECTRUM_SAMPLES != 3 /// Configured wavelengths bins in nanometers static Float m_wavelengths[SPECTRUM_SAMPLES+1]; - - /// @{ \name Pre-integrated CIE 1931 XYZ color matching functions. + + /// @{ \name Pre-integrated CIE 1931 XYZ color matching functions. static Spectrum CIE_X; static Spectrum CIE_Y; static Spectrum CIE_Z; diff --git a/include/mitsuba/core/sse.h b/include/mitsuba/core/sse.h index f1e67796..c3f083ec 100644 --- a/include/mitsuba/core/sse.h +++ b/include/mitsuba/core/sse.h @@ -88,19 +88,19 @@ union SSEVector { : ps(ps) { } - explicit SSEVector(float f0, float f1, float f2, float f3) + explicit SSEVector(float f0, float f1, float f2, float f3) : f0(f0), f1(f1), f2(f2), f3(f3) { } explicit SSEVector(float f) : f0(f), f1(f), f2(f), f3(f) {} - - explicit SSEVector(int32_t i0, int32_t i1, int32_t i2, int32_t i3) + + explicit SSEVector(int32_t i0, int32_t i1, int32_t i2, int32_t i3) : i0(i0), i1(i1), i2(i2), i3(i3) { } explicit SSEVector(int32_t i) : i0(i), i1(i), i2(i), i3(i) {} - explicit SSEVector(uint32_t ui0, uint32_t ui1, uint32_t ui2, uint32_t ui3) + explicit SSEVector(uint32_t ui0, uint32_t ui1, uint32_t ui2, uint32_t ui3) : ui0(ui0), ui1(ui1), ui2(ui2), ui3(ui3) { } diff --git a/include/mitsuba/core/ssemath.h b/include/mitsuba/core/ssemath.h index 6c2d82e9..32b58d99 100644 --- a/include/mitsuba/core/ssemath.h +++ b/include/mitsuba/core/ssemath.h @@ -52,7 +52,7 @@ namespace math { extern MTS_EXPORT_CORE __m128 cos_ps(__m128 x); /** - * \brief SIMD (SSE2) implementation which simultaneously + * \brief SIMD (SSE2) implementation which simultaneously * computes the sine and cosine of a given value * \author Julien Pommier */ diff --git a/include/mitsuba/core/ssevector.h b/include/mitsuba/core/ssevector.h index 359decff..d895b810 100644 --- a/include/mitsuba/core/ssevector.h +++ b/include/mitsuba/core/ssevector.h @@ -37,7 +37,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ----------------------------------------------------------------------------- + ----------------------------------------------------------------------------- Primary author: Edgar Velazquez-Armendariz ============================================================================*/ diff --git a/include/mitsuba/core/sshstream.h b/include/mitsuba/core/sshstream.h index ae3625cb..7b4b9309 100644 --- a/include/mitsuba/core/sshstream.h +++ b/include/mitsuba/core/sshstream.h @@ -27,17 +27,17 @@ MTS_NAMESPACE_BEGIN /** \brief Stream implementation based on an encrypted SSH tunnel - * - * This class remotely starts a program and exposes its stdin/stdout - * streams through an instance of \ref Stream. To make all - * of this work, passwordless authentication must be enabled (for - * example by using public key authentication in addition to a + * + * This class remotely starts a program and exposes its stdin/stdout + * streams through an instance of \ref Stream. To make all + * of this work, passwordless authentication must be enabled (for + * example by using public key authentication in addition to a * running ssh-agent, which stores the decrypted private key). * * On Windows, things are implemented a bit differently: Instead * of OpenSSH, plink.exe (from PUTTY) is used and must be available * in $PATH. For passwordless authentication, convert your private - * key to PuTTY's format (with the help of puttygen.exe). Afterwards, + * key to PuTTY's format (with the help of puttygen.exe). Afterwards, * pageant.exe is required to load and authenticate the key. * * Note: SSH streams are set to use network byte order by default. @@ -52,19 +52,19 @@ public: // ============================================================= /** - * \brief Create a new SSH stream. + * \brief Create a new SSH stream. * - * The timeout parameter specifies specifies the maximum amount of - * time that can be spent before failing to create the initial + * The timeout parameter specifies specifies the maximum amount of + * time that can be spent before failing to create the initial * connection. This feature is unsupported (and ignored) on Windows. - * + * * \param userName Username to use for the authentication * \param hostName Destination host name * \param cmdLine Command (with arguments) to be executed on the remote side * \param port Destination port * \param timeout Maximum time to use for the connection attempt (in seconds) */ - SSHStream(const std::string &userName, + SSHStream(const std::string &userName, const std::string &hostName, const std::vector &cmdLine, int port = 22, int timeout = 10 @@ -79,13 +79,13 @@ public: /// Return the destination machine's host name const std::string &getHostName() const; - + /// Return the user name used for authentication const std::string &getUserName() const; - + /// Return the number of received bytes size_t getReceivedBytes() const; - + /// Return the number of sent bytes size_t getSentBytes() const; @@ -105,7 +105,7 @@ public: void flush(); bool canWrite() const; bool canRead() const; - + //! @} // ============================================================= diff --git a/include/mitsuba/core/sstream.h b/include/mitsuba/core/sstream.h index b76d3c94..ea5161eb 100644 --- a/include/mitsuba/core/sstream.h +++ b/include/mitsuba/core/sstream.h @@ -25,8 +25,8 @@ MTS_NAMESPACE_BEGIN -/** \brief Portable %Stream implementation, which encapsulates a socket - * for IPv4/IPv6 network communications. +/** \brief Portable %Stream implementation, which encapsulates a socket + * for IPv4/IPv6 network communications. * * By default, this type of stream is configured to use network byte * order (= big endian). @@ -67,10 +67,10 @@ public: /// Return the peer's name inline const std::string &getPeer() const { return m_peer; } - + /// Return the number of received bytes inline size_t getReceivedBytes() const { return m_received; } - + /// Return the number of sent bytes inline size_t getSentBytes() const { return m_sent; } diff --git a/include/mitsuba/core/statistics.h b/include/mitsuba/core/statistics.h index 72e45bff..6856b271 100644 --- a/include/mitsuba/core/statistics.h +++ b/include/mitsuba/core/statistics.h @@ -37,10 +37,10 @@ MTS_NAMESPACE_BEGIN #define PROGRESS_MSG_SIZE 56 /** - * Specifies the number of internal counters associated with each + * Specifies the number of internal counters associated with each * \ref StatsCounter instance. * - * This is needed for SMP/ccNUMA systems where different processors might + * This is needed for SMP/ccNUMA systems where different processors might * be contending for a cache line containing a counter. The solution used * here tries to ensure that every processor has its own local counter. */ @@ -68,7 +68,7 @@ enum EStatsType { * * This counter takes up at least one cache line to reduce false sharing. */ -struct CacheLineCounter { +struct CacheLineCounter { #if MTS_32BIT_COUNTERS == 1 // WIN32 & Darwin (PPC/32) don't support atomic 64 bit increment operations // -> restrict counters to 32bit :( @@ -81,19 +81,19 @@ struct CacheLineCounter { }; /** \brief General-purpose statistics counter - * + * * This class implements a simple counter, which can be used to track various * quantities within Mitsuba. At various points during the execution, it is - * possible to then call \ref Statistics::printStats() to get a human-readable + * possible to then call \ref Statistics::printStats() to get a human-readable * report of their values. * * \ingroup libcore */ class MTS_EXPORT_CORE StatsCounter { public: - /** - * \brief Create a new statistics counter - * + /** + * \brief Create a new statistics counter + * * \param category Category of the counter when shown in the statistics summary * \param name Name of the counter when shown in the statistics summary * \param type Characterization of the quantity that will be measured @@ -137,7 +137,7 @@ public: __sync_fetch_and_add(&m_value[Thread::getID() & NUM_COUNTERS_MASK].value, amount); #endif } - + /// Increment the base counter by the specified amount (only for use with EPercentage/EAverage) inline void incrementBase(size_t amount = 1) { #ifdef MTS_NO_STATISTICS @@ -158,12 +158,12 @@ public: inline void recordMinimum(size_t value) { int id = Thread::getID() & NUM_COUNTERS_MASK; #if MTS_32BIT_COUNTERS == 1 - volatile int32_t *ptr = + volatile int32_t *ptr = (volatile int32_t *) &m_value[id].value; int32_t curMinimum; int32_t newMinimum = (int32_t) value; #else - volatile int64_t *ptr = + volatile int64_t *ptr = (volatile int64_t *) &m_value[id].value; int64_t curMinimum; int64_t newMinimum = (int64_t) value; @@ -186,12 +186,12 @@ public: inline void recordMaximum(size_t value) { int id = Thread::getID() & NUM_COUNTERS_MASK; #if MTS_32BIT_COUNTERS == 1 - volatile int32_t *ptr = + volatile int32_t *ptr = (volatile int32_t *) &m_value[id].value; int32_t curMaximum; int32_t newMaximum = (int32_t) value; #else - volatile int64_t *ptr = + volatile int64_t *ptr = (volatile int64_t *) &m_value[id].value; int64_t curMaximum; int64_t newMaximum = (int64_t) value; @@ -284,7 +284,7 @@ private: class MTS_EXPORT_CORE ProgressReporter { public: /** - * Construct a new progress reporter. + * Construct a new progress reporter. * 'ptr' is a custom pointer payload to be submitted with progress messages */ ProgressReporter(const std::string &title, long long total, const void *ptr); @@ -299,7 +299,7 @@ public: inline long long getValue() const { return m_value; } /// Finish - inline void finish() { + inline void finish() { if (m_value < m_total) update(m_total); } @@ -327,7 +327,7 @@ private: /** \brief Collects various rendering statistics and presents them * in a human-readable form. * - * \remark Only the \ref getInstance(), \ref getStats(), and + * \remark Only the \ref getInstance(), \ref getStats(), and * \ref printStats() functions are implemented in the Python bindings. * * \ingroup libcore @@ -370,7 +370,7 @@ private: return c1->getCategory() < c2->getCategory(); } }; - + static ref m_instance; std::vector m_counters; std::vector > m_plugins; diff --git a/include/mitsuba/core/stl.h b/include/mitsuba/core/stl.h index 1981e1f7..05eb48ef 100644 --- a/include/mitsuba/core/stl.h +++ b/include/mitsuba/core/stl.h @@ -19,7 +19,7 @@ #pragma once #if !defined(__MITSUBA_CORE_STL_H_) #define __MITSUBA_CORE_STL_H_ - + /* Include some SGI STL extensions, which might be missing */ #ifdef __GNUC__ #include @@ -36,7 +36,7 @@ namespace std { return __x.first; } }; - + template struct _Select2nd : public unary_function<_Pair, typename _Pair::second_type> { const typename _Pair::second_type& operator()(const _Pair& __x) const { return __x.second; @@ -66,7 +66,7 @@ namespace std { #define snprintf _snprintf #define vsnprintf _vsnprintf - + inline char tolower(char c) { return ::tolower(c); } diff --git a/include/mitsuba/core/stream.h b/include/mitsuba/core/stream.h index d4cf19fa..05842f0c 100644 --- a/include/mitsuba/core/stream.h +++ b/include/mitsuba/core/stream.h @@ -41,16 +41,16 @@ private: /** \brief Abstract seekable stream class * - * Specifies all functions to be implemented by stream + * Specifies all functions to be implemented by stream * subclasses and provides various convenience functions * layered on top of on them. * * All readX() and writeX() methods support transparent - * conversion based on the endianness of the underlying system and the + * conversion based on the endianness of the underlying system and the * value passed to \ref setByteOrder(). Whenever \ref getHostByteOrder() * and \ref getByteOrder() disagree, the endianness is swapped. * - * \sa FileStream, MemoryStream, SocketStream, + * \sa FileStream, MemoryStream, SocketStream, * ConsoleStream, SSHStream, ZStream * \ingroup libcore * \ingroup libpython @@ -65,21 +65,21 @@ public: }; /** - * \brief Create a new stream. - * - * By default, it assumes the byte order of the - * underlying system, i.e. no endianness conversion + * \brief Create a new stream. + * + * By default, it assumes the byte order of the + * underlying system, i.e. no endianness conversion * is performed. */ Stream(); - + /// Return a string representation virtual std::string toString() const; // ====================================================================== /// @{ \name Endianness-related // ====================================================================== - + /// Set the stream byte order void setByteOrder(EByteOrder byteOrder); @@ -88,7 +88,7 @@ public: /// Return the byte order of the underlying machine inline static EByteOrder getHostByteOrder() { return m_hostByteOrder; } - + /// @} // ====================================================================== @@ -98,7 +98,7 @@ public: /** * \brief Read a specified amount of data from the stream - * + * * Throws an exception when the stream ended prematurely */ virtual void read(void *ptr, size_t size) = 0; @@ -133,7 +133,7 @@ public: //! @} // ====================================================================== - + // ====================================================================== //! @{ \name Convenience functions with automatic endianness conversion // ====================================================================== @@ -149,7 +149,7 @@ public: /// Write a signed short (16 bit) to the stream void writeShort(short value); - + /// Write an array of signed shorts (16 bit) to the stream void writeShortArray(const short *values, size_t size); @@ -161,13 +161,13 @@ public: /// Write a signed int (32 bit) to the stream void writeInt(int value); - + /// Write an array of signed ints (32 bit) to the stream void writeIntArray(const int *values, size_t size); /// Write an unsigned int (32 bit) to the stream void writeUInt(unsigned int value); - + /// Write an array of unsigned ints (32 bit) to the stream void writeUIntArray(const unsigned int *values, size_t size); @@ -203,13 +203,13 @@ public: /// Write a single-precision floating point number (32 bit) to the stream void writeSingle(float value); - + /// Write a single-precision floating point array (32 bit) to the stream void writeSingleArray(const float *data, size_t size); /// Write a double-precision floating point number (64 bit) to the stream void writeDouble(double value); - + /// Write a double-precision floating point array (64 bit) to the stream void writeDoubleArray(const double *data, size_t size); @@ -242,25 +242,25 @@ public: /// Read a signed short (16 bit) from the stream short readShort(); - + /// Read an array of signed shorts (16 bit) from the stream void readShortArray(short *dest, size_t size); /// Read an unsigned short (16 bit) from the stream unsigned short readUShort(); - + /// Read an array of unsigned shorts (16 bit) from the stream void readUShortArray(unsigned short *dest, size_t size); /// Read a signed int (32 bit) from the stream int readInt(); - + /// Read an array of signed ints (32 bit) from the stream void readIntArray(int *dst, size_t size); /// Read an unsigned int (32 bit) from the stream unsigned int readUInt(); - + /// Read an array of unsigned ints (32 bit) from the stream void readUIntArray(unsigned int *dest, size_t size); @@ -272,7 +272,7 @@ public: /// Read an unsigned int (64 bit) from the stream uint64_t readULong(); - + /// Read a size value from the stream size_t readSize() { return (size_t) readULong(); } @@ -327,32 +327,32 @@ public: /** * \brief Copy content from this stream into another stream * \param stream Destination stream - * \param numBytes + * \param numBytes * The number of bytes to copy. When -1 is specified, * copying proceeds until the end of the source stream. */ void copyTo(Stream *stream, int64_t numBytes = -1); /** - * \brief Read an element from the stream (uses partial template + * \brief Read an element from the stream (uses partial template * specialization to select a method appropriate to the data type) */ template T readElement(); /** - * \brief Write an element to the stream (uses partial template + * \brief Write an element to the stream (uses partial template * specialization to select a method appropriate to the data type) */ template void writeElement(T value); /** - * \brief Read an array from the stream (uses partial template + * \brief Read an array from the stream (uses partial template * specialization to select a method appropriate to the data type) */ template void readArray(T *array, size_t count); /** - * \brief Write an array to the stream (uses partial template + * \brief Write an array to the stream (uses partial template * specialization to select a method appropriate to the data type) */ template void writeArray(const T *array, size_t count); diff --git a/include/mitsuba/core/thread.h b/include/mitsuba/core/thread.h index f2c0b4bd..f284518c 100644 --- a/include/mitsuba/core/thread.h +++ b/include/mitsuba/core/thread.h @@ -46,7 +46,7 @@ public: /** * \brief Create a new thread object - * \param name An identifying name of this thread + * \param name An identifying name of this thread * (will be shown in debug messages) * \remark Note that it is currently not possible to * construct Thread instances from Python @@ -56,7 +56,7 @@ public: /** * \brief Set the thread priority * - * This does not always work -- for instance, Linux + * This does not always work -- for instance, Linux * requires root privileges for this operation. * * \return \c true upon success. @@ -68,9 +68,9 @@ public: /** * \brief Specify whether or not this thread is critical - * - * When an thread marked critical crashes from an uncaught - * exception, the whole process is brought down. + * + * When an thread marked critical crashes from an uncaught + * exception, the whole process is brought down. * The default is \c false. */ void setCritical(bool critical); @@ -116,7 +116,7 @@ public: /** * \brief Detach the thread and release resources - * + * * After a call to this function, \ref join() * cannot be used anymore. This releases resources, which * would otherwise be held until a call to \ref join(). @@ -142,7 +142,7 @@ public: static void initializeOpenMP(size_t threadCount); /** - * \brief Register an unmanaged thread with Mitsuba (i.e. one that + * \brief Register an unmanaged thread with Mitsuba (i.e. one that * doesn't derive from \c mitsuba::Thread) * * Should be called from the thread in question. The function returns diff --git a/include/mitsuba/core/timer.h b/include/mitsuba/core/timer.h index 16313c9b..613ee457 100644 --- a/include/mitsuba/core/timer.h +++ b/include/mitsuba/core/timer.h @@ -46,7 +46,7 @@ public: void start(); /** - * \brief Reset the timer, including the total elapsed time across + * \brief Reset the timer, including the total elapsed time across * all intervals (and restart it by default) */ void reset(bool restart = true); @@ -81,7 +81,7 @@ public: /** * \brief "Lap"-style interface * - * This function is the atomic equivalent to stopping the + * This function is the atomic equivalent to stopping the * timer, recording the time passed since it was started, * and restarting it. The resulting time value in seconds * is returned. diff --git a/include/mitsuba/core/tls.h b/include/mitsuba/core/tls.h index 290dfd42..00c81a1b 100644 --- a/include/mitsuba/core/tls.h +++ b/include/mitsuba/core/tls.h @@ -41,7 +41,7 @@ namespace detail { /// Functor to release memory of a TLS object typedef void (*DestructFunctor)(void *); /// Construct a new thread local storage object - ThreadLocalBase(const ConstructFunctor &constructFunctor, + ThreadLocalBase(const ConstructFunctor &constructFunctor, const DestructFunctor &destructFfunctor); /// Destroy the thread local storage object ~ThreadLocalBase(); @@ -62,14 +62,14 @@ namespace detail { /** * \headerfile mitsuba/core/tls.h mitsuba/mitsuba.h - * \brief Thin wrapper around boost thread local storage. + * \brief Thin wrapper around boost thread local storage. * Stores references to Object instances. * \sa PrimitiveThreadLocal * \ingroup libcore * - * This class implements a reference counting thread local storage object which captures + * This class implements a reference counting thread local storage object which captures * references to subclasses of \ref Object. In comparison to an API like boost::thread_specific_ptr - * it has a much nicer cleanup mechanism. Held references are destroyed when the owning thread dies \a or + * it has a much nicer cleanup mechanism. Held references are destroyed when the owning thread dies \a or * when the \c ThreadLocal instance is freed, whichever occurs first. */ template class ThreadLocal { @@ -84,7 +84,7 @@ public: inline ValueType *get() { return ((ref *) m_base.get())->get(); } /** - * \brief Return a reference to the data associated with the + * \brief Return a reference to the data associated with the * current thread (const version) */ inline const ValueType *get() const { return ((const ref *) m_base.get())->get(); } @@ -102,14 +102,14 @@ protected: /** * \headerfile mitsuba/core/tls.h mitsuba/mitsuba.h - * \brief Thin wrapper around posix thread local storage. + * \brief Thin wrapper around posix thread local storage. * Stores heap-allocated data other than Object instances. * \sa ThreadLocal * \ingroup libcore - * + * * This class implements a thread local storage object for POD-style data structures. - * In comparison to an API like boost::thread_specific_ptr it has a much nicer - * cleanup mechanism. Held references are destroyed when the owning thread dies \a or + * In comparison to an API like boost::thread_specific_ptr it has a much nicer + * cleanup mechanism. Held references are destroyed when the owning thread dies \a or * when the \c PrimitiveThreadLocal instance is freed, whichever occurs first. */ template class PrimitiveThreadLocal { @@ -129,7 +129,7 @@ public: } /** - * \brief Return a reference to the data associated with the + * \brief Return a reference to the data associated with the * current thread (const version) */ inline const ValueType &get() const { diff --git a/include/mitsuba/core/transform.h b/include/mitsuba/core/transform.h index 46f26f24..a90523a8 100644 --- a/include/mitsuba/core/transform.h +++ b/include/mitsuba/core/transform.h @@ -37,9 +37,9 @@ public: m_transform.setIdentity(); m_invTransform.setIdentity(); } - + /// Unserialize a transformation from a stream - inline Transform(Stream *stream) { + inline Transform(Stream *stream) { m_transform = Matrix4x4(stream); m_invTransform = Matrix4x4(stream); } @@ -182,7 +182,7 @@ public: return Vector(x, y, z); } - /** + /** * \brief Matrix-vector multiplication for vectors in 3d space (no temporaries) * \remark This function is not available in the Python bindings */ @@ -196,7 +196,7 @@ public: } /** - * \brief Matrix-normal multiplication + * \brief Matrix-normal multiplication * \remark In the Python bindings, this is function implemented as * the multiplication operator (\c __mul__). */ @@ -222,7 +222,7 @@ public: dest.z = m_invTransform.m[0][2] * v.x + m_invTransform.m[1][2] * v.y + m_invTransform.m[2][2] * v.z; } - + /** * \brief 4D matrix-vector multiplication * \remark In the Python bindings, this is function implemented as @@ -327,7 +327,7 @@ public: /// Create a scale transformation static Transform scale(const Vector &v); - + /** \brief Create a perspective transformation. * (Maps [near, far] to [0, 1]) * \param fov Field of view in degrees @@ -335,7 +335,7 @@ public: * \param clipFar Far clipping plane */ static Transform perspective(Float fov, Float clipNear, Float clipFar); - + /** \brief Create a perspective transformation for OpenGL. * (Maps [-near, -far] to [-1, 1]) * \param fov Field of view in degrees @@ -360,7 +360,7 @@ public: * \param clipFar Far clipping plane */ static Transform orthographic(Float clipNear, Float clipFar); - + /** \brief Create an orthographic transformation for OpenGL * \param clipNear Near clipping plane * \param clipFar Far clipping plane diff --git a/include/mitsuba/core/triangle.h b/include/mitsuba/core/triangle.h index c4dccbb0..2071d57b 100644 --- a/include/mitsuba/core/triangle.h +++ b/include/mitsuba/core/triangle.h @@ -25,9 +25,9 @@ MTS_NAMESPACE_BEGIN -/** - * \brief Simple triangle class including a collection of routines - * for analysis and transformation. +/** + * \brief Simple triangle class including a collection of routines + * for analysis and transformation. * * Triangles are stored as indices into a vertex array * \ingroup libcore @@ -45,15 +45,15 @@ struct MTS_EXPORT_CORE Triangle { } /** - * \brief Returns the axis-aligned bounding box of a triangle after it has - * clipped to the extends of another given AABB. + * \brief Returns the axis-aligned bounding box of a triangle after it has + * clipped to the extends of another given AABB. * - * This function uses the Sutherland-Hodgman algorithm to calculate the - * convex polygon that is created when applying all 6 AABB splitting - * planes to the triangle. Afterwards, the AABB of the newly created - * convex polygon is returned. This function is an important component - * for efficiently creating 'Perfect Split' KD-trees. For more detail, - * see "On building fast kd-Trees for Ray Tracing, and on doing + * This function uses the Sutherland-Hodgman algorithm to calculate the + * convex polygon that is created when applying all 6 AABB splitting + * planes to the triangle. Afterwards, the AABB of the newly created + * convex polygon is returned. This function is an important component + * for efficiently creating 'Perfect Split' KD-trees. For more detail, + * see "On building fast kd-Trees for Ray Tracing, and on doing * that in O(N log N)" by Ingo Wald and Vlastimil Havran */ AABB getClippedAABB(const Point *positions, const AABB &aabb) const; @@ -66,7 +66,7 @@ struct MTS_EXPORT_CORE Triangle { Float surfaceArea(const Point *positions) const; /** \brief Ray-triangle intersection test - * + * * Uses the algorithm by Moeller and Trumbore discussed at * http://www.acm.org/jgt/papers/MollerTrumbore97/code.html. * @@ -90,7 +90,7 @@ struct MTS_EXPORT_CORE Triangle { * \return * \c true if an intersection has been detected */ - FINLINE static bool rayIntersect(const Point &p0, const Point &p1, const Point &p2, + FINLINE static bool rayIntersect(const Point &p0, const Point &p1, const Point &p2, const Ray &ray, Float &u, Float &v, Float &t) { /* Find vectors for two edges sharing */ Vector edge1 = p1 - p0, edge2 = p2 - p0; @@ -127,9 +127,9 @@ struct MTS_EXPORT_CORE Triangle { return false; } - + /** \brief Ray-triangle intersection test - * + * * Uses the algorithm by Moeller and Trumbore discussed at * http://www.acm.org/jgt/papers/MollerTrumbore97/code.html. * @@ -151,7 +151,7 @@ struct MTS_EXPORT_CORE Triangle { * \return * \c true if an intersection has been detected */ - FINLINE bool rayIntersect(const Point *positions, const Ray &ray, Float &u, + FINLINE bool rayIntersect(const Point *positions, const Ray &ray, Float &u, Float &v, Float &t) const { return rayIntersect( positions[idx[0]], positions[idx[1]], diff --git a/include/mitsuba/core/util.h b/include/mitsuba/core/util.h index d81bce23..46089548 100644 --- a/include/mitsuba/core/util.h +++ b/include/mitsuba/core/util.h @@ -23,7 +23,7 @@ #include MTS_NAMESPACE_BEGIN - + /*! \addtogroup libcore */ /*! @{ */ @@ -68,7 +68,7 @@ template std::string containerToString(const Iterator &start, co while (it != end) { oss << " " << indent((*it)->toString()); ++it; - if (it != end) + if (it != end) oss << "," << std::endl; else oss << std::endl; @@ -110,12 +110,12 @@ extern MTS_EXPORT_CORE int getCoreCount(); /// Return the host name of this machine extern MTS_EXPORT_CORE std::string getHostName(); -/// Return the fully qualified domain name of this machine +/// Return the fully qualified domain name of this machine extern MTS_EXPORT_CORE std::string getFQDN(); /** - * \brief Enable floating point exceptions (to catch NaNs, overflows, - * arithmetic with infinity). + * \brief Enable floating point exceptions (to catch NaNs, overflows, + * arithmetic with infinity). * * On Intel processors, this applies to both x87 and SSE2 math * @@ -183,7 +183,7 @@ static FINLINE __int64 rdtsc(void) { /** * \brief Apply an arbitrary permutation to an array in linear time - * + * * This algorithm is based on Donald Knuth's book * "The Art of Computer Programming, Volume 3: Sorting and Searching" * (1st edition, section 5.2, page 595) @@ -197,7 +197,7 @@ static FINLINE __int64 rdtsc(void) { * Pointer to the data that should be permuted * \param perm * Input permutation vector having the same size as \c data. After - * the function terminates, this vector will be set to the + * the function terminates, this vector will be set to the * identity permutation. */ template void permute_inplace( @@ -223,7 +223,7 @@ template void permute_inplace( } while (perm[j] != i); /* Fix the final position with the saved value */ - data[j] = curval; + data[j] = curval; perm[j] = j; } } @@ -329,94 +329,94 @@ inline size_t roundToPowerOfTwo(size_t value) { * \brief Solve a quadratic equation of the form a*x^2 + b*x + c = 0. * \return \c true if a solution could be found */ -extern MTS_EXPORT_CORE bool solveQuadratic(Float a, Float b, +extern MTS_EXPORT_CORE bool solveQuadratic(Float a, Float b, Float c, Float &x0, Float &x1); /** - * \brief Solve a double-precision quadratic equation of the + * \brief Solve a double-precision quadratic equation of the * form a*x^2 + b*x + c = 0. * \return \c true if a solution could be found */ -extern MTS_EXPORT_CORE bool solveQuadraticDouble(double a, double b, +extern MTS_EXPORT_CORE bool solveQuadraticDouble(double a, double b, double c, double &x0, double &x1); /** * \brief Evaluate a cubic spline interpolant of a regularly sampled 1D function - * + * * This implementation relies on Catmull-Rom splines, i.e. it uses finite * differences to approximate the derivatives at the endpoints of each spline * segment. * * \param x - * Evaluation point + * Evaluation point * \param data * Floating point array containing \c size regularly spaced evaluations * in the range [\c min,\c max] of the function to be approximated. - * \param min + * \param min * Position of the first knot * \param max * Position of the last knot - * \param size + * \param size * Denotes the size of the \c data array * \return * The interpolated value or zero when \c x lies outside of [\c min, \c max] */ -extern MTS_EXPORT_CORE Float interpCubic1D(Float x, const Float *data, +extern MTS_EXPORT_CORE Float interpCubic1D(Float x, const Float *data, Float min, Float max, size_t size); /** * \brief Evaluate a cubic spline interpolant of an \a irregularly sampled 1D function - * + * * This implementation relies on Catmull-Rom splines, i.e. it uses finite * differences to approximate the derivatives at the endpoints of each spline * segment. * * \param x - * Evaluation point + * Evaluation point * \param nodes * Floating point array containing \c size irregularly spaced values * denoting positions the where the function to be interpolated was evaluated. * They must be provided in \a increasing order. * \param data - * Floating point array containing interpolant values matched to + * Floating point array containing interpolant values matched to * the entries of \c nodes. - * \param size + * \param size * Denotes the size of the \c data array * \return * The interpolated value or zero when \c x lies outside of \a [\c min, \c max] */ -extern MTS_EXPORT Float interpCubic1DIrregular(Float x, const Float *nodes, +extern MTS_EXPORT Float interpCubic1DIrregular(Float x, const Float *nodes, const Float *data, size_t size); /** * \brief Evaluate a cubic spline interpolant of a regularly sampled 2D function - * - * This implementation relies on a tensor product of Catmull-Rom splines, i.e. it uses + * + * This implementation relies on a tensor product of Catmull-Rom splines, i.e. it uses * finite differences to approximate the derivatives at the endpoints of each spline * patch. * * \param p - * Evaluation point + * Evaluation point * \param data * A 2D floating point array of size.x*size.y cells containing regularly - * spaced evaluations of the function to be interpolated on the domain [min, max]. + * spaced evaluations of the function to be interpolated on the domain [min, max]. * Consecutive entries of this array correspond to increments in the 'x' coordinate. * \param min * Position of the first knot on each dimension * \param max * Position of the last knot on each dimension - * \param size + * \param size * Denotes the size of the \c data array (along each dimension) * \return * The interpolated value or zero when \c p lies outside of the knot range */ -extern MTS_EXPORT_CORE Float interpCubic2D(const Point2 &p, const Float *data, +extern MTS_EXPORT_CORE Float interpCubic2D(const Point2 &p, const Float *data, const Point2 &min, const Point2 &max, const Size2 &size); /** * \brief Evaluate a cubic spline interpolant of an \a irregularly sampled 2D function - * - * This implementation relies on a tensor product of Catmull-Rom splines, i.e. it uses + * + * This implementation relies on a tensor product of Catmull-Rom splines, i.e. it uses * finite differences to approximate the derivatives at the endpoints of each spline * region. * @@ -424,27 +424,27 @@ extern MTS_EXPORT_CORE Float interpCubic2D(const Point2 &p, const Float *data, * should be preferred, since data lookups will be considerably faster. * * \param p - * Evaluation point + * Evaluation point * \param nodes * Pointer to a list for each dimension denoting the positions where the function * to be interpolated was evaluated. The i-th array must have * size size[i] and contain position values in \a increasing order. * \param data * A 2D floating point array of size.x*size.y cells containing irregularly - * spaced evaluations of the function to be interpolated on the domain [min, max]. + * spaced evaluations of the function to be interpolated on the domain [min, max]. * Consecutive entries of this array correspond to increments in the 'x' coordinate. - * \param size + * \param size * Denotes the size of the \c data array (along each dimension) * \return * The interpolated value or zero when \c p lies outside of the knot range */ -extern MTS_EXPORT_CORE Float interpCubic2DIrregular(const Point2 &p, const Float **nodes, +extern MTS_EXPORT_CORE Float interpCubic2DIrregular(const Point2 &p, const Float **nodes, const Float *data, const Size2 &size); /** * \brief Evaluate a cubic spline interpolant of a regularly sampled 3D function - * - * This implementation relies on a tensor product of Catmull-Rom splines, i.e. it uses + * + * This implementation relies on a tensor product of Catmull-Rom splines, i.e. it uses * finite differences to approximate the derivatives at the endpoints of each spline * region. * @@ -452,25 +452,25 @@ extern MTS_EXPORT_CORE Float interpCubic2DIrregular(const Point2 &p, const Float * Evaluation point of the interpolant * \param data * A 3D floating point array of size.x*size.y*size.z cells containing regularly - * spaced evaluations of the function to be interpolated on the domain [min, max]. + * spaced evaluations of the function to be interpolated on the domain [min, max]. * Consecutive entries of this array correspond to increments in the 'x' coordinate, * then 'y', and finally 'z' increments. * \param min * Position of the first knot on each dimension * \param max * Position of the last knot on each dimension - * \param size + * \param size * Denotes the size of the \c data array (along each dimension) * \return * The interpolated value or zero when \c p lies outside of the knot range */ -extern MTS_EXPORT_CORE Float interpCubic3D(const Point3 &p, const Float *data, +extern MTS_EXPORT_CORE Float interpCubic3D(const Point3 &p, const Float *data, const Point3 &min, const Point3 &max, const Size3 &size); /** * \brief Evaluate a cubic spline interpolant of an \a irregularly sampled 3D function - * - * This implementation relies on a tensor product of Catmull-Rom splines, i.e. it uses + * + * This implementation relies on a tensor product of Catmull-Rom splines, i.e. it uses * finite differences to approximate the derivatives at the endpoints of each spline * region. * @@ -478,22 +478,22 @@ extern MTS_EXPORT_CORE Float interpCubic3D(const Point3 &p, const Float *data, * should be preferred, since data lookups will be considerably faster. * * \param p - * Evaluation point + * Evaluation point * \param nodes * Pointer to a list for each dimension denoting the positions where the function * to be interpolated was evaluated. The i-th array must have * size size[i] and contain position values in \a increasing order. * \param data * A 2D floating point array of size.x*size.y cells containing irregularly - * spaced evaluations of the function to be interpolated on the domain [min, max]. + * spaced evaluations of the function to be interpolated on the domain [min, max]. * Consecutive entries of this array correspond to increments in the 'x' coordinate, * then 'y', and finally 'z' increments. - * \param size + * \param size * Denotes the size of the \c data array (along each dimension) * \return * The interpolated value or zero when \c p lies outside of the knot range */ -extern MTS_EXPORT_CORE Float interpCubic3DIrregular(const Point3 &p, const Float **nodes, +extern MTS_EXPORT_CORE Float interpCubic3DIrregular(const Point3 &p, const Float **nodes, const Float *data, const Size3 &size); //// Convert radians to degrees @@ -519,7 +519,7 @@ inline Float smoothStep(Float min, Float max, Float value) { } /** - * \brief Numerically well-behaved routine for computing the angle + * \brief Numerically well-behaved routine for computing the angle * between two unit direction vectors * * This should be used wherever one is tempted to compute the @@ -549,7 +549,7 @@ extern MTS_EXPORT_CORE bool solveLinearSystem2x2(const Float a[2][2], const Floa /** * \brief Complete the set {a} to an orthonormal base - * \remark In Python, this function is used as + * \remark In Python, this function is used as * follows: s, t = coordinateSystem(n) * \ingroup libpython */ @@ -563,18 +563,18 @@ extern MTS_EXPORT_CORE void coordinateSystem(const Vector &a, Vector &b, Vector * \param count The interval [0, 1] is split into count strata * \param jitter Randomly jitter the samples? */ -extern MTS_EXPORT_CORE void stratifiedSample1D(Random *random, Float *dest, +extern MTS_EXPORT_CORE void stratifiedSample1D(Random *random, Float *dest, int count, bool jitter); /** * \brief Generate (optionally jittered) stratified 2D samples * \param random Source of random numbers - * \param dest A pointer to a floating point array + * \param dest A pointer to a floating point array * \param countX The X axis interval [0, 1] is split into countX strata * \param countY The Y axis interval [0, 1] is split into countY strata * \param jitter Randomly jitter the samples? */ -extern MTS_EXPORT_CORE void stratifiedSample2D(Random *random, Point2 *dest, +extern MTS_EXPORT_CORE void stratifiedSample2D(Random *random, Point2 *dest, int countX, int countY, bool jitter); /// Generate latin hypercube samples @@ -616,19 +616,19 @@ extern MTS_EXPORT_CORE Point2 toSphericalCoordinates(const Vector &v); * Relative refractive index to the transmitted direction * \ingroup libpython */ -extern MTS_EXPORT_CORE Float fresnelDielectric(Float cosThetaI, +extern MTS_EXPORT_CORE Float fresnelDielectric(Float cosThetaI, Float cosThetaT, Float eta); /** * \brief Calculates the unpolarized Fresnel reflection coefficient * at a planar interface between two dielectrics (extended version) * - * In comparison to \ref fresnelDielectric(), this function internally - * computes the transmitted direction and returns it using the \c cosThetaT - * argument. When encountering total internal reflection, it sets + * In comparison to \ref fresnelDielectric(), this function internally + * computes the transmitted direction and returns it using the \c cosThetaT + * argument. When encountering total internal reflection, it sets * cosThetaT=0 and returns the value 1. * - * When cosThetaI < 0, the function computes the Fresnel reflectance + * When cosThetaI < 0, the function computes the Fresnel reflectance * from the \a internal boundary, which is equivalent to calling the function * with arguments fresnelDielectric(abs(cosThetaI), cosThetaT, 1/eta). * @@ -639,13 +639,13 @@ extern MTS_EXPORT_CORE Float fresnelDielectric(Float cosThetaI, * Cosine of the angle between the normal and the incident ray * (may be negative) * \param cosThetaT - * Argument used to return the cosine of the angle between the normal + * Argument used to return the cosine of the angle between the normal * and the transmitted ray, will have the opposite sign of \c cosThetaI * \param eta * Relative refractive index * \ingroup libpython */ -extern MTS_EXPORT_CORE Float fresnelDielectricExt(Float cosThetaI, +extern MTS_EXPORT_CORE Float fresnelDielectricExt(Float cosThetaI, Float &cosThetaT, Float eta); /** @@ -663,7 +663,7 @@ inline Float fresnelDielectricExt(Float cosThetaI, Float eta) { Float cosThetaT; return fresnelDielectricExt(cosThetaI, cosThetaT, eta); } /** - * \brief Calculates the unpolarized fresnel reflection coefficient + * \brief Calculates the unpolarized fresnel reflection coefficient * at a planar interface between vacuum and a conductor. * * \param cosThetaI @@ -674,12 +674,12 @@ inline Float fresnelDielectricExt(Float cosThetaI, Float eta) { Float cosThetaT; * Imaginary refractive index (wavelength-dependent) * \ingroup libpython */ -extern MTS_EXPORT_CORE Spectrum fresnelConductor(Float cosThetaI, +extern MTS_EXPORT_CORE Spectrum fresnelConductor(Float cosThetaI, const Spectrum &eta, const Spectrum &k); /** * \brief Calculates the diffuse unpolarized fresnel reflectance of - * a dielectric material (sometimes referred to as "Fdr"). + * a dielectric material (sometimes referred to as "Fdr"). * * This value quantifies what fraction of diffuse incident illumination * will, on average, be reflected at a dielectric material boundary @@ -687,10 +687,10 @@ extern MTS_EXPORT_CORE Spectrum fresnelConductor(Float cosThetaI, * \param eta * Relative refraction coefficient * \param fast - * Compute an approximate value? If set to \c true, the + * Compute an approximate value? If set to \c true, the * implementation will use a polynomial approximation with * a max relative error of ~0.5% on the interval 0.5 < \c eta < 2. - * When \c fast=false, the code will use Gauss-Lobatto quadrature + * When \c fast=false, the code will use Gauss-Lobatto quadrature * to compute the diffuse reflectance more accurately, and for * a wider range of refraction coefficients, but at a cost * in terms of performance. @@ -712,11 +712,11 @@ extern MTS_EXPORT_CORE Float fresnelDiffuseReflectance( extern MTS_EXPORT_CORE Vector reflect(const Vector &wi, const Normal &n); /** - * \brief Specularly refract the direction \c wi into a planar dielectric with + * \brief Specularly refract the direction \c wi into a planar dielectric with * the given surface normal and index of refraction. * * This variant internally computes the transmitted direction cosine by - * calling \ref fresnelDielectricExt. As a side result, the cosine and + * calling \ref fresnelDielectricExt. As a side result, the cosine and * Fresnel reflectance are computed and returned via the reference arguments * \c cosThetaT and \c F. * @@ -730,8 +730,8 @@ extern MTS_EXPORT_CORE Vector reflect(const Vector &wi, const Normal &n); * \param eta * Relative index of refraction at the interface * \param cosThetaT - * Parameter used to return the signed cosine of the angle between the transmitted - * direction and the surface normal + * Parameter used to return the signed cosine of the angle between the transmitted + * direction and the surface normal * \param F * Parameter used to return the Fresnel reflectance * \return @@ -739,11 +739,11 @@ extern MTS_EXPORT_CORE Vector reflect(const Vector &wi, const Normal &n); * the case of total internal reflection) * \ingroup libpython */ -extern MTS_EXPORT_CORE Vector refract(const Vector &wi, const Normal &n, +extern MTS_EXPORT_CORE Vector refract(const Vector &wi, const Normal &n, Float eta, Float &cosThetaT, Float &F); /** - * \brief Specularly refract the direction \c wi into a planar dielectric with + * \brief Specularly refract the direction \c wi into a planar dielectric with * the given surface normal and index of refraction. * * This variant assumes that the transmitted direction cosine has @@ -762,11 +762,11 @@ extern MTS_EXPORT_CORE Vector refract(const Vector &wi, const Normal &n, * Specularly transmitted direction * \ingroup libpython */ -extern MTS_EXPORT_CORE Vector refract(const Vector &wi, const Normal &n, +extern MTS_EXPORT_CORE Vector refract(const Vector &wi, const Normal &n, Float eta, Float cosThetaT); /** - * \brief Specularly refract the direction \c wi into a planar dielectric with + * \brief Specularly refract the direction \c wi into a planar dielectric with * the given surface normal and index of refraction. * * This function is a simple convenience function that only returns the refracted diff --git a/include/mitsuba/core/vector.h b/include/mitsuba/core/vector.h index 21ed4c65..a7933056 100644 --- a/include/mitsuba/core/vector.h +++ b/include/mitsuba/core/vector.h @@ -38,7 +38,7 @@ template struct TVector1 { const static int dim = 1; /** \brief Construct a new vector without initializing it. - * + * * This construtor is useful when the vector will either not * be used at all (it might be part of a larger data structure) * or initialized at a later point in time. Always make sure @@ -52,15 +52,15 @@ template struct TVector1 { TVector1() { x = std::numeric_limits::quiet_NaN(); } #endif - /// Initialize the vector with the specified value + /// Initialize the vector with the specified value TVector1(T x) : x(x) { } /// Initialize the vector with the components of another vector data structure - template explicit TVector1(const TVector1 &v) + template explicit TVector1(const TVector1 &v) : x((T) v.x) { } /// Initialize the vector with the components of a point data structure - template explicit TVector1(const TPoint1 &p) + template explicit TVector1(const TPoint1 &p) : x((T) p.x) { } /// Unserialize a vector from a binary data stream @@ -80,7 +80,7 @@ template struct TVector1 { /// Add another vector to the current one TVector1& operator+=(const TVector1 &v) { - x += v.x; + x += v.x; return *this; } @@ -97,7 +97,7 @@ template struct TVector1 { /// Multiply the vector by the given scalar TVector1 &operator*=(T f) { - x *= f; + x *= f; return *this; } @@ -191,7 +191,7 @@ template inline TVector1 normalize(const TVector1 &v) { template <> inline TVector1 TVector1::operator/(int s) const { #ifdef MTS_DEBUG - if (s == 0) + if (s == 0) SLog(EWarn, "Vector1i: Division by zero!"); #endif return TVector1(x/s); @@ -199,7 +199,7 @@ template <> inline TVector1 TVector1::operator/(int s) const { template <> inline TVector1 &TVector1::operator/=(int s) { #ifdef MTS_DEBUG - if (s == 0) + if (s == 0) SLog(EWarn, "Vector1i: Division by zero!"); #endif @@ -222,7 +222,7 @@ template struct TVector2 { const static int dim = 2; /** \brief Construct a new vector without initializing it. - * + * * This construtor is useful when the vector will either not * be used at all (it might be part of a larger data structure) * or initialized at a later point in time. Always make sure @@ -243,11 +243,11 @@ template struct TVector2 { explicit TVector2(T val) : x(val), y(val) { } /// Initialize the vector with the components of another vector data structure - template explicit TVector2(const TVector2 &v) + template explicit TVector2(const TVector2 &v) : x((T) v.x), y((T) v.y) { } /// Initialize the vector with the components of a point data structure - template explicit TVector2(const TPoint2 &p) + template explicit TVector2(const TPoint2 &p) : x((T) p.x), y((T) p.y) { } /// Unserialize a vector from a binary data stream @@ -268,7 +268,7 @@ template struct TVector2 { /// Add another vector to the current one TVector2& operator+=(const TVector2 &v) { - x += v.x; y += v.y; + x += v.x; y += v.y; return *this; } @@ -285,7 +285,7 @@ template struct TVector2 { /// Multiply the vector by the given scalar TVector2 &operator*=(T f) { - x *= f; y *= f; + x *= f; y *= f; return *this; } @@ -311,7 +311,7 @@ template struct TVector2 { SLog(EWarn, "Vector2: Division by zero!"); #endif T recip = (T) 1 / f; - x *= recip; y *= recip; + x *= recip; y *= recip; return *this; } @@ -382,7 +382,7 @@ template inline TVector2 normalize(const TVector2 &v) { template <> inline TVector2 TVector2::operator/(int s) const { #ifdef MTS_DEBUG - if (s == 0) + if (s == 0) SLog(EWarn, "Vector2i: Division by zero!"); #endif return TVector2(x/s, y/s); @@ -390,7 +390,7 @@ template <> inline TVector2 TVector2::operator/(int s) const { template <> inline TVector2 &TVector2::operator/=(int s) { #ifdef MTS_DEBUG - if (s == 0) + if (s == 0) SLog(EWarn, "Vector2i: Division by zero!"); #endif @@ -409,12 +409,12 @@ template struct TVector3 { typedef TPoint3 PointType; T x, y, z; - + /// Number of dimensions const static int dim = 3; /** \brief Construct a new vector without initializing it. - * + * * This construtor is useful when the vector will either not * be used at all (it might be part of a larger data structure) * or initialized at a later point in time. Always make sure @@ -435,11 +435,11 @@ template struct TVector3 { explicit TVector3(T val) : x(val), y(val), z(val) { } /// Initialize the vector with the components of another vector data structure - template explicit TVector3(const TVector3 &v) + template explicit TVector3(const TVector3 &v) : x((T) v.x), y((T) v.y), z((T) v.z) { } /// Initialize the vector with the components of a point data structure - template explicit TVector3(const TPoint3 &p) + template explicit TVector3(const TPoint3 &p) : x((T) p.x), y((T) p.y), z((T) p.z) { } /// Unserialize a vector from a binary data stream @@ -572,7 +572,7 @@ template inline T absDot(const TVector3 &v1, const TVector3 & template inline TVector3 cross(const TVector3 &v1, const TVector3 &v2) { return TVector3( - (v1.y * v2.z) - (v1.z * v2.y), + (v1.y * v2.z) - (v1.z * v2.y), (v1.z * v2.x) - (v1.x * v2.z), (v1.x * v2.y) - (v1.y * v2.x) ); @@ -584,7 +584,7 @@ template inline TVector3 normalize(const TVector3 &v) { template <> inline TVector3 TVector3::operator/(int s) const { #ifdef MTS_DEBUG - if (s == 0) + if (s == 0) SLog(EWarn, "Vector3i: Division by zero!"); #endif return TVector3(x/s, y/s, z/s); @@ -592,7 +592,7 @@ template <> inline TVector3 TVector3::operator/(int s) const { template <> inline TVector3 &TVector3::operator/=(int s) { #ifdef MTS_DEBUG - if (s == 0) + if (s == 0) SLog(EWarn, "Vector3i: Division by zero!"); #endif @@ -613,13 +613,13 @@ template struct TVector4 { typedef TPoint4 PointType; T x, y, z, w; - + /// Number of dimensions const static int dim = 3; /** \brief Construct a new vector without initializing it. - * + * * This construtor is useful when the vector will either not * be used at all (it might be part of a larger data structure) * or initialized at a later point in time. Always make sure @@ -640,11 +640,11 @@ template struct TVector4 { explicit TVector4(T val) : x(val), y(val), z(val), w(val) { } /// Initialize the vector with the components of another vector data structure - template explicit TVector4(const TVector4 &v) + template explicit TVector4(const TVector4 &v) : x((T) v.x), y((T) v.y), z((T) v.z), w((T) v.w) { } /// Initialize the vector with the components of a point data structure - template explicit TVector4(const TPoint4 &p) + template explicit TVector4(const TPoint4 &p) : x((T) p.x), y((T) p.y), z((T) p.z), w((T) p.w) { } /// Unserialize a vector from a binary data stream @@ -783,7 +783,7 @@ template inline TVector4 normalize(const TVector4 &v) { template <> inline TVector4 TVector4::operator/(int s) const { #ifdef MTS_DEBUG - if (s == 0) + if (s == 0) SLog(EWarn, "Vector4i: Division by zero!"); #endif return TVector4(x/s, y/s, z/s, w/s); @@ -791,7 +791,7 @@ template <> inline TVector4 TVector4::operator/(int s) const { template <> inline TVector4 &TVector4::operator/=(int s) { #ifdef MTS_DEBUG - if (s == 0) + if (s == 0) SLog(EWarn, "Vector4i: Division by zero!"); #endif diff --git a/include/mitsuba/core/version.h b/include/mitsuba/core/version.h index a120d665..f3c6b2eb 100644 --- a/include/mitsuba/core/version.h +++ b/include/mitsuba/core/version.h @@ -35,7 +35,7 @@ MTS_NAMESPACE_BEGIN #define MTS_YEAR "2012" /** - * \brief A simple data structure for representing and + * \brief A simple data structure for representing and * comparing Mitsuba version strings * * \ingroup libcore @@ -44,17 +44,17 @@ struct MTS_EXPORT_CORE Version { public: /// Default constructor: initialize to an invalid version (0.0.0) inline Version() : m_major(0), m_minor(0), m_release(0) { } - + /// Initialize with the specified version number inline Version(int major, int minor, int release) : m_major(major), m_minor(minor), m_release(release) { } /** - * \brief Parse a version string of the form "major.minor.release" + * \brief Parse a version string of the form "major.minor.release" * and turn it into a \ref Version structure */ Version(const std::string &versionString); - + /// Check if this program version is \a older than \c other inline bool operator<(const Version &other) const { if (m_major < other.m_major) @@ -78,8 +78,8 @@ public: /// Check if two program versions match inline bool operator==(const Version &other) const { - return m_major == other.m_major - && m_minor == other.m_minor + return m_major == other.m_major + && m_minor == other.m_minor && m_release == other.m_release; } @@ -102,11 +102,11 @@ public: /// Return the major version inline int getMajorVersion() const { return m_major; } - + /// Return the minor version inline int getMinorVersion() const { return m_minor; } - /// Return the release + /// Return the release inline int getRelease() const { return m_release; } private: int m_major; diff --git a/include/mitsuba/core/vmf.h b/include/mitsuba/core/vmf.h index f8c92374..96576895 100644 --- a/include/mitsuba/core/vmf.h +++ b/include/mitsuba/core/vmf.h @@ -27,7 +27,7 @@ MTS_NAMESPACE_BEGIN /** * \brief Von Mises-Fisher distribution on the 2-sphere * - * This is a basic implementation, which assumes that the + * This is a basic implementation, which assumes that the * distribution is centered around the Z-axis. * * \author Wenzel Jakob @@ -36,7 +36,7 @@ MTS_NAMESPACE_BEGIN struct MTS_EXPORT_CORE VonMisesFisherDistr { public: /** - * \brief Create a new von Mises-Fisher distribution + * \brief Create a new von Mises-Fisher distribution * with the given concentration parameter */ VonMisesFisherDistr(Float kappa = 0); @@ -48,7 +48,7 @@ public: /// Evaluate the distribution for a given value of cos(theta) Float eval(Float cosTheta) const; - + /** * \brief Generate a sample from this distribution * @@ -64,9 +64,9 @@ public: static Float forPeakValue(Float x); /** - * \brief Compute an concentration parameter that approximately + * \brief Compute an concentration parameter that approximately * corresponds to the spherical convolution of two vMF distributions. - * + * * For details, see "Directional Statistics" by Mardia and Jupp, p.44 */ static Float convolve(Float kappa1, Float kappa2); diff --git a/include/mitsuba/core/warp.h b/include/mitsuba/core/warp.h index cb2b1a41..b6319278 100644 --- a/include/mitsuba/core/warp.h +++ b/include/mitsuba/core/warp.h @@ -28,7 +28,7 @@ MTS_NAMESPACE_BEGIN * \brief Implements common warping techniques that map from the unit * square to other domains, such as spheres, hemispheres, etc. * - * The main application of this class is to generate uniformly + * The main application of this class is to generate uniformly * distributed or weighted point sets in certain common target domains. */ class MTS_EXPORT_CORE Warp { @@ -53,11 +53,11 @@ public: static Vector squareToCosineHemisphere(const Point2 &sample); /// Density of \ref squareToCosineHemiphere with respect to solid angles - static inline Float squareToCosineHemispherePdf(const Vector &d) + static inline Float squareToCosineHemispherePdf(const Vector &d) { return INV_PI * Frame::cosTheta(d); } /** - * \brief Uniformly sample a vector that lies within a given + * \brief Uniformly sample a vector that lies within a given * cone of angles around the Z axis * * \param cosCutoff Cosine of the cutoff angle @@ -66,7 +66,7 @@ public: static Vector squareToUniformCone(Float cosCutoff, const Point2 &sample); /** - * \brief Uniformly sample a vector that lies within a given + * \brief Uniformly sample a vector that lies within a given * cone of angles around the Z axis * * \param cosCutoff Cosine of the cutoff angle @@ -102,7 +102,7 @@ public: static Point2 squareToUniformTriangle(const Point2 &sample); /** - * \brief Sample a point on a 2D standard normal distribution + * \brief Sample a point on a 2D standard normal distribution * * Internally uses the Box-Muller transformation */ diff --git a/include/mitsuba/core/zstream.h b/include/mitsuba/core/zstream.h index 05ffcded..f6a28c31 100644 --- a/include/mitsuba/core/zstream.h +++ b/include/mitsuba/core/zstream.h @@ -32,7 +32,7 @@ MTS_NAMESPACE_BEGIN * \brief Transparent compression/decompression stream based on \c zlib. * * This class transparently decompresses and compresses reads and writes - * to a nested stream, respectively. + * to a nested stream, respectively. * * \ingroup libcore */ diff --git a/include/mitsuba/hw/basicshader.h b/include/mitsuba/hw/basicshader.h index 967c1add..d9ef441a 100644 --- a/include/mitsuba/hw/basicshader.h +++ b/include/mitsuba/hw/basicshader.h @@ -52,7 +52,7 @@ public: inline Spectrum getAverage() const { return m_value; } - + inline Spectrum getMaximum() const { return m_value; } @@ -103,7 +103,7 @@ public: inline Spectrum getAverage() const { return Spectrum(m_value); } - + inline Spectrum getMaximum() const { return Spectrum(m_value); } diff --git a/include/mitsuba/hw/device.h b/include/mitsuba/hw/device.h index dbfaba72..ff1e903c 100644 --- a/include/mitsuba/hw/device.h +++ b/include/mitsuba/hw/device.h @@ -83,7 +83,7 @@ public: /// Get the interpreted keypress data inline const char* getKeyboardInterpreted() const { return m_keyboard.interpreted; } - + /// Get the interpreted keypress data inline char* getKeyboardInterpreted() { return m_keyboard.interpreted; } @@ -261,7 +261,7 @@ public: /// Return the FSAA sample count inline int getFSAA() const { return m_fsaa; } - + /// Only applies to devices, which are UI windows virtual void setVisible(bool visible) = 0; @@ -357,7 +357,7 @@ public: inline Session *getSession() { return m_session; } /** - * Initialize the renderer. Optionally, an existing device instance + * Initialize the renderer. Optionally, an existing device instance * can be provided as a second argument -- this is primarily meant * to create a device that will be able to support a shared context * with another device. @@ -387,7 +387,7 @@ protected: /// Create a new device Device(Session *session); - /** \brief Send a device event using + /** \brief Send a device event using * the registered callbacks */ void fireDeviceEvent(const DeviceEvent &event); diff --git a/include/mitsuba/hw/font.h b/include/mitsuba/hw/font.h index 2353b93a..55ed0ac0 100644 --- a/include/mitsuba/hw/font.h +++ b/include/mitsuba/hw/font.h @@ -59,7 +59,7 @@ public: */ int32_t verticalBearing; - /** \brief Horizontal advance value of this glyph + /** \brief Horizontal advance value of this glyph * * (# of pixels the pen must be advanced * after rendering a glyph) diff --git a/include/mitsuba/hw/glprogram.h b/include/mitsuba/hw/glprogram.h index d462ca3e..71818041 100644 --- a/include/mitsuba/hw/glprogram.h +++ b/include/mitsuba/hw/glprogram.h @@ -48,7 +48,7 @@ public: /// Determine the ID number of a named parameter int getParameterID(const std::string &name, bool failIfMissing = true) const; - + /// Set a boolean parameter void setParameter(int id, bool value); @@ -57,7 +57,7 @@ public: /// Set a integer parameter void setParameter(int id, int value); - + /// Set a unsigned integer parameter void setParameter(int id, uint32_t value); @@ -108,7 +108,7 @@ public: /** Set a GPUTexture parameter. Must be executed after binding the texture to a texture unit */ - void setParameter(int id, const GPUTexture *value); + void setParameter(int id, const GPUTexture *value); MTS_DECLARE_CLASS() protected: diff --git a/include/mitsuba/hw/glrenderer.h b/include/mitsuba/hw/glrenderer.h index 4f46bcfe..e5321448 100644 --- a/include/mitsuba/hw/glrenderer.h +++ b/include/mitsuba/hw/glrenderer.h @@ -73,7 +73,7 @@ public: /// Clear the viewport void clear(); - /// Configure the camera + /// Configure the camera void setCamera(const ProjectiveCamera *pCamera, const Point2 &apertureSample = Point2(0.5f), const Point2 &aaSample = Point2(0.5f), @@ -89,19 +89,19 @@ public: Matrix4x4 getMatrix(EMatrixType type) const; /// Set up the renderer for drawing triangle geometry - void beginDrawingMeshes(bool transmitOnlyPositions = false); + void beginDrawingMeshes(bool transmitOnlyPositions = false); /// Send a triangle mesh to the renderer - void drawMesh(const TriMesh *geo); + void drawMesh(const TriMesh *geo); /// Send a triangle mesh to the renderer - void drawMesh(const GPUGeometry *geo); + void drawMesh(const GPUGeometry *geo); /// Clean up the renderer after drawing triangle geometry - void endDrawingMeshes(); + void endDrawingMeshes(); /** - * \brief Quickly draw all geometry that has been registered + * \brief Quickly draw all geometry that has been registered * with the renderer. * * Only transmits positions, hence this is mainly useful for @@ -111,7 +111,7 @@ public: /// Draw a quad using the given texture void blitTexture(const GPUTexture *texture, - bool flipVertically = false, + bool flipVertically = false, bool centerHoriz = true, bool centerVert = true, const Vector2i &offset = Vector2i(0, 0)); @@ -122,7 +122,7 @@ public: * Draw a line of text on the screen. The coordinates are specified * in pixel coordinates, where the upper left corner is the origin */ - void drawText(const Point2i &pos, + void drawText(const Point2i &pos, const Font *font, const std::string &text); /// Set the size of point primitives @@ -159,7 +159,7 @@ public: void drawFilledRectangle(const Point2i &a, const Point2i &b); /// Draw an ellipse with the specified center and axes - void drawEllipse(const Point ¢er, + void drawEllipse(const Point ¢er, const Vector &axis1, const Vector &axis2); /// Draw a wire-frame axis-aligned box @@ -179,7 +179,7 @@ public: /// Set the current fixed-function pipeline color void setColor(const Color3 &color, Float alpha = 1.0f); - + /// Set the current fixed-function pipeline color void setColor(const Spectrum &spec, Float alpha = 1.0f); diff --git a/include/mitsuba/hw/gltexture.h b/include/mitsuba/hw/gltexture.h index eefbefb4..5e825bcc 100644 --- a/include/mitsuba/hw/gltexture.h +++ b/include/mitsuba/hw/gltexture.h @@ -38,7 +38,7 @@ public: /// Refresh (re-upload) the texture void refresh(); - + /** * \brief Refresh (re-upload) a subregion of the texture * @@ -56,7 +56,7 @@ public: * Specifies the unit to which this texture should be bound * \param textureIndex * When this texture has multiple sub-textures (e.g. - * a color and depth map in the case of a + * a color and depth map in the case of a * \ref EColorAndDepthBuffer texture), this parameter * specifies the one to be bound */ @@ -67,7 +67,7 @@ public: /// Unbind the texture and disable texturing void unbind() const; - + /// Activate the render target void activateTarget(); @@ -86,7 +86,7 @@ public: * \param target * Specifies the target render buffer (or NULL for the framebuffer) * \param what - * A bitwise-OR of the components in \ref EFrameBufferType to copy + * A bitwise-OR of the components in \ref EFrameBufferType to copy */ void blit(GPUTexture *target, int what) const; @@ -96,14 +96,14 @@ public: * \param target * Specifies the target render buffer (or NULL for the framebuffer) * \param what - * A bitwise-OR of the components in \ref EFrameBufferType to copy - * \param sourceOffset + * A bitwise-OR of the components in \ref EFrameBufferType to copy + * \param sourceOffset * Offset in the source render buffer - * \param sourceOffset + * \param sourceOffset * Size of the region to be copied from the source render buffer - * \param destOffset + * \param destOffset * Offset in the destination render buffer - * \param destOffset + * \param destOffset * Size of the region to be copied into the dest destination buffer */ void blit(GPUTexture *target, int what, const Point2i &sourceOffset, diff --git a/include/mitsuba/hw/glxrenderer.h b/include/mitsuba/hw/glxrenderer.h index 4e1d00fa..14f8f8f5 100644 --- a/include/mitsuba/hw/glxrenderer.h +++ b/include/mitsuba/hw/glxrenderer.h @@ -34,7 +34,7 @@ public: /// Return the rendering context inline GLXContext getGLXContext() { return m_context; } - + /// Initialize the renderer void init(Device *device, Renderer *other = NULL); diff --git a/include/mitsuba/hw/gpugeometry.h b/include/mitsuba/hw/gpugeometry.h index 783a9458..25fcda2b 100644 --- a/include/mitsuba/hw/gpugeometry.h +++ b/include/mitsuba/hw/gpugeometry.h @@ -51,7 +51,7 @@ public: /// Unbind the geometry object virtual void unbind() = 0; - + /// Free the geometry object from GPU memory virtual void cleanup() = 0; diff --git a/include/mitsuba/hw/gpuprogram.h b/include/mitsuba/hw/gpuprogram.h index 7f3d8d24..20796e34 100644 --- a/include/mitsuba/hw/gpuprogram.h +++ b/include/mitsuba/hw/gpuprogram.h @@ -80,104 +80,104 @@ public: virtual int getParameterID(const std::string &name, bool failIfMissing = true) const = 0; /// Set a boolean parameter by name - inline void setParameter(const std::string &name, bool value, + inline void setParameter(const std::string &name, bool value, bool failIfMissing = true) { setParameter(getParameterID(name, failIfMissing), value); } /// Set a integer parameter by name - inline void setParameter(const std::string &name, int value, + inline void setParameter(const std::string &name, int value, bool failIfMissing = true) { setParameter(getParameterID(name, failIfMissing), value); } /// Set an unsigned integer parameter by name - inline void setParameter(const std::string &name, uint32_t value, + inline void setParameter(const std::string &name, uint32_t value, bool failIfMissing = true) { setParameter(getParameterID(name, failIfMissing), value); } /// Set a float parameter by name - inline void setParameter(const std::string &name, Float value, + inline void setParameter(const std::string &name, Float value, bool failIfMissing = true) { setParameter(getParameterID(name, failIfMissing), value); } /// Set a Vector parameter by name inline void setParameter(const std::string &name, const Vector &value, - bool failIfMissing = true) { + bool failIfMissing = true) { setParameter(getParameterID(name, failIfMissing), value); } /// Set a Vector3i parameter by name inline void setParameter(const std::string &name, const Vector3i &value, - bool failIfMissing = true) { + bool failIfMissing = true) { setParameter(getParameterID(name, failIfMissing), value); } /// Set a Vector2 parameter by name inline void setParameter(const std::string &name, const Vector2 &value, - bool failIfMissing = true) { + bool failIfMissing = true) { setParameter(getParameterID(name, failIfMissing), value); } /// Set a Vector2i parameter by name inline void setParameter(const std::string &name, const Vector2i &value, - bool failIfMissing = true) { + bool failIfMissing = true) { setParameter(getParameterID(name, failIfMissing), value); } /// Set a Vector4 parameter by name inline void setParameter(const std::string &name, const Vector4 &value, - bool failIfMissing = true) { + bool failIfMissing = true) { setParameter(getParameterID(name, failIfMissing), value); } /// Set a Point parameter by name inline void setParameter(const std::string &name, const Point &value, - bool failIfMissing = true) { + bool failIfMissing = true) { setParameter(getParameterID(name, failIfMissing), value); } /// Set a Point3i parameter by name inline void setParameter(const std::string &name, const Point3i &value, - bool failIfMissing = true) { + bool failIfMissing = true) { setParameter(getParameterID(name, failIfMissing), value); } /// Set a Point2 parameter by name inline void setParameter(const std::string &name, const Point2 &value, - bool failIfMissing = true) { + bool failIfMissing = true) { setParameter(getParameterID(name, failIfMissing), value); } /// Set a Point2i parameter by name inline void setParameter(const std::string &name, const Point2i &value, - bool failIfMissing = true) { + bool failIfMissing = true) { setParameter(getParameterID(name, failIfMissing), value); } /// Set a Point4 parameter by name inline void setParameter(const std::string &name, const Point4 &value, - bool failIfMissing = true) { + bool failIfMissing = true) { setParameter(getParameterID(name, failIfMissing), value); } /// Set a Matrix2x2 parameter by name inline void setParameter(const std::string &name, const Matrix2x2 &value, - bool failIfMissing = true) { + bool failIfMissing = true) { setParameter(getParameterID(name, failIfMissing), value); } /// Set a Matrix3x3 parameter by name inline void setParameter(const std::string &name, const Matrix3x3 &value, - bool failIfMissing = true) { + bool failIfMissing = true) { setParameter(getParameterID(name, failIfMissing), value); } /// Set a Matrix4x4 parameter by name inline void setParameter(const std::string &name, const Matrix4x4 &value, - bool failIfMissing = true) { + bool failIfMissing = true) { setParameter(getParameterID(name, failIfMissing), value); } @@ -189,20 +189,20 @@ public: /// Set a Color3 parameter by name inline void setParameter(const std::string &name, const Color3 &value, - bool failIfMissing = true) { + bool failIfMissing = true) { setParameter(getParameterID(name, failIfMissing), value); } /// Set a Spectrum parameter (will be converted to linear RGB) by name inline void setParameter(const std::string &name, const Spectrum &value, - bool failIfMissing = true) { + bool failIfMissing = true) { setParameter(getParameterID(name, failIfMissing), value); } /** Set a GPUTexture parameter by name. Must be executed after binding the texture to a texture unit */ inline void setParameter(const std::string &name, const GPUTexture *value, - bool failIfMissing = true) { + bool failIfMissing = true) { setParameter(getParameterID(name, failIfMissing), value); } @@ -214,7 +214,7 @@ public: /// Set a int parameter virtual void setParameter(int id, int value) = 0; - + /// Set a uint32_t parameter virtual void setParameter(int id, uint32_t value) = 0; diff --git a/include/mitsuba/hw/gputexture.h b/include/mitsuba/hw/gputexture.h index aaf35a31..58057b27 100644 --- a/include/mitsuba/hw/gputexture.h +++ b/include/mitsuba/hw/gputexture.h @@ -49,14 +49,14 @@ public: ETextureCubeMap }; - /** \brief If the texture type is set to EFrameBuffer, the + /** \brief If the texture type is set to EFrameBuffer, the * configuration must be one of the following constants */ enum EFrameBufferType { /// This is not a framebuffer ENone = 0x00, /** - * \brief Color framebuffer (\a including an internal depth + * \brief Color framebuffer (\a including an internal depth * buffer that cannot be accessed as a texture) */ EColorBuffer = 0x01, @@ -81,10 +81,10 @@ public: /// 16-bit floating point (\c half) HDR component encoding EFloat16, - + /// 32-bit floating point (\c float) HDR component encoding EFloat32, - + /// 64-bit floating point (\c float) HDR component encoding EFloat64 }; @@ -148,7 +148,7 @@ public: enum EFilterType { /// Use the color value of the closest pixel ENearest = 0, - /// Use 4 surrounding pixels and weigh them + /// Use 4 surrounding pixels and weigh them ELinear, /** * Blend the color values of the closest matching @@ -168,7 +168,7 @@ public: * associated texture unit. 'ENormal' means that texture * values are returned as with any other texture, whereas * 'ECompare' causes a depth comparison to take place - * (this is the default). + * (this is the default). */ enum EDepthMode { ENormal, @@ -177,7 +177,7 @@ public: /** \brief Construct a new texture. * - * If bitmap is non-NULL, the texture type, format + * If bitmap is non-NULL, the texture type, format * will be automatically set * * \param name A human-readable name (for debugging) @@ -229,7 +229,7 @@ public: /// Set the wrap type along the U axis inline void setWrapTypeU(EWrapType wrapType) { m_wrapTypeU = wrapType; } - + /// Return the wrap type along the U axis inline EWrapType getWrapTypeU() { return m_wrapTypeU; } @@ -249,7 +249,7 @@ public: inline Float getMaxAnisotropy() const { return m_maxAnisotropy; } /** \brief Set the maximal anisotropy. - * + * * A value of 1 will result in isotropic * texture filtering. A value of 0 (default) will * use the global max. anisotropy value @@ -264,7 +264,7 @@ public: /// Return the depth map read mode inline EDepthMode getDepthMode() const { return m_depthMode; } - + /// Set the depth map read mode inline void setDepthMode(EDepthMode mode) { m_depthMode = mode; } @@ -291,7 +291,7 @@ public: /// Refresh (re-upload) the texture virtual void refresh() = 0; - + /** * \brief Refresh (re-upload) a subregion of the texture * @@ -301,7 +301,7 @@ public: /// Free the texture from GPU memory virtual void cleanup() = 0; - + /** * \brief Bind the texture and enable texturing * @@ -309,7 +309,7 @@ public: * Specifies the unit to which this texture should be bound * \param textureIndex * When this texture has multiple sub-textures (e.g. - * a color and depth map in the case of a + * a color and depth map in the case of a * \ref EColorAndDepthBuffer texture), this parameter * specifies the one to be bound */ @@ -342,14 +342,14 @@ public: /// Set the number of samples (for multisample color render targets) inline void setSampleCount(int samples) { m_samples = samples; } - + /// Return the number of samples (for multisample color render targets) inline int getSampleCount() const { return m_samples; } /// Set the border color (applicable if wrapMode=EClamp/EClampToBorder) inline void setBorderColor(const Color3 &borderColor) { m_borderColor = borderColor; } - - /// Return the border color + + /// Return the border color inline const Color3 &getBorderColor() const { return m_borderColor; } /** @@ -358,7 +358,7 @@ public: * \param target * Specifies the target render buffer * \param what - * A bitwise-OR of the components in \ref EFrameBufferType to copy + * A bitwise-OR of the components in \ref EFrameBufferType to copy */ virtual void blit(GPUTexture *target, int what) const = 0; @@ -368,14 +368,14 @@ public: * \param target * Specifies the target render buffer (or NULL for the framebuffer) * \param what - * A bitwise-OR of the components in \ref EFrameBufferType to copy - * \param sourceOffset + * A bitwise-OR of the components in \ref EFrameBufferType to copy + * \param sourceOffset * Offset in the source render buffer - * \param sourceOffset + * \param sourceOffset * Size of the region to be copied from the source render buffer - * \param destOffset + * \param destOffset * Offset in the destination render buffer - * \param destOffset + * \param destOffset * Size of the region to be copied into the dest destination buffer */ virtual void blit(GPUTexture *target, int what, const Point2i &sourceOffset, diff --git a/include/mitsuba/hw/nsgldevice.h b/include/mitsuba/hw/nsgldevice.h index cabe8b65..82a8e6e3 100644 --- a/include/mitsuba/hw/nsgldevice.h +++ b/include/mitsuba/hw/nsgldevice.h @@ -75,7 +75,7 @@ public: /// Set the window title void setTitle(const std::string &title); - + /// Display the NSGL cursor? void showCursor(bool enabled); @@ -103,7 +103,7 @@ public: /** * Deliver all events which have been - * received asynchronously + * received asynchronously */ void processEvents(); @@ -122,7 +122,7 @@ private: NSWindow *m_window; CustomView *m_view; NSOpenGLPixelFormat *m_fmt; - NSOpenGLContext *m_currentContext; + NSOpenGLContext *m_currentContext; #else void *m_window; void *m_view; diff --git a/include/mitsuba/hw/nsglsession.h b/include/mitsuba/hw/nsglsession.h index 16ad1af1..b1b5ee79 100644 --- a/include/mitsuba/hw/nsglsession.h +++ b/include/mitsuba/hw/nsglsession.h @@ -43,7 +43,7 @@ public: /** * \brief Process all events and call event callbacks. * - * This function will run until the \c stop parameter is set + * This function will run until the \c stop parameter is set * to \c true from within an event callback. */ void processEventsBlocking(bool &stop); diff --git a/include/mitsuba/hw/renderer.h b/include/mitsuba/hw/renderer.h index 54219d2d..35f1a898 100644 --- a/include/mitsuba/hw/renderer.h +++ b/include/mitsuba/hw/renderer.h @@ -62,7 +62,7 @@ public: m_capabilities[cap] = supported; } - inline bool isSupported(ECapability cap) const { + inline bool isSupported(ECapability cap) const { return m_capabilities[cap]; } @@ -109,8 +109,8 @@ public: } /** - * Initialize the renderer. Optionally, an existing renderer instance - * can be provided as a second argument -- this establishes a link + * Initialize the renderer. Optionally, an existing renderer instance + * can be provided as a second argument -- this establishes a link * between them to permit sharing of textures, programs, etc. */ virtual void init(Device *device, Renderer *other = NULL); @@ -137,7 +137,7 @@ public: /// Clear the viewport virtual void clear() = 0; - /// Configure the camera + /// Configure the camera virtual void setCamera(const ProjectiveCamera *pCamera, const Point2 &apertureSample = Point2(0.5f), const Point2 &aaSample = Point2(0.5f), @@ -153,19 +153,19 @@ public: virtual Matrix4x4 getMatrix(EMatrixType type) const = 0; /// Set up the renderer for drawing triangle geometry - virtual void beginDrawingMeshes(bool transmitOnlyPositions = false) = 0; + virtual void beginDrawingMeshes(bool transmitOnlyPositions = false) = 0; /// Send a triangle mesh to the renderer - virtual void drawMesh(const TriMesh *shape) = 0; + virtual void drawMesh(const TriMesh *shape) = 0; /// Send a triangle mesh to the renderer - virtual void drawMesh(const GPUGeometry *geo) = 0; + virtual void drawMesh(const GPUGeometry *geo) = 0; /// Clean up the renderer after drawing triangle geometry - virtual void endDrawingMeshes() = 0; + virtual void endDrawingMeshes() = 0; /** - * \brief Quickly draw all geometry that has been registered + * \brief Quickly draw all geometry that has been registered * with the renderer. * * Only transmits positions, hence this is mainly useful for @@ -175,7 +175,7 @@ public: /// Draw a quad using the given texture virtual void blitTexture(const GPUTexture *texture, - bool flipVertically = false, + bool flipVertically = false, bool centerHoriz = true, bool centerVert = true, const Vector2i &offset = Vector2i(0, 0)) = 0; @@ -186,7 +186,7 @@ public: * Draw a line of text on the screen. The coordinates are specified * in pixel coordinates, where the upper left corner is the origin */ - virtual void drawText(const Point2i &pos, + virtual void drawText(const Point2i &pos, const Font *font, const std::string &text) = 0; /// Set the size of point primitives @@ -223,7 +223,7 @@ public: virtual void drawFilledRectangle(const Point2i &a, const Point2i &b) = 0; /// Draw an ellipse with the specified center and axes - virtual void drawEllipse(const Point ¢er, + virtual void drawEllipse(const Point ¢er, const Vector &axis1, const Vector &axis2) = 0; /// Draw a wire-frame axis-aligned box diff --git a/include/mitsuba/hw/session.h b/include/mitsuba/hw/session.h index 922a6dbb..372f28d5 100644 --- a/include/mitsuba/hw/session.h +++ b/include/mitsuba/hw/session.h @@ -47,7 +47,7 @@ public: /** * \brief Process all events and call event callbacks. * - * This function will run until the \c stop parameter is set + * This function will run until the \c stop parameter is set * to \c true from within an event callback. */ virtual void processEventsBlocking(bool &stop) = 0; diff --git a/include/mitsuba/hw/shadow.h b/include/mitsuba/hw/shadow.h index 51065b27..9e58b235 100644 --- a/include/mitsuba/hw/shadow.h +++ b/include/mitsuba/hw/shadow.h @@ -24,8 +24,8 @@ MTS_NAMESPACE_BEGIN -/** \brief Utility class for creating different kinds of shadow maps (cube, - * directional, and paraboloid shadow maps) using hardware rasterization +/** \brief Utility class for creating different kinds of shadow maps (cube, + * directional, and paraboloid shadow maps) using hardware rasterization * * \ingroup libhw */ @@ -79,7 +79,7 @@ public: * \param trafo * View transformation of the source */ - void render(Renderer *renderer, GPUTexture *shadowMap, EShadowMapType type, + void render(Renderer *renderer, GPUTexture *shadowMap, EShadowMapType type, const Transform &trafo, Float minDepth, Float maxDepth, const std::vector &geo); diff --git a/include/mitsuba/hw/viewer.h b/include/mitsuba/hw/viewer.h index 390034ac..e1aefdd1 100644 --- a/include/mitsuba/hw/viewer.h +++ b/include/mitsuba/hw/viewer.h @@ -50,14 +50,14 @@ protected: /// Draw a heads-up display void drawHUD(const std::string &text); - /// Request that the draw() routine be called + /// Request that the draw() routine be called inline void redraw() { m_leaveEventLoop = true; } /// To be overwritten by the subclass: main drawing routine virtual void draw() = 0; /** - * \brief To be overwritten (optionally): perform any necessary + * \brief To be overwritten (optionally): perform any necessary * initializations * * The default implementation does nothing and returns \c true. @@ -73,13 +73,13 @@ protected: /// To be overwritten (optionally): handle a key press event virtual void keyPressed(const DeviceEvent &event); - + /// To be overwritten (optionally): handle a key release event virtual void keyReleased(const DeviceEvent &event); - + /// To be overwritten (optionally): handle a mouse button press event virtual void mouseButtonPressed(const DeviceEvent &event); - + /// To be overwritten (optionally): handle a mouse button release event virtual void mouseButtonReleased(const DeviceEvent &event); @@ -94,7 +94,7 @@ protected: /// To be overwritten (optionally): handle a mouse end drag event virtual void mouseEndDrag(const DeviceEvent &event); - + /// To be overwritten (optionally): handle a window resize event virtual void windowResized(const DeviceEvent &event); diff --git a/include/mitsuba/hw/vpl.h b/include/mitsuba/hw/vpl.h index 75131443..f37307e2 100644 --- a/include/mitsuba/hw/vpl.h +++ b/include/mitsuba/hw/vpl.h @@ -28,25 +28,25 @@ MTS_NAMESPACE_BEGIN /** * \brief This class is responsible for the on-demand creation of - * GPU shaders to render shapes that are illuminated by virtual - * point light sources. + * GPU shaders to render shapes that are illuminated by virtual + * point light sources. * - * This is used to drive the \c vpl integrator as well as the + * This is used to drive the \c vpl integrator as well as the * interactive preview in the Mitsuba GUI. * - * For each encountered BSDF-VPL pair, a custom piece of code + * For each encountered BSDF-VPL pair, a custom piece of code * describing the characteristic light transport between them is * created and cached. The implementation carefully looks at * the tree of shader dependencies and creates code that can be * shared with other materials that have a similar configuration. - * This is necessary to avoid generating a potentially huge O(N^2) + * This is necessary to avoid generating a potentially huge O(N^2) * number of very similar programs and brings it down to O(n^2) * where n << N. * * \ingroup libhw */ class MTS_EXPORT_HW VPLShaderManager : public Object { -public: +public: /// Create a new shader manager VPLShaderManager(Renderer *renderer); @@ -73,14 +73,14 @@ public: * \brief Prepare the shader manager for rendering * with a new VPL * - * Must be called after \ref setScene() and before - * \ref bind(). This function creates a suitable + * Must be called after \ref setScene() and before + * \ref bind(). This function creates a suitable * shadow map for the VPL. */ void setVPL(const VPL &vpl); /** - * \brief Bind a shader for rendering a certain + * \brief Bind a shader for rendering a certain * VPL/BSDF/Emitter triplet * * \param vpl @@ -100,12 +100,12 @@ public: * When set to \c true, a special shader is used to * create face normals for the geometry */ - void bind(const VPL &vpl, const BSDF *bsdf, - const Sensor *sensor, const Emitter *emitter, + void bind(const VPL &vpl, const BSDF *bsdf, + const Sensor *sensor, const Emitter *emitter, const Matrix4x4 &instanceTransform, bool faceNormals); /** - * \brief Release the currently bound shader and + * \brief Release the currently bound shader and * any resources (textures,..) that it references */ void unbind(); @@ -115,8 +115,8 @@ public: * for a given VPL * * This function issues the necessary calls to \ref bind() - * \ref unbind(), etc., and schedules draw calls for all - * of the scene geometry. + * \ref unbind(), etc., and schedules draw calls for all + * of the scene geometry. */ void drawAllGeometryForVPL(const VPL &vpl, const Sensor *sensor); @@ -141,7 +141,7 @@ public: /// Return whether or not non-diffuse VPLs are used inline bool getDiffuseSources() const { return m_diffuseSources; } - + /// Set whether or not surfaces are drawn assumed to be diffuse inline void setDiffuseReceivers(bool diffuseReceivers) { m_diffuseReceivers = diffuseReceivers; } @@ -165,7 +165,7 @@ protected: const Shader *shader; std::vector children; std::vector parameterIDs; - + /// Create from a \ref Shader object inline DependencyNode(Shader *shader = NULL) : shader(shader) { if (!shader) @@ -176,12 +176,12 @@ protected: it != deps.end(); ++it) children.push_back(DependencyNode(*it)); } - + /// Copy constructor - inline DependencyNode(const DependencyNode &node) - : shader(node.shader), children(node.children), + inline DependencyNode(const DependencyNode &node) + : shader(node.shader), children(node.children), parameterIDs(node.parameterIDs) { } - + /// Generate GLSL code for the entire shader chain inline std::string generateCode(std::ostringstream &oss, int &id) const { std::vector depNames; @@ -192,17 +192,17 @@ protected: oss << endl; return evalName; } - + /// Resolve all parameters of the shader chain inline void resolve(GPUProgram *program, int &id) { std::vector depNames; for (size_t i=0; iresolve(program, evalName, parameterIDs); } - + /// Bind all referenced resources (textures etc) inline void bind(GPUProgram *program, const DependencyNode &targetNode, int &textureUnitOffset) { if (!shader) @@ -211,7 +211,7 @@ protected: children[i].bind(program, targetNode.children[i], textureUnitOffset); shader->bind(program, targetNode.parameterIDs, textureUnitOffset); } - + /// Release resources that were bound by \ref bind() inline void unbind() { if (!shader) @@ -220,7 +220,7 @@ protected: for (size_t i=0; i m_backgroundProgram; DependencyNode m_backgroundDependencies; - int m_backgroundParam_camPosition; + int m_backgroundParam_camPosition; int m_backgroundParam_camDirection; int m_backgroundParam_clipToWorld; int m_backgroundParam_emitterScale; diff --git a/include/mitsuba/hw/wgldevice.h b/include/mitsuba/hw/wgldevice.h index e485ebf5..3a4c99f9 100644 --- a/include/mitsuba/hw/wgldevice.h +++ b/include/mitsuba/hw/wgldevice.h @@ -50,7 +50,7 @@ public: /// Set the window title void setTitle(const std::string &title); - + /// Display the WGL cursor? void showCursor(bool enabled); @@ -81,7 +81,7 @@ protected: bool translateKey(WPARAM vkey, LPARAM lParam, DeviceEvent &event); /// Translate a WIN32 mouse event - bool translateMouse(UINT uMsg, WPARAM wParam, DeviceEvent &event); + bool translateMouse(UINT uMsg, WPARAM wParam, DeviceEvent &event); protected: ref m_parent; HWND m_hwnd; diff --git a/include/mitsuba/hw/wglsession.h b/include/mitsuba/hw/wglsession.h index 3eb92646..f57de191 100644 --- a/include/mitsuba/hw/wglsession.h +++ b/include/mitsuba/hw/wglsession.h @@ -48,7 +48,7 @@ public: /** * \brief Process all events and call event callbacks. * - * This function will run until the \c stop parameter is set + * This function will run until the \c stop parameter is set * to \c true from within an event callback. */ void processEventsBlocking(bool &stop); diff --git a/include/mitsuba/hw/x11device.h b/include/mitsuba/hw/x11device.h index 377f01bc..bad15985 100644 --- a/include/mitsuba/hw/x11device.h +++ b/include/mitsuba/hw/x11device.h @@ -51,7 +51,7 @@ public: /// Set the window title void setTitle(const std::string &title); - + /// Display the X11 cursor? void showCursor(bool enabled); diff --git a/include/mitsuba/hw/x11session.h b/include/mitsuba/hw/x11session.h index d49ad83d..a7aa5694 100644 --- a/include/mitsuba/hw/x11session.h +++ b/include/mitsuba/hw/x11session.h @@ -38,7 +38,7 @@ public: /// Set the display name (eg. "localhost:0.0") void setDisplayName(const std::string &displayname); - + /// Initialize the session void init(); @@ -51,7 +51,7 @@ public: /** * \brief Process all events and call event callbacks. * - * This function will run until the \c stop parameter is set + * This function will run until the \c stop parameter is set * to \c true from within an event callback. */ void processEventsBlocking(bool &stop); diff --git a/include/mitsuba/render/bsdf.h b/include/mitsuba/render/bsdf.h index 41b2777d..9e4f1190 100644 --- a/include/mitsuba/render/bsdf.h +++ b/include/mitsuba/render/bsdf.h @@ -29,7 +29,7 @@ MTS_NAMESPACE_BEGIN /** - * \brief This data structured contains all information + * \brief This data structured contains all information * that is required to sample or query a BSDF. * * \sa BSDF::f() @@ -40,17 +40,17 @@ MTS_NAMESPACE_BEGIN struct MTS_EXPORT_RENDER BSDFSamplingRecord { public: /** - * \brief Given a surface interaction and an incident direction, - * construct a query record which can be used to sample an outgoing + * \brief Given a surface interaction and an incident direction, + * construct a query record which can be used to sample an outgoing * direction. * - * By default, all components will be sampled irregardless of - * what measure they live on. For convenience, this function - * uses the local incident direction vector contained in the + * By default, all components will be sampled irregardless of + * what measure they live on. For convenience, this function + * uses the local incident direction vector contained in the * supplied intersection record. The mode of transport is - * set to \ref ERadiance -- the \ref mode fie + * set to \ref ERadiance -- the \ref mode fie * - * \param its + * \param its * An reference to the underlying intersection record * * \param sampler @@ -62,21 +62,21 @@ public: * \param mode * The transported mode (\ref ERadiance or \ref EImportance) */ - explicit inline BSDFSamplingRecord(const Intersection &its, Sampler *sampler, + explicit inline BSDFSamplingRecord(const Intersection &its, Sampler *sampler, ETransportMode mode = ERadiance); /** - * \brief Given a surface interaction an an incident/exitant direction + * \brief Given a surface interaction an an incident/exitant direction * pair (wi, wo), create a query record to evaluate the BSDF or its * sampling density. * - * For convenience, this function uses the local incident direction + * For convenience, this function uses the local incident direction * vector contained in the supplied intersection record. * - * \param its + * \param its * An reference to the underlying intersection record * \param wo - * An outgoing direction in local coordinates. This should + * An outgoing direction in local coordinates. This should * be a normalized direction vector that points \a away from * the scattering event. * \param mode @@ -86,32 +86,32 @@ public: ETransportMode mode = ERadiance); /** - * \brief Given a surface interaction an an incident/exitant direction + * \brief Given a surface interaction an an incident/exitant direction * pair (wi, wo), create a query record to evaluate the BSDF or its * sampling density. * - * \param its + * \param its * An reference to the underlying intersection record * \param wi * An incident direction in local coordinates. This should * be a normalized direction vector that points \a away from * the scattering event. * \param wo - * An outgoing direction in local coordinates. This should + * An outgoing direction in local coordinates. This should * be a normalized direction vector that points \a away from * the scattering event. * \param mode * The transported mode (\ref ERadiance or \ref EImportance) * */ - inline BSDFSamplingRecord(const Intersection &its, + inline BSDFSamplingRecord(const Intersection &its, const Vector &wi, const Vector &wo, ETransportMode mode = ERadiance); /** * \brief Reverse the direction of light transport in the record * - * This function essentially swaps \c wi and \c wo and adjusts + * This function essentially swaps \c wi and \c wo and adjusts * \c mode appropriately, so that non-symmetric scattering * models can be queried in the reverse direction. */ @@ -126,10 +126,10 @@ public: /** * \brief Pointer to a \ref Sampler instance (optional). * - * Some BSDF implementations can significantly improve - * the quality of their importance sampling routines + * Some BSDF implementations can significantly improve + * the quality of their importance sampling routines * when having access to extra random numbers. This - * attribute provides a means of providing this + * attribute provides a means of providing this * capability to the BSDF. */ Sampler *sampler; @@ -137,7 +137,7 @@ public: /** * \brief Normalized incident direction in local coordinates * - * Mitsuba uses the convention that \c wi and \c wo + * Mitsuba uses the convention that \c wi and \c wo * point away from the scattering event */ Vector wi; @@ -145,7 +145,7 @@ public: /** * \brief Normalized outgoing direction in local coordinates * - * Mitsuba uses the convention that \c wi and \c wo + * Mitsuba uses the convention that \c wi and \c wo * point away from the scattering event */ Vector wo; @@ -154,25 +154,25 @@ public: Float eta; /** \brief Transported mode (radiance or importance) - * - * This information is required for rendering with non-reciprocal + * + * This information is required for rendering with non-reciprocal * BSDFs such as transmission through a dielectric material */ ETransportMode mode; /** - * \brief Bit mask containing the requested BSDF component types that + * \brief Bit mask containing the requested BSDF component types that * should be sampled/evaluated. * - * Set to \c BSDF::EAll by default. After sampling has been performed, + * Set to \c BSDF::EAll by default. After sampling has been performed, * the component type is stored inside \ref sampledType. - * + * * \sa BSDF::EBSDFType */ unsigned int typeMask; /** - * \brief Integer value specifying the requested BSDF component index that + * \brief Integer value specifying the requested BSDF component index that * should be sampled/evaluated (for multi-lobed BSDFs). * * After sampling has been performed, the component index is stored @@ -193,7 +193,7 @@ public: }; -/** +/** * \brief Abstract %BSDF base-class. * * This class implements an abstract interface to all BSDF plugins in Mitsuba. @@ -202,10 +202,10 @@ public: * two-dimensional density functions, as well as degenerate one-dimensional * and discrete densities are all handled within the same framework. * - * For improved flexibility with respect to the various rendering algorithms, + * For improved flexibility with respect to the various rendering algorithms, * this class can sample and evaluate a complete BSDF, but it also allows to - * pick and choose individual components of multi-lobed BSDFs based on their - * properties and component indices. This selection is specified using a + * pick and choose individual components of multi-lobed BSDFs based on their + * properties and component indices. This selection is specified using a * special record that is provided along with every query. * * \ref BSDFSamplingRecord. @@ -227,9 +227,9 @@ public: // ============================================================= /// 'null' scattering event, i.e. particles do not undergo deflection - ENull = 0x00001, + ENull = 0x00001, /// Ideally diffuse reflection - EDiffuseReflection = 0x00002, + EDiffuseReflection = 0x00002, /// Ideally diffuse transmission EDiffuseTransmission = 0x00004, /// Glossy reflection @@ -253,7 +253,7 @@ public: /// The BSDF depends on the UV coordinates ESpatiallyVarying = 0x02000, /// Flags non-symmetry (e.g. transmission in dielectric materials) - ENonSymmetric = 0x04000, + ENonSymmetric = 0x04000, /// Supports interactions on the front-facing side EFrontSide = 0x08000, /// Supports interactions on the back-facing side @@ -265,10 +265,10 @@ public: /// Convenient combinations of flags from \ref EBSDFType enum ETypeCombinations { /// Any reflection component (scattering into discrete, 1D, or 2D set of directions) - EReflection = EDiffuseReflection | EDeltaReflection + EReflection = EDiffuseReflection | EDeltaReflection | EDelta1DReflection | EGlossyReflection, /// Any transmission component (scattering into discrete, 1D, or 2D set of directions) - ETransmission = EDiffuseTransmission | EDeltaTransmission + ETransmission = EDiffuseTransmission | EDeltaTransmission | EDelta1DTransmission | EGlossyTransmission | ENull, /// Diffuse scattering into a 2D set of directions EDiffuse = EDiffuseReflection | EDiffuseTransmission, @@ -338,23 +338,23 @@ public: /** * \brief Sample the BSDF and return the importance weight (i.e. the - * value of the BSDF divided by the probability density of the sample). + * value of the BSDF divided by the probability density of the sample). * * When the probability density is not explicitly required, this function * should be preferred, since it is potentially faster by making use of * cancellations during the division. - * - * If a component mask or a specific component index is specified, the + * + * If a component mask or a specific component index is specified, the * sample is drawn from the matching component, if it exists. Depending - * on the provided transport type, either the BSDF or its adjoint version - * is used. + * on the provided transport type, either the BSDF or its adjoint version + * is used. * * \param bRec A BSDF query record * \param sample A uniformly distributed sample on \f$[0,1]^2\f$ * * \return The BSDF value divided by the probability density of the sample * sample (multiplied by the cosine foreshortening factor when a - * non-delta component is sampled) A zero spectrum means that + * non-delta component is sampled) A zero spectrum means that * sampling failed. * * \remark This function is not exposed by the Python API. See the other @@ -365,15 +365,15 @@ public: /** * \brief Sample the BSDF and return the probability density \a and the - * importance weight of the sample (i.e. the value of the BSDF divided + * importance weight of the sample (i.e. the value of the BSDF divided * by the probability density) * - * If a component mask or a specific component index is specified, the + * If a component mask or a specific component index is specified, the * sample is drawn from the matching component, if it exists. Depending - * on the provided transport type, either the BSDF or its adjoint version - * is used. - * - * When sampling a continuous/non-delta component, this method also + * on the provided transport type, either the BSDF or its adjoint version + * is used. + * + * When sampling a continuous/non-delta component, this method also * multiplies by the cosine foreshorening factor with respect to the * sampled direction. * @@ -382,19 +382,19 @@ public: * \param pdf Will record the probability with respect to solid angles * (or the discrete probability when a delta component is sampled) * - * \return The BSDF value (multiplied by the cosine foreshortening + * \return The BSDF value (multiplied by the cosine foreshortening * factor when a non-delta component is sampled). A zero spectrum * means that sampling failed. - * + * * \remark From Python, this function is is called using the syntax * value, pdf = bsdf.sample(bRec, sample) */ - virtual Spectrum sample(BSDFSamplingRecord &bRec, Float &pdf, + virtual Spectrum sample(BSDFSamplingRecord &bRec, Float &pdf, const Point2 &sample) const = 0; /** * \brief Evaluate the BSDF f(wi, wo) or its adjoint version f^{*}(wi, wo) - * + * * This method allows to query the BSDF as a whole or pick out * individual components. When querying a smooth (i.e. non-degenerate) * component, it already multiplies the result by the cosine @@ -402,7 +402,7 @@ public: * * \param bRec * A record with detailed information on the BSDF query - * + * * \param measure * Specifies the measure of the component. This is necessary * to handle BSDFs, whose components live on spaces with @@ -413,15 +413,15 @@ public: EMeasure measure = ESolidAngle) const = 0; /** - * \brief Compute the probability of sampling \c bRec.wo (given + * \brief Compute the probability of sampling \c bRec.wo (given * \c bRec.wi). * * This method provides access to the probability density that - * would result when supplying the same BSDF query record to the + * would result when supplying the same BSDF query record to the * \ref sample() method. It correctly handles changes in probability * when only a subset of the components is chosen for sampling - * (this can be done using the \ref BSDFSamplingRecord::component and - * \ref BSDFSamplingRecord::typeMask fields). + * (this can be done using the \ref BSDFSamplingRecord::component and + * \ref BSDFSamplingRecord::typeMask fields). * * \param bRec * A record with detailed information on the BSDF query @@ -436,7 +436,7 @@ public: EMeasure measure = ESolidAngle) const = 0; /** - * \brief For transmissive BSDFs: return the material's + * \brief For transmissive BSDFs: return the material's * relative index of refraction * * The default implementation returns 1.0. @@ -446,15 +446,15 @@ public: virtual Float getEta() const; /** - * \brief For rough BSDFs: return the root mean square + * \brief For rough BSDFs: return the root mean square * surface roughness of the given BSDF component * * An infinite value indicates a component that is ideally diffuse */ virtual Float getRoughness(const Intersection &its, int index) const; - + // ============================================================= - //! @{ \name ConfigurableObject interface + //! @{ \name ConfigurableObject interface // ============================================================= /// Configure the material (called after construction by the XML parser) @@ -471,7 +471,7 @@ public: /// Set the parent object virtual void setParent(ConfigurableObject *parent); - + //! @} // ============================================================= @@ -479,7 +479,7 @@ public: protected: /// Create a new BSDF instance BSDF(const Properties &props); - + /// Unserialize a BSDF instance BSDF(Stream *stream, InstanceManager *manager); @@ -489,11 +489,11 @@ protected: * This function determines the component-wise maximum of the * texture \c tex and checks if it is below \c max. If yes, * it returns the texture unmodified. Otherwise, it wraps - * the texture into a \ref ScaleTexture instance (with a - * scaling factor chosen so that the desired maximum \c max + * the texture into a \ref ScaleTexture instance (with a + * scaling factor chosen so that the desired maximum \c max * is abided) and prints a warning. */ - Texture *ensureEnergyConservation(Texture *tex, + Texture *ensureEnergyConservation(Texture *tex, const std::string ¶mName, Float max) const; /** @@ -502,8 +502,8 @@ protected: * This function determines the component-wise maximum of the * sum \c tex1 + \c tex2 and checks if it is below \c max. If yes, * it returns the texture unmodified. Otherwise, it wraps - * each the texture into a \ref ScaleTexture instance (with a - * scaling factor chosen so that the desired maximum \c max + * each the texture into a \ref ScaleTexture instance (with a + * scaling factor chosen so that the desired maximum \c max * is abided) and prints a warning. */ std::pair ensureEnergyConservation( diff --git a/include/mitsuba/render/common.h b/include/mitsuba/render/common.h index d4f0939c..cfee1022 100644 --- a/include/mitsuba/render/common.h +++ b/include/mitsuba/render/common.h @@ -25,7 +25,7 @@ MTS_NAMESPACE_BEGIN /** - * \brief Specifies the transport mode when sampling or + * \brief Specifies the transport mode when sampling or * evaluating a scattering function * * \ingroup librender @@ -43,12 +43,12 @@ enum ETransportMode { }; /** - * \brief A list of measures that are associated with various sampling + * \brief A list of measures that are associated with various sampling * methods in Mitsuba. * * Every now and then, sampling densities consist of a sum of several terms - * defined on spaces that have different associated measures. In this case, - * one of the constants in \ref EMeasure can be specified to clarify the + * defined on spaces that have different associated measures. In this case, + * one of the constants in \ref EMeasure can be specified to clarify the * component in question when performing query operations. * * \ingroup librender @@ -69,12 +69,12 @@ enum EMeasure { /** * \brief Generic sampling record for positions * - * This sampling record is used to implement techniques that draw a position - * from a point, line, surface, or volume domain in 3D and furthermore provide + * This sampling record is used to implement techniques that draw a position + * from a point, line, surface, or volume domain in 3D and furthermore provide * auxilary information about the sample. * - * Apart from returning the position and (optionally) the surface normal, the - * responsible sampling method must annotate the record with the + * Apart from returning the position and (optionally) the surface normal, the + * responsible sampling method must annotate the record with the * associated probability density and measure. * * \ingroup librender @@ -94,7 +94,7 @@ public: Float pdf; /** - * \brief Denotes the measure associated with the sample. + * \brief Denotes the measure associated with the sample. * * This is necessary to deal with quantities that are defined on * unusual spaces, e.g. areas that have collapsed to a point @@ -105,8 +105,8 @@ public: /** * \brief Optional: 2D sample position associated with the record * - * In some uses of this record, a sampled position may be associated - * with an important 2D quantity, such as the texture coordinates on + * In some uses of this record, a sampled position may be associated + * with an important 2D quantity, such as the texture coordinates on * a triangle mesh or a position on the aperture of a sensor. When * applicable, such positions are stored in the \c uv attribute. */ @@ -137,7 +137,7 @@ public: uv(0.0f), object(NULL) { } /** - * \brief Create a position sampling record + * \brief Create a position sampling record * from a surface intersection * * This is useful to determine the hypothetical sampling @@ -145,7 +145,7 @@ public: * ray tracing. This happens for instance in path tracing * with multiple importance sampling. */ - inline PositionSamplingRecord(const Intersection &its, + inline PositionSamplingRecord(const Intersection &its, EMeasure measure = EArea); /// Return a human-readable description of the record @@ -155,12 +155,12 @@ public: /** * \brief Generic sampling record for directions * - * This sampling record is used to implement techniques that randomly draw a - * unit vector from a subset of the sphere and furthermore provide + * This sampling record is used to implement techniques that randomly draw a + * unit vector from a subset of the sphere and furthermore provide * auxilary information about the sample. * - * Apart from returning the sampled direction, the responsible sampling method - * must annotate the record with the associated probability density + * Apart from returning the sampled direction, the responsible sampling method + * must annotate the record with the associated probability density * and measure. * * \ingroup librender @@ -181,9 +181,9 @@ public: std::string toString() const; /** - * \brief Create an uninitialized position sampling record + * \brief Create an uninitialized position sampling record * - * The resulting data structure is meant to be used + * The resulting data structure is meant to be used * to generate a new direction sample. * * \sa Emitter::sampleDirection @@ -199,12 +199,12 @@ public: * * \sa Emitter::pdfDirection */ - inline DirectionSamplingRecord(const Vector &d, - EMeasure measure = ESolidAngle) + inline DirectionSamplingRecord(const Vector &d, + EMeasure measure = ESolidAngle) : d(d), measure(measure) { } /** - * \brief Create a direction sampling record + * \brief Create a direction sampling record * from a surface intersection * * This is useful to determine the hypothetical sampling @@ -213,7 +213,7 @@ public: * the camera aperture in bidirectional rendering * techniques. */ - inline DirectionSamplingRecord(const Intersection &its, + inline DirectionSamplingRecord(const Intersection &its, EMeasure measure = ESolidAngle); }; @@ -224,13 +224,13 @@ public: * a position on the surface of an object with the goal of importance sampling * a quantity that is defined over the sphere seen from a given reference point. * - * This general approach for sampling positions is named "direct" sampling + * This general approach for sampling positions is named "direct" sampling * throughout Mitsuba motivated by direct illumination rendering techniques, * which represent the most important application. * * This record inherits all fields from \ref PositionSamplingRecord and - * extends it with two useful quantities that are cached so that they don't - * need to be recomputed many times: the unit direction and length from the + * extends it with two useful quantities that are cached so that they don't + * need to be recomputed many times: the unit direction and length from the * reference position to the sampled point. * * \ingroup librender @@ -267,7 +267,7 @@ public: * \param time * An associated time value */ - inline DirectSamplingRecord(const Point &ref, Float time) + inline DirectSamplingRecord(const Point &ref, Float time) : PositionSamplingRecord(time), ref(ref), refN(0.0f) { } /** @@ -303,7 +303,7 @@ public: inline void setQuery( const Ray &ray, - const Intersection &its, + const Intersection &its, EMeasure measure = ESolidAngle); /// Return a human-readable description of the record diff --git a/include/mitsuba/render/emitter.h b/include/mitsuba/render/emitter.h index 971834f9..b5836b03 100644 --- a/include/mitsuba/render/emitter.h +++ b/include/mitsuba/render/emitter.h @@ -36,23 +36,23 @@ MTS_NAMESPACE_BEGIN * luminaires and sensors are both considered to be emitters of radiance and * importance, respectively. * - * Subclasses must implement functions for evaluating and sampling the + * Subclasses must implement functions for evaluating and sampling the * emission profile and furthermore support querying the probability density * of the provided sampling technique. * * Subclasses must also provide a specialized \a direct sampling method * (a generalization of direct illumination sampling to both emitters \a and - * sensors). A direct sampling is given an arbitrary input position in the - * scene and in turn returns a sampled emitter position and direction, which - * has a nonzero contribution towards the provided position. The main idea is - * that direct sampling reduces the underlying space from 4D to 2D, hence it - * is often possible to use smarter sampling techniques than in the fully + * sensors). A direct sampling is given an arbitrary input position in the + * scene and in turn returns a sampled emitter position and direction, which + * has a nonzero contribution towards the provided position. The main idea is + * that direct sampling reduces the underlying space from 4D to 2D, hence it + * is often possible to use smarter sampling techniques than in the fully * general case. - * + * * Since the emission profile is defined as function over both positions - * and directions, there are functions to sample and query \a each of the - * two components separately. Furthermore, there is a convenience function - * to sample both at the same time, which is mainly used by unidirectional + * and directions, there are functions to sample and query \a each of the + * two components separately. Furthermore, there is a convenience function + * to sample both at the same time, which is mainly used by unidirectional * rendering algorithms that do not need this level of flexibility. * * One underlying assumption of this interface is that position and @@ -62,7 +62,7 @@ MTS_NAMESPACE_BEGIN * * When rendering scenes involving participating media, it is important * to know what medium surrounds the sensors and light sources. For - * this reason, every emitter instance keeps a reference to a medium + * this reason, every emitter instance keeps a reference to a medium * (or \c NULL when it is surrounded by vacuum). * * \ingroup librender @@ -70,7 +70,7 @@ MTS_NAMESPACE_BEGIN class MTS_EXPORT_RENDER AbstractEmitter : public ConfigurableObject { public: /** - * \brief Flags used to classify the emission profile of + * \brief Flags used to classify the emission profile of * different types of emitters */ enum EEmitterType { @@ -89,15 +89,15 @@ public: // ============================================================= /** - * \brief Importance sample the spatial component of the + * \brief Importance sample the spatial component of the * emission profile. * * This function takes an uniformly distributed 2D vector * and maps it to a position on the surface of the emitter. * * Some implementations may choose to implement extra functionality - * based on the value of \c extra: for instance, Sensors - * (which are a subclass of \ref AbstractEmitter) perform uniform + * based on the value of \c extra: for instance, Sensors + * (which are a subclass of \ref AbstractEmitter) perform uniform * sampling over the entire image plane if extra == NULL, * but other values, they will restrict sampling to a pixel-sized * rectangle with that offset. @@ -113,7 +113,7 @@ public: * when \ref needsPositionSample() == \c false) * * \param extra - * An additional 2D vector provided to the sampling + * An additional 2D vector provided to the sampling * routine -- its use is implementation-dependent. * * \return @@ -125,12 +125,12 @@ public: const Point2 &sample, const Point2 *extra = NULL) const; /** - * \brief Conditioned on the spatial component, importance + * \brief Conditioned on the spatial component, importance * sample the directional part of the emission profile. * * Some implementations may choose to implement extra functionality - * based on the value of \c extra: for instance, Sensors - * (which are a subclass of \ref AbstractEmitter) perform uniform + * based on the value of \c extra: for instance, Sensors + * (which are a subclass of \ref AbstractEmitter) perform uniform * sampling over the entire image plane if extra == NULL, * but other values, they will restrict sampling to a pixel-sized * rectangle with that offset. @@ -142,7 +142,7 @@ public: * direction and related information * * \param pRec - * A position record generated by a preceding call + * A position record generated by a preceding call * to \ref samplePosition() * * \param sample @@ -157,39 +157,39 @@ public: virtual Spectrum sampleDirection( DirectionSamplingRecord &dRec, PositionSamplingRecord &pRec, - const Point2 &sample, + const Point2 &sample, const Point2 *extra = NULL) const; /** - * \brief \a Direct sampling: given a reference point in the + * \brief \a Direct sampling: given a reference point in the * scene, sample an emitter position that contributes towards it. * - * Given an arbitrary reference point in the scene, this method - * samples a position on the emitter that has a nonzero contribution + * Given an arbitrary reference point in the scene, this method + * samples a position on the emitter that has a nonzero contribution * towards that point. * This can be seen as a generalization of direct illumination sampling * so that it works on both luminaires and sensors. - * + * * Ideally, the implementation should importance sample the product of - * the emission profile and the geometry term between the reference point + * the emission profile and the geometry term between the reference point * and the position on the emitter. * * The default implementation throws an exception. * * \param dRec - * A direct sampling record that specifies the reference point and - * a time value. After the function terminates, it will be + * A direct sampling record that specifies the reference point and + * a time value. After the function terminates, it will be * populated with the position sample and related information * * \param sample - * A uniformly distributed 2D vector (or any value + * A uniformly distributed 2D vector (or any value * when \ref needsDirectSample() == \c false) * * \return * An importance weight associated with the sample. Includes * any geometric terms between the emitter and the reference point. */ - virtual Spectrum sampleDirect(DirectSamplingRecord &dRec, + virtual Spectrum sampleDirect(DirectSamplingRecord &dRec, const Point2 &sample) const; //! @} @@ -206,17 +206,17 @@ public: * \param pRec * A position sampling record, which specifies the query location * - * \return The component of the emission profile that depends on - * the position (i.e. emitted power per unit area for luminaires and + * \return The component of the emission profile that depends on + * the position (i.e. emitted power per unit area for luminaires and * sensor response, or inverse power per unit area for sensors) */ - virtual Spectrum evalPosition(const PositionSamplingRecord &pRec) const; + virtual Spectrum evalPosition(const PositionSamplingRecord &pRec) const; /** * \brief Evaluate the directional component of the emission profile - * - * When querying a smooth (i.e. non-degenerate) component, it already - * multiplies the result by the cosine foreshortening factor with + * + * When querying a smooth (i.e. non-degenerate) component, it already + * multiplies the result by the cosine foreshortening factor with * respect to the outgoing direction. * * \param dRec @@ -225,7 +225,7 @@ public: * \param pRec * A position sampling record, which specifies the query position * - * \return The component of the emission profile that depends on + * \return The component of the emission profile that depends on * the direction (having units of 1/steradian) */ @@ -266,8 +266,8 @@ public: * method implemented by the \ref sampleDirect() method. * * \param dRec - * A direct sampling record, which specifies the query - * location. Note that this record need not be completely + * A direct sampling record, which specifies the query + * location. Note that this record need not be completely * filled out. The important fields are \c p, \c n, \c ref, * \c dist, \c d, \c measure, and \c uv. * @@ -293,21 +293,21 @@ public: inline uint32_t getType() const { return m_type; } /// Return the local space to world space transformation - inline const AnimatedTransform *getWorldTransform() const + inline const AnimatedTransform *getWorldTransform() const { return m_worldTransform.get(); } /// Set the local space to world space transformation - inline void setWorldTransform(AnimatedTransform *trafo) + inline void setWorldTransform(AnimatedTransform *trafo) { m_worldTransform = trafo; } /** - * \brief Does the method \ref samplePosition() require a uniformly + * \brief Does the method \ref samplePosition() require a uniformly * distributed sample for the spatial component? */ inline bool needsPositionSample() const { return !(m_type & EDeltaPosition); } /** - * \brief Does the method \ref sampleDirection() require a uniformly + * \brief Does the method \ref sampleDirection() require a uniformly * distributed sample for the direction component? */ inline bool needsDirectionSample() const { return !(m_type & EDeltaDirection); } @@ -324,11 +324,11 @@ public: inline bool isDegenerate() const { return m_type & (EDeltaPosition | EDeltaDirection); } /** - * \brief Does the method \ref sampleDirect() require a uniformly + * \brief Does the method \ref sampleDirect() require a uniformly * distributed sample? * * Since sampleDirect() essentially causes a 2D reduction of the - * sampling domain, this is the case exactly when the original + * sampling domain, this is the case exactly when the original * domain was four-dimensionsional. */ inline bool needsDirectSample() const { @@ -352,7 +352,7 @@ public: /// Return a pointer to the medium that surrounds the emitter inline Medium *getMedium() { return m_medium; } - + /// Return a pointer to the medium that surrounds the emitter (const version) inline const Medium *getMedium() const { return m_medium.get(); } @@ -367,17 +367,17 @@ public: * * Some types of emitters are inherently associated with a surface, yet * this surface is not explicitly needed for many kinds of rendering - * algorithms. + * algorithms. * * An example would be an environment map, where the associated shape * is a sphere surrounding the scene. Another example would be a * perspective camera with depth of field, where the associated shape * is a disk representing the aperture (remember that this class - * represents emitters in a generalized bidirectional sense, which + * represents emitters in a generalized bidirectional sense, which * includes sensors). - * + * * When this shape is in fact needed by the underlying rendering algorithm, - * this function can be called to create it. The default implementation + * this function can be called to create it. The default implementation * simply returns \c NULL. * * \param scene @@ -387,7 +387,7 @@ public: virtual ref createShape(const Scene *scene); /** - * \brief Return an axis-aligned box bounding the spatial + * \brief Return an axis-aligned box bounding the spatial * extents of the emitter */ virtual AABB getAABB() const = 0; @@ -395,14 +395,14 @@ public: /// Set the medium that surrounds the emitter inline void setMedium(Medium *medium) { m_medium = medium; } - /// Serialize this emitter to a binary data stream + /// Serialize this emitter to a binary data stream virtual void serialize(Stream *stream, InstanceManager *manager) const; //! @} // ============================================================= // ============================================================= - //! @{ \name ConfigurableObject interface + //! @{ \name ConfigurableObject interface // ============================================================= /// Add a child ConfigurableObject @@ -435,15 +435,15 @@ protected: * \brief Abstract radiance emitter interface * * This class provides an abstract interface to all emitter plugins in Mitsuba. - * It exposes functions for evaluating and sampling the emission profile, and - * it allows querying the probability density of the sampling method. + * It exposes functions for evaluating and sampling the emission profile, and + * it allows querying the probability density of the sampling method. * * \ingroup librender */ class MTS_EXPORT_RENDER Emitter : public AbstractEmitter, public HWResource { public: /** - * \brief This list of flags is used to additionally characterize + * \brief This list of flags is used to additionally characterize * and classify the response functions of different types of sensors * * \sa AbstractEmitter::EEmitterType @@ -460,19 +460,19 @@ public: /** * \brief Return the radiant emittance for the given surface intersection * - * This is function is used when an area light source has been hit by a + * This is function is used when an area light source has been hit by a * ray in a path tracing-style integrator, and it subsequently needs to * be queried for the emitted radiance along the negative ray direction. * * It efficiently computes the product of \ref evalPosition() - * and \ref evalDirection() \a divided by the absolute cosine of the + * and \ref evalDirection() \a divided by the absolute cosine of the * angle between \c d and \c its.shFrame.n. * - * This function is provided here as a fast convenience function for - * unidirectional rendering techniques. The default implementation + * This function is provided here as a fast convenience function for + * unidirectional rendering techniques. The default implementation * throws an exception, which states that the method is not implemented. * - * \param its + * \param its * An intersect record that specfies the query position * \param d * A unit vector, which specifies the query direction @@ -484,20 +484,20 @@ public: /** * \brief Importance sample a ray according to the emission profile * - * This function combines both steps of choosing a ray origin and - * direction value. It does not return any auxiliary sampling + * This function combines both steps of choosing a ray origin and + * direction value. It does not return any auxiliary sampling * information and is mainly meant to be used by unidirectional * rendering techniques. - * - * - * Note that this function potentially uses a different sampling - * strategy compared to the sequence of running \ref sampleArea() + * + * + * Note that this function potentially uses a different sampling + * strategy compared to the sequence of running \ref sampleArea() * and \ref sampleDirection(). The reason for this is that it may * be possible to switch to a better technique when sampling both * position and direction at the same time. * * \param ray - * A ray data structure to be populated with a position + * A ray data structure to be populated with a position * and direction value * * \param spatialSample @@ -534,7 +534,7 @@ public: */ inline Float getSamplingWeight() const { return m_samplingWeight; } - /// Serialize this emitter to a binary data stream + /// Serialize this emitter to a binary data stream virtual void serialize(Stream *stream, InstanceManager *manager) const; //! @} @@ -562,12 +562,12 @@ public: virtual Spectrum evalEnvironment(const RayDifferential &ray) const; /** - * \brief Fill out a data record that can be used to query the direct + * \brief Fill out a data record that can be used to query the direct * illumination sampling density of an environment emitter. * - * This is function is mainly called by unidirectional rendering - * techniques (e.g. a path tracer) when no scene object has been - * intersected, and the (hypothetical) sampling density of the + * This is function is mainly called by unidirectional rendering + * techniques (e.g. a path tracer) when no scene object has been + * intersected, and the (hypothetical) sampling density of the * environment emitter needs to be known by a multiple importance * sampling technique. * @@ -586,7 +586,7 @@ public: //! @} // ============================================================= - + // ============================================================= //! @{ \name Miscellaneous // ============================================================= @@ -595,7 +595,7 @@ public: virtual bool isCompound() const; /** - * \brief Return a sub-element of a compound emitter. + * \brief Return a sub-element of a compound emitter. * * When expanding emitters, the scene will repeatedly call this * function with increasing indices. Returning \a NULL indicates diff --git a/include/mitsuba/render/film.h b/include/mitsuba/render/film.h index 49afb33c..8a4c916d 100644 --- a/include/mitsuba/render/film.h +++ b/include/mitsuba/render/film.h @@ -64,7 +64,7 @@ public: virtual void develop() = 0; /** - * \brief Develop the contents of a subregion of the film and store + * \brief Develop the contents of a subregion of the film and store * it inside the given bitmap * * This may fail when the film does not have an explicit representation @@ -81,21 +81,21 @@ public: /// Does the destination file already exist? virtual bool destinationExists(const fs::path &basename) const = 0; - /** - * Should regions slightly outside the image plane be sampled to improve + /** + * Should regions slightly outside the image plane be sampled to improve * the quality of the reconstruction at the edges? This only makes * sense when reconstruction filters other than the box filter are used. */ inline bool hasHighQualityEdges() const { return m_highQualityEdges; } - + /// Return the image reconstruction filter inline ReconstructionFilter *getReconstructionFilter() { return m_filter.get(); } /// Return the image reconstruction filter (const version) inline const ReconstructionFilter *getReconstructionFilter() const { return m_filter.get(); } - + // ============================================================= - //! @{ \name ConfigurableObject interface + //! @{ \name ConfigurableObject interface // ============================================================= /// Add a child node @@ -106,18 +106,18 @@ public: /// Configure the film virtual void configure(); - + /// Serialize this film to a binary data stream virtual void serialize(Stream *stream, InstanceManager *manager) const; - + //! @} // ============================================================= - + MTS_DECLARE_CLASS() protected: /// Create a film Film(const Properties &props); - + /// Unserialize a film Film(Stream *stream, InstanceManager *manager); diff --git a/include/mitsuba/render/gatherproc.h b/include/mitsuba/render/gatherproc.h index 456b1090..31e4c26c 100644 --- a/include/mitsuba/render/gatherproc.h +++ b/include/mitsuba/render/gatherproc.h @@ -28,7 +28,7 @@ MTS_NAMESPACE_BEGIN /** * \brief Process for parallel photon map construction * - * Given a number and type (surface/caustic/volume) of photons, this + * Given a number and type (surface/caustic/volume) of photons, this * class distributes the work over an arbitrary number of machines. * \ingroup librender */ @@ -62,12 +62,12 @@ public: * \param progressReporterPayload * Custom pointer payload to be delivered with progress messages */ - GatherPhotonProcess(EGatherType type, size_t photonCount, + GatherPhotonProcess(EGatherType type, size_t photonCount, size_t granularity, int maxDepth, int rrDepth, bool isLocal, bool autoCancel, const void *progressReporterPayload); /** - * Once the process has finished, this returns a reference + * Once the process has finished, this returns a reference * to the (still unbalanced) photon map */ inline PhotonMap *getPhotonMap() { return m_photonMap; } @@ -93,7 +93,7 @@ public: // ====================================================================== bool isLocal() const; - ref createWorkProcessor() const; + ref createWorkProcessor() const; void processResult(const WorkResult *wr, bool cancelled); EStatus generateWork(WorkUnit *unit, int worker); diff --git a/include/mitsuba/render/gkdtree.h b/include/mitsuba/render/gkdtree.h index cbbe311e..c0509d97 100644 --- a/include/mitsuba/render/gkdtree.h +++ b/include/mitsuba/render/gkdtree.h @@ -44,7 +44,7 @@ #define MTS_KD_BLOCKSIZE_IDX (512*1024/sizeof(uint32_t)) /** - * \brief To avoid numerical issues, the size of the scene + * \brief To avoid numerical issues, the size of the scene * bounding box is increased by this amount */ #define MTS_KD_AABB_EPSILON 1e-3f @@ -53,8 +53,8 @@ #define KDAssert(expr) SAssert(expr) #define KDAssertEx(expr, text) SAssertEx(expr, text) #else -#define KDAssert(expr) -#define KDAssertEx(expr, text) +#define KDAssert(expr) +#define KDAssertEx(expr, text) #endif MTS_NAMESPACE_BEGIN @@ -62,13 +62,13 @@ MTS_NAMESPACE_BEGIN /** * \brief Special "ordered" memory allocator * - * During kd-tree construction, large amounts of memory are required + * During kd-tree construction, large amounts of memory are required * to temporarily hold index and edge event lists. When not implemented * properly, these allocations can become a critical bottleneck. * The class \ref OrderedChunkAllocator provides a specialized * memory allocator, which reserves memory in chunks of at least * 128KiB. An important assumption made by the allocator is that - * memory will be released in the exact same order, in which it was + * memory will be released in the exact same order, in which it was * previously allocated. This makes it possible to create an * implementation with a very low memory overhead. Note that no locking * is done, hence each thread will need its own allocator. @@ -101,7 +101,7 @@ public: */ void merge(const OrderedChunkAllocator &other) { m_chunks.reserve(m_chunks.size() + other.m_chunks.size()); - m_chunks.insert(m_chunks.end(), other.m_chunks.begin(), + m_chunks.insert(m_chunks.end(), other.m_chunks.begin(), other.m_chunks.end()); } @@ -133,7 +133,7 @@ public: } /* No chunk had enough free memory */ - size_t allocSize = std::max(size, + size_t allocSize = std::max(size, m_minAllocation); Chunk chunk; @@ -149,7 +149,7 @@ public: for (std::vector::iterator it = m_chunks.begin(); it != m_chunks.end(); ++it) { Chunk &chunk = *it; - if ((uint8_t *) ptr >= chunk.start && + if ((uint8_t *) ptr >= chunk.start && (uint8_t *) ptr < chunk.start + chunk.size) { chunk.cur = (uint8_t *) ptr; return; @@ -160,7 +160,7 @@ public: for (std::vector::iterator it = m_chunks.begin(); it != m_chunks.end(); ++it) { const Chunk &chunk = *it; - if ((uint8_t *) ptr == chunk.start + chunk.size) + if ((uint8_t *) ptr == chunk.start + chunk.size) return; } SLog(EError, "OrderedChunkAllocator: Internal error while" @@ -188,7 +188,7 @@ public: for (std::vector::iterator it = m_chunks.begin(); it != m_chunks.end(); ++it) { const Chunk &chunk = *it; - if ((uint8_t *) ptr == chunk.start + chunk.size) + if ((uint8_t *) ptr == chunk.start + chunk.size) return; } } @@ -247,8 +247,8 @@ private: } std::string toString() const { - return formatString("0x%llx-0x%llx (size=" SIZE_T_FMT - ", used=" SIZE_T_FMT ")", start, start+size, + return formatString("0x%llx-0x%llx (size=" SIZE_T_FMT + ", used=" SIZE_T_FMT ")", start, start+size, size, used()); } }; @@ -261,8 +261,8 @@ private: * \brief Basic vector implementation, which stores all data * in a list of fixed-sized blocks. * - * This leads to a more conservative memory usage when the - * final size of a (possibly very large) growing vector is + * This leads to a more conservative memory usage when the + * final size of a (possibly very large) growing vector is * unknown. Also, frequent reallocations & copies are avoided. * * \author Wenzel Jakob @@ -353,7 +353,7 @@ public: /** * \brief Resize the vector to the given size. * - * Note: this implementation doesn't support + * Note: this implementation doesn't support * enlarging the vector and simply changes the * last item pointer. */ @@ -368,7 +368,7 @@ public: * \brief Release all memory */ void clear() { - for (typename std::vector::iterator it = m_blocks.begin(); + for (typename std::vector::iterator it = m_blocks.begin(); it != m_blocks.end(); ++it) delete[] *it; m_blocks.clear(); @@ -385,14 +385,14 @@ private: * When classifying primitives with respect to a split plane, * a data structure is needed to hold the tertiary result of * this operation. This class implements a compact storage - * (2 bits per entry) in the spirit of the std::vector + * (2 bits per entry) in the spirit of the std::vector * specialization. * * \author Wenzel Jakob */ class ClassificationStorage { public: - ClassificationStorage() + ClassificationStorage() : m_buffer(NULL), m_bufferSize(0) { } ~ClassificationStorage() { @@ -446,7 +446,7 @@ public: typedef uint32_t SizeType; /** - * \brief KD-tree node in 8 bytes. + * \brief KD-tree node in 8 bytes. */ struct KDNode { union { @@ -455,7 +455,7 @@ public: /* Bit layout: 31 : False (inner node) 30 : Indirection node flag - 29-3 : Offset to the left child + 29-3 : Offset to the left child or indirection table entry 2-0 : Split axis */ @@ -508,14 +508,14 @@ public: /** * \brief Initialize an interior indirection node. * - * Indirections are necessary whenever the children cannot be - * referenced using a relative pointer, which can happen when + * Indirections are necessary whenever the children cannot be + * referenced using a relative pointer, which can happen when * they lie in different memory chunks. In this case, the node * stores an index into a globally shared pointer list. */ - inline void initIndirectionNode(int axis, float split, + inline void initIndirectionNode(int axis, float split, uint32_t indirectionEntry) { - inner.combined = EIndirectionMask + inner.combined = EIndirectionMask | ((uint32_t) indirectionEntry << 2) | axis; inner.split = split; @@ -548,7 +548,7 @@ public: /// Return the left child (assuming that this is an interior node) FINLINE const KDNode * __restrict getLeft() const { - return this + + return this + ((inner.combined & (uint32_t) EInnerOffsetMask) >> 2); } @@ -559,7 +559,7 @@ public: /// Return the left child (assuming that this is an interior node) FINLINE KDNode * __restrict getLeft() { - return this + + return this + ((inner.combined & (uint32_t) EInnerOffsetMask) >> 2); } @@ -569,7 +569,7 @@ public: } /** - * \brief Return the split plane location (assuming that this + * \brief Return the split plane location (assuming that this * is an interior node) */ FINLINE float getSplit() const { @@ -585,11 +585,11 @@ public: std::string toString() const { std::ostringstream oss; if (isLeaf()) { - oss << "KDNode[leaf, primStart=" << getPrimStart() + oss << "KDNode[leaf, primStart=" << getPrimStart() << ", primCount=" << getPrimEnd()-getPrimStart() << "]"; } else { - oss << "KDNode[interior, axis=" << getAxis() - << ", split=" << getAxis() + oss << "KDNode[interior, axis=" << getAxis() + << ", split=" << getAxis() << ", leftOffset=" << ((inner.combined & EInnerOffsetMask) >> 2) << "]"; @@ -601,7 +601,7 @@ public: /// Return the log level of kd-tree status messages inline ELogLevel getLogLevel() const { return m_logLevel; } - + /// Return the log level of kd-tree status messages inline void setLogLevel(ELogLevel level) { m_logLevel = level; } @@ -617,7 +617,7 @@ public: /// Return a (slightly enlarged) axis-aligned bounding box containing all primitives inline const AABBType &getAABB() const { return m_aabb; } - + /// Return a tight axis-aligned bounding box containing all primitives inline const AABBType &getTightAABB() const { return m_tightAABB;} @@ -631,7 +631,7 @@ protected: }; #if defined(_MSC_VER) && !defined(__INTELLISENSE__) -/* Use strict IEEE 754 floating point computations +/* Use strict IEEE 754 floating point computations for the following kd-tree building code */ MTS_NAMESPACE_END #pragma float_control(precise, on) @@ -643,17 +643,17 @@ MTS_NAMESPACE_BEGIN fmt, ## __VA_ARGS__) /** - * \brief Optimized KD-tree acceleration data structure for + * \brief Optimized KD-tree acceleration data structure for * n-dimensional (n<=4) shapes and various queries on them. * * Note that this class mainly concerns itself with data that cover a - * region of space. For point data, other implementations will be more - * suitable. The most important application in Mitsuba is the fast + * region of space. For point data, other implementations will be more + * suitable. The most important application in Mitsuba is the fast * construction of high-quality trees for ray tracing. See the class * \ref SAHKDTree for this specialization. * * The code in this class is a fully generic kd-tree implementation, which - * can theoretically support any kind of shape. However, subclasses still + * can theoretically support any kind of shape. However, subclasses still * need to provide the following signatures for a functional implementation: * * \code @@ -667,33 +667,33 @@ MTS_NAMESPACE_BEGIN * inline AABB getClippedAABB(IndexType primIdx, const AABBType &aabb) const; * \endcode * - * This class follows the "Curiously recurring template" design pattern - * so that the above functions can be inlined (in particular, no virtual + * This class follows the "Curiously recurring template" design pattern + * so that the above functions can be inlined (in particular, no virtual * calls will be necessary!). * - * When the kd-tree is initially built, this class optimizes a cost + * When the kd-tree is initially built, this class optimizes a cost * heuristic every time a split plane has to be chosen. For ray tracing, * the heuristic is usually the surface area heuristic (SAH), but other - * choices are possible as well. The tree construction heuristic must be + * choices are possible as well. The tree construction heuristic must be * passed as a template argument, which can use a supplied AABB and * split candidate to compute approximate probabilities of recursing into * the left and right subrees during a typical kd-tree query operation. * See \ref SurfaceAreaHeuristic for an example of the interface that * must be implemented. * - * The kd-tree construction algorithm creates 'perfect split' trees as + * The kd-tree construction algorithm creates 'perfect split' trees as * outlined in the paper "On Building fast kd-Trees for Ray Tracing, and on * doing that in O(N log N)" by Ingo Wald and Vlastimil Havran. This works * even when the tree is not meant to be used for ray tracing. - * For polygonal meshes, the involved Sutherland-Hodgman iterations can be - * quite expensive in terms of the overall construction time. The - * \ref setClip method can be used to deactivate perfect splits at the + * For polygonal meshes, the involved Sutherland-Hodgman iterations can be + * quite expensive in terms of the overall construction time. The + * \ref setClip method can be used to deactivate perfect splits at the * cost of a lower-quality tree. * * Because the O(N log N) construction algorithm tends to cause many - * incoherent memory accesses, a fast approximate technique (Min-max + * incoherent memory accesses, a fast approximate technique (Min-max * binning) is used near the top of the tree, which significantly reduces - * cache misses. Once the input data has been narrowed down to a + * cache misses. Once the input data has been narrowed down to a * reasonable amount, the implementation switches over to the O(N log N) * builder. When multiple processors are available, the build process runs * in parallel. @@ -701,7 +701,7 @@ MTS_NAMESPACE_BEGIN * \author Wenzel Jakob * \ingroup librender */ -template +template class GenericKDTree : public KDTreeBase { protected: // Some forward declarations @@ -725,7 +725,7 @@ public: using Parent::isBuilt; /** - * \brief Create a new kd-tree instance initialized with + * \brief Create a new kd-tree instance initialized with * the default parameters. */ GenericKDTree() : m_indices(NULL) { @@ -770,7 +770,7 @@ public: /** * \brief Set the query cost used by the tree construction heuristic - * (This is the average cost for testing a contained shape against + * (This is the average cost for testing a contained shape against * a kd-tree search query) */ inline void setQueryCost(Float queryCost) { @@ -779,7 +779,7 @@ public: /** * \brief Return the query cost used by the tree construction heuristic - * (This is the average cost for testing a contained shape against + * (This is the average cost for testing a contained shape against * a kd-tree search query) */ inline Float getQueryCost() const { @@ -909,8 +909,8 @@ public: } /** - * \brief Specify the number of primitives, at which the builder will - * switch from (approximate) Min-Max binning to the accurate + * \brief Specify the number of primitives, at which the builder will + * switch from (approximate) Min-Max binning to the accurate * O(n log n) optimization method. */ inline void setExactPrimitiveThreshold(SizeType exactPrimThreshold) { @@ -918,8 +918,8 @@ public: } /** - * \brief Return the number of primitives, at which the builder will - * switch from (approximate) Min-Max binning to the accurate + * \brief Return the number of primitives, at which the builder will + * switch from (approximate) Min-Max binning to the accurate * O(n log n) optimization method. */ inline SizeType getExactPrimitiveThreshold() const { @@ -951,7 +951,7 @@ protected: */ void buildInternal() { /* Some samity checks */ - if (isBuilt()) + if (isBuilt()) KDLog(EError, "The kd-tree has already been built!"); if (m_traversalCost <= 0) KDLog(EError, "The traveral cost must be > 0"); @@ -961,7 +961,7 @@ protected: KDLog(EError, "The empty space bonus must be in [0, 1]"); if (m_minMaxBins <= 1) KDLog(EError, "The number of min-max bins must be > 2"); - + SizeType primCount = cast()->getPrimitiveCount(); if (primCount == 0) { KDLog(EWarn, "kd-tree contains no geometry!"); @@ -981,7 +981,7 @@ protected: m_maxDepth = (int) (8 + 1.3f * log2i(primCount)); m_maxDepth = std::min(m_maxDepth, (SizeType) MTS_KD_MAXDEPTH); - KDLog(m_logLevel, "Creating a preliminary index list (%s)", + KDLog(m_logLevel, "Creating a preliminary index list (%s)", memString(primCount * sizeof(IndexType)).c_str()); OrderedChunkAllocator &leftAlloc = ctx.leftAlloc; @@ -995,7 +995,7 @@ protected: indices[i] = i; } - KDLog(m_logLevel, "Computed scene bounds in %i ms", + KDLog(m_logLevel, "Computed scene bounds in %i ms", timer->getMilliseconds()); KDLog(m_logLevel, ""); @@ -1004,18 +1004,18 @@ protected: KDLog(m_logLevel, " Query cost : %.2f", m_queryCost); KDLog(m_logLevel, " Empty space bonus : %.2f", m_emptySpaceBonus); KDLog(m_logLevel, " Max. tree depth : %i", m_maxDepth); - KDLog(m_logLevel, " Scene bounding box (min) : %s", + KDLog(m_logLevel, " Scene bounding box (min) : %s", aabb.min.toString().c_str()); - KDLog(m_logLevel, " Scene bounding box (max) : %s", + KDLog(m_logLevel, " Scene bounding box (max) : %s", aabb.max.toString().c_str()); KDLog(m_logLevel, " Min-max bins : %i", m_minMaxBins); - KDLog(m_logLevel, " O(n log n) method : use for <= %i primitives", + KDLog(m_logLevel, " O(n log n) method : use for <= %i primitives", m_exactPrimThreshold); KDLog(m_logLevel, " Perfect splits : %s", m_clip ? "yes" : "no"); - KDLog(m_logLevel, " Retract bad splits : %s", + KDLog(m_logLevel, " Retract bad splits : %s", m_retract ? "yes" : "no"); KDLog(m_logLevel, " Stopping primitive count : %i", m_stopPrims); - KDLog(m_logLevel, " Build tree in parallel : %s", + KDLog(m_logLevel, " Build tree in parallel : %s", m_parallelBuild ? "yes" : "no"); KDLog(m_logLevel, ""); @@ -1034,7 +1034,7 @@ protected: m_indirectionLock = new Mutex(); KDNode *prelimRoot = ctx.nodes.allocate(1); - buildTreeMinMax(ctx, 1, prelimRoot, aabb, aabb, + buildTreeMinMax(ctx, 1, prelimRoot, aabb, aabb, indices, primCount, true, 0); ctx.leftAlloc.release(indices); @@ -1046,7 +1046,7 @@ protected: m_interface.done = true; m_interface.cond->broadcast(); lock.unlock(); - for (SizeType i=0; ijoin(); } @@ -1054,15 +1054,15 @@ protected: KDLog(m_logLevel, ""); KDLog(m_logLevel, "Temporary memory statistics:"); - KDLog(m_logLevel, " Classification storage : %s", + KDLog(m_logLevel, " Classification storage : %s", memString((ctx.classStorage.size() * (1+procCount))).c_str()); - KDLog(m_logLevel, " Indirection entries : " SIZE_T_FMT " (%s)", + KDLog(m_logLevel, " Indirection entries : " SIZE_T_FMT " (%s)", m_indirections.size(), memString(m_indirections.capacity() * sizeof(KDNode *)).c_str()); KDLog(m_logLevel, " Main thread:"); ctx.printStats(m_logLevel); - size_t totalUsage = m_indirections.capacity() + size_t totalUsage = m_indirections.capacity() * sizeof(KDNode *) + ctx.size(); /// Clean up event lists and print statistics @@ -1101,7 +1101,7 @@ protected: sizeof(KDNode) * (m_nodeCount+1)))+1; m_indices = new IndexType[m_indexCount]; - /* The following code rewrites all tree nodes with proper relative + /* The following code rewrites all tree nodes with proper relative indices. It also computes the final tree cost and some other useful heuristics */ std::stack stack; @@ -1110,10 +1110,10 @@ protected: RewriteItem item = stack.top(); stack.pop(); - typename std::map::const_iterator it + typename std::map::const_iterator it = m_interface.threadMap.find(item.node); // Check if we're switching to a subtree built by a worker thread - if (it != m_interface.threadMap.end()) + if (it != m_interface.threadMap.end()) item.context = &m_builders[(*it).second]->getContext(); if (item.node->isLeaf()) { @@ -1132,9 +1132,9 @@ protected: if (primsInLeaf > maxPrimsInLeaf) maxPrimsInLeaf = primsInLeaf; - const BlockedVector &indices + const BlockedVector &indices = item.context->indices; - for (SizeType idx = primStart; idx= 0 && indices[idx] < primCount); m_indices[indexPtr++] = indices[idx]; } @@ -1146,7 +1146,7 @@ protected: const KDNode *left; if (EXPECT_TAKEN(!item.node->isIndirection())) left = item.node->getLeft(); - else + else left = m_indirections[item.node->getIndirectionIndex()]; KDNode *children = &m_nodes[nodePtr]; @@ -1197,7 +1197,7 @@ protected: expPrimitivesIntersected /= rootQuantity; heuristicCost /= rootQuantity; - /* Slightly enlarge the bounding box + /* Slightly enlarge the bounding box (necessary e.g. when the scene is planar) */ m_tightAABB = aabb; @@ -1207,15 +1207,15 @@ protected: aabb.max += (aabb.max-aabb.min) * eps + VectorType(eps); KDLog(m_logLevel, "Structural kd-tree statistics:"); - KDLog(m_logLevel, " Parallel work units : " SIZE_T_FMT, + KDLog(m_logLevel, " Parallel work units : " SIZE_T_FMT, m_interface.threadMap.size()); - KDLog(m_logLevel, " Node storage cost : %s", + KDLog(m_logLevel, " Node storage cost : %s", memString(nodePtr * sizeof(KDNode)).c_str()); - KDLog(m_logLevel, " Index storage cost : %s", + KDLog(m_logLevel, " Index storage cost : %s", memString(indexPtr * sizeof(IndexType)).c_str()); KDLog(m_logLevel, " Inner nodes : %i", ctx.innerNodeCount); KDLog(m_logLevel, " Leaf nodes : %i", ctx.leafNodeCount); - KDLog(m_logLevel, " Nonempty leaf nodes : %i", + KDLog(m_logLevel, " Nonempty leaf nodes : %i", ctx.nonemptyLeafNodeCount); std::ostringstream oss; oss << " Leaf node histogram : "; @@ -1234,11 +1234,11 @@ protected: KDLog(m_logLevel, " Pruned primitives : %i", ctx.pruned); KDLog(m_logLevel, " Largest leaf node : %i primitives", maxPrimsInLeaf); - KDLog(m_logLevel, " Avg. prims/nonempty leaf : %.2f", + KDLog(m_logLevel, " Avg. prims/nonempty leaf : %.2f", ctx.primIndexCount / (Float) ctx.nonemptyLeafNodeCount); KDLog(m_logLevel, " Expected traversals/query : %.2f", expTraversalSteps); KDLog(m_logLevel, " Expected leaf visits/query : %.2f", expLeavesVisited); - KDLog(m_logLevel, " Expected prim. visits/query : %.2f", + KDLog(m_logLevel, " Expected prim. visits/query : %.2f", expPrimitivesIntersected); KDLog(m_logLevel, " Final cost : %.2f", heuristicCost); KDLog(m_logLevel, ""); @@ -1385,7 +1385,7 @@ protected: } size_t size() { - return leftAlloc.size() + rightAlloc.size() + return leftAlloc.size() + rightAlloc.size() + nodes.capacity() * sizeof(KDNode) + indices.capacity() * sizeof(IndexType) + classStorage.size(); @@ -1393,16 +1393,16 @@ protected: void printStats(ELogLevel level) { KDLog(level, " Left events : " SIZE_T_FMT " chunks (%s)", - leftAlloc.getChunkCount(), + leftAlloc.getChunkCount(), memString(leftAlloc.size()).c_str()); KDLog(level, " Right events : " SIZE_T_FMT " chunks (%s)", - rightAlloc.getChunkCount(), + rightAlloc.getChunkCount(), memString(rightAlloc.size()).c_str()); - KDLog(level, " kd-tree nodes : " SIZE_T_FMT " entries, " - SIZE_T_FMT " blocks (%s)", nodes.size(), nodes.blockCount(), + KDLog(level, " kd-tree nodes : " SIZE_T_FMT " entries, " + SIZE_T_FMT " blocks (%s)", nodes.size(), nodes.blockCount(), memString(nodes.capacity() * sizeof(KDNode)).c_str()); - KDLog(level, " Indices : " SIZE_T_FMT " entries, " - SIZE_T_FMT " blocks (%s)", indices.size(), + KDLog(level, " Indices : " SIZE_T_FMT " entries, " + SIZE_T_FMT " blocks (%s)", indices.size(), indices.blockCount(), memString(indices.capacity() * sizeof(IndexType)).c_str()); } @@ -1450,7 +1450,7 @@ protected: */ class TreeBuilder : public Thread { public: - TreeBuilder(IndexType id, GenericKDTree *parent) + TreeBuilder(IndexType id, GenericKDTree *parent) : Thread(formatString("bld%i", id)), m_id(id), m_parent(parent), @@ -1482,7 +1482,7 @@ protected: int badRefines = m_interface.badRefines; EdgeEvent *eventStart = leftAlloc.allocate(eventCount), *eventEnd = eventStart + eventCount; - memcpy(eventStart, m_interface.eventStart, + memcpy(eventStart, m_interface.eventStart, eventCount * sizeof(EdgeEvent)); m_interface.threadMap[node] = m_id; m_interface.node = NULL; @@ -1526,13 +1526,13 @@ protected: }; /** - * \brief Create an edge event list for a given list of primitives. + * \brief Create an edge event list for a given list of primitives. * - * This is necessary when passing from Min-Max binning to the more + * This is necessary when passing from Min-Max binning to the more * accurate O(n log n) optimizier. */ EventList createEventList( - OrderedChunkAllocator &alloc, const AABBType &nodeAABB, + OrderedChunkAllocator &alloc, const AABBType &nodeAABB, IndexType *prims, SizeType primCount) { SizeType initialSize = primCount * 2 * PointType::dim, actualPrimCount = 0; EdgeEvent *eventStart = alloc.allocate(initialSize); @@ -1553,12 +1553,12 @@ protected: float min = (float) aabb.min[axis], max = (float) aabb.max[axis]; if (min == max) { - *eventEnd++ = EdgeEvent(EdgeEvent::EEdgePlanar, axis, + *eventEnd++ = EdgeEvent(EdgeEvent::EEdgePlanar, axis, min, index); } else { - *eventEnd++ = EdgeEvent(EdgeEvent::EEdgeStart, axis, + *eventEnd++ = EdgeEvent(EdgeEvent::EEdgeStart, axis, min, index); - *eventEnd++ = EdgeEvent(EdgeEvent::EEdgeEnd, axis, + *eventEnd++ = EdgeEvent(EdgeEvent::EEdgeEnd, axis, max, index); } } @@ -1575,7 +1575,7 @@ protected: /** * \brief Leaf node creation helper function * - * \param ctx + * \param ctx * Thread-specific build context containing allocators etc. * \param node * KD-tree node entry to be filled @@ -1586,14 +1586,14 @@ protected: * \param primCount * Total primitive count for the current node */ - void createLeaf(BuildContext &ctx, KDNode *node, EdgeEvent *eventStart, + void createLeaf(BuildContext &ctx, KDNode *node, EdgeEvent *eventStart, EdgeEvent *eventEnd, SizeType primCount) { node->initLeafNode((SizeType) ctx.indices.size(), primCount); if (primCount > 0) { SizeType seenPrims = 0; ctx.nonemptyLeafNodeCount++; - for (EdgeEvent *event = eventStart; event != eventEnd + for (EdgeEvent *event = eventStart; event != eventEnd && event->axis == 0; ++event) { if (event->type == EdgeEvent::EEdgeStart || event->type == EdgeEvent::EEdgePlanar) { @@ -1610,7 +1610,7 @@ protected: /** * \brief Leaf node creation helper function * - * \param ctx + * \param ctx * Thread-specific build context containing allocators etc. * \param node * KD-tree node entry to be filled @@ -1632,12 +1632,12 @@ protected: } /** - * \brief Leaf node creation helper function. + * \brief Leaf node creation helper function. * * Creates a unique index list by collapsing * a subtree with a bad cost. * - * \param ctx + * \param ctx * Thread-specific build context containing allocators etc. * \param node * KD-tree node entry to be filled @@ -1684,9 +1684,9 @@ protected: * \brief Implements the transition from min-max-binning to the * O(n log n) optimization. * - * \param ctx + * \param ctx * Thread-specific build context containing allocators etc. - * \param depth + * \param depth * Current tree depth (1 == root node) * \param node * KD-tree node entry to be filled @@ -1705,13 +1705,13 @@ protected: * the hope that the cost was significantly overestimated. The * counter makes sure that only a limited number of such splits can * happen in succession. - * \returns + * \returns * Final cost of the node */ - inline Float transitionToNLogN(BuildContext &ctx, unsigned int depth, KDNode *node, + inline Float transitionToNLogN(BuildContext &ctx, unsigned int depth, KDNode *node, const AABBType &nodeAABB, IndexType *indices, SizeType primCount, bool isLeftChild, SizeType badRefines) { - OrderedChunkAllocator &alloc = isLeftChild + OrderedChunkAllocator &alloc = isLeftChild ? ctx.leftAlloc : ctx.rightAlloc; EventList events = createEventList(alloc, nodeAABB, indices, primCount); Float cost; @@ -1745,9 +1745,9 @@ protected: /** * \brief Build helper function (min-max binning) * - * \param ctx + * \param ctx * Thread-specific build context containing allocators etc. - * \param depth + * \param depth * Current tree depth (1 == root node) * \param node * KD-tree node entry to be filled @@ -1768,10 +1768,10 @@ protected: * the hope that the cost was significantly overestimated. The * counter makes sure that only a limited number of such splits can * happen in succession. - * \returns + * \returns * Final cost of the node */ - Float buildTreeMinMax(BuildContext &ctx, unsigned int depth, KDNode *node, + Float buildTreeMinMax(BuildContext &ctx, unsigned int depth, KDNode *node, const AABBType &nodeAABB, const AABBType &tightAABB, IndexType *indices, SizeType primCount, bool isLeftChild, SizeType badRefines) { KDAssert(nodeAABB.contains(tightAABB)); @@ -1782,7 +1782,7 @@ protected: return leafCost; } - if (primCount <= m_exactPrimThreshold) + if (primCount <= m_exactPrimThreshold) return transitionToNLogN(ctx, depth, node, nodeAABB, indices, primCount, isLeftChild, badRefines); @@ -1802,10 +1802,10 @@ protected: if (bestSplit.cost == std::numeric_limits::infinity()) { /* This is bad: we have either run out of floating point precision to accurately represent split planes (e.g. 'tightAABB' is almost collapsed - along an axis), or the compiler made overly liberal use of floating point - optimizations, causing the two stages of the min-max binning code to + along an axis), or the compiler made overly liberal use of floating point + optimizations, causing the two stages of the min-max binning code to become inconsistent. The two ways to proceed at this point are to - either create a leaf (bad) or switch over to the O(n log n) greedy + either create a leaf (bad) or switch over to the O(n log n) greedy optimization, which is done below */ KDLog(EWarn, "Min-max binning was unable to split %i primitives with %s " "-- retrying with the O(n log n) greedy optimization", @@ -1828,8 +1828,8 @@ protected: /* Partitioning */ /* ==================================================================== */ - typename MinMaxBins::Partition partition = - ctx.minMaxBins.partition(ctx, cast(), indices, bestSplit, + typename MinMaxBins::Partition partition = + ctx.minMaxBins.partition(ctx, cast(), indices, bestSplit, isLeftChild, m_traversalCost, m_queryCost); /* ==================================================================== */ @@ -1850,7 +1850,7 @@ protected: m_indirections.push_back(children); /* Unable to store relative offset -- create an indirection table entry */ - node->initIndirectionNode(bestSplit.axis, bestSplit.pos, + node->initIndirectionNode(bestSplit.axis, bestSplit.pos, indirectionIdx); } ctx.innerNodeCount++; @@ -1870,13 +1870,13 @@ protected: bestSplit.numRight, false, badRefines); TreeConstructionHeuristic tch(nodeAABB); - std::pair prob = tch(bestSplit.axis, + std::pair prob = tch(bestSplit.axis, bestSplit.pos - nodeAABB.min[bestSplit.axis], nodeAABB.max[bestSplit.axis] - bestSplit.pos); - /* Compute the final cost given the updated cost + /* Compute the final cost given the updated cost values received from the children */ - Float finalCost = m_traversalCost + + Float finalCost = m_traversalCost + (prob.first * leftCost + prob.second * rightCost); /* Release the index lists not needed by the children anymore */ @@ -1907,9 +1907,9 @@ protected: /* * \brief Build helper function (greedy O(n log n) optimization) * - * \param ctx + * \param ctx * Thread-specific build context containing allocators etc. - * \param depth + * \param depth * Current tree depth (1 == root node) * \param node * KD-tree node entry to be filled @@ -1930,11 +1930,11 @@ protected: * the hope that the cost was significantly overestimated. The * counter makes sure that only a limited number of such splits can * happen in succession. - * \returns + * \returns * Final cost of the node */ Float buildTree(BuildContext &ctx, unsigned int depth, KDNode *node, - const AABBType &nodeAABB, EdgeEvent *eventStart, EdgeEvent *eventEnd, + const AABBType &nodeAABB, EdgeEvent *eventStart, EdgeEvent *eventEnd, SizeType primCount, bool isLeftChild, SizeType badRefines) { Float leafCost = primCount * m_queryCost; @@ -1957,7 +1957,7 @@ protected: and thus all geometry is on its right side */ SizeType numLeft[PointType::dim], numRight[PointType::dim]; - + for (int i=0; iaxis; float pos = event->pos; @@ -2005,7 +2005,7 @@ protected: eventsByAxis[eventsByAxisCtr++] = event; } - /* The split plane can now be moved onto 't'. Accordingly, all planar + /* The split plane can now be moved onto 't'. Accordingly, all planar and ending primitives are removed from the right side */ numRight[axis] -= numPlanar + numEnd; @@ -2014,7 +2014,7 @@ protected: const SizeType nL = numLeft[axis], nR = numRight[axis]; const Float nLF = (Float) nL, nRF = (Float) nR; - std::pair prob = tch(axis, + std::pair prob = tch(axis, pos - nodeAABB.min[axis], nodeAABB.max[axis] - pos); @@ -2061,7 +2061,7 @@ protected: } } else { #if defined(MTS_KD_DEBUG) - if (m_clip && (pos < nodeAABB.min[axis] + if (m_clip && (pos < nodeAABB.min[axis] || pos > nodeAABB.max[axis])) { /* When primitive clipping is active, this should never happen! */ KDLog(EError, "Internal error: edge event is out of bounds"); @@ -2102,13 +2102,13 @@ protected: ClassificationStorage &storage = ctx.classStorage; /* Initially mark all prims as being located on both sides */ - for (EdgeEvent *event = eventsByAxis[bestSplit.axis]; + for (EdgeEvent *event = eventsByAxis[bestSplit.axis]; event < eventEnd && event->axis == bestSplit.axis; ++event) storage.set(event->index, EBothSides); SizeType primsLeft = 0, primsRight = 0, primsBoth = primCount; /* Sweep over all edge events and classify the primitives wrt. the split */ - for (EdgeEvent *event = eventsByAxis[bestSplit.axis]; + for (EdgeEvent *event = eventsByAxis[bestSplit.axis]; event < eventEnd && event->axis == bestSplit.axis; ++event) { if (event->type == EdgeEvent::EEdgeEnd && event->pos <= bestSplit.pos) { /* The primitive's interval ends before or on the split plane @@ -2135,7 +2135,7 @@ protected: storage.set(event->index, ELeftSide); primsBoth--; primsLeft++; - } else if (event->pos > bestSplit.pos + } else if (event->pos > bestSplit.pos || (event->pos == bestSplit.pos && !bestSplit.planarLeft)) { storage.set(event->index, ERightSide); primsBoth--; @@ -2182,7 +2182,7 @@ protected: *newEventsLeftStart = leftAlloc.allocate(primsBoth * 2 * PointType::dim), *newEventsRightStart = rightAlloc.allocate(primsBoth * 2 * PointType::dim); - EdgeEvent *leftEventsTempEnd = leftEventsTempStart, + EdgeEvent *leftEventsTempEnd = leftEventsTempStart, *rightEventsTempEnd = rightEventsTempStart, *newEventsLeftEnd = newEventsLeftStart, *newEventsRightEnd = newEventsRightStart; @@ -2214,14 +2214,14 @@ protected: if (min == max) { *newEventsLeftEnd++ = EdgeEvent( - EdgeEvent::EEdgePlanar, + EdgeEvent::EEdgePlanar, axis, min, index); } else { *newEventsLeftEnd++ = EdgeEvent( - EdgeEvent::EEdgeStart, + EdgeEvent::EEdgeStart, axis, min, index); *newEventsLeftEnd++ = EdgeEvent( - EdgeEvent::EEdgeEnd, + EdgeEvent::EEdgeEnd, axis, max, index); } } @@ -2240,7 +2240,7 @@ protected: axis, min, index); } else { *newEventsRightEnd++ = EdgeEvent( - EdgeEvent::EEdgeStart, + EdgeEvent::EEdgeStart, axis, min, index); *newEventsRightEnd++ = EdgeEvent( EdgeEvent::EEdgeEnd, @@ -2251,7 +2251,7 @@ protected: prunedRight++; } - /* Mark this primitive as processed so that clipping + /* Mark this primitive as processed so that clipping is only done once */ storage.set(index, EBothSidesProcessed); } @@ -2268,7 +2268,7 @@ protected: std::sort(newEventsRightStart, newEventsRightEnd, EdgeEventOrdering()); /* Merge the left list */ - leftEventsEnd = std::merge(leftEventsTempStart, + leftEventsEnd = std::merge(leftEventsTempStart, leftEventsTempEnd, newEventsLeftStart, newEventsLeftEnd, leftEventsStart, EdgeEventOrdering()); @@ -2303,12 +2303,12 @@ protected: KDAssert((SizeType) (rightEventsEnd - rightEventsStart) <= bestSplit.numRight * 2 * PointType::dim); } - /* Shrink the edge event storage now that we know exactly how + /* Shrink the edge event storage now that we know exactly how many are on each side */ - ctx.leftAlloc.shrinkAllocation(leftEventsStart, + ctx.leftAlloc.shrinkAllocation(leftEventsStart, leftEventsEnd - leftEventsStart); - ctx.rightAlloc.shrinkAllocation(rightEventsStart, + ctx.rightAlloc.shrinkAllocation(rightEventsStart, rightEventsEnd - rightEventsStart); /* ==================================================================== */ @@ -2329,7 +2329,7 @@ protected: m_indirections.push_back(children); /* Unable to store relative offset -- create an indirection table entry */ - node->initIndirectionNode(bestSplit.axis, bestSplit.pos, + node->initIndirectionNode(bestSplit.axis, bestSplit.pos, indirectionIdx); } ctx.innerNodeCount++; @@ -2342,13 +2342,13 @@ protected: rightNodeAABB, rightEventsStart, rightEventsEnd, bestSplit.numRight - prunedRight, false, badRefines); - std::pair prob = tch(bestSplit.axis, + std::pair prob = tch(bestSplit.axis, bestSplit.pos - nodeAABB.min[bestSplit.axis], nodeAABB.max[bestSplit.axis] - bestSplit.pos); - /* Compute the final cost given the updated cost + /* Compute the final cost given the updated cost values received from the children */ - Float finalCost = m_traversalCost + + Float finalCost = m_traversalCost + (prob.first * leftCost + prob.second * rightCost); /* Release the index lists not needed by the children anymore */ @@ -2360,7 +2360,7 @@ protected: /* ==================================================================== */ /* Final decision */ /* ==================================================================== */ - + if (!m_retract || finalCost < primCount * m_queryCost) { return finalCost; } else { @@ -2401,7 +2401,7 @@ protected: void setAABB(const AABBType &aabb) { m_aabb = aabb; m_binSize = m_aabb.getExtents() / (Float) m_binCount; - for (int axis=0; axisgetAABB(indices[i]); for (int axis=0; axis prob = tch(axis, leftWidth, rightWidth); - Float cost = traversalCost + queryCost + Float cost = traversalCost + queryCost * (prob.first * numLeft + prob.second * numRight); if (cost < candidate.cost) { @@ -2481,9 +2481,9 @@ protected: const int axis = candidate.axis; const Float min = m_aabb.min[axis]; - /* The following part may seem a bit paranoid. It is ensures that the + /* The following part may seem a bit paranoid. It is ensures that the * returned split plane is consistent with the floating point calculations - * done by the binning code in \ref bin(). Since reciprocals and + * done by the binning code in \ref bin(). Since reciprocals and * various floating point roundoff errors are involved, simply setting * * candidate.pos = m_aabb.min[axis] + (leftBin+1) * m_binSize[axis]; @@ -2497,7 +2497,7 @@ protected: */ Float invBinSize = m_invBinSize[axis]; float split = (float) (min + (leftBin + 1) * m_binSize[axis]); - float splitNext = nextafterf(split, + float splitNext = nextafterf(split, std::numeric_limits::max()); int idx = (int) ((split - min) * invBinSize); int idxNext = (int) ((splitNext - min) * invBinSize); @@ -2514,7 +2514,7 @@ protected: int it = 0; while (true) { split = left + (right-left)/2; - splitNext = nextafterf(split, + splitNext = nextafterf(split, std::numeric_limits::max()); idx = (int) ((split - min) * invBinSize); idxNext = (int) ((splitNext - min) * invBinSize); @@ -2537,7 +2537,7 @@ protected: } if (split <= m_aabb.min[axis] || split >= m_aabb.max[axis]) { - /* Insufficient floating point resolution + /* Insufficient floating point resolution -> a leaf will be created. */ candidate.cost = std::numeric_limits::infinity(); } @@ -2566,7 +2566,7 @@ protected: */ Partition partition( BuildContext &ctx, const Derived *derived, IndexType *primIndices, - SplitCandidate &split, bool isLeftChild, Float traversalCost, + SplitCandidate &split, bool isLeftChild, Float traversalCost, Float queryCost) { const float splitPos = split.pos; const int axis = split.axis; @@ -2633,9 +2633,9 @@ protected: std::pair prob2 = tch(axis, rightBounds.min[axis] - m_aabb.min[axis], m_aabb.max[axis] - rightBounds.min[axis]); - Float cost1 = traversalCost + queryCost + Float cost1 = traversalCost + queryCost * (prob1.first * numLeft + prob1.second * numRight); - Float cost2 = traversalCost + queryCost + Float cost2 = traversalCost + queryCost * (prob2.first * numLeft + prob2.second * numRight); if (cost1 <= cost2) { @@ -2646,9 +2646,9 @@ protected: split.pos = (float) rightBounds.min[axis]; } - leftBounds.max[axis] = std::min(leftBounds.max[axis], + leftBounds.max[axis] = std::min(leftBounds.max[axis], (Float) split.pos); - rightBounds.min[axis] = std::max(rightBounds.min[axis], + rightBounds.min[axis] = std::max(rightBounds.min[axis], (Float) split.pos); } @@ -2685,7 +2685,7 @@ protected: }; #if defined(_MSC_VER) -/* Revert back to fast / non-strict IEEE 754 +/* Revert back to fast / non-strict IEEE 754 floating point computations */ MTS_NAMESPACE_END #pragma float_control(precise, off) @@ -2693,7 +2693,7 @@ MTS_NAMESPACE_BEGIN #endif template - Class *KDTreeBase::m_theClass + Class *KDTreeBase::m_theClass = new Class("KDTreeBase", true, "Object"); template diff --git a/include/mitsuba/render/imageblock.h b/include/mitsuba/render/imageblock.h index ead118ad..e2fcaf79 100644 --- a/include/mitsuba/render/imageblock.h +++ b/include/mitsuba/render/imageblock.h @@ -31,9 +31,9 @@ MTS_NAMESPACE_BEGIN * * This class is used by image-based parallel processes and encapsulates * computed rectangular regions of an image. This allows for easy and efficient - * distributed rendering of large images. Image blocks usually also include a - * border region storing contribuctions that are slightly outside of the block, - * which is required to support image reconstruction filters. + * distributed rendering of large images. Image blocks usually also include a + * border region storing contribuctions that are slightly outside of the block, + * which is required to support image reconstruction filters. * * \ingroup librender */ @@ -52,19 +52,19 @@ public: * Specifies the number of output channels. This is only necessary * when \ref Bitmap::EMultiChannel is chosen as the pixel format */ - ImageBlock(Bitmap::EPixelFormat fmt, const Vector2i &size, + ImageBlock(Bitmap::EPixelFormat fmt, const Vector2i &size, const ReconstructionFilter *filter = NULL, int channels = -1); /// Set the current block offset inline void setOffset(const Point2i &offset) { m_offset = offset; } - + /// Return the current block offset inline const Point2i &getOffset() const { return m_offset; } - /// Set the current block size + /// Set the current block size inline void setSize(const Vector2i &size) { m_size = size; } - /// Return the current block size + /// Return the current block size inline const Vector2i &getSize() const { return m_size; } /// Return the bitmap's width in pixels @@ -90,7 +90,7 @@ public: /// Accumulate another image block into this one inline void put(const ImageBlock *block) { - m_bitmap->accumulate(block->getBitmap(), + m_bitmap->accumulate(block->getBitmap(), Point2i(block->getOffset() - m_offset - Vector2i(block->getBorderSize() - m_borderSize))); } @@ -135,7 +135,7 @@ public: /* Check if all sample values are valid */ for (int i=0; igetFloatData() + Float *dest = m_bitmap->getFloatData() + (y * (size_t) size.x + min.x) * channels; for (int x=min.x, xr=0; x<=max.x; ++x, ++xr) { const Float weight = m_weightsX[xr] * weightY; - for (int k=0; k(its.p, its.shFrame.n). A value of \c NULL corresponds + * Const pointer to the medium that encloses the ray + * (its.p, its.shFrame.n). A value of \c NULL corresponds * to vacuum. * \param sampler * A pointer to a sample generator @@ -344,26 +344,26 @@ public: * Include indirect illumination in the estimate? */ virtual Spectrum E(const Scene *scene, const Intersection &its, - const Medium *medium, Sampler *sampler, int nSamples, - bool includeIndirect) const; + const Medium *medium, Sampler *sampler, int nSamples, + bool includeIndirect) const; /** * \brief Perform the main rendering task * - * The work is automatically parallelized to multiple cores and - * remote machines. The default implementation uniformly generates - * samples on the sensor aperture and image plane as specified by - * the used sampler. The average of the estimated radiance along the - * associated rays in a pixel region is then taken as an approximation - * of that pixel's radiance value. For adaptive strategies, have a look at + * The work is automatically parallelized to multiple cores and + * remote machines. The default implementation uniformly generates + * samples on the sensor aperture and image plane as specified by + * the used sampler. The average of the estimated radiance along the + * associated rays in a pixel region is then taken as an approximation + * of that pixel's radiance value. For adaptive strategies, have a look at * the \c adaptive plugin, which is an extension of this class. */ - bool render(Scene *scene, RenderQueue *queue, const RenderJob *job, + bool render(Scene *scene, RenderQueue *queue, const RenderJob *job, int sceneResID, int sensorResID, int samplerResID); /** * This can be called asynchronously to cancel a running render job. - * In this case, render() will quit with a return value of + * In this case, render() will quit with a return value of * false. */ void cancel(); @@ -380,25 +380,25 @@ public: * \param sampler * Pointer to the sampler used to render the image * \param block - * Pointer to the image block to be filled + * Pointer to the image block to be filled * \param points - * Specifies the traversal order, i.e. using a space-filling + * Specifies the traversal order, i.e. using a space-filling * curve. To limit the size of the array, it is currently assumed * that the block size is smaller than 256x256 * \param stop * Reference to a boolean, which will be set to true when * the user has requested that the program be stopped */ - virtual void renderBlock(const Scene *scene, const Sensor *sensor, + virtual void renderBlock(const Scene *scene, const Sensor *sensor, Sampler *sampler, ImageBlock *block, const bool &stop, const std::vector< TPoint2 > &points) const; /** * NetworkedObject implementation: - * When a parallel rendering process starts, the integrator is - * given the opportunity to attach globally shared resources to - * the process. This is useful for distributing heavy data - * structures (e.g. photon maps) without having to re-transmit + * When a parallel rendering process starts, the integrator is + * given the opportunity to attach globally shared resources to + * the process. This is useful for distributing heavy data + * structures (e.g. photon maps) without having to re-transmit * them every time an image is rendered. */ virtual void bindUsedResources(ParallelProcess *proc) const; @@ -408,8 +408,8 @@ public: * Called once just before this integrator instance is asked * to process an image block. In comparison to preprocess() * this will be executed on _every_ instance of this class, which is - * useful for connecting to globally shared resources (photon maps, - * irradiance caches, ..) after having been unserialized on a + * useful for connecting to globally shared resources (photon maps, + * irradiance caches, ..) after having been unserialized on a * remote machine. A list of resources bound to the associated * parallel process is given as a parameter. */ diff --git a/include/mitsuba/render/irrcache.h b/include/mitsuba/render/irrcache.h index a3b2a5ba..9e8548c6 100644 --- a/include/mitsuba/render/irrcache.h +++ b/include/mitsuba/render/irrcache.h @@ -30,10 +30,10 @@ typedef Spectrum RotationalGradient[3]; typedef Spectrum TranslationalGradient[3]; /** - * \brief Utility data structure for hemispherical sampling and + * \brief Utility data structure for hemispherical sampling and * translational/rotational gradient computation. * - * Uses the improved translational gradients proposed in + * Uses the improved translational gradients proposed in * the paper "Improved radiance gradient computation" by * Krivanek J., Gautron P., Bouatouch K., Pattanaik S. * (Proceedings of SCCG 2005) @@ -59,7 +59,7 @@ public: /// Return the elevational resolution inline uint32_t getM() const { return m_M; } - + /// Return the azimuthal resolution inline uint32_t getN() const { return m_N; } @@ -125,8 +125,8 @@ private: }; -/** \brief Irradiance cache data structure based on "A Ray Tracing Solution - * for Diffuse Interreflection" by Greg J. Ward, Francis M. Rubinstein and +/** \brief Irradiance cache data structure based on "A Ray Tracing Solution + * for Diffuse Interreflection" by Greg J. Ward, Francis M. Rubinstein and * Robert D. Clear (Computer Graphics, Volume 22, Number 4, August 1988) * * with extensions from @@ -157,7 +157,7 @@ public: * Create an empty irradiance of the given size */ IrradianceCache(const AABB &aabb); - + /** * Unserialize an irradiance cache from a binary data stream */ @@ -196,13 +196,13 @@ public: * * \param ray * Ray differentials (if they exist) - * \param its + * \param its * The position/normal of the surface in question * \param sample - * Record containing all hemispherical samples and + * Record containing all hemispherical samples and * derived gradient information */ - Record *put(const RayDifferential &ray, const Intersection &its, + Record *put(const RayDifferential &ray, const Intersection &its, const HemisphereSampler &hs); /** @@ -249,9 +249,9 @@ public: /// Dummy constructor inline Record() { } - + /// Copy constructor - inline Record(const Record *rec) + inline Record(const Record *rec) : p(rec->p), n(rec->n), R0(rec->R0), originalR0(rec->originalR0), R0_min(rec->R0_min), R0_max(rec->R0_max), E(rec->E) { for (int i=0; i<3; ++i) { @@ -296,7 +296,7 @@ public: */ inline Float getWeight(const Point &p2, const Normal &n2, Float kappa) const { Float dp = dot(n, n2); - + /* Quickly discard opposite-facing samples */ if (dp < 0.0f) return 0.0f; diff --git a/include/mitsuba/render/medium.h b/include/mitsuba/render/medium.h index 4fe55297..2a1e8e78 100644 --- a/include/mitsuba/render/medium.h +++ b/include/mitsuba/render/medium.h @@ -25,7 +25,7 @@ MTS_NAMESPACE_BEGIN /** - * \brief Data record for sampling a point on the in-scattering + * \brief Data record for sampling a point on the in-scattering * integral of the RTE * * \sa Medium::sampleDistance() @@ -49,7 +49,7 @@ public: /** * \brief Specifies the transmittance along the segment [mint, t] * - * When sampling a distance fails, this contains the + * When sampling a distance fails, this contains the * transmittance along the whole ray segment [mint, maxDist]. */ Spectrum transmittance; @@ -62,9 +62,9 @@ public: /// Records the probability of sampling a medium interaction at p Float pdfSuccess; - + /** - * \brief Records the probability of sampling a medium + * \brief Records the probability of sampling a medium * interaction in the reverse direction * * This is essentially the density of obtained by calling \ref sampleDistance, @@ -97,7 +97,7 @@ public: std::string toString() const; }; -/** \brief Abstract participating medium +/** \brief Abstract participating medium * \ingroup librender */ class MTS_EXPORT_RENDER Medium : public NetworkedObject { @@ -122,16 +122,16 @@ public: /** * \brief Compute the 1D density of sampling distance \a ray.maxt - * along the ray using the sampling strategy implemented by - * \a sampleDistance. + * along the ray using the sampling strategy implemented by + * \a sampleDistance. * * The function computes the continuous densities in the case of * a successful \ref sampleDistance() invocation (in both directions), * as well as the Dirac delta density associated with a failure. - * For convenience, it also stores the transmittance along the + * For convenience, it also stores the transmittance along the * supplied ray segment within \a mRec. */ - virtual void eval(const Ray &ray, + virtual void eval(const Ray &ray, MediumSamplingRecord &mRec) const = 0; //! @} @@ -141,10 +141,10 @@ public: //! @{ \name Functions for querying the medium // ============================================================= - /** + /** * \brief Compute the transmittance along a ray segment * - * Computes the transmittance along a ray segment + * Computes the transmittance along a ray segment * [mint, maxt] associated with the ray. It is assumed * that the ray has a normalized direction value. */ @@ -195,13 +195,13 @@ public: protected: /// Create a new participating medium instance Medium(const Properties &props); - + /// Unserialize a participating medium Medium(Stream *stream, InstanceManager *manager); /// Virtual destructor virtual ~Medium() { } -protected: +protected: ref m_phaseFunction; Spectrum m_sigmaA; Spectrum m_sigmaS; diff --git a/include/mitsuba/render/mipmap.h b/include/mitsuba/render/mipmap.h index 13957079..16deb898 100644 --- a/include/mitsuba/render/mipmap.h +++ b/include/mitsuba/render/mipmap.h @@ -50,7 +50,7 @@ namespace stats { extern MTS_EXPORT_RENDER StatsCounter filteredLookups; }; -/// Specifies the desired antialiasing filter +/// Specifies the desired antialiasing filter enum EMIPFilterType { /// No filtering (i.e. nearest neighbor lookups) ENearest = 0, @@ -60,23 +60,23 @@ enum EMIPFilterType { EEWA = 2, }; -/** +/** * \brief MIP map class with support for elliptically weighted averages * * This class stores a precomputed collection of images that provide * a hierarchy of resolution levels of an input image. These are used - * to prefilter texture lookups at render time, reducing aliasing - * artifacts. The implementation here supports non-power-of two images, - * different data types and quantizations thereof, as well as the - * computation of elliptically weighted averages that account for the + * to prefilter texture lookups at render time, reducing aliasing + * artifacts. The implementation here supports non-power-of two images, + * different data types and quantizations thereof, as well as the + * computation of elliptically weighted averages that account for the * anisotropy of texture lookups in UV space. * * Generating good mip maps is costly, and therefore this class provides * the means to cache them on disk if desired. * * \tparam Value - * This class can be parameterized to yield MIP map classes for - * RGB values, color spectra, or just plain floats. This parameter + * This class can be parameterized to yield MIP map classes for + * RGB values, color spectra, or just plain floats. This parameter * specifies the underlying type. * * \tparam QuantizedValue @@ -95,7 +95,7 @@ public: /// Use a non-blocked array to store MIP map data typedef LinearArray Array2DType; #endif - + /// Shortcut typedef ReconstructionFilter::EBoundaryCondition EBoundaryCondition; @@ -103,28 +103,28 @@ public: * \brief Construct a new MIP map from the given bitmap * * \param bitmap - * An arbitrary input bitmap that will (if necessary) be + * An arbitrary input bitmap that will (if necessary) be * transformed into a representation that is compatible * with the desired MIP map pixel format. * - * \ref pixelFormat - * A pixel format that is compatible with the + * \ref pixelFormat + * A pixel format that is compatible with the * \c Value and \c QuantizedValue types * - * \ref componentFormat - * A component format that is compatible with the + * \ref componentFormat + * A component format that is compatible with the * \c Value type. * * \param rfilter - * An image reconstruction filter that is used to create + * An image reconstruction filter that is used to create * progressively lower-resolution versions of the input image. * * \param bcu - * Specifies how to handle texture lookups outside of the + * Specifies how to handle texture lookups outside of the * horizontal range [0, 1] * * \param bcv - * Specifies how to handle texture lookups outside of the + * Specifies how to handle texture lookups outside of the * vertical range [0, 1] * * \param filterType @@ -132,13 +132,13 @@ public: * the default is to use elliptically weighted averages. * * \param maxAnisotropy - * Denotes the highest tolerated anisotropy of the lookup - * kernel. This is necessary to bound the computational + * Denotes the highest tolerated anisotropy of the lookup + * kernel. This is necessary to bound the computational * cost of filtered lookups. * * \param cacheFilename - * Optional filename of a memory-mapped cache file that is used to keep - * MIP map data out of core, and to avoid having to load and + * Optional filename of a memory-mapped cache file that is used to keep + * MIP map data out of core, and to avoid having to load and * downsample textures over and over again in subsequent Mitsuba runs. * * \param maxValue @@ -150,19 +150,19 @@ public: * this parameter specifies what conversion method should be used. * See \ref Spectrum::EConversionIntent for further details. */ - TMIPMap(Bitmap *bitmap_, + TMIPMap(Bitmap *bitmap_, Bitmap::EPixelFormat pixelFormat, Bitmap::EComponentFormat componentFormat, const ReconstructionFilter *rfilter, EBoundaryCondition bcu = ReconstructionFilter::ERepeat, EBoundaryCondition bcv = ReconstructionFilter::ERepeat, - EMIPFilterType filterType = EEWA, + EMIPFilterType filterType = EEWA, Float maxAnisotropy = 20.0f, fs::path cacheFilename = fs::path(), uint64_t timestamp = 0, Float maxValue = 1.0f, - Spectrum::EConversionIntent intent = Spectrum::EReflectance) - : m_pixelFormat(pixelFormat), m_bcu(bcu), m_bcv(bcv), m_filterType(filterType), + Spectrum::EConversionIntent intent = Spectrum::EReflectance) + : m_pixelFormat(pixelFormat), m_bcu(bcu), m_bcv(bcv), m_filterType(filterType), m_weightLut(NULL), m_maxAnisotropy(maxAnisotropy) { /* Keep track of time */ @@ -212,9 +212,9 @@ public: m_pyramid[0].alloc(bitmap_->getSize()); } - /* Initialize the first mip map level and extract some general + /* Initialize the first mip map level and extract some general information (i.e. the minimum, maximum, and average texture value) */ - ref bitmap = bitmap_->expand()->convert(pixelFormat, + ref bitmap = bitmap_->expand()->convert(pixelFormat, componentFormat, 1.0f, 1.0f, intent); m_pyramid[0].cleanup(); @@ -224,7 +224,7 @@ public: Log(EWarn, "The texture contains negative pixel values! These will be clamped!"); Value *value = (Value *) bitmap->getData(); - for (size_t i=0, count=bitmap->getPixelCount(); igetPixelCount(); igetData(), m_minimum, m_maximum, m_average); @@ -261,7 +261,7 @@ public: } if (mmapData) { - /* If a cache file was requested, create a header that + /* If a cache file was requested, create a header that describes the current MIP map configuration */ MIPMapHeader header; memcpy(header.identifier, "MIP", 3); @@ -297,23 +297,23 @@ public: * \brief Construct a new MIP map from a previously created cache file * * \param cacheFilename - * Filename of a memory-mapped cache file that is used to keep - * MIP map data out of core, and to avoid having to load and + * Filename of a memory-mapped cache file that is used to keep + * MIP map data out of core, and to avoid having to load and * downsample textures over and over again in subsequent Mitsuba runs. * * \param maxAnisotropy - * Denotes the highest tolerated anisotropy of the lookup - * kernel. This is necessary to bound the computational + * Denotes the highest tolerated anisotropy of the lookup + * kernel. This is necessary to bound the computational * cost of filtered lookups. This parameter is independent of the * cache file that was previously created. */ - TMIPMap(fs::path cacheFilename, Float maxAnisotropy = 20.0f) + TMIPMap(fs::path cacheFilename, Float maxAnisotropy = 20.0f) : m_weightLut(NULL), m_maxAnisotropy(maxAnisotropy) { m_mmap = new MemoryMappedFile(cacheFilename); uint8_t *mmapPtr = (uint8_t *) m_mmap->getData(); Log(EInfo, "Mapped MIP map cache file \"%s\" into memory (%s).", cacheFilename.c_str(), memString(m_mmap->getSize()).c_str()); - + stats::mipStorage += m_mmap->getSize(); /* Load the file header, and run some santity checks */ @@ -377,7 +377,7 @@ public: } /** - * \brief Check if a MIP map cache is up-to-date and matches the + * \brief Check if a MIP map cache is up-to-date and matches the * desired configuration * * \param path @@ -394,7 +394,7 @@ public: * \return \c true if the texture file is good for use */ static bool validateCacheFile(const fs::path &path, uint64_t timestamp, - Bitmap::EPixelFormat pixelFormat, EBoundaryCondition bcu, + Bitmap::EPixelFormat pixelFormat, EBoundaryCondition bcu, EBoundaryCondition bcv, EMIPFilterType filterType, Float gamma) { fs::ifstream is(path); if (!is.good()) @@ -405,14 +405,14 @@ public: if (is.fail()) return false; - if (header.identifier[0] != 'M' || header.identifier[1] != 'I' - || header.identifier[2] != 'P' || header.version != MTS_MIPMAP_CACHE_VERSION - || header.timestamp != timestamp + if (header.identifier[0] != 'M' || header.identifier[1] != 'I' + || header.identifier[2] != 'P' || header.version != MTS_MIPMAP_CACHE_VERSION + || header.timestamp != timestamp || header.bcu != (uint8_t) bcu || header.bcv != (uint8_t) bcv || header.pixelFormat != (uint8_t) pixelFormat || header.filterType != (uint8_t) filterType) return false; - + if (gamma != 0 && (float) gamma != header.gamma) return false; @@ -422,7 +422,7 @@ public: padding = MTS_MIPMAP_CACHE_ALIGNMENT - padding; Vector2i size(header.width, header.height); - size_t expectedFileSize = sizeof(MIPMapHeader) + padding + size_t expectedFileSize = sizeof(MIPMapHeader) + padding + Array2DType::bufferSize(size); if (filterType != ENearest) { @@ -512,11 +512,11 @@ public: x = 2*size.x - x - 1; break; case ReconstructionFilter::EZero: - // Assume that the input function is zero + // Assume that the input function is zero // outside of the defined domain return Value(0.0f); case ReconstructionFilter::EOne: - // Assume that the input function is equal + // Assume that the input function is equal // to one outside of the defined domain return Value(1.0f); } @@ -540,16 +540,16 @@ public: y = 2*size.y - y - 1; break; case ReconstructionFilter::EZero: - // Assume that the input function is zero + // Assume that the input function is zero // outside of the defined domain return Value(0.0f); case ReconstructionFilter::EOne: - // Assume that the input function is equal + // Assume that the input function is equal // to one outside of the defined domain return Value(1.0f); } } - + return Value(m_pyramid[level](x, y)); } @@ -596,7 +596,7 @@ public: Float du0 = d0.x * size.x, dv0 = d0.y * size.y, du1 = d1.x * size.x, dv1 = d1.y * size.y; - /* Turn the texture-space Jacobian into the coefficients of an + /* Turn the texture-space Jacobian into the coefficients of an implicitly defined ellipse. */ Float A = dv0*dv0 + dv1*dv1, B = -2.0f * (du0*dv0 + du1*dv1), @@ -633,13 +633,13 @@ public: minorRadius = majorRadius / m_maxAnisotropy; /* We need to find the coefficients of the adjusted ellipse, which - unfortunately involves expensive trig and arctrig functions. + unfortunately involves expensive trig and arctrig functions. Fortunately, this is somewhat of a corner case and won't happen overly often in practice. */ Float theta = 0.5f * std::atan(B / (A-C)), sinTheta, cosTheta; math::sincos(theta, &sinTheta, &cosTheta); - Float a2 = majorRadius*majorRadius, + Float a2 = majorRadius*majorRadius, b2 = minorRadius*minorRadius, sinTheta2 = sinTheta*sinTheta, cosTheta2 = cosTheta*cosTheta, @@ -649,7 +649,7 @@ public: B = (a2-b2) * sin2Theta; C = a2*sinTheta2 + b2*cosTheta2; F = a2*b2; - + ++stats::clampedAnisotropy; } stats::clampedAnisotropy.incrementBase(); @@ -731,7 +731,7 @@ protected: /* Convert to fractional pixel coordinates on the specified level */ const Vector2i &size = m_pyramid[level].getSize(); - Float u = uv.x * size.x - 0.5f; + Float u = uv.x * size.x - 0.5f; Float v = uv.y * size.y - 0.5f; /* Do the same to the ellipse coefficients */ @@ -806,7 +806,7 @@ private: }; template - Class *TMIPMap::m_theClass + Class *TMIPMap::m_theClass = new Class("MIPMap", false, "Object"); template diff --git a/include/mitsuba/render/noise.h b/include/mitsuba/render/noise.h index 7377c84d..224bc6fa 100644 --- a/include/mitsuba/render/noise.h +++ b/include/mitsuba/render/noise.h @@ -42,33 +42,33 @@ public: * \brief Evaluate a fractional Brownian noise function * based on \ref perlinNoise() at \a p. * - * \param dpdx Differential of p with respect to + * \param dpdx Differential of p with respect to * the next horizontal pixel in screen-space. - * \param dpdy Differential of p with respect to + * \param dpdy Differential of p with respect to * the next vertical pixel in screen-space. * \param omega Controls the falloff weights applied * to higher-frequency octaves * \param maxOctaves Max. number of octaves used * in the noise computation */ - static Float fbm(const Point &p, const Vector &dpdx, + static Float fbm(const Point &p, const Vector &dpdx, const Vector &dpdy, Float omega, int maxOctaves); /** * \brief Similar to \ref fbm, but adds first-derivative - * discontinuities, causing the resulting function to have + * discontinuities, causing the resulting function to have * infinite frequency content. * - * \param dpdx Differential of p with respect to + * \param dpdx Differential of p with respect to * the next horizontal pixel in screen-space. - * \param dpdy Differential of p with respect to + * \param dpdy Differential of p with respect to * the next vertical pixel in screen-space. * \param omega Controls the falloff weights applied * to higher-frequency octaves * \param maxOctaves Max. number of octaves used * in the noise computation */ - static Float turbulence(const Point &p, const Vector &dpdx, + static Float turbulence(const Point &p, const Vector &dpdx, const Vector &dpdy, Float omega, int maxOctaves); }; diff --git a/include/mitsuba/render/particleproc.h b/include/mitsuba/render/particleproc.h index 6b3b410b..5786cd0b 100644 --- a/include/mitsuba/render/particleproc.h +++ b/include/mitsuba/render/particleproc.h @@ -30,7 +30,7 @@ MTS_NAMESPACE_BEGIN * This class implements a particle tracer similar to what is * described in appendix 4.A of Eric Veach's PhD thesis. Particles * are emitted from the light source and subsequently perform a random - * walk that includes both surface and medium scattering events. The + * walk that includes both surface and medium scattering events. The * work is spread out over multiple cores/machines. For every such * event,a custom routine is invoked. * @@ -48,10 +48,10 @@ public: enum EMode { /** * \brief Trace a fixed number of \a particles - * + * * In this mode, a specified number of particles will be emitted, and * a customizable action is performed for every scattering event. - * Note that the number of resulting \a events will generally be + * Note that the number of resulting \a events will generally be * different from the number of traced \a particles. * * This mode is used for instance by the \c ptracer plugin. @@ -65,7 +65,7 @@ public: * unknown ahead of time. Instead, the implementation traces * particles until a a certain number of scattering events * have been recorded. - * + * * This mode is used to create photon maps. See * \ref GatherPhotonProcess for an implementation. */ @@ -77,7 +77,7 @@ public: // ============================================================= virtual EStatus generateWork(WorkUnit *unit, int worker); - + //! @} // ============================================================= @@ -85,7 +85,7 @@ public: protected: /** - * Create a new particle process + * Create a new particle process * * \param mode * Particle tracing mode - see above @@ -133,7 +133,7 @@ public: virtual ref createWorkUnit() const; virtual void prepare(); - virtual void process(const WorkUnit *workUnit, WorkResult *workResult, + virtual void process(const WorkUnit *workUnit, WorkResult *workResult, const bool &stop); void serialize(Stream *stream, InstanceManager *manager) const; @@ -176,10 +176,10 @@ public: * To be overridden in a subclass. The default implementation * does nothing * - * \param depth + * \param depth * Depth of the interaction in path space (with 1 - * corresponding to the first bounce) - * \param delta + * corresponding to the first bounce) + * \param delta * Denotes if the previous scattering event was a degenerate * specular reflection or refraction. * \param its @@ -202,10 +202,10 @@ public: * To be overridden in a subclass. The default implementation * does nothing * - * \param depth + * \param depth * Depth of the interaction in path space (with 1 - * corresponding to the first bounce) - * \param delta + * corresponding to the first bounce) + * \param delta * Denotes if the previous scattering event was a degenerate * specular reflection or refraction. * \param mRec diff --git a/include/mitsuba/render/phase.h b/include/mitsuba/render/phase.h index 732a1606..93ae478c 100644 --- a/include/mitsuba/render/phase.h +++ b/include/mitsuba/render/phase.h @@ -26,14 +26,14 @@ MTS_NAMESPACE_BEGIN /** - * \brief Data structure, which contains information - * required to sample or query a phase function. + * \brief Data structure, which contains information + * required to sample or query a phase function. * * \ingroup librender */ struct MTS_EXPORT_RENDER PhaseFunctionSamplingRecord { /** - * \brief Reference to a Medium sampling record created + * \brief Reference to a Medium sampling record created * by \ref Medium::sampleDistance() */ const MediumSamplingRecord &mRec; @@ -43,7 +43,7 @@ struct MTS_EXPORT_RENDER PhaseFunctionSamplingRecord { * from the scattering event. * * In Mitsuba, the direction convention for phase functions is the - * same as for BSDFs, as opposed to much of the literature, where + * same as for BSDFs, as opposed to much of the literature, where * \c wi points inwards. */ Vector wi; @@ -51,19 +51,19 @@ struct MTS_EXPORT_RENDER PhaseFunctionSamplingRecord { /// Normalized outgoing direction vector Vector wo; - /* Transported mode (radiance or importance) -- required for + /* Transported mode (radiance or importance) -- required for rendering with non-reciprocal phase functions */ ETransportMode mode; /** - * \brief Given a medium interaction and an incident direction, - * construct a query record which can be used to sample an outgoing + * \brief Given a medium interaction and an incident direction, + * construct a query record which can be used to sample an outgoing * direction. * * \param mRec * An reference to the underlying medium sampling record * \param wi - * An incident direction in world coordinates. This should + * An incident direction in world coordinates. This should * be a normalized direction vector that points \a away from * the scattering event. * \param mode @@ -75,18 +75,18 @@ struct MTS_EXPORT_RENDER PhaseFunctionSamplingRecord { : mRec(mRec), wi(wi), mode(mode) { } /* - * \brief Given a medium interaction an an incident/exitant direction + * \brief Given a medium interaction an an incident/exitant direction * pair (wi, wo), create a query record to evaluate the phase function * or its sampling density. * * \param mRec * An reference to the underlying medium sampling record * \param wi - * An incident direction in world coordinates. This should + * An incident direction in world coordinates. This should * be a normalized direction vector that points \a away from * the scattering event. * \param wo - * An outgoing direction in world coordinates. This should + * An outgoing direction in world coordinates. This should * be a normalized direction vector that points \a away from * the scattering event. * \param mode @@ -99,7 +99,7 @@ struct MTS_EXPORT_RENDER PhaseFunctionSamplingRecord { /** * \brief Reverse the direction of light transport in the record * - * This function essentially swaps \c wi and \c wo and adjusts + * This function essentially swaps \c wi and \c wo and adjusts * \c mode appropriately, so that non-symmetric scattering * models can be queried in the reverse direction. */ @@ -140,38 +140,38 @@ public: virtual void configure(); /** - * \brief Evaluate the phase function for an outward-pointing + * \brief Evaluate the phase function for an outward-pointing * pair of directions (wi, wo) */ virtual Float eval(const PhaseFunctionSamplingRecord &pRec) const = 0; /** * \brief Sample the phase function and return the importance weight (i.e. the - * value of the phase function divided by the probability density of the sample). + * value of the phase function divided by the probability density of the sample). * * When the probability density is not explicitly required, this function * should be preferred, since it is potentially faster by making use of * cancellations during the division. - * + * * \param pRec A phase function query record * \param sampler A sample generator * - * \return The phase function value divided by the probability + * \return The phase function value divided by the probability * density of the sample */ - virtual Float sample(PhaseFunctionSamplingRecord &pRec, + virtual Float sample(PhaseFunctionSamplingRecord &pRec, Sampler *sampler) const = 0; /** * \brief Sample the phase function and return the probability density \a and the - * importance weight of the sample (i.e. the value of the phase function divided + * importance weight of the sample (i.e. the value of the phase function divided * by the probability density) * * \param pRec A phase function query record * \param sampler A sample generator * \param pdf Will record the probability with respect to solid angles * - * \return The phase function value divided by the probability + * \return The phase function value divided by the probability * density of the sample */ virtual Float sample(PhaseFunctionSamplingRecord &pRec, @@ -180,7 +180,7 @@ public: /** * \brief Calculate the probability of sampling wo (given wi). * - * Assuming that the phase function can be sampled exactly, + * Assuming that the phase function can be sampled exactly, * the default implementation just evaluates \ref eval() */ virtual Float pdf(const PhaseFunctionSamplingRecord &pRec) const; @@ -207,7 +207,7 @@ public: virtual Float sigmaDir(Float cosTheta) const; /** - * \brief Returns the maximum value take on on by \ref sigmaDirMax(). + * \brief Returns the maximum value take on on by \ref sigmaDirMax(). * This is useful when implementing Woodcock tracking. */ virtual Float sigmaDirMax() const; diff --git a/include/mitsuba/render/photon.h b/include/mitsuba/render/photon.h index 61755def..54184ef1 100644 --- a/include/mitsuba/render/photon.h +++ b/include/mitsuba/render/photon.h @@ -27,7 +27,7 @@ * \brief Should Mitsuba use a left-balanced photon map? * * This saves some memory, but at a noticeable cost in query - * performance. The default is to build an unbalanced + * performance. The default is to build an unbalanced * photon map using the sliding midpoint rule. */ #define MTS_PHOTONMAP_LEFT_BALANCED 0 @@ -54,7 +54,7 @@ struct PhotonData { * \ingroup librender * \sa PhotonMap */ -struct MTS_EXPORT_RENDER Photon : +struct MTS_EXPORT_RENDER Photon : #if MTS_PHOTONMAP_LEFT_BALANCED == 1 public LeftBalancedKDNode { #else @@ -65,11 +65,11 @@ public: /// Dummy constructor inline Photon() { } - /// Construct from a photon interaction + /// Construct from a photon interaction Photon(const Point &pos, const Normal &normal, const Vector &dir, const Spectrum &power, uint16_t depth); - + /// Unserialize from a binary data stream Photon(Stream *stream); @@ -83,7 +83,7 @@ public: /** * Convert the photon direction from quantized spherical coordinates - * to a floating point vector value. Precomputation idea based on + * to a floating point vector value. Precomputation idea based on * Jensen's implementation. */ inline Vector getDirection() const { diff --git a/include/mitsuba/render/photonmap.h b/include/mitsuba/render/photonmap.h index 8a01fcca..bbe40394 100644 --- a/include/mitsuba/render/photonmap.h +++ b/include/mitsuba/render/photonmap.h @@ -26,8 +26,8 @@ MTS_NAMESPACE_BEGIN /** \brief Implementation of the photon map data structure * - * Based on Henrik Wann Jensen's book "Realistic Image Synthesis - * Using Photon Mapping". + * Based on Henrik Wann Jensen's book "Realistic Image Synthesis + * Using Photon Mapping". * * \ingroup librender */ @@ -42,7 +42,7 @@ public: /* ===================================================================== */ /** - * \brief Create an empty photon map and reserve memory + * \brief Create an empty photon map and reserve memory * for a specified number of photons. */ PhotonMap(size_t photonCount = 0); @@ -80,7 +80,7 @@ public: /** * \brief Estimate the irradiance at a given surface position - * + * * Uses a Simpson filter to smooth the data. * * \param p @@ -96,13 +96,13 @@ public: * How many photon should (at most) be used in the estimate? */ Spectrum estimateIrradiance( - const Point &p, const Normal &n, + const Point &p, const Normal &n, Float searchRadius, int maxDepth, size_t maxPhotons) const; /** * \brief Estimate the radiance received from an intersected surface - * + * * Uses a Simpson filter to smooth the data. * * \param p @@ -119,12 +119,12 @@ public: /** * \brief Compute scattered contributions from all photons within - * the specified radius. + * the specified radius. * - * Does no weighting/filtering/dynamic search radius reduction - * and simply sums over all photons. Only considers photons with - * a depth value less than or equal to the \c maxDepth parameter. - * This function is meant to be used with progressive photon mapping. + * Does no weighting/filtering/dynamic search radius reduction + * and simply sums over all photons. Only considers photons with + * a depth value less than or equal to the \c maxDepth parameter. + * This function is meant to be used with progressive photon mapping. */ size_t estimateRadianceRaw(const Intersection &its, Float searchRadius, Spectrum &result, int maxDepth) const; @@ -136,7 +136,7 @@ public: } /// Perform a nearest-neighbor query, see \ref PointKDTree for details - inline size_t nnSearch(const Point &p, + inline size_t nnSearch(const Point &p, size_t k, SearchResult *results) const { return m_kdtree.nnSearch(p, k, results); } @@ -165,9 +165,9 @@ public: inline Float getScaleFactor() const { return m_scale; } /** - * \brief Build a photon map over the supplied photons. + * \brief Build a photon map over the supplied photons. * - * This has to be done once after all photons have been stored, + * This has to be done once after all photons have been stored, * but prior to executing any queries. */ inline void build(bool recomputeAABB = false) { m_kdtree.build(recomputeAABB); } diff --git a/include/mitsuba/render/range.h b/include/mitsuba/render/range.h index 5ff8e8b7..d023c1bc 100644 --- a/include/mitsuba/render/range.h +++ b/include/mitsuba/render/range.h @@ -26,7 +26,7 @@ MTS_NAMESPACE_BEGIN /** * \brief A work unit specifying a range of some quantity to be processed. - * + * * An example usage is in \ref ParticleProcess, where this class specifies * sequences of particles to be traced. * @@ -39,7 +39,7 @@ public: m_rangeStart = other->m_rangeStart; m_rangeEnd = other->m_rangeEnd; } - + inline void load(Stream *stream) { m_rangeStart = stream->readSize(); m_rangeEnd = stream->readSize(); diff --git a/include/mitsuba/render/records.inl b/include/mitsuba/render/records.inl index eee1b86f..b6ee2894 100644 --- a/include/mitsuba/render/records.inl +++ b/include/mitsuba/render/records.inl @@ -20,7 +20,7 @@ #define __RECORDS_INLINE_H MTS_NAMESPACE_BEGIN - + inline BSDFSamplingRecord::BSDFSamplingRecord(const Intersection &its, Sampler *sampler, ETransportMode mode) : its(its), sampler(sampler), wi(its.wi), mode(mode), typeMask(BSDF::EAll), component(-1), sampledType(0), sampledComponent(-1) { @@ -30,8 +30,8 @@ inline BSDFSamplingRecord::BSDFSamplingRecord(const Intersection &its, const Vec : its(its), sampler(NULL), wi(its.wi), wo(wo), mode(mode), typeMask(BSDF::EAll), component(-1), sampledType(0), sampledComponent(-1) { } - -inline BSDFSamplingRecord::BSDFSamplingRecord(const Intersection &its, const Vector &wi, const Vector &wo, ETransportMode mode) + +inline BSDFSamplingRecord::BSDFSamplingRecord(const Intersection &its, const Vector &wi, const Vector &wo, ETransportMode mode) : its(its), sampler(NULL), wi(wi), wo(wo), mode(mode), typeMask(BSDF::EAll), component(-1), sampledType(0), sampledComponent(-1) { } @@ -57,7 +57,7 @@ inline Spectrum Intersection::Le(const Vector &d) const { return shape->getEmitter()->eval(*this, d); } -inline Spectrum Intersection::LoSub(const Scene *scene, +inline Spectrum Intersection::LoSub(const Scene *scene, Sampler *sampler, const Vector &d, int depth) const { return shape->getSubsurface()->Lo(scene, sampler, *this, d, depth); } @@ -84,14 +84,14 @@ inline const Medium *Intersection::getTargetMedium(const Vector &d) const { else return shape->getInteriorMedium(); } - + inline const Medium *Intersection::getTargetMedium(Float cosTheta) const { if (cosTheta > 0) return shape->getExteriorMedium(); else return shape->getInteriorMedium(); } - + inline const PhaseFunction *MediumSamplingRecord::getPhaseFunction() const { return medium->getPhaseFunction(); } @@ -129,13 +129,13 @@ inline PositionSamplingRecord::PositionSamplingRecord(const Intersection &its, E inline DirectionSamplingRecord::DirectionSamplingRecord(const Intersection &its, EMeasure measure) : d(its.toWorld(its.wi)), measure(measure) { } -inline DirectSamplingRecord::DirectSamplingRecord(const Intersection &refIts) +inline DirectSamplingRecord::DirectSamplingRecord(const Intersection &refIts) : PositionSamplingRecord(refIts.time), ref(refIts.p), refN(0.0f) { if ((refIts.shape->getBSDF()->getType() & BSDF::ETransmission) == 0) refN = refIts.shFrame.n; } -inline DirectSamplingRecord::DirectSamplingRecord(const MediumSamplingRecord &refM) +inline DirectSamplingRecord::DirectSamplingRecord(const MediumSamplingRecord &refM) : PositionSamplingRecord(refM.time), ref(refM.p), refN(0.0f) { } diff --git a/include/mitsuba/render/renderjob.h b/include/mitsuba/render/renderjob.h index ca00f51a..ba870552 100644 --- a/include/mitsuba/render/renderjob.h +++ b/include/mitsuba/render/renderjob.h @@ -26,9 +26,9 @@ MTS_NAMESPACE_BEGIN /** - * \brief Coordinates the process of rendering a single image. + * \brief Coordinates the process of rendering a single image. * - * Implemented as a thread so that multiple jobs can + * Implemented as a thread so that multiple jobs can * be executed concurrently. * * \ingroup librender @@ -37,12 +37,12 @@ MTS_NAMESPACE_BEGIN class MTS_EXPORT_RENDER RenderJob : public Thread { public: /** - * \brief Create a new render job for the given scene. + * \brief Create a new render job for the given scene. * * When the Resource ID parameters (\c sceneResID, \c sensorResID, ..) are * set to \c -1, the implementation will automatically register the - * associated objects (scene, sensor, sampler) with the scheduler and - * forward copies to all involved network rendering workers. When some + * associated objects (scene, sensor, sampler) with the scheduler and + * forward copies to all involved network rendering workers. When some * of these resources have already been registered with * the scheduler, their IDs can be provided to avoid this extra * communication cost. @@ -60,13 +60,13 @@ public: * \param samplerResID * Resource ID of the sample generator (or \c -1) * \param threadIsCritical - * When set to \c true, the entire program will terminate + * When set to \c true, the entire program will terminate * if this thread fails unexpectedly. * \param interactive * Are partial results of the rendering process visible, e.g. in * a graphical user interface? */ - RenderJob(const std::string &threadName, + RenderJob(const std::string &threadName, Scene *scene, RenderQueue *queue, int sceneResID = -1, int sensorResID = -1, diff --git a/include/mitsuba/render/renderproc.h b/include/mitsuba/render/renderproc.h index 272ca134..7b19f21b 100644 --- a/include/mitsuba/render/renderproc.h +++ b/include/mitsuba/render/renderproc.h @@ -37,7 +37,7 @@ MTS_NAMESPACE_BEGIN */ class MTS_EXPORT_RENDER BlockedRenderProcess : public BlockedImageProcess { public: - BlockedRenderProcess(const RenderJob *parent, RenderQueue *queue, + BlockedRenderProcess(const RenderJob *parent, RenderQueue *queue, int blockSize); // ====================================================================== @@ -48,7 +48,7 @@ public: void processResult(const WorkResult *result, bool cancelled); void bindResource(const std::string &name, int id); EStatus generateWork(WorkUnit *unit, int worker); - + //! @} // ====================================================================== diff --git a/include/mitsuba/render/renderqueue.h b/include/mitsuba/render/renderqueue.h index 6a225f56..3a9944a5 100644 --- a/include/mitsuba/render/renderqueue.h +++ b/include/mitsuba/render/renderqueue.h @@ -25,8 +25,8 @@ MTS_NAMESPACE_BEGIN -/** - * \brief Abstract render listener - can be used to react to +/** + * \brief Abstract render listener - can be used to react to * progress messages (e.g. in a GUI) * \ingroup librender */ @@ -34,10 +34,10 @@ class MTS_EXPORT_RENDER RenderListener : public Object { public: /// Called when work has begun in a rectangular image region virtual void workBeginEvent(const RenderJob *job, const RectangularWorkUnit *wu, int worker) = 0; - + /// Called when work has finished in a rectangular image region virtual void workEndEvent(const RenderJob *job, const ImageBlock *wr) = 0; - + /// Called when work has been canceled in a rectangular image region virtual void workCanceledEvent(const RenderJob *job, const Point2i &offset, const Vector2i &size) = 0; @@ -53,7 +53,7 @@ protected: virtual ~RenderListener() { } }; -/** +/** * \brief Render queue - used to keep track of a number of scenes * that are simultaneously being rendered. * @@ -82,7 +82,7 @@ public: /// Unregister a render listener void unregisterListener(RenderListener *listener); - /** + /** * Wait until the queue contains a certain number * of scenes (or less). */ diff --git a/include/mitsuba/render/sahkdtree2.h b/include/mitsuba/render/sahkdtree2.h index fb670269..b7b1267f 100644 --- a/include/mitsuba/render/sahkdtree2.h +++ b/include/mitsuba/render/sahkdtree2.h @@ -34,7 +34,7 @@ MTS_NAMESPACE_BEGIN class SurfaceAreaHeuristic2 { public: /** - * \brief Initialize the surface area heuristic with the bounds of + * \brief Initialize the surface area heuristic with the bounds of * a parent node * * Precomputes some information so that traversal probabilities @@ -49,7 +49,7 @@ public: * Given a split on axis \a axis that produces children having extents * \a leftWidth and \a rightWidth along \a axis, compute the probability * of traversing the left and right child during a typical query - * operation. + * operation. */ inline std::pair operator()(int axis, Float leftWidth, Float rightWidth) const { return std::pair( @@ -71,25 +71,25 @@ private: /** * \brief Specializes \ref GenericKDTree to a two-dimensional - * tree to be used for flatland ray tracing. + * tree to be used for flatland ray tracing. * * One additional function call must be implemented by subclasses: * \code - * /// Check whether a primitive is intersected by the given ray. - * /// Some temporary space is supplied, which can be used to cache + * /// Check whether a primitive is intersected by the given ray. + * /// Some temporary space is supplied, which can be used to cache * /// information about the intersection - * bool intersect(const Ray2 &ray, IndexType idx, + * bool intersect(const Ray2 &ray, IndexType idx, * Float mint, Float maxt, Float &t, void *tmp); * \endcode * - * This class implements an epsilon-free version of the optimized ray - * traversal algorithm (TA^B_{rec}), which is explained in Vlastimil - * Havran's PhD thesis "Heuristic Ray Shooting Algorithms". + * This class implements an epsilon-free version of the optimized ray + * traversal algorithm (TA^B_{rec}), which is explained in Vlastimil + * Havran's PhD thesis "Heuristic Ray Shooting Algorithms". * * \author Wenzel Jakob * \ingroup librender */ -template +template class SAHKDTree2D : public GenericKDTree { public: typedef GenericKDTree Parent; @@ -142,21 +142,21 @@ protected: * This is generally the most robust and fastest traversal routine * of the methods implemented in this class. */ - FINLINE bool rayIntersectHavran(const Ray2 &ray, Float mint, Float maxt, + FINLINE bool rayIntersectHavran(const Ray2 &ray, Float mint, Float maxt, Float &t, void *temp) const { KDStackEntryHavran stack[MTS_KD_MAXDEPTH]; - + /* Set up the entry point */ uint32_t enPt = 0; stack[enPt].t = mint; stack[enPt].p = ray(mint); - + /* Set up the exit point */ uint32_t exPt = 1; stack[exPt].t = maxt; stack[exPt].p = ray(maxt); stack[exPt].node = NULL; - + bool foundIntersection = false; const KDNode * __restrict currNode = m_nodes; while (currNode != NULL) { @@ -164,14 +164,14 @@ protected: const Float splitVal = (Float) currNode->getSplit(); const int axis = currNode->getAxis(); const KDNode * __restrict farChild; - + if (stack[enPt].p[axis] <= splitVal) { if (stack[exPt].p[axis] <= splitVal) { /* Cases N1, N2, N3, P5, Z2 and Z3 (see thesis) */ currNode = currNode->getLeft(); continue; } - + /* Typo in Havran's thesis: (it specifies "stack[exPt].p == splitVal", which is clearly incorrect) */ @@ -180,7 +180,7 @@ protected: currNode = currNode->getRight(); continue; } - + /* Case N4 */ currNode = currNode->getLeft(); farChild = currNode + 1; // getRight() @@ -194,48 +194,48 @@ protected: farChild = currNode->getLeft(); currNode = farChild + 1; // getRight() } - + /* Cases P4 and N4 -- calculate the distance to the split plane */ Float distToSplit = (splitVal - ray.o[axis]) * ray.dRcp[axis]; - + /* Set up a new exit point */ const uint32_t tmp = exPt++; if (exPt == enPt) /* Do not overwrite the entry point */ ++exPt; - + KDAssert(exPt < MTS_KD_MAXDEPTH); stack[exPt].prev = tmp; stack[exPt].t = distToSplit; stack[exPt].node = farChild; - - /* Intrestingly, this appears to be faster than the + + /* Intrestingly, this appears to be faster than the original code with the prevAxis & nextAxis table */ stack[exPt].p = ray(distToSplit); stack[exPt].p[axis] = splitVal; } - + /* Reached a leaf node */ for (IndexType entry=currNode->getPrimStart(), last = currNode->getPrimEnd(); entry != last; entry++) { const IndexType primIdx = m_indices[entry]; - + bool result = cast()->intersect(ray, primIdx, mint, maxt, t, temp); - + if (result) { maxt = t; foundIntersection = true; } } - - if (stack[exPt].t > maxt) + + if (stack[exPt].t > maxt) break; - + /* Pop from the stack and advance to the next node on the interval */ enPt = exPt; currNode = stack[exPt].node; exPt = stack[enPt].prev; } - + return foundIntersection; } }; diff --git a/include/mitsuba/render/sahkdtree3.h b/include/mitsuba/render/sahkdtree3.h index 8cb402e0..9db4338d 100644 --- a/include/mitsuba/render/sahkdtree3.h +++ b/include/mitsuba/render/sahkdtree3.h @@ -39,7 +39,7 @@ MTS_NAMESPACE_BEGIN class SurfaceAreaHeuristic3 { public: /** - * \brief Initialize the surface area heuristic with the bounds of + * \brief Initialize the surface area heuristic with the bounds of * a parent node * * Precomputes some information so that traversal probabilities @@ -47,7 +47,7 @@ public: */ inline SurfaceAreaHeuristic3(const AABB &aabb) { const Vector extents(aabb.getExtents()); - const Float temp = 1.0f / (extents.x * extents.y + const Float temp = 1.0f / (extents.x * extents.y + extents.y*extents.z + extents.x*extents.z); m_temp0 = Vector( extents[1] * extents[2], @@ -63,7 +63,7 @@ public: * Given a split on axis \a axis that produces children having extents * \a leftWidth and \a rightWidth along \a axis, compute the probability * of traversing the left and right child during a typical query - * operation. + * operation. */ inline std::pair operator()(int axis, Float leftWidth, Float rightWidth) const { return std::pair( @@ -84,25 +84,25 @@ private: /** * \brief Specializes \ref GenericKDTree to a three-dimensional - * tree to be used for ray tracing. + * tree to be used for ray tracing. * * One additional function call must be implemented by subclasses: * \code - * /// Check whether a primitive is intersected by the given ray. - * /// Some temporary space is supplied, which can be used to cache + * /// Check whether a primitive is intersected by the given ray. + * /// Some temporary space is supplied, which can be used to cache * /// information about the intersection - * bool intersect(const Ray &ray, IndexType idx, + * bool intersect(const Ray &ray, IndexType idx, * Float mint, Float maxt, Float &t, void *tmp); * \endcode * - * This class implements an epsilon-free version of the optimized ray - * traversal algorithm (TA^B_{rec}), which is explained in Vlastimil - * Havran's PhD thesis "Heuristic Ray Shooting Algorithms". + * This class implements an epsilon-free version of the optimized ray + * traversal algorithm (TA^B_{rec}), which is explained in Vlastimil + * Havran's PhD thesis "Heuristic Ray Shooting Algorithms". * * \author Wenzel Jakob * \ingroup librender */ -template +template class SAHKDTree3D : public GenericKDTree { public: typedef GenericKDTree Parent; @@ -175,29 +175,29 @@ protected: * of the methods implemented in this class. */ template FINLINE - bool rayIntersectHavran(const Ray &ray, Float mint, Float maxt, + bool rayIntersectHavran(const Ray &ray, Float mint, Float maxt, Float &t, void *temp) const { KDStackEntryHavran stack[MTS_KD_MAXDEPTH]; #if 0 static const int prevAxisTable[] = { 2, 0, 1 }; static const int nextAxisTable[] = { 1, 2, 0 }; #endif - + #if defined(MTS_KD_MAILBOX_ENABLED) HashedMailbox mailbox; #endif - + /* Set up the entry point */ uint32_t enPt = 0; stack[enPt].t = mint; stack[enPt].p = ray(mint); - + /* Set up the exit point */ uint32_t exPt = 1; stack[exPt].t = maxt; stack[exPt].p = ray(maxt); stack[exPt].node = NULL; - + bool foundIntersection = false; const KDNode * __restrict currNode = m_nodes; while (currNode != NULL) { @@ -205,14 +205,14 @@ protected: const Float splitVal = (Float) currNode->getSplit(); const int axis = currNode->getAxis(); const KDNode * __restrict farChild; - + if (stack[enPt].p[axis] <= splitVal) { if (stack[exPt].p[axis] <= splitVal) { /* Cases N1, N2, N3, P5, Z2 and Z3 (see thesis) */ currNode = currNode->getLeft(); continue; } - + /* Typo in Havran's thesis: (it specifies "stack[exPt].p == splitVal", which is clearly incorrect) */ @@ -221,7 +221,7 @@ protected: currNode = currNode->getRight(); continue; } - + /* Case N4 */ currNode = currNode->getLeft(); farChild = currNode + 1; // getRight() @@ -235,22 +235,22 @@ protected: farChild = currNode->getLeft(); currNode = farChild + 1; // getRight() } - + /* Cases P4 and N4 -- calculate the distance to the split plane */ Float distToSplit = (splitVal - ray.o[axis]) * ray.dRcp[axis]; - + /* Set up a new exit point */ const uint32_t tmp = exPt++; if (exPt == enPt) /* Do not overwrite the entry point */ ++exPt; - + KDAssert(exPt < MTS_KD_MAXDEPTH); stack[exPt].prev = tmp; stack[exPt].t = distToSplit; stack[exPt].node = farChild; - + #if 1 - /* Intrestingly, this appears to be faster than the + /* Intrestingly, this appears to be faster than the original code with the prevAxis & nextAxis table */ stack[exPt].p = ray(distToSplit); stack[exPt].p[axis] = splitVal; @@ -263,46 +263,46 @@ protected: stack[exPt].p[prevAxis] = ray.o[prevAxis] + distToSplit*ray.d[prevAxis]; #endif - + } - + /* Reached a leaf node */ for (IndexType entry=currNode->getPrimStart(), last = currNode->getPrimEnd(); entry != last; entry++) { const IndexType primIdx = m_indices[entry]; - + #if defined(MTS_KD_MAILBOX_ENABLED) - if (mailbox.contains(primIdx)) + if (mailbox.contains(primIdx)) continue; #endif - + bool result; if (!shadowRay) result = cast()->intersect(ray, primIdx, mint, maxt, t, temp); else result = cast()->intersect(ray, primIdx, mint, maxt); - + if (result) { if (shadowRay) return true; maxt = t; foundIntersection = true; } - + #if defined(MTS_KD_MAILBOX_ENABLED) mailbox.put(primIdx); #endif } - - if (stack[exPt].t > maxt) + + if (stack[exPt].t > maxt) break; - + /* Pop from the stack and advance to the next node on the interval */ enPt = exPt; currNode = stack[exPt].node; exPt = stack[enPt].prev; } - + return foundIntersection; } @@ -313,7 +313,7 @@ protected: uint64_t time; RayStatistics(bool foundIntersection, uint32_t numTraversals, - uint32_t numIntersections, uint64_t time) : + uint32_t numIntersections, uint64_t time) : foundIntersection(foundIntersection), numTraversals(numTraversals), numIntersections(numIntersections), time(time) { } }; @@ -329,30 +329,30 @@ protected: FINLINE RayStatistics rayIntersectHavranCollectStatistics( const Ray &ray, Float mint, Float maxt, Float &t, void *temp) const { KDStackEntryHavran stack[MTS_KD_MAXDEPTH]; - + /* Set up the entry point */ uint32_t enPt = 0; stack[enPt].t = mint; stack[enPt].p = ray(mint); - + /* Set up the exit point */ uint32_t exPt = 1; stack[exPt].t = maxt; stack[exPt].p = ray(maxt); stack[exPt].node = NULL; - + uint32_t numTraversals = 0; uint32_t numIntersections = 0; uint64_t timer = rdtsc(); bool foundIntersection = false; - + const KDNode * __restrict currNode = m_nodes; while (currNode != NULL) { while (EXPECT_TAKEN(!currNode->isLeaf())) { const Float splitVal = (Float) currNode->getSplit(); const int axis = currNode->getAxis(); const KDNode * __restrict farChild; - + ++numTraversals; if (stack[enPt].p[axis] <= splitVal) { if (stack[exPt].p[axis] <= splitVal) { @@ -360,7 +360,7 @@ protected: currNode = currNode->getLeft(); continue; } - + /* Typo in Havran's thesis: (it specifies "stack[exPt].p == splitVal", which is clearly incorrect) */ @@ -369,7 +369,7 @@ protected: currNode = currNode->getRight(); continue; } - + /* Case N4 */ currNode = currNode->getLeft(); farChild = currNode + 1; // getRight() @@ -383,15 +383,15 @@ protected: farChild = currNode->getLeft(); currNode = farChild + 1; // getRight() } - + /* Cases P4 and N4 -- calculate the distance to the split plane */ t = (splitVal - ray.o[axis]) * ray.dRcp[axis]; - + /* Set up a new exit point */ const uint32_t tmp = exPt++; if (exPt == enPt) /* Do not overwrite the entry point */ ++exPt; - + KDAssert(exPt < MTS_KD_MAXDEPTH); stack[exPt].prev = tmp; stack[exPt].t = t; @@ -399,61 +399,61 @@ protected: stack[exPt].p = ray(t); stack[exPt].p[axis] = splitVal; } - + /* Reached a leaf node */ for (unsigned int entry=currNode->getPrimStart(), last = currNode->getPrimEnd(); entry != last; entry++) { const IndexType primIdx = m_indices[entry]; - + ++numIntersections; bool result = cast()->intersect(ray, primIdx, mint, maxt, t, temp); - + if (result) { maxt = t; foundIntersection = true; } } - - if (stack[exPt].t > maxt) + + if (stack[exPt].t > maxt) break; - + /* Pop from the stack and advance to the next node on the interval */ enPt = exPt; currNode = stack[exPt].node; exPt = stack[enPt].prev; } - - return RayStatistics(foundIntersection, numTraversals, + + return RayStatistics(foundIntersection, numTraversals, numIntersections, rdtsc() - timer); } /** * \brief Ray tracing kd-tree traversal loop (PBRT variant) */ - template FINLINE bool rayIntersectPBRT(const Ray &ray, + template FINLINE bool rayIntersectPBRT(const Ray &ray, Float mint_, Float maxt_, Float &t, void *temp) const { KDStackEntry stack[MTS_KD_MAXDEPTH]; int stackPos = 0; Float mint = mint_, maxt=maxt_; const KDNode *node = m_nodes; bool foundIntersection = false; - + while (node != NULL) { if (maxt_ < mint) break; - + if (EXPECT_TAKEN(!node->isLeaf())) { const Float split = (Float) node->getSplit(); const int axis = node->getAxis(); const float tPlane = (split - ray.o[axis]) * ray.dRcp[axis]; bool leftOfSplit = (ray.o[axis] < split) || (ray.o[axis] == split && ray.d[axis] <= 0); - + const KDNode * __restrict left = node->getLeft(); const KDNode * __restrict right = left + 1; const KDNode * __restrict first = leftOfSplit ? left : right; const KDNode * __restrict second = leftOfSplit ? right : left; - + if (tPlane > maxt || tPlane <= 0) { node = first; } else if (tPlane < mint) { @@ -470,13 +470,13 @@ protected: for (unsigned int entry=node->getPrimStart(), last = node->getPrimEnd(); entry != last; entry++) { const IndexType primIdx = m_indices[entry]; - + bool result; if (!shadowRay) result = cast()->intersect(ray, primIdx, mint, maxt, t, temp); else result = cast()->intersect(ray, primIdx, mint, maxt); - + if (result) { if (shadowRay) return true; @@ -484,7 +484,7 @@ protected: foundIntersection = true; } } - + if (stackPos > 0) { --stackPos; node = stack[stackPos].node; @@ -499,10 +499,10 @@ protected: } public: /** - * \brief Empirically find the best traversal and intersection + * \brief Empirically find the best traversal and intersection * cost values * - * This is done by running the traversal code on random rays + * This is done by running the traversal code on random rays * and fitting the SAH cost model to the collected statistics. */ void findCosts(Float &traversalCost, Float &intersectionCost) { @@ -513,7 +513,7 @@ public: Vector *A = new Vector[nRays-warmup]; Float *b = new Float[nRays-warmup]; int nIntersections = 0, idx = 0; - + for (int i=0; inextFloat(), random->nextFloat()), sample2(random->nextFloat(), random->nextFloat()); @@ -539,27 +539,27 @@ public: } } } - - KDLog(EDebug, "Fitting to " SIZE_T_FMT " samples (" SIZE_T_FMT + + KDLog(EDebug, "Fitting to " SIZE_T_FMT " samples (" SIZE_T_FMT " intersections)", idx, nIntersections); - + /* Solve using normal equations */ Matrix4x4 M(0.0f), Minv; Vector4 rhs(0.0f), x; - + for (int i=0; i<3; ++i) { - for (int j=0; j<3; ++j) - for (int k=0; krayIntersect(ray, t, shape, n, uv); } @@ -220,7 +220,7 @@ public: * * This is by far the fastest ray tracing method. This performance * improvement comes with a major limitation though: this function - * cannot provide any additional information about the detected + * cannot provide any additional information about the detected * intersection (not even its position). * * \param ray @@ -244,13 +244,13 @@ public: * its direction (i.e. geometry with an alpha mask) * * The implementation correctly handles arbitrary amounts of index-matched - * medium transitions. The \c interactions parameter can be used to - * specify a maximum number of possible surface interactions and medium - * transitions between \c p1 and \c p2. When this number is exceeded, + * medium transitions. The \c interactions parameter can be used to + * specify a maximum number of possible surface interactions and medium + * transitions between \c p1 and \c p2. When this number is exceeded, * the function returns zero. * * Note that index-mismatched boundaries (i.e. a transition from air to - * water) are not supported by this function. The integrator needs to take + * water) are not supported by this function. The integrator needs to take * care of these in some other way. * * \param p1 @@ -261,10 +261,10 @@ public: * Is the source position located on a surface? This information is * necessary to set up the right ray epsilons for the kd-tree traversal * \param p2OnSurface - * Is the target position located on a surface? + * Is the target position located on a surface? * \param medium * The medium at \c p1 - * \param interactions + * \param interactions * Specifies the maximum permissible number of index-matched medium * transitions or \ref BSDF::ENull scattering events on the way * to the light source. (interactions<0 means arbitrarily many). @@ -280,31 +280,31 @@ public: * between zero and one. */ Spectrum evalTransmittance(const Point &p1, bool p1OnSurface, - const Point &p2, bool p2OnSurface, Float time, const Medium *medium, + const Point &p2, bool p2OnSurface, Float time, const Medium *medium, int &interactions, Sampler *sampler = NULL) const; //! @} // ============================================================= - + // ============================================================= //! @{ \name Ray tracing support for bidirectional algorithms // ============================================================= /** - * \brief Intersect a ray against all scene primitives \a and + * \brief Intersect a ray against all scene primitives \a and * "special" primitives, such as the aperture of a sensor. * * This function does exactly the same thing as \ref rayIntersect, * except that it additionally performs intersections against a * list of "special" shapes that are intentionally kept outside - * of the main scene kd-tree (e.g. because they are not static + * of the main scene kd-tree (e.g. because they are not static * and might change from rendering to rendering). This is needed - * by some bidirectional techniques that e.g. care about + * by some bidirectional techniques that e.g. care about * intersections with the sensor aperture. * * \param ray * A 3-dimensional ray data structure with minimum/maximum - * extent information, as well as a time value (which applies + * extent information, as well as a time value (which applies * when the shapes are in motion) * * \param its @@ -326,9 +326,9 @@ public: * This function does exactly the same thing as \ref rayIntersect, * except that it additionally performs intersections against a * list of "special" shapes that are intentionally kept outside - * of the main scene kd-tree (e.g. because they are not static + * of the main scene kd-tree (e.g. because they are not static * and might change from rendering to rendering). This is needed - * by some bidirectional techniques that e.g. care about + * by some bidirectional techniques that e.g. care about * intersections with the sensor aperture. * * \param ray @@ -338,7 +338,7 @@ public: * * \param t * The traveled ray distance will be stored in this parameter - + * \param shape * A pointer to the intersected shape will be stored in this * parameter @@ -352,24 +352,24 @@ public: * * \return \c true if an intersection was found */ - bool rayIntersectAll(const Ray &ray, Float &t, + bool rayIntersectAll(const Ray &ray, Float &t, ConstShapePtr &shape, Normal &n, Point2 &uv) const; /** - * \brief Intersect a ray against all normal and "special" primitives + * \brief Intersect a ray against all normal and "special" primitives * and \a only determine whether or not there is an intersection. * * This is by far the fastest ray tracing method. This performance * improvement comes with a major limitation though: this function - * cannot provide any additional information about the detected + * cannot provide any additional information about the detected * intersection (not even its position). * * This function does exactly the same thing as \ref rayIntersect, * except that it additionally performs intersections against a * list of "special" shapes that are intentionally kept outside - * of the main scene kd-tree (e.g. because they are not static + * of the main scene kd-tree (e.g. because they are not static * and might change from rendering to rendering). This is needed - * by some bidirectional techniques that e.g. care about + * by some bidirectional techniques that e.g. care about * intersections with the sensor aperture. * * \param ray @@ -391,21 +391,21 @@ public: * its direction (i.e. geometry with an alpha mask) * * The implementation correctly handles arbitrary amounts of index-matched - * medium transitions. The \c interactions parameter can be used to - * specify a maximum number of possible surface interactions and medium - * transitions between \c p1 and \c p2. When this number is exceeded, + * medium transitions. The \c interactions parameter can be used to + * specify a maximum number of possible surface interactions and medium + * transitions between \c p1 and \c p2. When this number is exceeded, * the function returns zero. * * Note that index-mismatched boundaries (i.e. a transition from air to - * water) are not supported by this function. The integrator needs to take + * water) are not supported by this function. The integrator needs to take * care of these in some other way. * * This function does exactly the same thing as \ref evalTransmittance, * except that it additionally performs intersections against a * list of "special" shapes that are intentionally kept outside - * of the main scene kd-tree (e.g. because they are not static + * of the main scene kd-tree (e.g. because they are not static * and might change from rendering to rendering). This is needed - * by some bidirectional techniques that care about intersections + * by some bidirectional techniques that care about intersections * with the sensor aperture, etc. * * \param p1 @@ -416,10 +416,10 @@ public: * Is the source position located on a surface? This information is * necessary to set up the right ray epsilons for the kd-tree traversal * \param p2OnSurface - * Is the target position located on a surface? + * Is the target position located on a surface? * \param medium * The medium at \c p1 - * \param interactions + * \param interactions * Specifies the maximum permissible number of index-matched medium * transitions or \ref BSDF::ENull scattering events on the way * to the light source. (interactions<0 means arbitrarily many). @@ -435,7 +435,7 @@ public: * between zero and one. */ Spectrum evalTransmittanceAll(const Point &p1, bool p1OnSurface, - const Point &p2, bool p2OnSurface, Float time, const Medium *medium, + const Point &p2, bool p2OnSurface, Float time, const Medium *medium, int &interactions, Sampler *sampler = NULL) const; //! @} @@ -456,7 +456,7 @@ public: * and the position on the emitter. * * \param dRec - * A direct illumination sampling record that specifies the + * A direct illumination sampling record that specifies the * reference point and a time value. After the function terminates, * it will be populated with the position sample and related information * @@ -468,10 +468,10 @@ public: * sampled emitter position and the reference point are mutually visible. * * \return - * An importance weight given by the radiance received along + * An importance weight given by the radiance received along * the sampled ray divided by the sample probability. */ - Spectrum sampleEmitterDirect(DirectSamplingRecord &dRec, + Spectrum sampleEmitterDirect(DirectSamplingRecord &dRec, const Point2 &sample, bool testVisibility = true) const; /** @@ -479,7 +479,7 @@ public: * * Given an arbitrary reference point in the scene, this method samples a * position on an sensor that has a nonzero contribution towards that point. - * This function can be interpreted as a generalization of a direct + * This function can be interpreted as a generalization of a direct * illumination sampling strategy to sensors. * * Ideally, the implementation should importance sample the product of @@ -487,7 +487,7 @@ public: * and the position on the emitter. * * \param dRec - * A direct illumination sampling record that specifies the + * A direct illumination sampling record that specifies the * reference point and a time value. After the function terminates, * it will be populated with the position sample and related information * @@ -499,10 +499,10 @@ public: * sampled sensor position and the reference point are mutually visible. * * \return - * An importance weight given by the importance emitted along + * An importance weight given by the importance emitted along * the sampled ray divided by the sample probability. */ - Spectrum sampleSensorDirect(DirectSamplingRecord &dRec, + Spectrum sampleSensorDirect(DirectSamplingRecord &dRec, const Point2 &sample, bool testVisibility = true) const; /** @@ -511,16 +511,16 @@ public: * * Given an arbitrary reference point in the scene, this method samples a * position on an emitter that has a nonzero contribution towards that point. - * In comparison to \ref sampleEmitterDirect, this version also accounts for + * In comparison to \ref sampleEmitterDirect, this version also accounts for * attenuation by participating media and should be used when \c dRec.p * lies \a inside a medium, i.e. \a not on a surface! * * Ideally, the implementation should importance sample the product of - * the emission profile and the geometry term between the reference point + * the emission profile and the geometry term between the reference point * and the position on the emitter. * * \param dRec - * A direct illumination sampling record that specifies the + * A direct illumination sampling record that specifies the * reference point and a time value. After the function terminates, * it will be populated with the position sample and related information * @@ -544,11 +544,11 @@ public: * access to additional random numbers. * * \return - * An importance weight given by the radiance received along + * An importance weight given by the radiance received along * the sampled ray divided by the sample probability. */ Spectrum sampleAttenuatedEmitterDirect(DirectSamplingRecord &dRec, - const Medium *medium, int &interactions, const Point2 &sample, + const Medium *medium, int &interactions, const Point2 &sample, Sampler *sampler = NULL) const; /** @@ -557,18 +557,18 @@ public: * * Given an arbitrary reference point in the scene, this method samples a * position on an sensor that has a nonzero response towards that point. - * In comparison to \ref sampleSensorDirect, this version also accounts for + * In comparison to \ref sampleSensorDirect, this version also accounts for * attenuation by participating media and should be used when \c dRec.p * lies \a inside a medium, i.e. \a not on a surface! - * This function can be interpreted as a generalization of a direct + * This function can be interpreted as a generalization of a direct * illumination sampling strategy to sensors. * * Ideally, the implementation should importance sample the product of - * the response profile and the geometry term between the reference point + * the response profile and the geometry term between the reference point * and the position on the sensor. * * \param dRec - * A direct illumination sampling record that specifies the + * A direct illumination sampling record that specifies the * reference point and a time value. After the function terminates, * it will be populated with the position sample and related information * @@ -592,11 +592,11 @@ public: * access to additional random numbers. * * \return - * An importance weight given by the radiance received along + * An importance weight given by the radiance received along * the sampled ray divided by the sample probability. */ Spectrum sampleAttenuatedSensorDirect(DirectSamplingRecord &dRec, - const Medium *medium, int &interactions, const Point2 &sample, + const Medium *medium, int &interactions, const Point2 &sample, Sampler *sampler = NULL) const; /** @@ -605,8 +605,8 @@ public: * * Given an arbitrary reference point in the scene, this method samples a * position on an emitter that has a nonzero contribution towards that point. - * In comparison to \ref sampleEmitterDirect, this version also accounts for - * attenuation by participating media and should be used when the target + * In comparison to \ref sampleEmitterDirect, this version also accounts for + * attenuation by participating media and should be used when the target * position lies on a surface. * * Ideally, the implementation should importance sample the product of @@ -614,19 +614,19 @@ public: * and the position on the emitter. * * \param dRec - * A direct illumination sampling record that specifies the + * A direct illumination sampling record that specifies the * reference point and a time value. After the function terminates, * it will be populated with the position sample and related information * * \param its * An intersection record associated with the reference point in - * \c dRec. This record is needed to determine the participating + * \c dRec. This record is needed to determine the participating * medium between the emitter sample and the reference point * when \c its marks a medium transition. * * \param medium * The medium located at \c its (or \c NULL for vacuum). When the shape - * associated with \c its marks a medium transition, it does not matter + * associated with \c its marks a medium transition, it does not matter * which of the two media is specified. * * \param interactions @@ -646,7 +646,7 @@ public: * access to additional random numbers. * * \return - * An importance weight given by the radiance received along + * An importance weight given by the radiance received along * the sampled ray divided by the sample probability. */ Spectrum sampleAttenuatedEmitterDirect(DirectSamplingRecord &dRec, @@ -659,8 +659,8 @@ public: * * Given an arbitrary reference point in the scene, this method samples a * position on an sensor that has a nonzero response towards that point. - * In comparison to \ref sampleSensorDirect, this version also accounts for - * attenuation by participating media and should be used when the target + * In comparison to \ref sampleSensorDirect, this version also accounts for + * attenuation by participating media and should be used when the target * position lies on a surface. * * Ideally, the implementation should importance sample the product of @@ -668,19 +668,19 @@ public: * and the position on the sensor. * * \param dRec - * A direct illumination sampling record that specifies the + * A direct illumination sampling record that specifies the * reference point and a time value. After the function terminates, * it will be populated with the position sample and related information * * \param its * An intersection record associated with the reference point in - * \c dRec. This record is needed to determine the participating + * \c dRec. This record is needed to determine the participating * medium between the sensor sample and the reference point * when \c its marks a medium transition. * * \param medium * The medium located at \c its (or \c NULL for vacuum). When the shape - * associated with \c its marks a medium transition, it does not matter + * associated with \c its marks a medium transition, it does not matter * which of the two media is specified. * * \param interactions @@ -700,11 +700,11 @@ public: * access to additional random numbers. * * \return - * An importance weight given by the radiance received along + * An importance weight given by the radiance received along * the sampled ray divided by the sample probability. */ Spectrum sampleAttenuatedSensorDirect(DirectSamplingRecord &dRec, - const Intersection &its, const Medium *medium, int &interactions, + const Intersection &its, const Medium *medium, int &interactions, const Point2 &sample, Sampler *sampler = NULL) const; /** @@ -712,15 +712,15 @@ public: * method implemented by the \ref sampleEmitterDirect() method. * * \param dRec - * A direct sampling record, which specifies the query - * location. Note that this record need not be completely + * A direct sampling record, which specifies the query + * location. Note that this record need not be completely * filled out. The important fields are \c p, \c n, \c ref, * \c dist, \c d, \c measure, and \c uv. * * \param p * The world-space position that would have been passed to \ref * sampleEmitterDirect() - * + * * \return * The density expressed with respect to the requested measure * (usually \ref ESolidAngle) @@ -732,15 +732,15 @@ public: * method implemented by the \ref sampleSensorDirect() method. * * \param dRec - * A direct sampling record, which specifies the query - * location. Note that this record need not be completely + * A direct sampling record, which specifies the query + * location. Note that this record need not be completely * filled out. The important fields are \c p, \c n, \c ref, * \c dist, \c d, \c measure, and \c uv. * * \param p * The world-space position that would have been passed to \ref * sampleSensorDirect() - * + * * \return * The density expressed with respect to the requested measure * (usually \ref ESolidAngle) @@ -755,7 +755,7 @@ public: // ============================================================= /** - * \brief Sample a position according to the emission profile + * \brief Sample a position according to the emission profile * defined by the emitters in the scene. * * To sample the directional component, please use the @@ -777,9 +777,9 @@ public: const Point2 &sample) const; /** - * \brief Sample a position on the main sensor of the scene. + * \brief Sample a position on the main sensor of the scene. * - * This function is provided here mainly for symmetry + * This function is provided here mainly for symmetry * with respect to \ref sampleEmitterPosition(). * * To sample the directional component, please use the @@ -793,7 +793,7 @@ public: * A uniformly distributed 2D vector * * \param extra - * An additional 2D vector provided to the sampling + * An additional 2D vector provided to the sampling * routine -- its use is implementation-dependent. * * \return @@ -834,7 +834,7 @@ public: } /** - * \brief Return the discrete probability of choosing a + * \brief Return the discrete probability of choosing a * certain emitter in sampleEmitter* */ inline Float pdfEmitterDiscrete(const Emitter *emitter) const { @@ -842,7 +842,7 @@ public: } /** - * \brief Sample a position according to the emission profile + * \brief Sample a position according to the emission profile * defined by the emitters in the scene. * * To sample the directional component, please use the @@ -864,19 +864,19 @@ public: * \brief Importance sample a ray according to the emission profile * defined by the sensors in the scene * - * This function combines both steps of choosing a ray origin and - * direction value. It does not return any auxiliary sampling + * This function combines both steps of choosing a ray origin and + * direction value. It does not return any auxiliary sampling * information and is mainly meant to be used by unidirectional * rendering techniques. - * - * Note that this function potentially uses a different sampling - * strategy compared to the sequence of running \ref sampleEmitterPosition() + * + * Note that this function potentially uses a different sampling + * strategy compared to the sequence of running \ref sampleEmitterPosition() * and \ref Emitter::sampleDirection(). The reason for this is that it may * be possible to switch to a better technique when sampling both * position and direction at the same time. * * \param ray - * A ray data structure to be populated with a position + * A ray data structure to be populated with a position * and direction value * * \param spatialSample @@ -901,7 +901,7 @@ public: //! @} // ============================================================= - + // ============================================================= //! @{ \name Environment emitters // ============================================================= @@ -919,7 +919,7 @@ public: * This is primarily meant for path tracing-style integrators. */ inline Spectrum evalEnvironment(const RayDifferential &ray) const { - return hasEnvironmentEmitter() ? + return hasEnvironmentEmitter() ? m_environmentEmitter->evalEnvironment(ray) : Spectrum(0.0f); } @@ -930,7 +930,7 @@ public: * * This is primarily meant for path tracing-style integrators. */ - inline Spectrum evalAttenuatedEnvironment(const RayDifferential &ray, + inline Spectrum evalAttenuatedEnvironment(const RayDifferential &ray, const Medium *medium, Sampler *sampler) const { if (!m_environmentEmitter) return Spectrum(0.0f); @@ -939,7 +939,7 @@ public: result *= medium->evalTransmittance(ray, sampler); return result; } - + //! @} // ============================================================= @@ -953,7 +953,7 @@ public: } /** - * \brief Is the main scene sensor degenerate? (i.e. has it + * \brief Is the main scene sensor degenerate? (i.e. has it * collapsed to a point or line) * * Note that this function only cares about the spatial component @@ -965,9 +965,9 @@ public: /** * \brief Area \a all emitters in this scene degenerate? * (i.e. they has collapsed to a point or line) - * + * * Note that this function only cares about the spatial component - * of the emitters -- its value does not depend on whether the + * of the emitters -- its value does not depend on whether the * directional emission profile is degenerate. */ inline bool hasDegenerateEmitters() const { return m_degenerateEmitters; } @@ -982,20 +982,20 @@ public: inline bool hasMedia() const { return !m_media.empty(); } /** - * \brief Set the main scene sensor. + * \brief Set the main scene sensor. * * Note that the main sensor is not included when this Scene instance - * is serialized -- the sensor field will be \c NULL after - * unserialization. This is intentional so that the sensor can - * be changed without having to re-transmit the whole scene. - * Hence, it needs to be submitted separately and re-attached + * is serialized -- the sensor field will be \c NULL after + * unserialization. This is intentional so that the sensor can + * be changed without having to re-transmit the whole scene. + * Hence, it needs to be submitted separately and re-attached * on the remote side using \ref setSensor(). **/ void setSensor(Sensor *sensor); /// \brief Remove a sensor from the scene's sensor list void removeSensor(Sensor *sensor); - + /// \brief Add a sensor to the scene's sensor list void addSensor(Sensor *sensor); @@ -1030,13 +1030,13 @@ public: inline const ref_vector &getSensors() const { return m_sensors; } /** - * \brief Set the scene's integrator. + * \brief Set the scene's integrator. * - * Note that the integrator is not included when this Scene instance - * is serialized -- the integrator field will be \c NULL after + * Note that the integrator is not included when this Scene instance + * is serialized -- the integrator field will be \c NULL after * unserialization. This is intentional so that the integrator can - * be changed without having to re-transmit the whole scene. Hence, - * the integrator needs to be submitted separately and re-attached + * be changed without having to re-transmit the whole scene. Hence, + * the integrator needs to be submitted separately and re-attached * on the remote side using \ref setIntegrator(). **/ inline void setIntegrator(Integrator *integrator) { m_integrator = integrator; } @@ -1047,25 +1047,25 @@ public: inline const Integrator *getIntegrator() const { return m_integrator.get(); } /** - * \brief Set the scene's sampler. + * \brief Set the scene's sampler. * - * Note that the sampler is not included when this Scene instance - * is serialized -- the sampler field will be \c NULL after - * unserialization. This is intentional so that the sampler can - * be changed without having to re-transmit the whole scene. + * Note that the sampler is not included when this Scene instance + * is serialized -- the sampler field will be \c NULL after + * unserialization. This is intentional so that the sampler can + * be changed without having to re-transmit the whole scene. * Hence, the sampler needs to be submitted separately * and re-attached on the remote side using \ref setSampler(). **/ inline void setSampler(Sampler *sampler) { m_sampler = sampler; } /** - * \brief Return the scene's sampler. + * \brief Return the scene's sampler. * - * Note that when rendering using multiple different threads, each - * thread will be passed a shallow copy of the scene, which has a - * different sampler instance. This helps to avoid locking/contention - * issues and ensures that different threads render with different - * random number sequences. The sampler instance provided here is a + * Note that when rendering using multiple different threads, each + * thread will be passed a shallow copy of the scene, which has a + * different sampler instance. This helps to avoid locking/contention + * issues and ensures that different threads render with different + * random number sequences. The sampler instance provided here is a * clone of the original sampler specified in the sensor. */ inline Sampler *getSampler() { return m_sampler; } @@ -1076,7 +1076,7 @@ public: inline Film *getFilm() { return m_sensor->getFilm(); } /// Return the scene's film inline const Film *getFilm() const { return m_sensor->getFilm(); } - + /// Return the scene's kd-tree accelerator inline ShapeKDTree *getKDTree() { return m_kdtree; } /// Return the scene's kd-tree accelerator diff --git a/include/mitsuba/render/scenehandler.h b/include/mitsuba/render/scenehandler.h index 08d6ac8d..c8a4a149 100644 --- a/include/mitsuba/render/scenehandler.h +++ b/include/mitsuba/render/scenehandler.h @@ -53,7 +53,7 @@ public: VersionException(const std::string &str, const Version &version) : std::runtime_error(str), m_version(version) { } - /* For stupid and subtle reasons when compiling with GCC, it is important + /* For stupid and subtle reasons when compiling with GCC, it is important that this class has a virtual member. This will ensure that its typeid structure is in librender, which is important for throwing exceptions across DLL boundaries */ @@ -82,19 +82,19 @@ public: typedef std::map NamedObjectMap; typedef std::map ParameterMap; - SceneHandler(const xercesc::SAXParser *parser, - const ParameterMap ¶ms, NamedObjectMap *objects = NULL, + SceneHandler(const xercesc::SAXParser *parser, + const ParameterMap ¶ms, NamedObjectMap *objects = NULL, bool isIncludedFile = false); virtual ~SceneHandler(); - /// Convenience method -- load a scene from a given filename + /// Convenience method -- load a scene from a given filename static ref loadScene(const fs::path &filename, const ParameterMap ¶ms= ParameterMap()); /// Convenience method -- load a scene from a given string static ref loadSceneFromString(const std::string &string, const ParameterMap ¶ms= ParameterMap()); - + /// Initialize Xerces-C++ (needs to be called once at program startup) static void staticInitialization(); @@ -157,10 +157,10 @@ private: EVector, ERGB, ESRGB, EBlackBody, ESpectrum, ETransform, EInclude, EAlias }; - + typedef std::pair TagEntry; typedef boost::unordered_map TagMap; - + const xercesc::SAXParser *m_parser; xercesc::XMLTranscoder* m_transcoder; ref m_scene; diff --git a/include/mitsuba/render/sensor.h b/include/mitsuba/render/sensor.h index 790d4eef..70f7469c 100644 --- a/include/mitsuba/render/sensor.h +++ b/include/mitsuba/render/sensor.h @@ -31,42 +31,42 @@ MTS_NAMESPACE_BEGIN * * This class provides an abstract interface to all sensor plugins in Mitsuba. * It exposes functions for evaluating and sampling the response function of the - * sensor, and it allows querying the probability density of the sampling method. + * sensor, and it allows querying the probability density of the sampling method. * - * Somewhat curiously, the \ref Sensor class derives from \ref AbstractEmitter. - * The reason for this is that much like radiance, the spectral response of a - * sensor can be interpreted as emitted quantity named \a importance. The - * \ref Sensor interface thus inherits almost all of the emitter API and only + * Somewhat curiously, the \ref Sensor class derives from \ref AbstractEmitter. + * The reason for this is that much like radiance, the spectral response of a + * sensor can be interpreted as emitted quantity named \a importance. The + * \ref Sensor interface thus inherits almost all of the emitter API and only * needs to add a few camera-specific methods on top. * * The concept of interpreting sensor response as an emitted quantity and - * the resulting flexibility of being able to dynamically transition between - * emitter and receiver interpretations of luminaires and sensors is a key - * insight that enables the construction of powerful bidirectional rendering - * techniques It is the reason why the API to these components may seem + * the resulting flexibility of being able to dynamically transition between + * emitter and receiver interpretations of luminaires and sensors is a key + * insight that enables the construction of powerful bidirectional rendering + * techniques It is the reason why the API to these components may seem * somewhat unorthodox. * - * In Mitsuba, a sensor can be as simple as an irradiance meter that performs a + * In Mitsuba, a sensor can be as simple as an irradiance meter that performs a * single measurement along a specified ray, but it can also represent sensors - * that are more commonly used in computer graphics, such as a perspective camera + * that are more commonly used in computer graphics, such as a perspective camera * based on the thin lens equation. * * An important difference between a luminaire and a sensor is that the sensor * records spectral measurements to a film, and for that reason it needs a * mapping between rays and film pixel coordinates. Apart from that, the * interfaces are almost identical. - * - * Mitsuba assumes that a sensor always has a form of "shutter", which opens + * + * Mitsuba assumes that a sensor always has a form of "shutter", which opens * for a certain time, during which the exposure takes place. The sensor - * itself may also undergo motion while the shutter is open, but a more + * itself may also undergo motion while the shutter is open, but a more * complicated dependence on time is not allowed. - * + * * \ingroup librender */ class MTS_EXPORT_RENDER Sensor : public AbstractEmitter { public: /** - * \brief This list of flags is used to additionally characterize + * \brief This list of flags is used to additionally characterize * and classify the response functions of different types of sensors * * \sa AbstractEmitter::EEmitterType @@ -102,23 +102,23 @@ public: * \brief Importance sample a ray according to the sensor response * * This function combines all three of the steps of sampling a time, - * ray position, and direction value. It does not return any auxiliary + * ray position, and direction value. It does not return any auxiliary * sampling information and is mainly meant to be used by unidirectional * rendering techniques. - * - * Note that this function potentially uses a different sampling - * strategy compared to the sequence of running \ref sampleArea() + * + * Note that this function potentially uses a different sampling + * strategy compared to the sequence of running \ref sampleArea() * and \ref sampleDirection(). The reason for this is that it may * be possible to switch to a better technique when sampling both * position and direction at the same time. * * \param ray - * A ray data structure to be populated with a position + * A ray data structure to be populated with a position * and direction value * * \param samplePosition * Denotes the desired sample position in fractional pixel - * coordinates relative to the crop window of the underlying + * coordinates relative to the crop window of the underlying * film. * * \param apertureSample @@ -142,31 +142,31 @@ public: Float timeSample) const = 0; /** - * \brief Importance sample a ray differential according to the + * \brief Importance sample a ray differential according to the * sensor response * * This function combines all three of the steps of sampling a time, - * ray position, and direction value. It does not return any auxiliary + * ray position, and direction value. It does not return any auxiliary * sampling information and is mainly meant to be used by unidirectional * rendering techniques. - * - * Note that this function potentially uses a different sampling - * strategy compared to the sequence of running \ref sampleArea() + * + * Note that this function potentially uses a different sampling + * strategy compared to the sequence of running \ref sampleArea() * and \ref sampleDirection(). The reason for this is that it may * be possible to switch to a better technique when sampling both * position and direction at the same time. * - * The default implementation computes differentials using several + * The default implementation computes differentials using several * internal calls to \ref sampleRay(). Subclasses of the \ref Sensor * interface may optionally provide a more efficient approach. * * \param ray - * A ray data structure to be populated with a position + * A ray data structure to be populated with a position * and direction value * * \param samplePosition * Denotes the desired sample position in fractional pixel - * coordinates relative to the crop window of the underlying + * coordinates relative to the crop window of the underlying * film. * * \param apertureSample @@ -204,7 +204,7 @@ public: /** * \brief Return the emitted importance for the given surface intersection * - * This is function is used when a sensor has been hit by a + * This is function is used when a sensor has been hit by a * ray in a particle tracing-style integrator, and it subsequently needs to * be queried for the emitted importance along the negative ray direction. * @@ -212,21 +212,21 @@ public: * and \ref evalDirection(), though note that it does not include the * cosine foreshortening factor of the latter method. * - * This function is provided here as a fast convenience function for + * This function is provided here as a fast convenience function for * unidirectional rendering techniques that support intersecting the - * sensor. The default implementation throws an exception, which + * sensor. The default implementation throws an exception, which * states that the method is not implemented. * - * \param its + * \param its * An intersect record that specfies the query position * * \param d * A unit vector, which specifies the query direction * * \param result - * This argument is used to return the 2D sample position - * (i.e. the fractional pixel coordinates) associated - * with the intersection. + * This argument is used to return the 2D sample position + * (i.e. the fractional pixel coordinates) associated + * with the intersection. * * \return * The emitted importance @@ -235,7 +235,7 @@ public: Point2 &samplePos) const; /** - * \brief Return the sample position associated with a given + * \brief Return the sample position associated with a given * position and direction sampling record * * \param dRec @@ -250,7 +250,7 @@ public: const DirectionSamplingRecord &dRec, Point2 &position) const; /** - * \brief Evaluate the temporal component of the sampling density + * \brief Evaluate the temporal component of the sampling density * implemented by the \ref sampleRay() method. */ Float pdfTime(const Ray &ray, EMeasure measure) const; @@ -262,7 +262,7 @@ public: inline Float getShutterOpenTime() const { return m_shutterOpenTime; } /** - * \brief Does the method \ref sampleRay() require a uniformly distributed + * \brief Does the method \ref sampleRay() require a uniformly distributed * sample for the time-dependent component? */ inline bool needsTimeSample() const { return !(m_type & EDeltaTime); } @@ -275,7 +275,7 @@ public: // ============================================================= /** - * \brief Does the method \ref sampleRay() require a uniformly + * \brief Does the method \ref sampleRay() require a uniformly * distributed sample for the aperture component? */ inline bool needsApertureSample() const { return m_type & ENeedsApertureSample; } @@ -292,10 +292,10 @@ public: /** * \brief Return the sensor's sample generator * - * This is the \a root sampler, which will later be cloned a - * number of times to provide each participating worker thread - * with its own instance (see \ref Scene::getSampler()). - * Therefore, this sampler should never be used for anything + * This is the \a root sampler, which will later be cloned a + * number of times to provide each participating worker thread + * with its own instance (see \ref Scene::getSampler()). + * Therefore, this sampler should never be used for anything * except creating clones. */ inline Sampler *getSampler() { return m_sampler; } @@ -303,22 +303,22 @@ public: /** * \brief Return the sensor's sampler (const version). * - * This is the \a root sampler, which will later be cloned a - * number of times to provide each participating worker thread - * with its own instance (see \ref Scene::getSampler()). - * Therefore, this sampler should never be used for anything + * This is the \a root sampler, which will later be cloned a + * number of times to provide each participating worker thread + * with its own instance (see \ref Scene::getSampler()). + * Therefore, this sampler should never be used for anything * except creating clones. */ inline const Sampler *getSampler() const { return m_sampler.get(); } - /// Serialize this sensor to a binary data stream + /// Serialize this sensor to a binary data stream virtual void serialize(Stream *stream, InstanceManager *manager) const; //! @} // ============================================================= // ============================================================= - //! @{ \name ConfigurableObject interface + //! @{ \name ConfigurableObject interface // ============================================================= /// Add a child ConfigurableObject virtual void addChild(const std::string &name, ConfigurableObject *child); @@ -359,11 +359,11 @@ protected: * are commonly used in computer graphics, such as perspective and orthographic * camera models. * - * The interface is meant to be implemented by any kind of sensor, whose - * world to clip space transformation can be explained using only linear - * operations on homogeneous coordinates. + * The interface is meant to be implemented by any kind of sensor, whose + * world to clip space transformation can be explained using only linear + * operations on homogeneous coordinates. * - * A useful feature of \ref ProjectiveCamera sensors is that their view can be + * A useful feature of \ref ProjectiveCamera sensors is that their view can be * rendered using the traditional OpenGL pipeline. * * \ingroup librender @@ -371,17 +371,17 @@ protected: class MTS_EXPORT_RENDER ProjectiveCamera : public Sensor { public: /// Return the world-to-view (aka "view") transformation at time \c t - inline const Transform getViewTransform(Float t) const { + inline const Transform getViewTransform(Float t) const { return getWorldTransform()->eval(t).inverse(); } /// Return the view-to-world transformation at time \c t - inline const Transform getInverseViewTransform(Float t) const { + inline const Transform getInverseViewTransform(Float t) const { return getWorldTransform()->eval(t); } /** - * \brief Overwrite the inverse world-to-view transformation + * \brief Overwrite the inverse world-to-view transformation * with a static (i.e. non-animated) transformation. */ virtual void setInverseViewTransform(const Transform &trafo); @@ -390,17 +390,17 @@ public: * \brief Return a projection matrix suitable for rendering the * scene using OpenGL * - * For scenes involving a narrow depth of field and antialiasing, + * For scenes involving a narrow depth of field and antialiasing, * it is necessary to average many separately rendered images using * different pixel offsets and aperture positions. * * \param apertureSample - * Sample for rendering with defocus blur. This should be a + * Sample for rendering with defocus blur. This should be a * uniformly distributed random point in [0,1]^2 (or any value * when \ref needsApertureSample() == \c false) * * \param aaSample - * Sample for antialiasing. This should be a uniformly + * Sample for antialiasing. This should be a uniformly * distributed random point in [0,1]^2. */ virtual Transform getProjectionTransform(const Point2 &apertureSample, @@ -450,11 +450,11 @@ protected: * are commonly used in computer graphics, such as perspective and orthographic * camera models. * - * The interface is meant to be implemented by any kind of sensor, whose - * world to clip space transformation can be explained using only linear - * operations on homogeneous coordinates. + * The interface is meant to be implemented by any kind of sensor, whose + * world to clip space transformation can be explained using only linear + * operations on homogeneous coordinates. * - * A useful feature of \ref ProjectiveCamera sensors is that their view can be + * A useful feature of \ref ProjectiveCamera sensors is that their view can be * rendered using the traditional OpenGL pipeline. * * \ingroup librender @@ -476,13 +476,13 @@ public: /// Set the vertical field of view in degrees void setYFov(Float yfov); - + /// Return the diagonal field of view in degrees Float getDiagonalFov() const; - + /// Set the diagonal field of view in degrees void setDiagonalFov(Float dfov); - + //! @} // ============================================================= diff --git a/include/mitsuba/render/shader.h b/include/mitsuba/render/shader.h index b30832a0..7894f493 100644 --- a/include/mitsuba/render/shader.h +++ b/include/mitsuba/render/shader.h @@ -29,9 +29,9 @@ class Renderer; class GPUProgram; /** - * \brief Abstract hardware resource. + * \brief Abstract hardware resource. * - * Implementations provides support for functionality that are also able to + * Implementations provides support for functionality that are also able to * live on the GPU. By default, the method 'createShader' just returns \c NULL, * which means that the BSDF/Light source/Texture/.. has not yet been ported * to the GPU-based renderer. @@ -46,7 +46,7 @@ public: /** * \brief %Shader base class for use with a VPL-style renderer. * - * Subclasses can implement one of various things, such as a BSDF, + * Subclasses can implement one of various things, such as a BSDF, * a light source, or a texture. * * \ingroup librender @@ -79,20 +79,20 @@ public: virtual void putDependencies(std::vector &deps); /** - * \brief Is this shader complete? + * \brief Is this shader complete? * - * This is mainly useful to check whether all dependencies - * could be constructed successfully. The default + * This is mainly useful to check whether all dependencies + * could be constructed successfully. The default * implementation returns \c true. */ virtual bool isComplete() const; /** * \brief Generate a string version of this shader's evaluation - * routine. + * routine. * - * The appended string should assign the name \c evalName to this - * function. The function names of depedencies (as specified by + * The appended string should assign the name \c evalName to this + * function. The function names of depedencies (as specified by * \ref putDependencies), are supplied in the parameter \c depNames * in identical order. */ @@ -101,7 +101,7 @@ public: const std::vector &depNames) const = 0; /** - * \brief This function can optionally be implemented to resolve named + * \brief This function can optionally be implemented to resolve named * program parameters to numerical IDs for increased performance. * * The int array returned here will later be passed to \ref bind(). @@ -111,12 +111,12 @@ public: std::vector ¶meterIDs) const; /** - * \brief Configure the the associated GPU program. + * \brief Configure the the associated GPU program. * * This function is typically used to bind textures and * to set program pararameters. */ - virtual void bind(GPUProgram *program, const std::vector ¶meterIDs, + virtual void bind(GPUProgram *program, const std::vector ¶meterIDs, int &textureUnitOffset) const; /// Release any bound resources. diff --git a/include/mitsuba/render/shape.h b/include/mitsuba/render/shape.h index efdb42d0..3c7fe7ea 100644 --- a/include/mitsuba/render/shape.h +++ b/include/mitsuba/render/shape.h @@ -61,10 +61,10 @@ public: /// Does the intersected shape have a subsurface integrator? inline bool hasSubsurface() const; - + /// Does the surface mark a transition between two media? inline bool isMediumTransition() const; - + /** * \brief Determine the target medium * @@ -83,9 +83,9 @@ public: inline const Medium *getTargetMedium(Float cosTheta) const; /** - * \brief Returns the BSDF of the intersected shape. + * \brief Returns the BSDF of the intersected shape. * - * The parameter ray must match the one used to create the intersection + * The parameter ray must match the one used to create the intersection * record. This function computes texture coordinate partials if this is * required by the BSDF (e.g. for texture filtering). * @@ -100,7 +100,7 @@ public: /** * \brief Returns radiance emitted into direction d. * - * \remark This function should only be called if the + * \remark This function should only be called if the * intersected shape is actually an emitter. */ inline Spectrum Le(const Vector &d) const; @@ -181,7 +181,7 @@ public: virtual bool isCompound() const; /** - * \brief Return a sub-element of a compound shape. + * \brief Return a sub-element of a compound shape. * * When expanding shapes, the scene will repeatedly call this * function with increasing indices. Returning \a NULL indicates @@ -200,9 +200,9 @@ public: virtual AABB getAABB() const = 0; /** - * \brief Returns the minimal axis-aligned bounding box + * \brief Returns the minimal axis-aligned bounding box * of this shape when clipped to another bounding box. - * + * * This is extremely important to construct decent kd-trees. * The default implementation just takes the bounding box * returned by \ref getAABB() and clips it to \a box. @@ -212,13 +212,13 @@ public: /** * \brief Create a triangle mesh approximation of this shape * - * This function is used by the realtime preview and + * This function is used by the realtime preview and * certain integrators, which rely on hardware rasterization. * * The default implementation simply returns \a NULL. */ virtual ref createTriMesh(); - + //! @} // ============================================================= @@ -231,31 +231,31 @@ public: * * Check whether the shape is intersected by the given ray. Some * temporary space (\ref MTS_KD_INTERSECTION_TEMP-4 bytes) is, - * supplied which can be used to cache information about the - * intersection. The function \ref fillIntersectionRecord() - * can later use this information to fill in a detailed + * supplied which can be used to cache information about the + * intersection. The function \ref fillIntersectionRecord() + * can later use this information to fill in a detailed * intersection record. */ - virtual bool rayIntersect(const Ray &ray, Float mint, + virtual bool rayIntersect(const Ray &ray, Float mint, Float maxt, Float &t, void *temp) const; /** * \brief Fast ray intersection test for visibility queries * - * Check whether the shape is intersected by the given ray. + * Check whether the shape is intersected by the given ray. * No details about the intersection are returned, hence the * function is only useful for visibility queries. For most - * shapes, this will simply call forward the call to \ref - * rayIntersect. When the shape actually contains a nested + * shapes, this will simply call forward the call to \ref + * rayIntersect. When the shape actually contains a nested * kd-tree, some optimizations are possible. */ virtual bool rayIntersect(const Ray &ray, Float mint, Float maxt) const; /** - * \brief Given that an intersection has been found, create a + * \brief Given that an intersection has been found, create a * detailed intersection record */ - virtual void fillIntersectionRecord(const Ray &ray, + virtual void fillIntersectionRecord(const Ray &ray, const void *temp, Intersection &its) const; /** @@ -268,10 +268,10 @@ public: * \param its * Intersection record associated with the query * \param dndu - * Parameter used to store the partial derivative of the + * Parameter used to store the partial derivative of the * normal vector with respect to \c u * \param dndv - * Parameter used to store the partial derivative of the + * Parameter used to store the partial derivative of the * normal vector with respect to \c v * \param shadingFrame * Specifies whether to compute the derivative of the @@ -294,7 +294,7 @@ public: * Specifies whether to compute the curvature based on the * geometric normal \a or the shading normal of the surface */ - void getCurvature(const Intersection &its, Float &H, Float &K, + void getCurvature(const Intersection &its, Float &H, Float &K, bool shadingFrame = true) const; /** @@ -326,7 +326,7 @@ public: * \param sample * A uniformly distributed 2D vector */ - virtual void samplePosition(PositionSamplingRecord &pRec, + virtual void samplePosition(PositionSamplingRecord &pRec, const Point2 &sample) const; /** @@ -347,26 +347,26 @@ public: * (with respect to the solid angle measure) * * The sample density should ideally be uniform in direction as seen from - * the reference point \c dRec.p. + * the reference point \c dRec.p. * - * This general approach for sampling positions is named "direct" sampling + * This general approach for sampling positions is named "direct" sampling * throughout Mitsuba motivated by direct illumination rendering techniques, * which represent the most important application. * - * When no implementation of this function is supplied, the \ref Shape - * class will revert to the default approach, which piggybacks on - * \ref sampleArea(). This usually results in a a suboptimal sample - * placement, which can manifest itself in the form of high variance + * When no implementation of this function is supplied, the \ref Shape + * class will revert to the default approach, which piggybacks on + * \ref sampleArea(). This usually results in a a suboptimal sample + * placement, which can manifest itself in the form of high variance * * \param dRec - * A direct sampling record that specifies the reference point and a - * time value. After the function terminates, it will be populated + * A direct sampling record that specifies the reference point and a + * time value. After the function terminates, it will be populated * with the position sample and related information * * \param sample * A uniformly distributed 2D vector */ - virtual void sampleDirect(DirectSamplingRecord &dRec, + virtual void sampleDirect(DirectSamplingRecord &dRec, const Point2 &sample) const; /** @@ -374,8 +374,8 @@ public: * a particular point on the surface. * * \param dRec - * A direct sampling record, which specifies the query - * location. Note that this record need not be completely + * A direct sampling record, which specifies the query + * location. Note that this record need not be completely * filled out. The important fields are \c p, \c n, \c ref, * \c dist, \c d, \c measure, and \c uv. * @@ -386,11 +386,11 @@ public: //! @} // ============================================================= - + // ============================================================= //! @{ \name Miscellaneous // ============================================================= - + /// Does the surface of this shape mark a medium transition? inline bool isMediumTransition() const { return m_interiorMedium.get() || m_exteriorMedium.get(); } /// Return the medium that lies on the interior of this shape (\c NULL == vacuum) @@ -406,7 +406,7 @@ public: inline bool hasSubsurface() const { return m_subsurface.get() != NULL; } /// Return the associated sub-surface integrator inline Subsurface *getSubsurface() { return m_subsurface; } - /// Return the associated sub-surface integrator + /// Return the associated sub-surface integrator inline const Subsurface *getSubsurface() const { return m_subsurface.get(); } /// Is this shape also an area emitter? @@ -455,9 +455,9 @@ public: //! @} // ============================================================= - + // ============================================================= - //! @{ \name ConfigurableObject interface + //! @{ \name ConfigurableObject interface // ============================================================= /// Called once after constructing the object @@ -468,7 +468,7 @@ public: /// Add a child (e.g. a emitter/sub surface integrator) to this shape void addChild(const std::string &name, ConfigurableObject *child); - + /// Add an unnamed child inline void addChild(ConfigurableObject *child) { addChild("", child); } diff --git a/include/mitsuba/render/skdtree.h b/include/mitsuba/render/skdtree.h index 7a53cb6f..bdc790bf 100644 --- a/include/mitsuba/render/skdtree.h +++ b/include/mitsuba/render/skdtree.h @@ -31,7 +31,7 @@ #endif #if defined(SINGLE_PRECISION) -/// 32 byte temporary storage for intersection computations +/// 32 byte temporary storage for intersection computations #define MTS_KD_INTERSECTION_TEMP 32 #else #define MTS_KD_INTERSECTION_TEMP 64 @@ -42,23 +42,23 @@ MTS_NAMESPACE_BEGIN typedef const Shape * ConstShapePtr; /** - * \brief SAH KD-tree acceleration data structure for fast ray-triangle + * \brief SAH KD-tree acceleration data structure for fast ray-triangle * intersections. * - * Implements the construction algorithm for 'perfect split' trees as outlined + * Implements the construction algorithm for 'perfect split' trees as outlined * in the paper "On Bulding fast kd-Trees for Ray Tracing, and on doing that in - * O(N log N)" by Ingo Wald and Vlastimil Havran. Non-triangle shapes are + * O(N log N)" by Ingo Wald and Vlastimil Havran. Non-triangle shapes are * supported, but most optimizations here target large triangle meshes. * For more details regarding the construction algorithm, please refer to * the class \ref GenericKDTree. * * This class offers a choice of two different triangle intersection algorithms: - * By default, intersections are computed using the "TriAccel" projection with - * pre-computation method from Ingo Wald's PhD thesis "Realtime Ray Tracing + * By default, intersections are computed using the "TriAccel" projection with + * pre-computation method from Ingo Wald's PhD thesis "Realtime Ray Tracing * and Interactive Global Illumination". This adds an overhead of 48 bytes per * triangle. * - * When compiled with \c MTS_KD_CONSERVE_MEMORY, the Moeller-Trumbore intersection + * When compiled with \c MTS_KD_CONSERVE_MEMORY, the Moeller-Trumbore intersection * test is used instead, which doesn't need any extra storage. However, it also * tends to be quite a bit slower. * @@ -137,7 +137,7 @@ public: * * \param t * The traveled ray distance will be stored in this parameter - + * \param shape * A pointer to the intersected shape will be stored in this * parameter @@ -151,7 +151,7 @@ public: * * \return \c true if an intersection was found */ - bool rayIntersect(const Ray &ray, Float &t, ConstShapePtr &shape, + bool rayIntersect(const Ray &ray, Float &t, ConstShapePtr &shape, Normal &n, Point2 &uv) const; /** @@ -161,7 +161,7 @@ public: * This function does not compute a detailed intersection record, * and it never determines the closest intersection, which makes * it quite a bit faster than the other two \c rayIntersect() methods. - * However, for this reason, it can only be used to check whether + * However, for this reason, it can only be used to check whether * there is \a any occlusion along a ray or ray segment. * * \param ray @@ -178,14 +178,14 @@ public: * \brief Intersect four rays with the stored triangle meshes while making * use of ray coherence to do this very efficiently. Requires SSE. */ - void rayIntersectPacket(const RayPacket4 &packet, + void rayIntersectPacket(const RayPacket4 &packet, const RayInterval4 &interval, Intersection4 &its, void *temp) const; /** * \brief Fallback for incoherent rays * \sa rayIntesectPacket */ - void rayIntersectPacketIncoherent(const RayPacket4 &packet, + void rayIntersectPacketIncoherent(const RayPacket4 &packet, const RayInterval4 &interval, Intersection4 &its, void *temp) const; #endif //! @} @@ -243,19 +243,19 @@ protected: * temporary space is supplied to store data that can later * be used to create a detailed intersection record. */ - FINLINE bool intersect(const Ray &ray, IndexType idx, Float mint, + FINLINE bool intersect(const Ray &ray, IndexType idx, Float mint, Float maxt, Float &t, void *temp) const { - IntersectionCache *cache = + IntersectionCache *cache = static_cast(temp); #if defined(MTS_KD_CONSERVE_MEMORY) IndexType shapeIdx = findShape(idx); if (EXPECT_TAKEN(m_triangleFlag[shapeIdx])) { - const TriMesh *mesh = + const TriMesh *mesh = static_cast(m_shapes[shapeIdx]); const Triangle &tri = mesh->getTriangles()[idx]; Float tempU, tempV, tempT; - if (tri.rayIntersect(mesh->getVertexPositions(), ray, + if (tri.rayIntersect(mesh->getVertexPositions(), ray, tempU, tempV, tempT)) { if (tempT < mint || tempT > maxt) return false; @@ -268,7 +268,7 @@ protected: } } else { const Shape *shape = m_shapes[shapeIdx]; - if (shape->rayIntersect(ray, mint, maxt, t, + if (shape->rayIntersect(ray, mint, maxt, t, reinterpret_cast(temp) + 8)) { cache->shapeIndex = shapeIdx; cache->primIndex = KNoTriangleFlag; @@ -290,7 +290,7 @@ protected: } else { uint32_t shapeIndex = ta.shapeIndex; const Shape *shape = m_shapes[shapeIndex]; - if (shape->rayIntersect(ray, mint, maxt, t, + if (shape->rayIntersect(ray, mint, maxt, t, reinterpret_cast(temp) + 8)) { cache->shapeIndex = shapeIndex; cache->primIndex = KNoTriangleFlag; @@ -305,12 +305,12 @@ protected: * Check whether a primitive is intersected by the given ray. This * version is used for shadow rays, hence no temporary space is supplied. */ - FINLINE bool intersect(const Ray &ray, IndexType idx, + FINLINE bool intersect(const Ray &ray, IndexType idx, Float mint, Float maxt) const { #if defined(MTS_KD_CONSERVE_MEMORY) IndexType shapeIdx = findShape(idx); if (EXPECT_TAKEN(m_triangleFlag[shapeIdx])) { - const TriMesh *mesh = + const TriMesh *mesh = static_cast(m_shapes[shapeIdx]); const Triangle &tri = mesh->getTriangles()[idx]; Float tempU, tempV, tempT; @@ -336,9 +336,9 @@ protected: /** * \brief After having found a unique intersection, fill a proper record - * using the temporary information collected in \ref intersect() + * using the temporary information collected in \ref intersect() */ - template FINLINE void fillIntersectionRecord(const Ray &ray, + template FINLINE void fillIntersectionRecord(const Ray &ray, const void *temp, Intersection &its) const { const IntersectionCache *cache = reinterpret_cast(temp); const Shape *shape = m_shapes[cache->shapeIndex]; @@ -377,7 +377,7 @@ protected: its.dpdv = side2; } if (EXPECT_TAKEN(vertexNormals)) { - const Normal + const Normal &n0 = vertexNormals[idx0], &n1 = vertexNormals[idx1], &n2 = vertexNormals[idx2]; @@ -388,7 +388,7 @@ protected: coordinateSystem(its.shFrame.n, its.shFrame.s, its.shFrame.t); } else { /* Align shFrame.s with dpdu, use Gram-Schmidt to orthogonalize */ - its.shFrame.s = normalize(its.dpdu - its.shFrame.n + its.shFrame.s = normalize(its.dpdu - its.shFrame.n * dot(its.shFrame.n, its.dpdu)); its.shFrame.t = cross(its.shFrame.n, its.shFrame.s); } @@ -426,7 +426,7 @@ protected: its.primIndex = cache->primIndex; its.instance = NULL; } else { - shape->fillIntersectionRecord(ray, + shape->fillIntersectionRecord(ray, reinterpret_cast(temp) + 8, its); } its.time = ray.time; @@ -434,7 +434,7 @@ protected: /// Plain shadow ray query (used by the 'instance' plugin) inline bool rayIntersect(const Ray &ray, Float _mint, Float _maxt) const { - Float mint, maxt, tempT = std::numeric_limits::infinity(); + Float mint, maxt, tempT = std::numeric_limits::infinity(); if (m_aabb.rayIntersect(ray, mint, maxt)) { if (_mint > mint) mint = _mint; if (_maxt < maxt) maxt = _maxt; @@ -447,7 +447,7 @@ protected: /// Plain intersection query (used by the 'instance' plugin) inline bool rayIntersect(const Ray &ray, Float _mint, Float _maxt, Float &t, void *temp) const { - Float mint, maxt, tempT = std::numeric_limits::infinity(); + Float mint, maxt, tempT = std::numeric_limits::infinity(); if (m_aabb.rayIntersect(ray, mint, maxt)) { if (_mint > mint) mint = _mint; if (_maxt < maxt) maxt = _maxt; diff --git a/include/mitsuba/render/spiral.h b/include/mitsuba/render/spiral.h index e541c5ec..014db16e 100644 --- a/include/mitsuba/render/spiral.h +++ b/include/mitsuba/render/spiral.h @@ -89,7 +89,7 @@ public: /// Send the finished event even if not all blocks have been processed yet void finish(); - + /// Send events notifying all listeners that the film has changed void notifyFilmChanged(); diff --git a/include/mitsuba/render/subsurface.h b/include/mitsuba/render/subsurface.h index 3d8c5cc0..77d2e56a 100644 --- a/include/mitsuba/render/subsurface.h +++ b/include/mitsuba/render/subsurface.h @@ -27,7 +27,7 @@ MTS_NAMESPACE_BEGIN /** * \brief Abstract subsurface scattering models * - * Can be attached to an arbitrary shape to compute exitant + * Can be attached to an arbitrary shape to compute exitant * radiance due to internal scattering. How that is done is * completely up to the implementation. It might for instance * recursively trace rays or perform lookups into a precomputed @@ -38,10 +38,10 @@ MTS_NAMESPACE_BEGIN class MTS_EXPORT_RENDER Subsurface : public NetworkedObject { public: /** - * \brief Possibly perform a pre-process task. + * \brief Possibly perform a pre-process task. * - * The last three parameters are resource IDs of the associated scene, - * camera and sample generator, which have been made available to all + * The last three parameters are resource IDs of the associated scene, + * camera and sample generator, which have been made available to all * local and remote workers. */ virtual bool preprocess(const Scene *scene, RenderQueue *queue, const RenderJob *job, diff --git a/include/mitsuba/render/testcase.h b/include/mitsuba/render/testcase.h index d480b88d..dd6150a7 100644 --- a/include/mitsuba/render/testcase.h +++ b/include/mitsuba/render/testcase.h @@ -37,7 +37,7 @@ MTS_NAMESPACE_BEGIN /** \brief Base class of all testcases. * - * Implementations of this interface can be executed using the 'mtsutil' command. + * Implementations of this interface can be executed using the 'mtsutil' command. * The execution order is as follows: after initializaiton using init(), any tests * declared using the MTS_DECLARE_TEST() macro are executed. Finally, * the shutdown() method is called. See the files in 'mitsuba/src/tests' @@ -61,7 +61,7 @@ public: /// Return the number of executed testcases inline int getExecuted() const { return m_executed; } - + /// Return the number of successfully executed testcases inline int getSucceeded() const { return m_succeeded; } @@ -75,7 +75,7 @@ protected: /// Asserts that the two floating point values are equal void assertEqualsImpl(Float actual, Float expected, Float epsilon, const char *file, int line); - + /// Asserts that the two spectral power distributions are equal void assertEqualsImpl(const Spectrum &actual, const Spectrum &expected, Float epsilon, const char *file, int line); diff --git a/include/mitsuba/render/texture.h b/include/mitsuba/render/texture.h index 44a8fe84..f53f325e 100644 --- a/include/mitsuba/render/texture.h +++ b/include/mitsuba/render/texture.h @@ -57,7 +57,7 @@ public: virtual bool isConstant() const; /** - * \brief Does this texture perform any pre-filtering when + * \brief Does this texture perform any pre-filtering when * ray differentials are available? */ virtual bool usesRayDifferentials() const; diff --git a/include/mitsuba/render/track.h b/include/mitsuba/render/track.h index 30c00283..25049a3d 100644 --- a/include/mitsuba/render/track.h +++ b/include/mitsuba/render/track.h @@ -24,7 +24,7 @@ #include MTS_NAMESPACE_BEGIN - + template class AnimationTrack; /** @@ -36,13 +36,13 @@ class MTS_EXPORT_RENDER AbstractAnimationTrack : public Object { public: enum EType { EInvalid = 0, - ETranslationX = 1, - ETranslationY = 2, - ETranslationZ = 3, - ETranslationXYZ = 4, - EScaleX = 5, - EScaleY = 6, - EScaleZ = 7, + ETranslationX = 1, + ETranslationY = 2, + ETranslationZ = 3, + ETranslationXYZ = 4, + EScaleX = 5, + EScaleY = 6, + EScaleZ = 7, EScaleXYZ = 8, ERotationX = 9, ERotationY = 10, @@ -67,7 +67,7 @@ public: MTS_DECLARE_CLASS() protected: - AbstractAnimationTrack(EType type, size_t nKeyframes) + AbstractAnimationTrack(EType type, size_t nKeyframes) : m_type(type), m_times(nKeyframes) { } virtual ~AbstractAnimationTrack() { } @@ -84,10 +84,10 @@ template class AnimationTrack : public AbstractAnimationTrack { public: typedef T value_type; - AnimationTrack(EType type, size_t nKeyframes) + AnimationTrack(EType type, size_t nKeyframes) : AbstractAnimationTrack(type, nKeyframes), m_values(nKeyframes) { } - AnimationTrack(EType type, Stream *stream) + AnimationTrack(EType type, Stream *stream) : AbstractAnimationTrack(type, stream->readSize()) { m_values.resize(m_times.size()); stream->readFloatArray(&m_times[0], m_times.size()); @@ -109,11 +109,11 @@ public: for (size_t i=0; i 0); - std::vector::const_iterator entry = + std::vector::const_iterator entry = std::lower_bound(m_times.begin(), m_times.end(), time); size_t idx0 = (size_t) std::max( (ptrdiff_t) (entry - m_times.begin()) - 1, @@ -140,7 +140,7 @@ protected: private: std::vector m_values; }; - + template inline T AnimationTrack::lerp(size_t idx0, size_t idx1, Float t) const { return m_values[idx0] * (1-t) + m_values[idx1] * t; } @@ -194,11 +194,11 @@ public: /** * \brief Create a new animated transformation * - * When the transformation is constant (i.e. there are no + * When the transformation is constant (i.e. there are no * animation tracks), the supplied parameter specifies the * target value. */ - AnimatedTransform(const Transform &trafo = Transform()) + AnimatedTransform(const Transform &trafo = Transform()) : m_transform(trafo) { } /// Unserialized an animated transformation from a binary data stream diff --git a/include/mitsuba/render/triaccel.h b/include/mitsuba/render/triaccel.h index 2c0f7919..6acb5306 100644 --- a/include/mitsuba/render/triaccel.h +++ b/include/mitsuba/render/triaccel.h @@ -28,7 +28,7 @@ MTS_NAMESPACE_BEGIN static const uint32_t KNoTriangleFlag = 0xFFFFFFFF; /** - * \brief Pre-computed triangle representation based on Ingo Wald's TriAccel layout. + * \brief Pre-computed triangle representation based on Ingo Wald's TriAccel layout. * * Fits into three 16-byte cache lines if single precision floats are used. * The k parameter is also used for classification during kd-tree construction. diff --git a/include/mitsuba/render/triaccel_sse.h b/include/mitsuba/render/triaccel_sse.h index f8216afe..3f7c5db8 100644 --- a/include/mitsuba/render/triaccel_sse.h +++ b/include/mitsuba/render/triaccel_sse.h @@ -24,24 +24,24 @@ MTS_NAMESPACE_BEGIN -FINLINE __m128 rayIntersectPacket(const TriAccel &tri, const RayPacket4 &packet, +FINLINE __m128 rayIntersectPacket(const TriAccel &tri, const RayPacket4 &packet, __m128 mint, __m128 maxt, __m128 inactive, Intersection4 &its) { static const MM_ALIGN16 int waldModulo[4] = { 1, 2, 0, 1 }; const int ku = waldModulo[tri.k], kv = waldModulo[tri.k+1]; /* Get the u and v components */ - const __m128 + const __m128 o_u = packet.o[ku].ps, o_v = packet.o[kv].ps, o_k = packet.o[tri.k].ps, d_u = packet.d[ku].ps, d_v = packet.d[kv].ps, d_k = packet.d[tri.k].ps; /* Extract data from the first cache line */ - const __m128 + const __m128 line1 = _mm_load_ps((const float *) &tri), n_u = splat_ps(line1, 1), n_v = splat_ps(line1, 2), n_d = splat_ps(line1, 3); - const __m128 + const __m128 ounu = _mm_mul_ps(o_u, n_u), ovnv = _mm_mul_ps(o_v, n_v), dunu = _mm_mul_ps(d_u, n_u), @@ -52,29 +52,29 @@ FINLINE __m128 rayIntersectPacket(const TriAccel &tri, const RayPacket4 &packet, num = _mm_sub_ps(_mm_sub_ps(_mm_sub_ps(n_d, ounu), ovnv), o_k), denom = _mm_add_ps(_mm_add_ps(dunu, dvnv), d_k); - const __m128 + const __m128 t = _mm_div_ps(num, denom); - __m128 hasIts = + __m128 hasIts = _mm_andnot_ps(inactive, _mm_and_ps(_mm_cmpgt_ps(maxt, t), _mm_cmpgt_ps(t, mint))); - if (_mm_movemask_ps(hasIts) == 0) + if (_mm_movemask_ps(hasIts) == 0) return hasIts; /* Extract data from the second cache line */ - const __m128 + const __m128 line2 = _mm_load_ps(&tri.a_u), a_u = splat_ps(line2, 0), a_v = splat_ps(line2, 1), b_nu = splat_ps(line2, 2), b_nv = splat_ps(line2, 3); - const __m128 + const __m128 hu = _mm_add_ps(o_u, _mm_sub_ps(_mm_mul_ps(t, d_u), a_u)), hv = _mm_add_ps(o_v, _mm_sub_ps(_mm_mul_ps(t, d_v), a_v)); /* Extract data from the third cache line */ - const __m128 + const __m128 line3 = _mm_load_ps(&tri.c_nu), c_nu = splat_ps(line3, 0), c_nv = splat_ps(line3, 1); @@ -86,19 +86,19 @@ FINLINE __m128 rayIntersectPacket(const TriAccel &tri, const RayPacket4 &packet, u = _mm_add_ps(_mm_mul_ps(hv, b_nu), _mm_mul_ps(hu, b_nv)), v = _mm_add_ps(_mm_mul_ps(hu, c_nu), _mm_mul_ps(hv, c_nv)); - const __m128 + const __m128 zero = _mm_setzero_ps(), term1 = _mm_cmpge_ps(u, zero), term2 = _mm_cmpge_ps(v, zero), term3 = _mm_add_ps(u, v); - + const __m128 term4 = _mm_and_ps(term1, term2), term5 = _mm_cmpge_ps(SSEConstants::one.ps, term3); hasIts = _mm_and_ps(hasIts, _mm_and_ps(term4, term5)); - if (_mm_movemask_ps(hasIts) == 0) + if (_mm_movemask_ps(hasIts) == 0) return hasIts; its.t.ps = mux_ps(hasIts, t, its.t.ps); diff --git a/include/mitsuba/render/trimesh.h b/include/mitsuba/render/trimesh.h index ae87ffe9..fb256d17 100644 --- a/include/mitsuba/render/trimesh.h +++ b/include/mitsuba/render/trimesh.h @@ -58,11 +58,11 @@ struct TangentSpace { class MTS_EXPORT_RENDER TriMesh : public Shape { public: /// Create a new, empty triangle mesh with the specified state - TriMesh(const std::string &name, + TriMesh(const std::string &name, size_t triangleCount, size_t vertexCount, bool hasNormals = false, - bool hasTexcoords = false, - bool hasVertexColors = false, + bool hasTexcoords = false, + bool hasVertexColors = false, bool flipNormals = false, bool faceNormals = false); @@ -78,7 +78,7 @@ public: * the specified index determines which one to load. */ TriMesh(Stream *stream, int idx = 0); - + // ============================================================= //! @{ \name General query functions // ============================================================= @@ -97,7 +97,7 @@ public: /** * \brief Create a triangle mesh approximation of this shape - * + * * Since instances are already triangle meshes, the implementation * just returns a pointer to \a this. */ @@ -148,7 +148,7 @@ public: /// Return the per-triangle UV tangents (const version) inline const TangentSpace *getUVTangents() const { return m_tangents; }; - /// Return the per-triangle UV tangents + /// Return the per-triangle UV tangents inline TangentSpace *getUVTangents() { return m_tangents; }; /// Does the mesh have UV tangent information? inline bool hasUVTangents() const { return m_tangents != NULL; }; @@ -173,7 +173,7 @@ public: * \param sample * A uniformly distributed 2D vector */ - void samplePosition(PositionSamplingRecord &pRec, + void samplePosition(PositionSamplingRecord &pRec, const Point2 &sample) const; /** @@ -191,7 +191,7 @@ public: //! @} // ============================================================= - + // ============================================================= //! @{ \name Miscellaneous // ============================================================= @@ -200,7 +200,7 @@ public: * \brief Generate per-triangle space basis vectors from * a user-specified set of UV coordinates * - * Will throw an exception when no UV coordinates are + * Will throw an exception when no UV coordinates are * associated with the mesh. */ void computeUVTangents(); @@ -210,9 +210,9 @@ public: /** * \brief Rebuild the mesh so that adjacent faces - * with a dihedral angle greater than \c maxAngle degrees + * with a dihedral angle greater than \c maxAngle degrees * are topologically disconnected. - * + * * On the other hand, if the angle is less than \a maxAngle, the code * ensures that the faces reference the same vertices. * This step is very useful as a pre-process when generating @@ -237,8 +237,8 @@ public: void serialize(Stream *stream) const; /** - * \brief Build a discrete probability distribution - * for sampling. + * \brief Build a discrete probability distribution + * for sampling. * * Called once while loading the scene */ @@ -254,10 +254,10 @@ public: * \param its * Intersection record associated with the query * \param dndu - * Parameter used to store the partial derivative of the + * Parameter used to store the partial derivative of the * normal vector with respect to \c u * \param dndv - * Parameter used to store the partial derivative of the + * Parameter used to store the partial derivative of the * normal vector with respect to \c v * \param shadingFrame * Specifies whether to compute the derivative of the @@ -284,7 +284,7 @@ public: /// Export an Wavefront OBJ version of this file void writeOBJ(const fs::path &path) const; - + /// Return a string representation std::string toString() const; @@ -298,7 +298,7 @@ protected: /// Virtual destructor virtual ~TriMesh(); - + /// Load a Mitsuba compressed triangle mesh substream void loadCompressed(Stream *stream, int idx = 0); diff --git a/include/mitsuba/render/util.h b/include/mitsuba/render/util.h index eaa3a7c8..79dd5f8a 100644 --- a/include/mitsuba/render/util.h +++ b/include/mitsuba/render/util.h @@ -33,7 +33,7 @@ class MTS_EXPORT_RENDER Utility : public Object { public: /** * Run the utility. The supplied argc - * and argv parameters contain any + * and argv parameters contain any * extra arguments passed to mtsutil. The value * returned here will be used as the return value of the * 'mtsutil' process. @@ -50,7 +50,7 @@ protected: /// Load a scene from an external file ref loadScene(const fs::path &fname, const ParameterMap ¶ms= ParameterMap()); - + /// Load a scene from a string ref loadSceneFromString(const std::string &content, const ParameterMap ¶ms= ParameterMap()); diff --git a/include/mitsuba/render/volume.h b/include/mitsuba/render/volume.h index c8a35735..5c4cb912 100644 --- a/include/mitsuba/render/volume.h +++ b/include/mitsuba/render/volume.h @@ -58,7 +58,7 @@ public: virtual Vector lookupVector(const Point &p) const; /** - * \brief Return the recommended step size for numerical + * \brief Return the recommended step size for numerical * integration or inifinity if this is not known/applicable */ virtual Float getStepSize() const = 0; @@ -80,7 +80,7 @@ protected: VolumeDataSource(const Properties &props); /// Unserialize from a binary data stream - VolumeDataSource(Stream *stream, InstanceManager *manager); + VolumeDataSource(Stream *stream, InstanceManager *manager); protected: AABB m_aabb; }; diff --git a/include/mitsuba/render/vpl.h b/include/mitsuba/render/vpl.h index d71ae0c3..878e18b8 100644 --- a/include/mitsuba/render/vpl.h +++ b/include/mitsuba/render/vpl.h @@ -27,7 +27,7 @@ MTS_NAMESPACE_BEGIN enum EVPLType { EPointEmitterVPL = 0, EDirectionalEmitterVPL, - ESurfaceVPL + ESurfaceVPL }; /** @@ -36,7 +36,7 @@ enum EVPLType { * \ingroup librender */ struct VPL { - inline VPL(EVPLType type, const Spectrum &P) + inline VPL(EVPLType type, const Spectrum &P) : type(type), P(P) { } EVPLType type; @@ -52,8 +52,8 @@ struct VPL { * Generate a series of point light sources by sampling from the Halton * sequence (as is done in Instant Radiosity). The parameter \c offset * allows setting the initial QMC sample index (should be set to 0 if no offset is - * desired), and the last index is returned after the function finishes. This can - * be used to generate an arbitrary number of VPLs incrementally. Note that the + * desired), and the last index is returned after the function finishes. This can + * be used to generate an arbitrary number of VPLs incrementally. Note that the * value supplied with the parameter \c count is only a suggestion to the implementation. * Generally, it will produce a few more VPLs than the requsted amount. After VPL * generation is done, their power must be scaled by the inverse of the returned index. @@ -61,7 +61,7 @@ struct VPL { * is used to prune VPLs in an unbiased manner. */ extern MTS_EXPORT_RENDER size_t generateVPLs(const Scene *scene, - Random *random, size_t offset, + Random *random, size_t offset, size_t count, int maxDepth, bool prune, std::deque &vpls); diff --git a/src/bsdfs/blendbsdf.cpp b/src/bsdfs/blendbsdf.cpp index bc81157e..3d7f6617 100644 --- a/src/bsdfs/blendbsdf.cpp +++ b/src/bsdfs/blendbsdf.cpp @@ -39,14 +39,14 @@ MTS_NAMESPACE_BEGIN * smooth gold based on a binary bitmap texture (\lstref{blendbsdf})}{bsdf_blendbsdf} * } * - * This plugin implements a ``blend'' material, which represents + * This plugin implements a ``blend'' material, which represents * linear combinations of two BSDF instances. It is conceptually very similar * to the \pluginref{mixturebsdf} plugin. The main difference is that - * \pluginref{blendbsdf} can interpolate based on a texture rather than a set + * \pluginref{blendbsdf} can interpolate based on a texture rather than a set * of constants. * - * Any surface scattering model in Mitsuba (be it smooth, rough, reflecting, or - * transmitting) can be mixed with others in this manner to synthesize new models. + * Any surface scattering model in Mitsuba (be it smooth, rough, reflecting, or + * transmitting) can be mixed with others in this manner to synthesize new models. * * \begin{xml}[caption=Description of the material shown above, * label=lst:blendbsdf] @@ -59,7 +59,7 @@ MTS_NAMESPACE_BEGIN * * * - * + * * * * @@ -69,12 +69,12 @@ MTS_NAMESPACE_BEGIN class BlendBSDF : public BSDF { public: - BlendBSDF(const Properties &props) + BlendBSDF(const Properties &props) : BSDF(props) { m_weight = new ConstantFloatTexture(props.getFloat("weight", 0.5f)); } - BlendBSDF(Stream *stream, InstanceManager *manager) + BlendBSDF(Stream *stream, InstanceManager *manager) : BSDF(stream, manager) { m_weight = static_cast(manager->getInstance(stream)); m_bsdfs.push_back(static_cast(manager->getInstance(stream))); @@ -131,7 +131,7 @@ public: } Spectrum eval(const BSDFSamplingRecord &bRec, EMeasure measure) const { - Float weight = std::min((Float) 1.0f, std::max((Float) 0.0f, + Float weight = std::min((Float) 1.0f, std::max((Float) 0.0f, m_weight->eval(bRec.its).average())); if (bRec.component == -1) { @@ -152,7 +152,7 @@ public: Float pdf(const BSDFSamplingRecord &bRec, EMeasure measure) const { Spectrum result; - Float weight = std::min((Float) 1.0f, std::max((Float) 0.0f, + Float weight = std::min((Float) 1.0f, std::max((Float) 0.0f, m_weight->eval(bRec.its).average())); if (bRec.component == -1) { @@ -174,7 +174,7 @@ public: Point2 sample(_sample); Float weights[2]; - weights[1] = std::min((Float) 1.0f, std::max((Float) 0.0f, + weights[1] = std::min((Float) 1.0f, std::max((Float) 0.0f, m_weight->eval(bRec.its).average())); weights[0] = 1-weights[1]; @@ -220,7 +220,7 @@ public: Point2 sample(_sample); Float weights[2]; - weights[1] = std::min((Float) 1.0f, std::max((Float) 0.0f, + weights[1] = std::min((Float) 1.0f, std::max((Float) 0.0f, m_weight->eval(bRec.its).average())); weights[0] = 1-weights[1]; @@ -285,7 +285,7 @@ public: << " id = \"" << getID() << "\"," << endl << " weight = " << indent(m_weight->toString()) << endl << " bsdfs = {" << endl; - for (size_t i=0; itoString(), 2) << "," << endl; oss << " }" << "]"; diff --git a/src/bsdfs/bump.cpp b/src/bsdfs/bump.cpp index 0faf92e1..c7a81c7a 100644 --- a/src/bsdfs/bump.cpp +++ b/src/bsdfs/bump.cpp @@ -27,7 +27,7 @@ MTS_NAMESPACE_BEGIN * * \parameters{ * \parameter{\Unnamed}{\Texture}{ - * The luminance of this texture specifies the amount of + * The luminance of this texture specifies the amount of * displacement. The implementation ignores any constant * offset---only changes in the luminance matter. * } @@ -42,19 +42,19 @@ MTS_NAMESPACE_BEGIN * Bump mapping \cite{Blinn1978Simulation} is a simple technique for cheaply * adding surface detail to a rendering. This is done by perturbing the * shading coordinate frame based on a displacement height field provided - * as a texture. This method can lend objects a highly realistic and detailed + * as a texture. This method can lend objects a highly realistic and detailed * appearance (e.g. wrinkled or covered by scratches and other imperfections) * without requiring any changes to the input geometry. * * The implementation in Mitsuba uses the common approach of ignoring - * the usually negligible texture-space derivative of the base mesh + * the usually negligible texture-space derivative of the base mesh * surface normal. As side effect of this decision, it is invariant * to constant offsets in the height field texture---only variations in * its luminance cause changes to the shading frame. * - * Note that the magnitude of the height field variations influences + * Note that the magnitude of the height field variations influences * the strength of the displacement. If desired, the \pluginref{scale} - * texture plugin can be used to magnify or reduce the effect of a + * texture plugin can be used to magnify or reduce the effect of a * bump map texture. * \begin{xml}[caption=A rough metal model with a scaled image-based bump map] * @@ -76,7 +76,7 @@ class BumpMap : public BSDF { public: BumpMap(const Properties &props) : BSDF(props) { } - BumpMap(Stream *stream, InstanceManager *manager) + BumpMap(Stream *stream, InstanceManager *manager) : BSDF(stream, manager) { m_nested = static_cast(manager->getInstance(stream)); m_displacement = static_cast(manager->getInstance(stream)); @@ -90,7 +90,7 @@ public: Log(EError, "A displacement texture must be specified"); m_components.clear(); - for (int i=0; igetComponentCount(); ++i) + for (int i=0; igetComponentCount(); ++i) m_components.push_back(m_nested->getType(i) | ESpatiallyVarying | EAnisotropic); m_usesRayDifferentials = true; @@ -136,7 +136,7 @@ public: Float dDispDu = (dispU - disp) / eps; Float dDispDv = (dispV - disp) / eps; - /* Build a perturbed frame -- ignores the usually + /* Build a perturbed frame -- ignores the usually negligible normal derivative term */ Vector dpdu = its.dpdu + its.shFrame.n * ( dDispDu - dot(its.shFrame.n, its.dpdu)); @@ -174,7 +174,7 @@ public: const Intersection& its = bRec.its; Intersection perturbed; perturbIntersection(its, perturbed); - + BSDFSamplingRecord perturbedQuery(perturbed, perturbed.toLocal(its.toWorld(bRec.wi)), perturbed.toLocal(its.toWorld(bRec.wo)), bRec.mode); @@ -252,7 +252,7 @@ protected: ref m_nested; }; -// ================ Hardware shader implementation ================ +// ================ Hardware shader implementation ================ /** * This is a quite approximate version of the bump map model -- it likely @@ -261,7 +261,7 @@ protected: */ class BumpMapShader : public Shader { public: - BumpMapShader(Renderer *renderer, const BSDF *nested, const Texture *displacement) + BumpMapShader(Renderer *renderer, const BSDF *nested, const Texture *displacement) : Shader(renderer, EBSDFShader), m_nested(nested), m_displacement(displacement) { m_nestedShader = renderer->registerShaderForResource(m_nested.get()); m_displacementShader = renderer->registerShaderForResource(m_displacement.get()); @@ -329,7 +329,7 @@ private: ref m_displacementShader; }; -Shader *BumpMap::createShader(Renderer *renderer) const { +Shader *BumpMap::createShader(Renderer *renderer) const { return new BumpMapShader(renderer, m_nested.get(), m_displacement.get()); } diff --git a/src/bsdfs/coating.cpp b/src/bsdfs/coating.cpp index e50ed9d0..1d4722d1 100644 --- a/src/bsdfs/coating.cpp +++ b/src/bsdfs/coating.cpp @@ -31,37 +31,37 @@ MTS_NAMESPACE_BEGIN * numerically or using a known material name. \default{\texttt{bk7} / 1.5046}} * \parameter{extIOR}{\Float\Or\String}{Exterior index of refraction specified * numerically or using a known material name. \default{\texttt{air} / 1.000277}} - * \parameter{thickness}{\Float}{Denotes the thickness of the layer (to + * \parameter{thickness}{\Float}{Denotes the thickness of the layer (to * model absorption --- should be specified in inverse units of \code{sigmaA})\default{1}} - * \parameter{sigmaA}{\Spectrum\Or\Texture}{The absorption coefficient of the + * \parameter{sigmaA}{\Spectrum\Or\Texture}{The absorption coefficient of the * coating layer. \default{0, i.e. there is no absorption}} * \parameter{specular\showbreak Transmittance}{\Spectrum\Or\Texture}{Optional - * factor that can be used to modulate the specular transmission component. Note + * factor that can be used to modulate the specular transmission component. Note * that for physical realism, this parameter should never be touched. \default{1.0}} * \parameter{\Unnamed}{\BSDF}{A nested BSDF model that should be coated.} * } - * + * * \renderings{ * \rendering{Rough copper} * {bsdf_coating_uncoated} - * \rendering{The same material coated with a single layer of + * \rendering{The same material coated with a single layer of * clear varnish (see \lstref{coating-roughcopper})} * {bsdf_coating_roughconductor} * } * - * This plugin implements a smooth dielectric coating (e.g. a layer of varnish) - * in the style of the paper ``Arbitrarily Layered Micro-Facet Surfaces'' by - * Weidlich and Wilkie \cite{Weidlich2007Arbitrarily}. Any BSDF in Mitsuba - * can be coated using this plugin, and multiple coating layers can even - * be applied in sequence. This allows designing interesting custom materials - * like car paint or glazed metal foil. The coating layer can optionally be - * tinted (i.e. filled with an absorbing medium), in which case this model also + * This plugin implements a smooth dielectric coating (e.g. a layer of varnish) + * in the style of the paper ``Arbitrarily Layered Micro-Facet Surfaces'' by + * Weidlich and Wilkie \cite{Weidlich2007Arbitrarily}. Any BSDF in Mitsuba + * can be coated using this plugin, and multiple coating layers can even + * be applied in sequence. This allows designing interesting custom materials + * like car paint or glazed metal foil. The coating layer can optionally be + * tinted (i.e. filled with an absorbing medium), in which case this model also * accounts for the directionally dependent absorption within the layer. * * Note that the plugin discards illumination that undergoes internal * reflection within the coating. This can lead to a noticeable energy * loss for materials that reflect much of their energy near or below the critical - * angle (i.e. diffuse or very rough materials). + * angle (i.e. diffuse or very rough materials). * Therefore, users are discouraged to use this plugin to coat smooth * diffuse materials, since there is a separately available plugin * named \pluginref{plastic}, which covers the same case and does not @@ -78,11 +78,11 @@ MTS_NAMESPACE_BEGIN * * \vspace{4mm} * - * \begin{xml}[caption=Rough copper coated with a transparent layer of + * \begin{xml}[caption=Rough copper coated with a transparent layer of * varnish, label=lst:coating-roughcopper] * * - * + * * * * @@ -98,22 +98,22 @@ MTS_NAMESPACE_BEGIN * } * * \subsubsection*{Technical details} - * Evaluating the internal component of this model entails refracting the + * Evaluating the internal component of this model entails refracting the * incident and exitant rays through the dielectric interface, followed by - * querying the nested material with this modified direction pair. The result + * querying the nested material with this modified direction pair. The result * is attenuated by the two Fresnel transmittances and the absorption, if * any. */ class SmoothCoating : public BSDF { public: - SmoothCoating(const Properties &props) + SmoothCoating(const Properties &props) : BSDF(props) { /* Specifies the internal index of refraction at the interface */ Float intIOR = lookupIOR(props, "intIOR", "bk7"); /* Specifies the external index of refraction at the interface */ Float extIOR = lookupIOR(props, "extIOR", "air"); - + if (intIOR < 0 || extIOR < 0 || intIOR == extIOR) Log(EError, "The interior and exterior indices of " "refraction must be positive and differ!"); @@ -133,7 +133,7 @@ public: props.getSpectrum("specularReflectance", Spectrum(1.0f))); } - SmoothCoating(Stream *stream, InstanceManager *manager) + SmoothCoating(Stream *stream, InstanceManager *manager) : BSDF(stream, manager) { m_eta = stream->readFloat(); m_thickness = stream->readFloat(); @@ -163,7 +163,7 @@ public: extraFlags |= ESpatiallyVarying; m_components.clear(); - for (int i=0; igetComponentCount(); ++i) + for (int i=0; igetComponentCount(); ++i) m_components.push_back(m_nested->getType(i) | extraFlags); m_components.push_back(EDeltaReflection | EFrontSide | EBackSide @@ -241,21 +241,21 @@ public: * (1-R12) * (1-R21); Spectrum sigmaA = m_sigmaA->eval(bRec.its) * m_thickness; - if (!sigmaA.isZero()) + if (!sigmaA.isZero()) result *= (-sigmaA * (1/std::abs(Frame::cosTheta(bRecInt.wi)) + 1/std::abs(Frame::cosTheta(bRecInt.wo)))).exp(); if (measure == ESolidAngle) { /* Solid angle compression & irradiance conversion factors */ - result *= m_invEta * m_invEta * + result *= m_invEta * m_invEta * Frame::cosTheta(bRec.wi) * Frame::cosTheta(bRec.wo) / (Frame::cosTheta(bRecInt.wi) * Frame::cosTheta(bRecInt.wo)); } return result; } - + return Spectrum(0.0f); } @@ -264,13 +264,13 @@ public: && (bRec.component == -1 || bRec.component == (int) m_components.size()-1); bool sampleNested = (bRec.typeMask & m_nested->getType() & BSDF::EAll) && (bRec.component == -1 || bRec.component < (int) m_components.size()-1); - + Float R12; Vector wiPrime = refractIn(bRec.wi, R12); /* Reallocate samples */ Float probSpecular = (R12*m_specularSamplingWeight) / - (R12*m_specularSamplingWeight + + (R12*m_specularSamplingWeight + (1-R12) * (1-m_specularSamplingWeight)); if (measure == EDiscrete && sampleSpecular && @@ -311,7 +311,7 @@ public: /* Reallocate samples */ Float probSpecular = (R12*m_specularSamplingWeight) / - (R12*m_specularSamplingWeight + + (R12*m_specularSamplingWeight + (1-R12) * (1-m_specularSamplingWeight)); bool choseSpecular = sampleSpecular; @@ -341,13 +341,13 @@ public: bRec.wi = wiPrime; Spectrum result = m_nested->sample(bRec, pdf, sample); bRec.wi = wiBackup; - if (result.isZero()) + if (result.isZero()) return Spectrum(0.0f); Vector woPrime = bRec.wo; Spectrum sigmaA = m_sigmaA->eval(bRec.its) * m_thickness; - if (!sigmaA.isZero()) + if (!sigmaA.isZero()) result *= (-sigmaA * (1/std::abs(Frame::cosTheta(wiPrime)) + 1/std::abs(Frame::cosTheta(woPrime)))).exp(); @@ -369,7 +369,7 @@ public: result *= Frame::cosTheta(bRec.wi) / Frame::cosTheta(wiPrime); pdf *= m_invEta * m_invEta * Frame::cosTheta(bRec.wo) / Frame::cosTheta(woPrime); } - + return result; } } @@ -388,7 +388,7 @@ public: std::ostringstream oss; oss << "SmoothCoating[" << endl << " id = \"" << getID() << "\"," << endl - << " eta = " << m_eta << "," << endl + << " eta = " << m_eta << "," << endl << " specularSamplingWeight = " << m_specularSamplingWeight << "," << endl << " sigmaA = " << indent(m_sigmaA->toString()) << "," << endl << " specularReflectance = " << indent(m_specularReflectance->toString()) << "," << endl @@ -410,7 +410,7 @@ protected: Float m_thickness; }; -// ================ Hardware shader implementation ================ +// ================ Hardware shader implementation ================ /** * Simple GLSL version -- uses Schlick's approximation and approximates the @@ -534,7 +534,7 @@ private: Float m_R0, m_eta; }; -Shader *SmoothCoating::createShader(Renderer *renderer) const { +Shader *SmoothCoating::createShader(Renderer *renderer) const { return new SmoothCoatingShader(renderer, m_eta, m_nested.get(), m_sigmaA.get()); } diff --git a/src/bsdfs/conductor.cpp b/src/bsdfs/conductor.cpp index 25feb465..da828747 100644 --- a/src/bsdfs/conductor.cpp +++ b/src/bsdfs/conductor.cpp @@ -26,15 +26,15 @@ MTS_NAMESPACE_BEGIN * \order{6} * \icon{bsdf_conductor} * \parameters{ - * \parameter{material}{\String}{Name of a material preset, see + * \parameter{material}{\String}{Name of a material preset, see * \tblref{conductor-iors}.\!\default{\texttt{Cu} / copper}} - * \parameter{eta}{\Spectrum}{Real part of the material's index + * \parameter{eta}{\Spectrum}{Real part of the material's index * of refraction \default{based on the value of \texttt{material}}} - * \parameter{k}{\Spectrum}{Imaginary part of the material's index of + * \parameter{k}{\Spectrum}{Imaginary part of the material's index of * refraction, also known as absorption coefficient. * \default{based on the value of \texttt{material}}} * \parameter{specular\showbreak Reflectance}{\Spectrum\Or\Texture}{Optional - * factor that can be used to modulate the specular reflection component. Note + * factor that can be used to modulate the specular reflection component. Note * that for physical realism, this parameter should never be touched. \default{1.0}} * } * \renderings{ @@ -44,41 +44,41 @@ MTS_NAMESPACE_BEGIN * \rendering{Measured gold material (\lstref{conductor-gold})} * {bsdf_conductor_gold.jpg} * } - * - * This plugin implements a perfectly smooth interface to a conducting material, - * such as a metal. For a similar model that instead describes a rough surface - * microstructure, take a look at the separately available + * + * This plugin implements a perfectly smooth interface to a conducting material, + * such as a metal. For a similar model that instead describes a rough surface + * microstructure, take a look at the separately available * \pluginref{roughconductor} plugin. - * In contrast to dielectric materials, conductors do not transmit + * In contrast to dielectric materials, conductors do not transmit * any light. Their index of refraction is complex-valued and tends to undergo - * considerable changes throughout the visible color spectrum. - * - * To facilitate the tedious task of specifying spectrally-varying index of - * refraction information, Mitsuba ships with a set of measured data for - * several materials, where visible-spectrum information was publicly + * considerable changes throughout the visible color spectrum. + * + * To facilitate the tedious task of specifying spectrally-varying index of + * refraction information, Mitsuba ships with a set of measured data for + * several materials, where visible-spectrum information was publicly * available\footnote{ - * These index of refraction values are identical to the data distributed + * These index of refraction values are identical to the data distributed * with PBRT. They are originally from the Luxpop database - * (\url{www.luxpop.com}) and are based on data by Palik et al. - * \cite{Palik1998Handbook} and measurements of atomic scattering factors - * made by the Center For X-Ray Optics (CXRO) at Berkeley and the + * (\url{www.luxpop.com}) and are based on data by Palik et al. + * \cite{Palik1998Handbook} and measurements of atomic scattering factors + * made by the Center For X-Ray Optics (CXRO) at Berkeley and the * Lawrence Livermore National Laboratory (LLNL). - * }. - * - * Note that \tblref{conductor-iors} also includes several popular optical - * coatings, which are not actually conductors. These materials can also - * be used with this plugin, though note that the plugin will ignore any + * }. + * + * Note that \tblref{conductor-iors} also includes several popular optical + * coatings, which are not actually conductors. These materials can also + * be used with this plugin, though note that the plugin will ignore any * refraction component that the actual material might have had. * - * When using this plugin, you should ideally compile Mitsuba with support for - * spectral rendering to get the most accurate results. While it also works + * When using this plugin, you should ideally compile Mitsuba with support for + * spectral rendering to get the most accurate results. While it also works * in RGB mode, the computations will be more approximate in nature. - * Also note that this material is one-sided---that is, observed from the - * back side, it will be completely black. If this is undesirable, + * Also note that this material is one-sided---that is, observed from the + * back side, it will be completely black. If this is undesirable, * consider using the \pluginref{twosided} BRDF adapter plugin.\vspace{4mm} * - * \begin{xml}[caption=A material configuration for a smooth conductor with + * \begin{xml}[caption=A material configuration for a smooth conductor with * measured gold data, label=lst:conductor-gold] * * @@ -87,9 +87,9 @@ MTS_NAMESPACE_BEGIN * * \end{xml} * \vspace{5mm} - * It is also possible to load spectrally varying index of refraction data from + * It is also possible to load spectrally varying index of refraction data from * two external files containing the real and imaginary components, - * respectively (see \secref{format-spectra} for details on the file + * respectively (see \secref{format-spectra} for details on the file * format): * \begin{xml}[caption=Rendering a smooth conductor with custom data] * @@ -134,10 +134,10 @@ MTS_NAMESPACE_BEGIN * \label{tbl:conductor-iors} * This table lists all supported materials that can be passed into the * \pluginref{conductor} and \pluginref{roughconductor} plugins. Note that - * some of them are not actually conductors---this is not a problem, + * some of them are not actually conductors---this is not a problem, * they can be used regardless (though only the reflection component and - * no transmission will be simulated). In most cases, there are - * multiple entries for each material, which represent measurements by + * no transmission will be simulated). In most cases, there are + * multiple entries for each material, which represent measurements by * different authors. * } * \end{table} @@ -161,7 +161,7 @@ public: m_k = props.getSpectrum("k", materialK); } - SmoothConductor(Stream *stream, InstanceManager *manager) + SmoothConductor(Stream *stream, InstanceManager *manager) : BSDF(stream, manager) { m_specularReflectance = static_cast(manager->getInstance(stream)); m_eta = Spectrum(stream); @@ -174,8 +174,8 @@ public: /* Verify the input parameters and fix them if necessary */ m_specularReflectance = ensureEnergyConservation( m_specularReflectance, "specularReflectance", 1.0f); - - m_usesRayDifferentials = + + m_usesRayDifferentials = m_specularReflectance->usesRayDifferentials(); m_components.clear(); @@ -240,7 +240,7 @@ public: Spectrum sample(BSDFSamplingRecord &bRec, const Point2 &sample) const { bool sampleReflection = (bRec.typeMask & EDeltaReflection) && (bRec.component == -1 || bRec.component == 0); - + if (!sampleReflection || Frame::cosTheta(bRec.wi) <= 0) return Spectrum(0.0f); @@ -256,7 +256,7 @@ public: Spectrum sample(BSDFSamplingRecord &bRec, Float &pdf, const Point2 &sample) const { bool sampleReflection = (bRec.typeMask & EDeltaReflection) && (bRec.component == -1 || bRec.component == 0); - + if (!sampleReflection || Frame::cosTheta(bRec.wi) <= 0) return Spectrum(0.0f); @@ -285,7 +285,7 @@ public: return oss.str(); } - Shader *createShader(Renderer *renderer) const; + Shader *createShader(Renderer *renderer) const; MTS_DECLARE_CLASS() private: @@ -295,7 +295,7 @@ private: }; /* Smooth conductor shader -- it is really hopeless to visualize - this material in the VPL renderer, so let's try to do at least + this material in the VPL renderer, so let's try to do at least something that suggests the presence of a specularly-reflecting conductor. @@ -305,7 +305,7 @@ private: class SmoothConductorShader : public Shader { public: SmoothConductorShader(Renderer *renderer, const Texture *specularReflectance, - const Spectrum &eta, const Spectrum &k) : Shader(renderer, EBSDFShader), + const Spectrum &eta, const Spectrum &k) : Shader(renderer, EBSDFShader), m_specularReflectance(specularReflectance) { m_specularReflectanceShader = renderer->registerShaderForResource(m_specularReflectance.get()); @@ -385,7 +385,7 @@ private: Float m_alpha; }; -Shader *SmoothConductor::createShader(Renderer *renderer) const { +Shader *SmoothConductor::createShader(Renderer *renderer) const { return new SmoothConductorShader(renderer, m_specularReflectance.get(), m_eta, m_k); } diff --git a/src/bsdfs/dielectric.cpp b/src/bsdfs/dielectric.cpp index 65575794..afa6efce 100644 --- a/src/bsdfs/dielectric.cpp +++ b/src/bsdfs/dielectric.cpp @@ -31,32 +31,32 @@ MTS_NAMESPACE_BEGIN * \parameter{extIOR}{\Float\Or\String}{Exterior index of refraction specified * numerically or using a known material name. \default{\texttt{air} / 1.000277}} * \parameter{specular\showbreak Reflectance}{\Spectrum\Or\Texture}{Optional - * factor that can be used to modulate the specular reflection component. Note + * factor that can be used to modulate the specular reflection component. Note * that for physical realism, this parameter should never be touched. \default{1.0}} * \parameter{specular\showbreak Transmittance}{\Spectrum\Or\Texture}{Optional - * factor that can be used to modulate the specular transmission component. Note + * factor that can be used to modulate the specular transmission component. Note * that for physical realism, this parameter should never be touched. \default{1.0}} * } * * \renderings{ - * \medrendering{Air$\leftrightarrow$Water (IOR: 1.33) interface. + * \medrendering{Air$\leftrightarrow$Water (IOR: 1.33) interface. * See \lstref{dielectric-water}.}{bsdf_dielectric_water} * \medrendering{Air$\leftrightarrow$Diamond (IOR: 2.419)}{bsdf_dielectric_diamond} - * \medrendering{Air$\leftrightarrow$Glass (IOR: 1.504) interface with absorption. + * \medrendering{Air$\leftrightarrow$Glass (IOR: 1.504) interface with absorption. * See \lstref{dielectric-glass}.}{bsdf_dielectric_glass} * } * - * This plugin models an interface between two dielectric materials having mismatched + * This plugin models an interface between two dielectric materials having mismatched * indices of refraction (for instance, water and air). Exterior and interior IOR values - * can be specified independently, where ``exterior'' refers to the side that contains + * can be specified independently, where ``exterior'' refers to the side that contains * the surface normal. When no parameters are given, the plugin activates the defaults, which * describe a borosilicate glass BK7/air interface. * - * In this model, the microscopic structure of the surface is assumed to be perfectly + * In this model, the microscopic structure of the surface is assumed to be perfectly * smooth, resulting in a degenerate\footnote{Meaning that for any given incoming ray of light, - * the model always scatters into a discrete set of directions, as opposed to a continuum.} - * BSDF described by a Dirac delta distribution. For a similar model that instead describes a - * rough surface microstructure, take a look at the \pluginref{roughdielectric} plugin. + * the model always scatters into a discrete set of directions, as opposed to a continuum.} + * BSDF described by a Dirac delta distribution. For a similar model that instead describes a + * rough surface microstructure, take a look at the \pluginref{roughdielectric} plugin. * * \begin{xml}[caption=A simple air-to-water interface, label=lst:dielectric-water] * @@ -70,12 +70,12 @@ MTS_NAMESPACE_BEGIN * When using this model, it is crucial that the scene contains * meaningful and mutually compatible indices of refraction changes---see * \figref{glass-explanation} for a description of what this entails. - * + * * In many cases, we will want to additionally describe the \emph{medium} within a * dielectric material. This requires the use of a rendering technique that is * aware of media (e.g. the volumetric path tracer). An example of how one might * describe a slightly absorbing piece of glass is shown below: - * \begin{xml}[caption=A glass material with absorption (based on the + * \begin{xml}[caption=A glass material with absorption (based on the * Beer-Lambert law). This material can only be used by an integrator * that is aware of participating media., label=lst:dielectric-glass] * @@ -134,7 +134,7 @@ MTS_NAMESPACE_BEGIN * \pluginref{dielectric},\ * \pluginref{roughdielectric},\ * \pluginref{plastic}, \ - * \pluginref{roughplastic}, as well as + * \pluginref{roughplastic}, as well as * \pluginref{coating}. * } * \end{table} @@ -164,7 +164,7 @@ public: props.getSpectrum("specularTransmittance", Spectrum(1.0f))); } - SmoothDielectric(Stream *stream, InstanceManager *manager) + SmoothDielectric(Stream *stream, InstanceManager *manager) : BSDF(stream, manager) { m_eta = stream->readFloat(); m_specularReflectance = static_cast(manager->getInstance(stream)); @@ -187,17 +187,17 @@ public: m_specularReflectance, "specularReflectance", 1.0f); m_specularTransmittance = ensureEnergyConservation( m_specularTransmittance, "specularTransmittance", 1.0f); - + m_components.clear(); m_components.push_back(EDeltaReflection | EFrontSide | EBackSide | (m_specularReflectance->isConstant() ? 0 : ESpatiallyVarying)); m_components.push_back(EDeltaTransmission | EFrontSide | EBackSide | ENonSymmetric | (m_specularTransmittance->isConstant() ? 0 : ESpatiallyVarying)); - - m_usesRayDifferentials = + + m_usesRayDifferentials = m_specularReflectance->usesRayDifferentials() || m_specularTransmittance->usesRayDifferentials(); - + BSDF::configure(); } @@ -219,7 +219,7 @@ public: return Vector(-wi.x, -wi.y, wi.z); } - /// Refraction in local coordinates + /// Refraction in local coordinates inline Vector refract(const Vector &wi, Float cosThetaT) const { Float scale = -(cosThetaT < 0 ? m_invEta : m_eta); return Vector(scale*wi.x, scale*wi.y, cosThetaT); @@ -243,9 +243,9 @@ public: if (!sampleTransmission || absDot(refract(bRec.wi, cosThetaT), bRec.wo) < 1-DeltaEpsilon) return Spectrum(0.0f); - /* Radiance must be scaled to account for the solid angle compression + /* Radiance must be scaled to account for the solid angle compression that occurs when crossing the interface. */ - Float factor = (bRec.mode == ERadiance) + Float factor = (bRec.mode == ERadiance) ? (cosThetaT < 0 ? m_invEta : m_eta) : 1.0f; return m_specularTransmittance->eval(bRec.its) * factor * factor * (1 - F); @@ -299,9 +299,9 @@ public: bRec.eta = cosThetaT < 0 ? m_eta : m_invEta; pdf = 1-F; - /* Radiance must be scaled to account for the solid angle compression + /* Radiance must be scaled to account for the solid angle compression that occurs when crossing the interface. */ - Float factor = (bRec.mode == ERadiance) + Float factor = (bRec.mode == ERadiance) ? (cosThetaT < 0 ? m_invEta : m_eta) : 1.0f; return m_specularTransmittance->eval(bRec.its) * (factor * factor); @@ -321,9 +321,9 @@ public: bRec.eta = cosThetaT < 0 ? m_eta : m_invEta; pdf = 1.0f; - /* Radiance must be scaled to account for the solid angle compression + /* Radiance must be scaled to account for the solid angle compression that occurs when crossing the interface. */ - Float factor = (bRec.mode == ERadiance) + Float factor = (bRec.mode == ERadiance) ? (cosThetaT < 0 ? m_invEta : m_eta) : 1.0f; return m_specularTransmittance->eval(bRec.its) * (factor * factor * (1-F)); @@ -355,9 +355,9 @@ public: bRec.wo = refract(bRec.wi, cosThetaT); bRec.eta = cosThetaT < 0 ? m_eta : m_invEta; - /* Radiance must be scaled to account for the solid angle compression + /* Radiance must be scaled to account for the solid angle compression that occurs when crossing the interface. */ - Float factor = (bRec.mode == ERadiance) + Float factor = (bRec.mode == ERadiance) ? (cosThetaT < 0 ? m_invEta : m_eta) : 1.0f; return m_specularTransmittance->eval(bRec.its) * (factor * factor); @@ -375,9 +375,9 @@ public: bRec.wo = refract(bRec.wi, cosThetaT); bRec.eta = cosThetaT < 0 ? m_eta : m_invEta; - /* Radiance must be scaled to account for the solid angle compression + /* Radiance must be scaled to account for the solid angle compression that occurs when crossing the interface. */ - Float factor = (bRec.mode == ERadiance) + Float factor = (bRec.mode == ERadiance) ? (cosThetaT < 0 ? m_invEta : m_eta) : 1.0f; return m_specularTransmittance->eval(bRec.its) * (factor * factor * (1-F)); @@ -398,7 +398,7 @@ public: std::ostringstream oss; oss << "SmoothDielectric[" << endl << " id = \"" << getID() << "\"," << endl - << " eta = " << m_eta << "," << endl + << " eta = " << m_eta << "," << endl << " specularReflectance = " << indent(m_specularReflectance->toString()) << "," << endl << " specularTransmittance = " << indent(m_specularTransmittance->toString()) << endl << "]"; @@ -415,7 +415,7 @@ private: }; /* Fake glass shader -- it is really hopeless to visualize - this material in the VPL renderer, so let's try to do at least + this material in the VPL renderer, so let's try to do at least something that suggests the presence of a transparent boundary */ class SmoothDielectricShader : public Shader { public: @@ -446,7 +446,7 @@ public: MTS_DECLARE_CLASS() }; -Shader *SmoothDielectric::createShader(Renderer *renderer) const { +Shader *SmoothDielectric::createShader(Renderer *renderer) const { return new SmoothDielectricShader(renderer); } diff --git a/src/bsdfs/difftrans.cpp b/src/bsdfs/difftrans.cpp index 816e61b1..f976d449 100644 --- a/src/bsdfs/difftrans.cpp +++ b/src/bsdfs/difftrans.cpp @@ -37,26 +37,26 @@ MTS_NAMESPACE_BEGIN * \rendering{The model with default parameters}{bsdf_difftrans.jpg} * } * - * This BSDF models a non-reflective material, where any entering light loses - * its directionality and is diffusely scattered from the other side. This + * This BSDF models a non-reflective material, where any entering light loses + * its directionality and is diffusely scattered from the other side. This * model can be combined\footnote{For instance using the - * \pluginref{mixturebsdf} plugin.} with a surface reflection model to - * describe translucent substances that have internal multiple scattering + * \pluginref{mixturebsdf} plugin.} with a surface reflection model to + * describe translucent substances that have internal multiple scattering * processes (e.g. plant leaves). */ class DiffuseTransmitter : public BSDF { public: - DiffuseTransmitter(const Properties &props) + DiffuseTransmitter(const Properties &props) : BSDF(props) { /* For better compatibility with other models, support both 'transmittance' and 'diffuseTransmittance' as parameter names */ m_transmittance = new ConstantSpectrumTexture(props.getSpectrum( - props.hasProperty("transmittance") ? "transmittance" + props.hasProperty("transmittance") ? "transmittance" : "diffuseTransmittance", Spectrum(.5f))); m_usesRayDifferentials = false; } - DiffuseTransmitter(Stream *stream, InstanceManager *manager) + DiffuseTransmitter(Stream *stream, InstanceManager *manager) : BSDF(stream, manager) { m_transmittance = static_cast(manager->getInstance(stream)); m_usesRayDifferentials = m_transmittance->usesRayDifferentials(); @@ -103,7 +103,7 @@ public: } Spectrum sample(BSDFSamplingRecord &bRec, Float &pdf, const Point2 &sample) const { - if (!(bRec.typeMask & m_combinedType)) + if (!(bRec.typeMask & m_combinedType)) return Spectrum(0.0f); bRec.wo = Warp::squareToCosineHemisphere(sample); if (Frame::cosTheta(bRec.wi) > 0) @@ -116,7 +116,7 @@ public: } void addChild(const std::string &name, ConfigurableObject *child) { - if (child->getClass()->derivesFrom(MTS_CLASS(Texture)) && + if (child->getClass()->derivesFrom(MTS_CLASS(Texture)) && (name == "transmittance" || name == "diffuseTransmittance")) { m_transmittance = static_cast(child); m_usesRayDifferentials |= m_transmittance->usesRayDifferentials(); @@ -151,11 +151,11 @@ private: ref m_transmittance; }; -// ================ Hardware shader implementation ================ +// ================ Hardware shader implementation ================ class DiffuseTransmitterShader : public Shader { public: - DiffuseTransmitterShader(Renderer *renderer, const Texture *reflectance) + DiffuseTransmitterShader(Renderer *renderer, const Texture *reflectance) : Shader(renderer, EBSDFShader), m_transmittance(reflectance) { m_transmittanceShader = renderer->registerShaderForResource(m_transmittance.get()); } @@ -192,7 +192,7 @@ private: ref m_transmittanceShader; }; -Shader *DiffuseTransmitter::createShader(Renderer *renderer) const { +Shader *DiffuseTransmitter::createShader(Renderer *renderer) const { return new DiffuseTransmitterShader(renderer, m_transmittance.get()); } diff --git a/src/bsdfs/diffuse.cpp b/src/bsdfs/diffuse.cpp index 6b56e147..7cfe9a65 100644 --- a/src/bsdfs/diffuse.cpp +++ b/src/bsdfs/diffuse.cpp @@ -28,7 +28,7 @@ MTS_NAMESPACE_BEGIN * \icon{bsdf_diffuse} * \parameters{ * \parameter{reflectance}{\Spectrum\Or\Texture}{ - * Specifies the diffuse albedo of the + * Specifies the diffuse albedo of the * material \default{0.5} * } * } @@ -41,22 +41,22 @@ MTS_NAMESPACE_BEGIN * } * * The smooth diffuse material (also referred to as ``Lambertian'') - * represents an ideally diffuse material with a user-specified amount of - * reflectance. Any received illumination is scattered so that the surface + * represents an ideally diffuse material with a user-specified amount of + * reflectance. Any received illumination is scattered so that the surface * looks the same independently of the direction of observation. * - * Apart from a homogeneous reflectance value, the plugin can also accept - * a nested or referenced texture map to be used as the source of reflectance + * Apart from a homogeneous reflectance value, the plugin can also accept + * a nested or referenced texture map to be used as the source of reflectance * information, which is then mapped onto the shape based on its UV - * parameterization. When no parameters are specified, the model uses the default + * parameterization. When no parameters are specified, the model uses the default * of 50% reflectance. * - * Note that this material is one-sided---that is, observed from the - * back side, it will be completely black. If this is undesirable, + * Note that this material is one-sided---that is, observed from the + * back side, it will be completely black. If this is undesirable, * consider using the \pluginref{twosided} BRDF adapter plugin. * \vspace{4mm} * - * \begin{xml}[caption={A diffuse material, whose reflectance is specified + * \begin{xml}[caption={A diffuse material, whose reflectance is specified * as an sRGB color}, label=lst:diffuse-uniform] * * @@ -74,16 +74,16 @@ MTS_NAMESPACE_BEGIN */ class SmoothDiffuse : public BSDF { public: - SmoothDiffuse(const Properties &props) + SmoothDiffuse(const Properties &props) : BSDF(props) { /* For better compatibility with other models, support both 'reflectance' and 'diffuseReflectance' as parameter names */ m_reflectance = new ConstantSpectrumTexture(props.getSpectrum( - props.hasProperty("reflectance") ? "reflectance" + props.hasProperty("reflectance") ? "reflectance" : "diffuseReflectance", Spectrum(.5f))); } - SmoothDiffuse(Stream *stream, InstanceManager *manager) + SmoothDiffuse(Stream *stream, InstanceManager *manager) : BSDF(stream, manager) { m_reflectance = static_cast(manager->getInstance(stream)); @@ -109,17 +109,17 @@ public: Spectrum eval(const BSDFSamplingRecord &bRec, EMeasure measure) const { if (!(bRec.typeMask & EDiffuseReflection) || measure != ESolidAngle - || Frame::cosTheta(bRec.wi) <= 0 + || Frame::cosTheta(bRec.wi) <= 0 || Frame::cosTheta(bRec.wo) <= 0) return Spectrum(0.0f); - + return m_reflectance->eval(bRec.its) * (INV_PI * Frame::cosTheta(bRec.wo)); } Float pdf(const BSDFSamplingRecord &bRec, EMeasure measure) const { if (!(bRec.typeMask & EDiffuseReflection) || measure != ESolidAngle - || Frame::cosTheta(bRec.wi) <= 0 + || Frame::cosTheta(bRec.wi) <= 0 || Frame::cosTheta(bRec.wo) <= 0) return 0.0f; @@ -127,7 +127,7 @@ public: } Spectrum sample(BSDFSamplingRecord &bRec, const Point2 &sample) const { - if (!(bRec.typeMask & EDiffuseReflection) || Frame::cosTheta(bRec.wi) <= 0) + if (!(bRec.typeMask & EDiffuseReflection) || Frame::cosTheta(bRec.wi) <= 0) return Spectrum(0.0f); bRec.wo = Warp::squareToCosineHemisphere(sample); @@ -150,7 +150,7 @@ public: } void addChild(const std::string &name, ConfigurableObject *child) { - if (child->getClass()->derivesFrom(MTS_CLASS(Texture)) + if (child->getClass()->derivesFrom(MTS_CLASS(Texture)) && (name == "reflectance" || name == "diffuseReflectance")) { m_reflectance = static_cast(child); } else { @@ -184,11 +184,11 @@ private: ref m_reflectance; }; -// ================ Hardware shader implementation ================ +// ================ Hardware shader implementation ================ class SmoothDiffuseShader : public Shader { public: - SmoothDiffuseShader(Renderer *renderer, const Texture *reflectance) + SmoothDiffuseShader(Renderer *renderer, const Texture *reflectance) : Shader(renderer, EBSDFShader), m_reflectance(reflectance) { m_reflectanceShader = renderer->registerShaderForResource(m_reflectance.get()); } @@ -225,7 +225,7 @@ private: ref m_reflectanceShader; }; -Shader *SmoothDiffuse::createShader(Renderer *renderer) const { +Shader *SmoothDiffuse::createShader(Renderer *renderer) const { return new SmoothDiffuseShader(renderer, m_reflectance.get()); } diff --git a/src/bsdfs/hk.cpp b/src/bsdfs/hk.cpp index bc0097a5..22485bca 100644 --- a/src/bsdfs/hk.cpp +++ b/src/bsdfs/hk.cpp @@ -30,21 +30,21 @@ MTS_NAMESPACE_BEGIN * \icon{bsdf_hk} * * \parameters{ - * \parameter{material}{\String}{Name of a material preset, see + * \parameter{material}{\String}{Name of a material preset, see * \tblref{medium-coefficients}. \default{\texttt{skin1}}} - * \parameter{sigmaS}{\Spectrum\Or\Texture}{Specifies the scattering coefficient + * \parameter{sigmaS}{\Spectrum\Or\Texture}{Specifies the scattering coefficient * of the internal layer. \default{based on \code{material}}} - * \parameter{sigmaA}{\Spectrum\Or\Texture}{Specifies the absorption coefficient + * \parameter{sigmaA}{\Spectrum\Or\Texture}{Specifies the absorption coefficient * of the internal layer. \default{based on \code{material}}} * \parameter{sigmaT \& albedo}{\Spectrum\Or\Texture}{ * Optional: Alternatively, the scattering and absorption coefficients may also be - * specified using the extinction coefficient \code{sigmaT} and the - * single-scattering albedo. Note that only one of the parameter passing - * conventions can be used at a time (i.e. use either \code{sigmaS\&sigmaA} + * specified using the extinction coefficient \code{sigmaT} and the + * single-scattering albedo. Note that only one of the parameter passing + * conventions can be used at a time (i.e. use either \code{sigmaS\&sigmaA} * \emph{or} \code{sigmaT\&albedo})} * \parameter{thickness}{\Float}{Denotes the thickness of the layer. * (should be specified in inverse units of \code{sigmaA} and \code{sigmaS})\default{1}} - * \parameter{\Unnamed}{\Phase}{A nested phase function instance that represents + * \parameter{\Unnamed}{\Phase}{A nested phase function instance that represents * the type of scattering interactions occurring within the layer} * } * @@ -59,15 +59,15 @@ MTS_NAMESPACE_BEGIN * } * * This plugin provides an implementation of the Hanrahan-Krueger BSDF - * \cite{Hanrahan1993Reflection} for simulating single scattering in thin - * index-matched layers filled with a random scattering medium. + * \cite{Hanrahan1993Reflection} for simulating single scattering in thin + * index-matched layers filled with a random scattering medium. * In addition, the implementation also accounts for attenuated * light that passes through the medium without undergoing any scattering events. * * This BSDF requires a phase function to model scattering interactions within the - * random medium. When no phase function is explicitly specified, it uses an + * random medium. When no phase function is explicitly specified, it uses an * isotropic one ($g=0$) by default. A sample usage for instantiating the - * plugin is given on the next page:\newpage + * plugin is given on the next page:\newpage * \begin{xml} * * @@ -80,16 +80,16 @@ MTS_NAMESPACE_BEGIN * * \end{xml} * - * When used in conjuction with the \pluginref{coating} plugin, it is possible - * to model refraction and reflection at the layer boundaries when the indices - * of refraction are mismatched. The combination of these two plugins then + * When used in conjuction with the \pluginref{coating} plugin, it is possible + * to model refraction and reflection at the layer boundaries when the indices + * of refraction are mismatched. The combination of these two plugins then * reproduces the full model as it was originally proposed by Hanrahan and * Krueger \cite{Hanrahan1993Reflection}. * - * Note that this model does not account for light that undergoes multiple + * Note that this model does not account for light that undergoes multiple * scattering events within the layer. This leads to energy loss, * particularly at grazing angles, which can be seen in the left-hand image of - * \figref{hk-example}. + * \figref{hk-example}. * * \begin{xml}[caption=A thin dielectric layer with measured ketchup scattering parameters, label=lst:hk-coated] * @@ -104,11 +104,11 @@ MTS_NAMESPACE_BEGIN * \end{xml} * * Note that when \texttt{sigmaS} = \texttt{sigmaA}$\ = 0$, or when \texttt{thickness=0}, - * any geometry associated with this BSDF becomes invisible, as light will pass through + * any geometry associated with this BSDF becomes invisible, as light will pass through * unchanged. * * The implementation in Mitsuba is based on code by Tom Kazimiers and Marios Papas. - * Marios Papas has kindly verified the implementation of the coated and uncoated variants + * Marios Papas has kindly verified the implementation of the coated and uncoated variants * against both a path tracer and a separate reference implementation. */ class HanrahanKrueger : public BSDF { @@ -124,10 +124,10 @@ public: /* Absorption coefficient of the layer */ m_sigmaA = new ConstantSpectrumTexture( props.getSpectrum("sigmaA", sigmaA)); - + /* Slab thickness in inverse units of sigmaS and sigmaA */ - m_thickness = props.getFloat("thickness", 1); - + m_thickness = props.getFloat("thickness", 1); + if (props.hasProperty("sigmaT")) m_sigmaT = new ConstantSpectrumTexture( props.getSpectrum("sigmaT")); @@ -136,7 +136,7 @@ public: props.getSpectrum("albedo")); } - HanrahanKrueger(Stream *stream, InstanceManager *manager) + HanrahanKrueger(Stream *stream, InstanceManager *manager) : BSDF(stream, manager) { m_phase = static_cast(manager->getInstance(stream)); m_sigmaS = static_cast(manager->getInstance(stream)); @@ -209,7 +209,7 @@ public: && (bRec.component == -1 || bRec.component == 0); bool hasGlossyTransmission = (bRec.typeMask & EGlossyTransmission) && (bRec.component == -1 || bRec.component == 1); - + Spectrum albedo; for (int i = 0; i < SPECTRUM_SAMPLES; i++) albedo[i] = sigmaT[i] > 0 ? (sigmaS[i]/sigmaT[i]) : (Float) 0; @@ -217,7 +217,7 @@ public: const Float cosThetaI = Frame::cosTheta(bRec.wi), cosThetaO = Frame::cosTheta(bRec.wo), dp = cosThetaI*cosThetaO; - + bool reflection = dp > 0, transmission = dp < 0; /* ==================================================================== */ @@ -226,7 +226,7 @@ public: if (hasGlossyReflection && reflection) { MediumSamplingRecord dummy; - PhaseFunctionSamplingRecord pRec(dummy,bRec.wi,bRec.wo); + PhaseFunctionSamplingRecord pRec(dummy,bRec.wi,bRec.wo); const Float phaseVal = m_phase->eval(pRec); result = albedo * (phaseVal*cosThetaI/(cosThetaI+cosThetaO)) * @@ -246,11 +246,11 @@ public: /* Hanrahan etal 93 Single Scattering transmission term */ if (std::abs(cosThetaI + cosThetaO) < Epsilon) { /* avoid division by zero */ - result += albedo * phaseVal*tauD/std::abs(cosThetaO) * + result += albedo * phaseVal*tauD/std::abs(cosThetaO) * ((-tauD/std::abs(cosThetaO)).exp()); } else { /* Guaranteed to be positive even if |cosThetaO| > |cosThetaI| */ - result += albedo * phaseVal*std::abs(cosThetaI)/(std::abs(cosThetaI)-std::abs(cosThetaO)) * + result += albedo * phaseVal*std::abs(cosThetaI)/(std::abs(cosThetaI)-std::abs(cosThetaO)) * ((-tauD/std::abs(cosThetaI)).exp() - (-tauD/std::abs(cosThetaO)).exp()); } } @@ -314,7 +314,7 @@ public: sigmaT = sigmaA + sigmaS, tauD = sigmaT * m_thickness; - /* Probability for a specular transmission is approximated by the average (per wavelength) + /* Probability for a specular transmission is approximated by the average (per wavelength) * probability of a photon exiting without a scattering event or an absorption event */ Float probSpecularTransmission = (-tauD/std::abs(Frame::cosTheta(bRec.wi))).exp().average(); @@ -351,7 +351,7 @@ public: /* Store the sampled direction */ bRec.wo = pRec.wo; - + bool reflection = Frame::cosTheta(bRec.wi) * Frame::cosTheta(bRec.wo) >= 0; if ((!hasGlossyReflection && reflection) || (!hasGlossyTransmission && !reflection)) @@ -364,7 +364,7 @@ public: _pdf *= (hasSpecularTransmission ? (1 - probSpecularTransmission) : 1.0f); /* Guard against numerical imprecisions */ - if (_pdf == 0) + if (_pdf == 0) return Spectrum(0.0f); else return eval(bRec, ESolidAngle) / _pdf; @@ -409,7 +409,7 @@ public: } Float getRoughness(const Intersection &its, int component) const { - /* For lack of a better value, treat this material as diffuse + /* For lack of a better value, treat this material as diffuse in Manifold Exploration */ return std::numeric_limits::infinity(); } @@ -425,7 +425,7 @@ public: << "]"; return oss.str(); } - + Shader *createShader(Renderer *renderer) const; MTS_DECLARE_CLASS() @@ -440,7 +440,7 @@ private: }; -// ================ Hardware shader implementation ================ +// ================ Hardware shader implementation ================ /** * This is a relatively approximate GLSL shader for the HK model. @@ -449,7 +449,7 @@ private: */ class HanrahanKruegerShader : public Shader { public: - HanrahanKruegerShader(Renderer *renderer, const Texture *sigmaS, const Texture *sigmaA) + HanrahanKruegerShader(Renderer *renderer, const Texture *sigmaS, const Texture *sigmaA) : Shader(renderer, EBSDFShader), m_sigmaS(sigmaS), m_sigmaA(sigmaA) { m_sigmaSShader = renderer->registerShaderForResource(m_sigmaS.get()); m_sigmaAShader = renderer->registerShaderForResource(m_sigmaA.get()); @@ -499,7 +499,7 @@ private: ref m_sigmaAShader; }; -Shader *HanrahanKrueger::createShader(Renderer *renderer) const { +Shader *HanrahanKrueger::createShader(Renderer *renderer) const { return new HanrahanKruegerShader(renderer, m_sigmaS.get(), m_sigmaA.get()); } diff --git a/src/bsdfs/ior.h b/src/bsdfs/ior.h index 284cfea2..e2578b94 100644 --- a/src/bsdfs/ior.h +++ b/src/bsdfs/ior.h @@ -30,9 +30,9 @@ struct IOREntry { }; /** - * Many values are taken from Hecht, Optics, + * Many values are taken from Hecht, Optics, * Fourth Edition. - * + * * The IOR values are from measurements between * 0 and 20 degrees celsius at ~589 nm. */ @@ -77,7 +77,7 @@ static Float lookupIOR(const std::string &name) { } std::ostringstream oss; - oss << "Unable to find an IOR value for \"" << lowerCase + oss << "Unable to find an IOR value for \"" << lowerCase << "\"! Valid choices are:"; /* Unable to find the IOR value by name -- print an error diff --git a/src/bsdfs/irawan.cpp b/src/bsdfs/irawan.cpp index 311afe98..53d6cf86 100644 --- a/src/bsdfs/irawan.cpp +++ b/src/bsdfs/irawan.cpp @@ -44,7 +44,7 @@ MTS_NAMESPACE_BEGIN * parameterization} * \parameter{(\emph{Additional parameters})}{\Spectrum\Or\Float}{ * Weave pattern files may define their own custom parameters; this is - * useful for instance to support changing the color of a weave + * useful for instance to support changing the color of a weave * without having to create a new file every time. * These parameters must be specified directly to the plugin * so that they can be appropriately resolved when the pattern file is loaded. @@ -54,16 +54,16 @@ MTS_NAMESPACE_BEGIN * This plugin implements the Irawan \& Marschner BRDF, * a realistic model for rendering woven materials. * This spatially-varying reflectance model uses an explicit description - * of the underlying weave pattern to create fine-scale texture and + * of the underlying weave pattern to create fine-scale texture and * realistic reflections across a wide range of different weave types. - * To use the model, you must provide a special weave pattern - * file---for an example of what these look like, see the + * To use the model, you must provide a special weave pattern + * file---for an example of what these look like, see the * examples scenes available on the Mitsuba website. * * A detailed explanation of the model is beyond the scope of this manual. - * For reference, it is described in detail in the PhD thesis of + * For reference, it is described in detail in the PhD thesis of * Piti Irawan (``The Appearance of Woven Cloth'' \cite{IrawanThesis}). - * The code in Mitsuba a modified port of a previous Java implementation + * The code in Mitsuba a modified port of a previous Java implementation * by Piti, which has been extended with a simple domain-specific weave * pattern description language. \vspace{8mm} * @@ -81,13 +81,13 @@ MTS_NAMESPACE_BEGIN */ class IrawanClothBRDF : public BSDF { public: - IrawanClothBRDF(const Properties &props) + IrawanClothBRDF(const Properties &props) : BSDF(props), m_specularNormalization(0) { FileResolver *fResolver = Thread::getThread()->getFileResolver(); fs::path path = fResolver->resolve(props.getString("filename")); if (!fs::exists(path)) - Log(EError, "Weave pattern file \"%s\" could not be found!", + Log(EError, "Weave pattern file \"%s\" could not be found!", path.string().c_str()); fs::ifstream in(path); typedef spirit::istream_iterator iterator_type; @@ -98,15 +98,15 @@ public: bool success = phrase_parse(begin, end, g, sg, m_pattern); if (!success) - Log(EError, "Unable to parse the weave pattern file \"%s\"!", + Log(EError, "Unable to parse the weave pattern file \"%s\"!", path.string().c_str()); /* Some sanity checks */ - SAssert(m_pattern.pattern.size() == + SAssert(m_pattern.pattern.size() == m_pattern.tileWidth * m_pattern.tileHeight); for (size_t i=0; i 0 && - m_pattern.pattern[i] <= m_pattern.yarns.size()); + m_pattern.pattern[i] <= m_pattern.yarns.size()); /* U and V tile count */ m_repeatU = props.getFloat("repeatU"); @@ -118,7 +118,7 @@ public: "appropriately set the 'kd' and 'ks'-values used in your model."); } - IrawanClothBRDF(Stream *stream, InstanceManager *manager) + IrawanClothBRDF(Stream *stream, InstanceManager *manager) : BSDF(stream, manager) { m_pattern = WeavePattern(stream); m_repeatU = stream->readFloat(); @@ -143,7 +143,7 @@ public: m_components.push_back(EDiffuseReflection | EFrontSide | ESpatiallyVarying); - /* Estimate the average reflectance under diffuse + /* Estimate the average reflectance under diffuse illumination and use it to normalize the specular component */ ref random = new Random(); @@ -175,7 +175,7 @@ public: Spectrum getDiffuseReflectance(const Intersection &its) const { Point2 uv = Point2(its.uv.x * m_repeatU, (1 - its.uv.y) * m_repeatV); - Point2 xy(uv.x * m_pattern.tileWidth, uv.y * m_pattern.tileHeight); + Point2 xy(uv.x * m_pattern.tileWidth, uv.y * m_pattern.tileHeight); Point2i lookup( modulo((int) xy.x, m_pattern.tileWidth), modulo((int) xy.y, m_pattern.tileHeight)); @@ -191,7 +191,7 @@ public: (bRec.component == -1 || bRec.component == 0); bool hasDiffuse = (bRec.typeMask & EDiffuseReflection) && (bRec.component == -1 || bRec.component == 1); - + if (Frame::cosTheta(bRec.wi) <= 0 || Frame::cosTheta(bRec.wo) <= 0 || (!hasDiffuse && !hasSpecular) || @@ -200,7 +200,7 @@ public: Point2 uv = Point2(bRec.its.uv.x * m_repeatU, (1 - bRec.its.uv.y) * m_repeatV); - Point2 xy(uv.x * m_pattern.tileWidth, uv.y * m_pattern.tileHeight); + Point2 xy(uv.x * m_pattern.tileWidth, uv.y * m_pattern.tileHeight); Point2i lookup( modulo((int) xy.x, m_pattern.tileWidth), @@ -211,20 +211,20 @@ public: const Yarn &yarn = m_pattern.yarns.at(yarnID); // store center of the yarn segment Point2 center - (((int) xy.x / m_pattern.tileWidth) * m_pattern.tileWidth + (((int) xy.x / m_pattern.tileWidth) * m_pattern.tileWidth + yarn.centerU * m_pattern.tileWidth, - ((int) xy.y / m_pattern.tileHeight) * m_pattern.tileHeight + ((int) xy.y / m_pattern.tileHeight) * m_pattern.tileHeight + (1 - yarn.centerV) * m_pattern.tileHeight); - + // transform x and y to new coordinate system with (0,0) at the // center of the yarn segment xy.x = xy.x - center.x; xy.y = - (xy.y - center.y); - + int type = yarn.type; Float w = yarn.width; Float l = yarn.length; - + // Get incident and exitant directions. Vector om_i = bRec.wi; Vector om_r = bRec.wo; @@ -232,7 +232,7 @@ public: Float psi = yarn.psi; Float umax = yarn.umax; Float kappa = yarn.kappa; - + Float dUmaxOverDWarp, dUmaxOverDWeft; if (type == Yarn::EWarp) { dUmaxOverDWarp = m_pattern.dWarpUmaxOverDWarp; @@ -240,7 +240,7 @@ public: } else { // type == EWeft dUmaxOverDWarp = m_pattern.dWeftUmaxOverDWarp; dUmaxOverDWeft = m_pattern.dWeftUmaxOverDWeft; - // Rotate xy, incident, and exitant directions pi/2 radian about z-axis + // Rotate xy, incident, and exitant directions pi/2 radian about z-axis Float tmp = xy.x; xy.x = -xy.y; xy.y = tmp; @@ -265,10 +265,10 @@ public: Point2u pos(center); random1 = Noise::perlinNoise(Point( - (center.x * (m_pattern.tileHeight * m_repeatV + (center.x * (m_pattern.tileHeight * m_repeatV + sampleTEAFloat(pos.x, 2*pos.y, teaIterations)) + center.y) / m_pattern.period, 0, 0)); random2 = Noise::perlinNoise(Point( - (center.y * (m_pattern.tileWidth * m_repeatU + (center.y * (m_pattern.tileWidth * m_repeatU + sampleTEAFloat(pos.x, 2*pos.y+1, teaIterations)) + center.x) / m_pattern.period, 0, 0)); umax = umax + random1 * dUmaxOverDWarp + random2 * dUmaxOverDWeft; } @@ -283,24 +283,24 @@ public: if (hasSpecular) { Float integrand; if (psi != 0.0f) - integrand = evalStapleIntegrand(u, v, om_i, om_r, m_pattern.alpha, + integrand = evalStapleIntegrand(u, v, om_i, om_r, m_pattern.alpha, m_pattern.beta, psi, umax, kappa, w, l); else - integrand = evalFilamentIntegrand(u, v, om_i, om_r, m_pattern.alpha, + integrand = evalFilamentIntegrand(u, v, om_i, om_r, m_pattern.alpha, m_pattern.beta, m_pattern.ss, umax, kappa, w, l); // Initialize random number generator based on texture location. Float intensityVariation = 1.0f; if (m_pattern.fineness > 0.0f) { // Compute random variation and scale specular component. - // Generate fineness^2 seeds per 1 unit of texture. + // Generate fineness^2 seeds per 1 unit of texture. uint32_t index1 = (uint32_t) ((center.x + xy.x) * m_pattern.fineness); uint32_t index2 = (uint32_t) ((center.y + xy.y) * m_pattern.fineness); Float xi = sampleTEAFloat(index1, index2, teaIterations); intensityVariation = std::min(-math::fastlog(xi), (Float) 10.0f); } - + if (!m_initialization) result = yarn.ks * (intensityVariation * integrand * m_specularNormalization); else @@ -323,7 +323,7 @@ public: (bRec.component == -1 || bRec.component == 0); bool hasDiffuse = (bRec.typeMask & EDiffuseReflection) && (bRec.component == -1 || bRec.component == 1); - + if (Frame::cosTheta(bRec.wi) <= 0 || Frame::cosTheta(bRec.wo) <= 0 || (!hasDiffuse && !hasSpecular) || @@ -338,7 +338,7 @@ public: (bRec.component == -1 || bRec.component == 0); bool hasDiffuse = (bRec.typeMask & EDiffuseReflection) && (bRec.component == -1 || bRec.component == 1); - + if (Frame::cosTheta(bRec.wi) <= 0 || (!hasDiffuse && !hasSpecular)) return Spectrum(0.0f); @@ -356,7 +356,7 @@ public: (bRec.component == -1 || bRec.component == 0); bool hasDiffuse = (bRec.typeMask & EDiffuseReflection) && (bRec.component == -1 || bRec.component == 1); - + if (Frame::cosTheta(bRec.wi) <= 0 || (!hasDiffuse && !hasSpecular)) return Spectrum(0.0f); @@ -387,7 +387,7 @@ public: * w width of segment rectangle * l length of segment rectangle */ - Float evalFilamentIntegrand(Float u, Float v, const Vector &om_i, + Float evalFilamentIntegrand(Float u, Float v, const Vector &om_i, const Vector &om_r, Float alpha, Float beta, Float ss, Float umax, Float kappa, Float w, Float l) const { // 0 <= ss < 1.0 @@ -404,10 +404,10 @@ public: // h is the half vector Vector h = normalize(om_r + om_i); - + // u_of_v is location of specular reflection. Float u_of_v = std::atan(h.y / h.z); - + // Check if u_of_v within the range of valid u values if (std::abs(u_of_v) < umax) { // n is normal to the yarn surface @@ -453,16 +453,16 @@ public: Float y_of_v = u_of_v * 0.5f * l / umax; if (y_of_v > 0.5f * (l - delta_y)) y_of_v = 0.5f * (l - delta_y); - else if (y_of_v < 0.5f * (delta_y - l)) + else if (y_of_v < 0.5f * (delta_y - l)) y_of_v = 0.5f * (delta_y - l); - + // Check if |y(u(v)) - y(u)| < delta_y/2. if (std::abs(y_of_v - u * 0.5f * l / umax) < 0.5f * delta_y) return fs / delta_y; } return 0.0f; } - + /** parameters: * u for staple, we compute v(u) * v to be compared to v(u) in texturing @@ -479,8 +479,8 @@ public: * w width of segment rectangle * l length of segment rectangle */ - Float evalStapleIntegrand(Float u, Float v, const Vector &om_i, - const Vector &om_r, Float alpha, Float beta, Float psi, + Float evalStapleIntegrand(Float u, Float v, const Vector &om_i, + const Vector &om_r, Float alpha, Float beta, Float psi, Float umax, Float kappa, Float w, Float l) const { // w * sin(umax) < l if (w * std::sin(umax) >= l) @@ -502,12 +502,12 @@ public: if (std::abs(D) < 1.0f && std::abs(v_of_u) < M_PI / 2.0f) { // n is normal to the yarn surface. // t is tangent of the fibers. - + Normal n = normalize(Normal(std::sin(v_of_u), std::sin(u) * std::cos(v_of_u), std::cos(u) * std::cos(v_of_u))); /*Vector t = normalize(Vector(-std::cos(v_of_u) * std::sin(psi), - std::cos(u) * std::cos(psi) + std::sin(u) * std::sin(v_of_u) * std::sin(psi), + std::cos(u) * std::cos(psi) + std::sin(u) * std::sin(v_of_u) * std::sin(psi), -std::sin(u) * std::cos(psi) + std::cos(u) * std::sin(v_of_u) * std::sin(psi))); */ // R is radius of curvature. @@ -521,7 +521,7 @@ public: // fc is phase function. Float fc = alpha + vonMises(-dot(om_i, om_r), beta); - + // A is attenuation function without smoothing. Float A = seeliger(dot(n, om_i), dot(n, om_r), 0, 1); @@ -533,7 +533,7 @@ public: // Highlight has constant width delta_x on screen. Float delta_x = w * m_pattern.hWidth; - + // Clamp x_of_u between (w - delta_x)/2 and -(w - delta_x)/2. Float x_of_u = v_of_u * w / M_PI; if (x_of_u > 0.5f * (w - delta_x)) @@ -615,7 +615,7 @@ public: } Float getRoughness(const Intersection &its, int component) const { - /* For lack of a better value, treat this material as diffuse + /* For lack of a better value, treat this material as diffuse in Manifold Exploration */ return std::numeric_limits::infinity(); } @@ -641,15 +641,15 @@ private: bool m_initialization; }; -// ================ Hardware shader implementation ================ +// ================ Hardware shader implementation ================ /** - * In place of a real shader, let's just show the average + * In place of a real shader, let's just show the average * diffuse albedo for now.. */ class IrawanShader : public Shader { public: - IrawanShader(Renderer *renderer, Spectrum albedo) + IrawanShader(Renderer *renderer, Spectrum albedo) : Shader(renderer, EBSDFShader), m_albedo(albedo) { } @@ -681,7 +681,7 @@ private: Spectrum m_albedo; }; -Shader *IrawanClothBRDF::createShader(Renderer *renderer) const { +Shader *IrawanClothBRDF::createShader(Renderer *renderer) const { Spectrum albedo(0.0f); for (size_t i=0; i(manager->getInstance(stream)); m_nestedBSDF = static_cast(manager->getInstance(stream)); @@ -94,7 +94,7 @@ public: void configure() { if (!m_nestedBSDF) Log(EError, "A child BSDF is required"); - + unsigned int extraFlags = 0; if (!m_opacity->isConstant()) extraFlags |= ESpatiallyVarying; @@ -102,7 +102,7 @@ public: m_components.clear(); for (int i=0; igetComponentCount(); ++i) m_components.push_back(m_nestedBSDF->getType(i) | extraFlags); - m_components.push_back(ENull | EFrontSide + m_components.push_back(ENull | EFrontSide | EBackSide | extraFlags); m_usesRayDifferentials = m_nestedBSDF->usesRayDifferentials(); @@ -223,7 +223,7 @@ public: } void addChild(const std::string &name, ConfigurableObject *child) { - if (child->getClass()->derivesFrom(MTS_CLASS(Texture)) && name == "opacity") + if (child->getClass()->derivesFrom(MTS_CLASS(Texture)) && name == "opacity") m_opacity = static_cast(child); else if (child->getClass()->derivesFrom(MTS_CLASS(BSDF))) m_nestedBSDF = static_cast(child); @@ -249,7 +249,7 @@ protected: ref m_nestedBSDF; }; -// ================ Hardware shader implementation ================ +// ================ Hardware shader implementation ================ /** * Somewhat lame GLSL version, which doesn't actually render @@ -258,7 +258,7 @@ protected: */ class MaskShader : public Shader { public: - MaskShader(Renderer *renderer, const Texture *opacity, const BSDF *bsdf) + MaskShader(Renderer *renderer, const Texture *opacity, const BSDF *bsdf) : Shader(renderer, EBSDFShader), m_opacity(opacity), m_bsdf(bsdf) { m_opacityShader = renderer->registerShaderForResource(opacity); m_bsdfShader = renderer->registerShaderForResource(bsdf); @@ -297,7 +297,7 @@ private: ref m_bsdfShader; }; -Shader *Mask::createShader(Renderer *renderer) const { +Shader *Mask::createShader(Renderer *renderer) const { return new MaskShader(renderer, m_opacity.get(), m_nestedBSDF.get()); } diff --git a/src/bsdfs/microfacet.h b/src/bsdfs/microfacet.h index 397ac4f2..bc0ad126 100644 --- a/src/bsdfs/microfacet.h +++ b/src/bsdfs/microfacet.h @@ -63,7 +63,7 @@ public: m_type = EGGX; else if (distr == "as") m_type = EAshikhminShirley; - else + else SLog(EError, "Specified an invalid distribution \"%s\", must be " "\"beckmann\", \"phong\", \"ggx\", or \"as\"!", distr.c_str()); } @@ -80,12 +80,12 @@ public: * \brief Convert the roughness values so that they behave similarly to the * Beckmann distribution. * - * Also clamps to the minimal exponent to to avoid numerical issues + * Also clamps to the minimal exponent to to avoid numerical issues * (For lower roughness values, please switch to the smooth BSDF variants) */ Float transformRoughness(Float value) const { value = std::max(value, (Float) 1e-5f); - if (m_type == EPhong || m_type == EAshikhminShirley) + if (m_type == EPhong || m_type == EAshikhminShirley) value = std::max(2 / (value * value) - 2, (Float) 0.1f); return value; } @@ -116,26 +116,26 @@ public: case EBeckmann: { /* Beckmann distribution function for Gaussian random surfaces */ const Float ex = Frame::tanTheta(m) / alphaU; - result = math::fastexp(-(ex*ex)) / (M_PI * alphaU*alphaU * + result = math::fastexp(-(ex*ex)) / (M_PI * alphaU*alphaU * std::pow(Frame::cosTheta(m), (Float) 4.0f)); } break; - + case EGGX: { /* Empirical GGX distribution function for rough surfaces */ const Float tanTheta = Frame::tanTheta(m), cosTheta = Frame::cosTheta(m); - - const Float root = alphaU / (cosTheta*cosTheta * + + const Float root = alphaU / (cosTheta*cosTheta * (alphaU*alphaU + tanTheta*tanTheta)); - + result = INV_PI * (root * root); } break; case EPhong: { /* Phong distribution function */ - result = (alphaU + 2) * INV_TWOPI + result = (alphaU + 2) * INV_TWOPI * std::pow(Frame::cosTheta(m), alphaU); } break; @@ -145,7 +145,7 @@ public: const Float ds = 1 - cosTheta * cosTheta; if (ds < 0) return 0.0f; - const Float exponent = (alphaU * m.x * m.x + const Float exponent = (alphaU * m.x * m.x + alphaV * m.y * m.y) / ds; result = std::sqrt((alphaU + 2) * (alphaV + 2)) * INV_TWOPI * std::pow(cosTheta, exponent); @@ -160,7 +160,7 @@ public: /* Prevent potential numerical issues in other stages of the model */ if (result < 1e-20f) result = 0; - + return result; } @@ -168,7 +168,7 @@ public: * \brief Returns the density function associated with * the \ref sample() function. * \param m The microsurface normal - * \param alpha The surface roughness + * \param alpha The surface roughness */ inline Float pdf(const Vector &m, Float alpha) const { return pdf(m, alpha, alpha); @@ -193,7 +193,7 @@ public: const Float ds = 1 - cosTheta * cosTheta; if (ds < 0) return 0.0f; - const Float exponent = (alphaU * m.x * m.x + const Float exponent = (alphaU * m.x * m.x + alphaV * m.y * m.y) / ds; Float result = std::sqrt((alphaU + 1) * (alphaV + 1)) * INV_TWOPI * std::pow(cosTheta, exponent); @@ -215,7 +215,7 @@ public: std::sqrt((alphaU + 1.0f) / (alphaV + 1.0f)) * std::tan(M_PI * u1 * 0.5f)); const Float cosPhi = std::cos(phi), sinPhi = std::sin(phi); - cosTheta = std::pow(u2, 1.0f / + cosTheta = std::pow(u2, 1.0f / (alphaU * cosPhi * cosPhi + alphaV * sinPhi * sinPhi + 1.0f)); } @@ -223,7 +223,7 @@ public: * \brief Draw a sample from the microsurface normal distribution * * \param sample A uniformly distributed 2D sample - * \param alpha The surface roughness + * \param alpha The surface roughness */ inline Normal sample(const Point2 &sample, Float alpha) const { return MicrofacetDistribution::sample(sample, alpha, alpha); @@ -237,7 +237,7 @@ public: * \param alphaV The surface roughness in the bitangent direction */ Normal sample(const Point2 &sample, Float alphaU, Float alphaV) const { - /* The azimuthal component is always selected + /* The azimuthal component is always selected uniformly regardless of the distribution */ Float cosThetaM = 0.0f, phiM = (2.0f * M_PI) * sample.y; @@ -279,7 +279,7 @@ public: } } break; - default: + default: SLog(EError, "Invalid distribution function!"); } @@ -307,7 +307,7 @@ public: * \param pdf The probability density wrt. solid angles */ Normal sample(const Point2 &sample, Float alphaU, Float alphaV, Float &pdf) const { - /* The azimuthal component is always selected + /* The azimuthal component is always selected uniformly regardless of the distribution */ Float cosThetaM = 0.0f; @@ -370,11 +370,11 @@ public: + alphaV * sinPhiM*sinPhiM; pdf = std::sqrt((alphaU + 1) * (alphaV + 1)) * INV_TWOPI * std::pow(cosThetaM, exponent); - + /* Prevent potential numerical issues in other stages of the model */ if (pdf < 1e-20f) pdf = 0; - + return Vector( sinThetaM * cosPhiM, sinThetaM * sinPhiM, @@ -390,7 +390,7 @@ public: /* Prevent potential numerical issues in other stages of the model */ if (pdf < 1e-20f) pdf = 0; - + const Float sinThetaM = std::sqrt( std::max((Float) 0, 1 - cosThetaM*cosThetaM)); Float phiM = (2.0f * M_PI) * sample.y; @@ -410,16 +410,16 @@ public: * \param alpha The surface roughness */ Float smithG1(const Vector &v, const Vector &m, Float alpha) const { - const Float tanTheta = std::abs(Frame::tanTheta(v)); + const Float tanTheta = std::abs(Frame::tanTheta(v)); /* perpendicular incidence -- no shadowing/masking */ if (tanTheta == 0.0f) return 1.0f; - + /* Can't see the back side from the front and vice versa */ if (dot(v, m) * Frame::cosTheta(v) <= 0) return 0.0f; - + switch (m_type) { case EPhong: case EBeckmann: { @@ -434,21 +434,21 @@ public: if (a >= 1.6f) return 1.0f; - + /* Use a fast and accurate (<0.35% rel. error) rational approximation to the shadowing-masking function */ const Float aSqr = a * a; - return (3.535f * a + 2.181f * aSqr) + return (3.535f * a + 2.181f * aSqr) / (1.0f + 2.276f * a + 2.577f * aSqr); } break; - + case EGGX: { const Float root = alpha * tanTheta; return 2.0f / (1.0f + std::sqrt(1.0f + root*root)); } break; - + default: SLog(EError, "Invalid distribution function!"); return 0.0f; @@ -456,7 +456,7 @@ public: } /** - * \brief Shadow-masking function for each of the supported + * \brief Shadow-masking function for each of the supported * microfacet distributions * * \param wi The incident direction @@ -469,7 +469,7 @@ public: } /** - * \brief Shadow-masking function for each of the supported + * \brief Shadow-masking function for each of the supported * microfacet distributions * * \param wi The incident direction @@ -495,7 +495,7 @@ public: woDotM = dot(wo, m), wiDotM = dot(wi, m); - return std::min((Float) 1, + return std::min((Float) 1, std::min(std::abs(2 * nDotM * nDotWo / woDotM), std::abs(2 * nDotM * nDotWi / wiDotM))); } diff --git a/src/bsdfs/mixturebsdf.cpp b/src/bsdfs/mixturebsdf.cpp index 51fc444e..42177d62 100644 --- a/src/bsdfs/mixturebsdf.cpp +++ b/src/bsdfs/mixturebsdf.cpp @@ -37,9 +37,9 @@ MTS_NAMESPACE_BEGIN * (\lstref{mixture-example})}{bsdf_mixturebsdf_result} * } * - * This plugin implements a ``mixture'' material, which represents + * This plugin implements a ``mixture'' material, which represents * linear combinations of multiple BSDF instances. Any surface scattering - * model in Mitsuba (be it smooth, rough, reflecting, or transmitting) can + * model in Mitsuba (be it smooth, rough, reflecting, or transmitting) can * be mixed with others in this manner to synthesize new models. There * is no limit on how many models can be mixed, but their combination * weights must be non-negative and sum to a value of one or less to ensure @@ -64,10 +64,10 @@ MTS_NAMESPACE_BEGIN class MixtureBSDF : public BSDF { public: - MixtureBSDF(const Properties &props) + MixtureBSDF(const Properties &props) : BSDF(props) { /* Parse the weight parameter */ - std::vector weights = + std::vector weights = tokenize(props.getString("weights", ""), " ,;"); if (weights.size() == 0) Log(EError, "No weights were supplied!"); @@ -84,7 +84,7 @@ public: } } - MixtureBSDF(Stream *stream, InstanceManager *manager) + MixtureBSDF(Stream *stream, InstanceManager *manager) : BSDF(stream, manager) { size_t bsdfCount = stream->readSize(); m_weights.resize(bsdfCount); @@ -104,7 +104,7 @@ public: void serialize(Stream *stream, InstanceManager *manager) const { BSDF::serialize(stream, manager); - + stream->writeSize(m_bsdfs.size()); for (size_t i=0; iwriteFloat(m_weights[i]); @@ -253,7 +253,7 @@ public: result *= m_weights[entry] * pdf; pdf *= m_pdf[entry]; - + EMeasure measure = BSDF::getMeasure(bRec.sampledType); for (size_t i=0; itoString(), 2) << "," << endl; oss << " }" << endl << "]"; @@ -322,11 +322,11 @@ private: DiscreteDistribution m_pdf; }; -// ================ Hardware shader implementation ================ +// ================ Hardware shader implementation ================ class MixtureBSDFShader : public Shader { public: - MixtureBSDFShader(Renderer *renderer, const std::vector &bsdfs, const std::vector &weights) + MixtureBSDFShader(Renderer *renderer, const std::vector &bsdfs, const std::vector &weights) : Shader(renderer, EBSDFShader), m_bsdfs(bsdfs), m_weights(weights), m_complete(false) { m_bsdfShader.resize(bsdfs.size()); for (size_t i=0; i(manager->getInstance(stream)); m_specularReflectance = static_cast(manager->getInstance(stream)); @@ -98,7 +98,7 @@ public: sAvg = m_specularReflectance->getAverage().getLuminance(); m_specularSamplingWeight = sAvg / (dAvg + sAvg); - m_usesRayDifferentials = + m_usesRayDifferentials = m_diffuseReflectance->usesRayDifferentials() || m_specularReflectance->usesRayDifferentials() || m_exponent->usesRayDifferentials(); @@ -115,7 +115,7 @@ public: return Vector(-wi.x, -wi.y, wi.z); } - Spectrum eval(const BSDFSamplingRecord &bRec, EMeasure measure) const { + Spectrum eval(const BSDFSamplingRecord &bRec, EMeasure measure) const { if (Frame::cosTheta(bRec.wi) <= 0 || Frame::cosTheta(bRec.wo) <= 0 || measure != ESolidAngle) return Spectrum(0.0f); @@ -136,7 +136,7 @@ public: } } - if (hasDiffuse) + if (hasDiffuse) result += m_diffuseReflectance->eval(bRec.its) * INV_PI; return result * Frame::cosTheta(bRec.wo); @@ -161,7 +161,7 @@ public: Float alpha = dot(bRec.wo, reflect(bRec.wi)), exponent = m_exponent->eval(bRec.its).average(); if (alpha > 0) - specProb = std::pow(alpha, exponent) * + specProb = std::pow(alpha, exponent) * (exponent + 1.0f) / (2.0f * M_PI); } @@ -218,7 +218,7 @@ public: bRec.sampledComponent = 1; bRec.sampledType = EGlossyReflection; - if (Frame::cosTheta(bRec.wo) <= 0) + if (Frame::cosTheta(bRec.wo) <= 0) return Spectrum(0.0f); } else { bRec.wo = Warp::squareToCosineHemisphere(sample); @@ -229,7 +229,7 @@ public: _pdf = pdf(bRec, ESolidAngle); - if (_pdf == 0) + if (_pdf == 0) return Spectrum(0.0f); else return eval(bRec, ESolidAngle) / _pdf; @@ -242,13 +242,13 @@ public: void addChild(const std::string &name, ConfigurableObject *child) { if (child->getClass()->derivesFrom(MTS_CLASS(Texture))) { - if (name == "exponent") + if (name == "exponent") m_exponent = static_cast(child); - else if (name == "specularReflectance") + else if (name == "specularReflectance") m_specularReflectance = static_cast(child); else if (name == "diffuseReflectance") m_diffuseReflectance = static_cast(child); - else + else BSDF::addChild(name, child); } else { BSDF::addChild(name, child); @@ -285,7 +285,7 @@ public: return oss.str(); } - Shader *createShader(Renderer *renderer) const; + Shader *createShader(Renderer *renderer) const; MTS_DECLARE_CLASS() private: @@ -295,7 +295,7 @@ private: Float m_specularSamplingWeight; }; -// ================ Hardware shader implementation ================ +// ================ Hardware shader implementation ================ /** * The GLSL implementation clamps the exponent to 30 so that a @@ -305,7 +305,7 @@ class PhongShader : public Shader { public: PhongShader(Renderer *renderer, const Texture *exponent, const Texture *diffuseColor, const Texture *specularColor) - : Shader(renderer, EBSDFShader), + : Shader(renderer, EBSDFShader), m_exponent(exponent), m_diffuseReflectance(diffuseColor), m_specularReflectance(specularColor) { @@ -339,9 +339,9 @@ public: << " if (cosTheta(wi) <= 0.0 || cosTheta(wo) <= 0.0)" << endl << " return vec3(0.0);" << endl << " vec3 R = vec3(-wi.x, -wi.y, wi.z);" << endl - << " float specRef = 0.0, alpha = dot(R, wo);" << endl - << " float exponent = min(30.0, " << depNames[0] << "(uv)[0]);" << endl - << " if (alpha > 0.0)" << endl + << " float specRef = 0.0, alpha = dot(R, wo);" << endl + << " float exponent = min(30.0, " << depNames[0] << "(uv)[0]);" << endl + << " if (alpha > 0.0)" << endl << " specRef = pow(alpha, exponent) * " << endl << " (exponent + 2) * 0.15915;" << endl << " return (" << depNames[1] << "(uv) * inv_pi" << endl @@ -365,7 +365,7 @@ private: ref m_specularReflectanceShader; }; -Shader *Phong::createShader(Renderer *renderer) const { +Shader *Phong::createShader(Renderer *renderer) const { return new PhongShader(renderer, m_exponent.get(), m_diffuseReflectance.get(), m_specularReflectance.get()); } diff --git a/src/bsdfs/plastic.cpp b/src/bsdfs/plastic.cpp index 2525ca4d..bb12a1a9 100644 --- a/src/bsdfs/plastic.cpp +++ b/src/bsdfs/plastic.cpp @@ -32,7 +32,7 @@ MTS_NAMESPACE_BEGIN * \parameter{extIOR}{\Float\Or\String}{Exterior index of refraction specified * numerically or using a known material name. \default{\texttt{air} / 1.000277}} * \parameter{specular\showbreak Reflectance}{\Spectrum\Or\Texture}{Optional - * factor that can be used to modulate the specular reflection component. Note that + * factor that can be used to modulate the specular reflection component. Note that * for physical realism, this parameter should never be touched. \default{1.0}} * \parameter{diffuse\showbreak Reflectance}{\Spectrum\Or\Texture}{Optional * factor used to modulate the diffuse reflection component\default{0.5}} @@ -50,27 +50,27 @@ MTS_NAMESPACE_BEGIN * } * * \vspace{3mm} - * This plugin describes a smooth plastic-like material with internal scattering. - * It uses the Fresnel reflection and transmission coefficients to provide + * This plugin describes a smooth plastic-like material with internal scattering. + * It uses the Fresnel reflection and transmission coefficients to provide * direction-dependent specular and diffuse components. * Since it is simple, realistic, and fast, this model is often a better choice * than the \pluginref{phong}, \pluginref{ward}, and \pluginref{roughplastic} - * plugins when rendering smooth plastic-like materials. + * plugins when rendering smooth plastic-like materials. * - * For convenience, this model allows to specify IOR values either numerically, - * or based on a list of known materials (see \tblref{dielectric-iors} for - * an overview). + * For convenience, this model allows to specify IOR values either numerically, + * or based on a list of known materials (see \tblref{dielectric-iors} for + * an overview). * * Note that this plugin is quite similar to what one would get by applying the * \pluginref{coating} plugin to the \pluginref{diffuse} material. The main * difference is that this plugin is significantly faster, while at the same * time causing less variance. Furthermore, it accounts for multiple - * interreflections inside the material (read on for details), which avoids + * interreflections inside the material (read on for details), which avoids * a serious energy loss problem of the aforementioned plugin * combination. * \newpage * - * \begin{xml}[caption=A shiny material whose diffuse reflectance is + * \begin{xml}[caption=A shiny material whose diffuse reflectance is * specified using sRGB, label=lst:plastic-shiny] * * @@ -86,19 +86,19 @@ MTS_NAMESPACE_BEGIN * \label{fig:plastic-nonlinear} * When asked to do so, this model can account for subtle nonlinear color shifts due * to internal scattering processes. The above images show a textured - * object first rendered using \pluginref{diffuse}, then + * object first rendered using \pluginref{diffuse}, then * \pluginref{plastic} with the default parameters, and finally using * \pluginref{plastic} and support for nonlinear color shifts. * } * } * * \subsubsection*{Internal scattering} - * Internally, this is model simulates the interaction of light with a diffuse - * base surface coated by a thin dielectric layer. This is a convenient - * abstraction rather than a restriction. In other words, there are many - * materials that can be rendered with this model, even if they might not not + * Internally, this is model simulates the interaction of light with a diffuse + * base surface coated by a thin dielectric layer. This is a convenient + * abstraction rather than a restriction. In other words, there are many + * materials that can be rendered with this model, even if they might not not * fit this description perfectly well. - * + * * \begin{figure}[h] * \setcounter{subfigure}{0} * \centering @@ -118,24 +118,24 @@ MTS_NAMESPACE_BEGIN * of the illumination is specularly reflected at the material * boundary, which results in a sharp reflection in the mirror direction * (\subfigref{plastic-intscat}{a}). - * The remaining illumination refracts into the material, where it + * The remaining illumination refracts into the material, where it * scatters from the diffuse base layer. (\subfigref{plastic-intscat}{b}). - * While some of the diffusely scattered illumination is able to - * directly refract outwards again, the remainder is reflected from the - * interior side of the dielectric boundary and will in fact remain - * trapped inside the material for some number of internal scattering + * While some of the diffusely scattered illumination is able to + * directly refract outwards again, the remainder is reflected from the + * interior side of the dielectric boundary and will in fact remain + * trapped inside the material for some number of internal scattering * events until it is finally able to escape (\subfigref{plastic-intscat}{c}). * - * Due to the mathematical simplicity of this setup, it is possible to work + * Due to the mathematical simplicity of this setup, it is possible to work * out the correct form of the model without actually having to simulate * the potentially large number of internal scattering events. * - * Note that due to the internal scattering, the diffuse color of the - * material is in practice slightly different from the color of the - * base layer on its own---in particular, the material color will tend to shift towards - * darker colors with higher saturation. Since this can be counter-intuitive when + * Note that due to the internal scattering, the diffuse color of the + * material is in practice slightly different from the color of the + * base layer on its own---in particular, the material color will tend to shift towards + * darker colors with higher saturation. Since this can be counter-intuitive when * using bitmap textures, these color shifts are disabled by default. Specify - * the parameter \code{nonlinear=true} to enable them. \figref{plastic-nonlinear} + * the parameter \code{nonlinear=true} to enable them. \figref{plastic-nonlinear} * illustrates the resulting change. This effect is also seen in real life, * for instance a piece of wood will look slightly darker after coating it * with a layer of varnish. @@ -165,7 +165,7 @@ public: m_specularSamplingWeight = 0.0f; } - SmoothPlastic(Stream *stream, InstanceManager *manager) + SmoothPlastic(Stream *stream, InstanceManager *manager) : BSDF(stream, manager) { m_eta = stream->readFloat(); m_nonlinear = stream->readBool(); @@ -200,10 +200,10 @@ public: sAvg = m_specularReflectance->getAverage().getLuminance(); m_specularSamplingWeight = sAvg / (dAvg + sAvg); - + m_invEta2 = 1/(m_eta*m_eta); - m_usesRayDifferentials = + m_usesRayDifferentials = m_specularReflectance->usesRayDifferentials() || m_diffuseReflectance->usesRayDifferentials(); @@ -223,11 +223,11 @@ public: void addChild(const std::string &name, ConfigurableObject *child) { if (child->getClass()->derivesFrom(MTS_CLASS(Texture))) { - if (name == "specularReflectance") + if (name == "specularReflectance") m_specularReflectance = static_cast(child); else if (name == "diffuseReflectance") m_diffuseReflectance = static_cast(child); - else + else BSDF::addChild(name, child); } else { BSDF::addChild(name, child); @@ -261,7 +261,7 @@ public: Float Fo = fresnelDielectricExt(Frame::cosTheta(bRec.wo), m_eta); Spectrum diff = m_diffuseReflectance->eval(bRec.its); - + if (m_nonlinear) diff /= Spectrum(1.0f) - diff * m_fdrInt; else @@ -287,7 +287,7 @@ public: if (hasSpecular && hasDiffuse) { Float Fi = fresnelDielectricExt(Frame::cosTheta(bRec.wi), m_eta); probSpecular = (Fi*m_specularSamplingWeight) / - (Fi*m_specularSamplingWeight + + (Fi*m_specularSamplingWeight + (1-Fi) * (1-m_specularSamplingWeight)); } @@ -308,7 +308,7 @@ public: && (bRec.component == -1 || bRec.component == 0); bool hasDiffuse = (bRec.typeMask & EDiffuseReflection) && (bRec.component == -1 || bRec.component == 1); - + if ((!hasDiffuse && !hasSpecular) || Frame::cosTheta(bRec.wi) <= 0) return Spectrum(0.0f); @@ -317,7 +317,7 @@ public: bRec.eta = 1.0f; if (hasDiffuse && hasSpecular) { Float probSpecular = (Fi*m_specularSamplingWeight) / - (Fi*m_specularSamplingWeight + + (Fi*m_specularSamplingWeight + (1-Fi) * (1-m_specularSamplingWeight)); /* Importance sample wrt. the Fresnel reflectance */ @@ -380,7 +380,7 @@ public: bRec.eta = 1.0f; if (hasDiffuse && hasSpecular) { Float probSpecular = (Fi*m_specularSamplingWeight) / - (Fi*m_specularSamplingWeight + + (Fi*m_specularSamplingWeight + (1-Fi) * (1-m_specularSamplingWeight)); /* Importance sample wrt. the Fresnel reflectance */ @@ -407,9 +407,9 @@ public: else diff /= 1 - m_fdrInt; - pdf = (1-probSpecular) * + pdf = (1-probSpecular) * Warp::squareToCosineHemispherePdf(bRec.wo); - + return diff * (m_invEta2 * (1-Fi) * (1-Fo) / (1-probSpecular)); } } else if (hasSpecular) { @@ -454,7 +454,7 @@ public: << " specularSamplingWeight = " << m_specularSamplingWeight << "," << endl << " diffuseSamplingWeight = " << (1-m_specularSamplingWeight) << "," << endl << " nonlinear = " << m_nonlinear << "," << endl - << " eta = " << m_eta << "," << endl + << " eta = " << m_eta << "," << endl << " fdrInt = " << m_fdrInt << "," << endl << " fdrExt = " << m_fdrExt << endl << "]"; @@ -474,15 +474,15 @@ private: /** * Smooth plastic shader -- it is really hopeless to visualize - * this material in the VPL renderer, so let's try to do at least + * this material in the VPL renderer, so let's try to do at least * something that suggests the presence of a specularly-reflecting * dielectric material with something diffuse underneath. */ class SmoothPlasticShader : public Shader { public: SmoothPlasticShader(Renderer *renderer, const Texture *specularReflectance, - const Texture *diffuseReflectance, Float eta) : Shader(renderer, EBSDFShader), - m_specularReflectance(specularReflectance), + const Texture *diffuseReflectance, Float eta) : Shader(renderer, EBSDFShader), + m_specularReflectance(specularReflectance), m_diffuseReflectance(diffuseReflectance) { m_specularReflectanceShader = renderer->registerShaderForResource(m_specularReflectance.get()); m_diffuseReflectanceShader = renderer->registerShaderForResource(m_diffuseReflectance.get()); @@ -574,7 +574,7 @@ private: Float m_alpha, m_R0; }; -Shader *SmoothPlastic::createShader(Renderer *renderer) const { +Shader *SmoothPlastic::createShader(Renderer *renderer) const { return new SmoothPlasticShader(renderer, m_specularReflectance.get(), m_diffuseReflectance.get(), m_eta); } diff --git a/src/bsdfs/roughcoating.cpp b/src/bsdfs/roughcoating.cpp index 24d3a169..ff811c7f 100644 --- a/src/bsdfs/roughcoating.cpp +++ b/src/bsdfs/roughcoating.cpp @@ -29,37 +29,37 @@ MTS_NAMESPACE_BEGIN * \icon{bsdf_roughcoating} * \parameters{ * \parameter{distribution}{\String}{ - * Specifies the type of microfacet normal distribution + * Specifies the type of microfacet normal distribution * used to model the surface roughness. * \begin{enumerate}[(i)] * \item \code{beckmann}: Physically-based distribution derived from * Gaussian random surfaces. This is the default. * \item \code{ggx}: New distribution proposed by - * Walter et al. \cite{Walter07Microfacet}, which is meant to better handle - * the long tails observed in measurements of ground surfaces. + * Walter et al. \cite{Walter07Microfacet}, which is meant to better handle + * the long tails observed in measurements of ground surfaces. * Renderings with this distribution may converge slowly. * \item \code{phong}: Classical $\cos^p\theta$ distribution. - * Due to the underlying microfacet theory, - * the use of this distribution here leads to more realistic + * Due to the underlying microfacet theory, + * the use of this distribution here leads to more realistic * behavior than the separately available \pluginref{phong} plugin. * \end{enumerate} * } * \parameter{alpha}{\Float\Or\Texture}{ - * Specifies the roughness of the unresolved surface micro-geometry. - * When the Beckmann distribution is used, this parameter is equal to the - * \emph{root mean square} (RMS) slope of the microfacets. - * \default{0.1}. + * Specifies the roughness of the unresolved surface micro-geometry. + * When the Beckmann distribution is used, this parameter is equal to the + * \emph{root mean square} (RMS) slope of the microfacets. + * \default{0.1}. * } * \parameter{intIOR}{\Float\Or\String}{Interior index of refraction specified * numerically or using a known material name. \default{\texttt{bk7} / 1.5046}} * \parameter{extIOR}{\Float\Or\String}{Exterior index of refraction specified * numerically or using a known material name. \default{\texttt{air} / 1.000277}} - * \parameter{thickness}{\Float}{Denotes the thickness of the layer (to + * \parameter{thickness}{\Float}{Denotes the thickness of the layer (to * model absorption --- should be specified in inverse units of \code{sigmaA})\default{1}} - * \parameter{sigmaA}{\Spectrum\Or\Texture}{The absorption coefficient of the + * \parameter{sigmaA}{\Spectrum\Or\Texture}{The absorption coefficient of the * coating layer. \default{0, i.e. there is no absorption}} * \parameter{specular\showbreak Transmittance}{\Spectrum\Or\Texture}{Optional - * factor that can be used to modulate the specular transmission component. Note + * factor that can be used to modulate the specular transmission component. Note * that for physical realism, this parameter should never be touched. \default{1.0}} * \parameter{\Unnamed}{\BSDF}{A nested BSDF model that should be coated.} * } @@ -71,27 +71,27 @@ MTS_NAMESPACE_BEGIN * } * * This plugin implements a \emph{very} approximate\footnote{ - * The model only accounts for roughness + * The model only accounts for roughness * in the specular reflection and Fresnel transmittance through the interface. * The interior model receives incident illumination * that is transformed \emph{as if} the coating was smooth. While - * that's not quite correct, it is a convenient workaround when the + * that's not quite correct, it is a convenient workaround when the * \pluginref{coating} plugin produces specular highlights that are too sharp.} - * model that simulates a rough dielectric coating. It is essentially the - * roughened version of \pluginref{coating}. - * Any BSDF in Mitsuba can be coated using this plugin and multiple coating - * layers can even be applied in sequence, which allows designing interesting - * custom materials. The coating layer can optionally be tinted (i.e. filled - * with an absorbing medium), in which case this model also accounts for the + * model that simulates a rough dielectric coating. It is essentially the + * roughened version of \pluginref{coating}. + * Any BSDF in Mitsuba can be coated using this plugin and multiple coating + * layers can even be applied in sequence, which allows designing interesting + * custom materials. The coating layer can optionally be tinted (i.e. filled + * with an absorbing medium), in which case this model also accounts for the * directionally dependent absorption within the layer. * * Note that the plugin discards illumination that undergoes internal * reflection within the coating. This can lead to a noticeable energy * loss for materials that reflect much of their energy near or below the critical - * angle (i.e. diffuse or very rough materials). + * angle (i.e. diffuse or very rough materials). * - * The implementation here is influenced by the paper - * ``Arbitrarily Layered Micro-Facet Surfaces'' by Weidlich and + * The implementation here is influenced by the paper + * ``Arbitrarily Layered Micro-Facet Surfaces'' by Weidlich and * Wilkie \cite{Weidlich2007Arbitrarily}. */ class RoughCoating : public BSDF { @@ -108,7 +108,7 @@ public: /* Specifies the external index of refraction at the interface */ Float extIOR = lookupIOR(props, "extIOR", "air"); - + if (intIOR < 0 || extIOR < 0 || intIOR == extIOR) Log(EError, "The interior and exterior indices of " "refraction must be positive and differ!"); @@ -141,7 +141,7 @@ public: m_specularSamplingWeight = 0.0f; } - RoughCoating(Stream *stream, InstanceManager *manager) + RoughCoating(Stream *stream, InstanceManager *manager) : BSDF(stream, manager) { m_distribution = MicrofacetDistribution( (MicrofacetDistribution::EType) stream->readUInt() @@ -175,7 +175,7 @@ public: extraFlags |= ESpatiallyVarying; m_components.clear(); - for (int i=0; igetComponentCount(); ++i) + for (int i=0; igetComponentCount(); ++i) m_components.push_back(m_nested->getType(i) | extraFlags); m_components.push_back(EGlossyReflection | EFrontSide | EBackSide @@ -202,16 +202,16 @@ public: transmittance through the dielectric interface */ m_roughTransmittance = new RoughTransmittance( m_distribution.getType()); - + m_roughTransmittance->checkEta(m_eta); m_roughTransmittance->checkAlpha(m_alpha->getMinimum().average()); m_roughTransmittance->checkAlpha(m_alpha->getMaximum().average()); - + /* Reduce the rough transmittance data to a 2D slice */ m_roughTransmittance->setEta(m_eta); /* If possible, even reduce it to a 1D slice */ - if (m_alpha->isConstant()) + if (m_alpha->isConstant()) m_roughTransmittance->setAlpha( m_alpha->eval(Intersection()).average()); } @@ -224,7 +224,7 @@ public: return 2 * dot(wi, m) * Vector(m) - wi; } - /// Refraction in local coordinates + /// Refraction in local coordinates Vector refractTo(EDestination dest, const Vector &wi) const { Float cosThetaI = Frame::cosTheta(wi); Float invEta = (dest == EInterior) ? m_invEta : m_eta; @@ -242,7 +242,7 @@ public: Float cosThetaT = std::sqrt(1.0f - sinThetaTSqr); /* Retain the directionality of the vector */ - return Vector(invEta*wi.x, invEta*wi.y, + return Vector(invEta*wi.x, invEta*wi.y, entering ? cosThetaT : -cosThetaT); } } @@ -274,7 +274,7 @@ public: const Float G = m_distribution.G(bRec.wi, bRec.wo, H, alphaT); /* Calculate the specular reflection component */ - Float value = F * D * G / + Float value = F * D * G / (4.0f * std::abs(Frame::cosTheta(bRec.wi))); result += m_specularReflectance->eval(bRec.its) * value; @@ -290,7 +290,7 @@ public: m_roughTransmittance->eval(std::abs(Frame::cosTheta(bRec.wo)), alpha); Spectrum sigmaA = m_sigmaA->eval(bRec.its) * m_thickness; - if (!sigmaA.isZero()) + if (!sigmaA.isZero()) nestedResult *= (-sigmaA * (1/std::abs(Frame::cosTheta(bRecInt.wi)) + 1/std::abs(Frame::cosTheta(bRecInt.wo)))).exp(); @@ -331,7 +331,7 @@ public: /* Reallocate samples */ probSpecular = (probSpecular*m_specularSamplingWeight) / - (probSpecular*m_specularSamplingWeight + + (probSpecular*m_specularSamplingWeight + (1-probSpecular) * (1-m_specularSamplingWeight)); probNested = 1 - probSpecular; @@ -388,7 +388,7 @@ public: /* Reallocate samples */ probSpecular = (probSpecular*m_specularSamplingWeight) / - (probSpecular*m_specularSamplingWeight + + (probSpecular*m_specularSamplingWeight + (1-probSpecular) * (1-m_specularSamplingWeight)); if (sample.y <= probSpecular) { @@ -415,7 +415,7 @@ public: bRec.wi = refractTo(EInterior, bRec.wi); Spectrum result = m_nested->sample(bRec, _pdf, sample); bRec.wi = wiBackup; - if (result.isZero()) + if (result.isZero()) return Spectrum(0.0f); bRec.wo = refractTo(EExterior, bRec.wo); if (bRec.wo.isZero()) @@ -426,7 +426,7 @@ public: EMeasure measure = getMeasure(bRec.sampledType); _pdf = pdf(bRec, measure); - if (_pdf == 0) + if (_pdf == 0) return Spectrum(0.0f); else return eval(bRec, measure) / _pdf; @@ -493,18 +493,18 @@ private: /** * GLSL port of the rough coating shader. This version is much more - * approximate -- it only supports the Beckmann distribution, - * does everything in RGB, uses a cheaper shadowing-masking term, and - * it also makes use of the Schlick approximation to the Fresnel - * reflectance of dielectrics. When the roughness is lower than + * approximate -- it only supports the Beckmann distribution, + * does everything in RGB, uses a cheaper shadowing-masking term, and + * it also makes use of the Schlick approximation to the Fresnel + * reflectance of dielectrics. When the roughness is lower than * \alpha < 0.2, the shader clamps it to 0.2 so that it will still perform * reasonably well in a VPL-based preview. */ class RoughCoatingShader : public Shader { public: RoughCoatingShader(Renderer *renderer, const BSDF *nested, - const Texture *sigmaA, const Texture *alpha, - Float eta) : Shader(renderer, EBSDFShader), + const Texture *sigmaA, const Texture *alpha, + Float eta) : Shader(renderer, EBSDFShader), m_nested(nested), m_sigmaA(sigmaA), m_alpha(alpha), m_eta(eta) { m_nestedShader = renderer->registerShaderForResource(m_nested.get()); m_sigmaAShader = renderer->registerShaderForResource(m_sigmaA.get()); @@ -624,8 +624,8 @@ private: Float m_R0, m_eta; }; -Shader *RoughCoating::createShader(Renderer *renderer) const { - return new RoughCoatingShader(renderer, m_nested.get(), +Shader *RoughCoating::createShader(Renderer *renderer) const { + return new RoughCoatingShader(renderer, m_nested.get(), m_sigmaA.get(), m_alpha.get(), m_eta); } diff --git a/src/bsdfs/roughconductor.cpp b/src/bsdfs/roughconductor.cpp index 968dda2c..2ccce5ff 100644 --- a/src/bsdfs/roughconductor.cpp +++ b/src/bsdfs/roughconductor.cpp @@ -28,88 +28,88 @@ MTS_NAMESPACE_BEGIN * \icon{bsdf_roughconductor} * \parameters{ * \parameter{distribution}{\String}{ - * Specifies the type of microfacet normal distribution + * Specifies the type of microfacet normal distribution * used to model the surface roughness. * \begin{enumerate}[(i)] * \item \code{beckmann}: Physically-based distribution derived from * Gaussian random surfaces. This is the default. * \item \code{ggx}: New distribution proposed by - * Walter et al. \cite{Walter07Microfacet}, which is meant to better handle - * the long tails observed in measurements of ground surfaces. + * Walter et al. \cite{Walter07Microfacet}, which is meant to better handle + * the long tails observed in measurements of ground surfaces. * Renderings with this distribution may converge slowly. * \item \code{phong}: Classical $\cos^p\theta$ distribution. - * Due to the underlying microfacet theory, - * the use of this distribution here leads to more realistic + * Due to the underlying microfacet theory, + * the use of this distribution here leads to more realistic * behavior than the separately available \pluginref{phong} plugin. * \item \code{as}: Anisotropic Phong-style microfacet distribution proposed by * Ashikhmin and Shirley \cite{Ashikhmin2005Anisotropic}.\vspace{-3mm} * \end{enumerate} * } * \parameter{alpha}{\Float\Or\Texture}{ - * Specifies the roughness of the unresolved surface micro-geometry. - * When the Beckmann distribution is used, this parameter is equal to the + * Specifies the roughness of the unresolved surface micro-geometry. + * When the Beckmann distribution is used, this parameter is equal to the * \emph{root mean square} (RMS) slope of the microfacets. This * parameter is only valid when \texttt{distribution=beckmann/phong/ggx}. - * \default{0.1}. + * \default{0.1}. * } * \parameter{alphaU, alphaV}{\Float\Or\Texture}{ - * Specifies the anisotropic roughness values along the tangent and - * bitangent directions. These parameter are only valid when - * \texttt{distribution=as}. \default{0.1}. + * Specifies the anisotropic roughness values along the tangent and + * bitangent directions. These parameter are only valid when + * \texttt{distribution=as}. \default{0.1}. * } - * \parameter{material}{\String}{Name of a material preset, see + * \parameter{material}{\String}{Name of a material preset, see * \tblref{conductor-iors}.\!\default{\texttt{Cu} / copper}} - * \parameter{eta}{\Spectrum}{Real part of the material's index + * \parameter{eta}{\Spectrum}{Real part of the material's index * of refraction \default{based on the value of \texttt{material}}} - * \parameter{k}{\Spectrum}{Imaginary part of the material's index of + * \parameter{k}{\Spectrum}{Imaginary part of the material's index of * refraction (the absorption coefficient). * \default{based on \texttt{material}}} * \parameter{specular\showbreak Reflectance}{\Spectrum\Or\Texture}{Optional - * factor that can be used to modulate the specular reflection component. Note + * factor that can be used to modulate the specular reflection component. Note * that for physical realism, this parameter should never be touched. \default{1.0}} * } * \vspace{4mm} * This plugin implements a realistic microfacet scattering model for rendering - * rough conducting materials, such as metals. It can be interpreted as a fancy - * version of the Cook-Torrance model and should be preferred over + * rough conducting materials, such as metals. It can be interpreted as a fancy + * version of the Cook-Torrance model and should be preferred over * heuristic models like \pluginref{phong} and \pluginref{ward} when possible. * \renderings{ * \rendering{Rough copper (Beckmann, $\alpha=0.1$)} * {bsdf_roughconductor_copper.jpg} - * \rendering{Vertically brushed aluminium (Ashikhmin-Shirley, - * $\alpha_u=0.05,\ \alpha_v=0.3$), see + * \rendering{Vertically brushed aluminium (Ashikhmin-Shirley, + * $\alpha_u=0.05,\ \alpha_v=0.3$), see * \lstref{roughconductor-aluminium}} * {bsdf_roughconductor_anisotropic_aluminium.jpg} * } * - * Microfacet theory describes rough - * surfaces as an arrangement of unresolved and ideally specular facets, whose - * normal directions are given by a specially chosen \emph{microfacet distribution}. - * By accounting for shadowing and masking effects between these facets, it is - * possible to reproduce the important off-specular reflections peaks observed + * Microfacet theory describes rough + * surfaces as an arrangement of unresolved and ideally specular facets, whose + * normal directions are given by a specially chosen \emph{microfacet distribution}. + * By accounting for shadowing and masking effects between these facets, it is + * possible to reproduce the important off-specular reflections peaks observed * in real-world measurements of such materials. * * This plugin is essentially the ``roughened'' equivalent of the (smooth) plugin * \pluginref{conductor}. For very low values of $\alpha$, the two will - * be identical, though scenes using this plugin will take longer to render + * be identical, though scenes using this plugin will take longer to render * due to the additional computational burden of tracking surface roughness. - * + * * The implementation is based on the paper ``Microfacet Models - * for Refraction through Rough Surfaces'' by Walter et al. + * for Refraction through Rough Surfaces'' by Walter et al. * \cite{Walter07Microfacet}. It supports several different types of microfacet - * distributions and has a texturable roughness parameter. - * To facilitate the tedious task of specifying spectrally-varying index of + * distributions and has a texturable roughness parameter. + * To facilitate the tedious task of specifying spectrally-varying index of * refraction information, this plugin can access a set of measured materials - * for which visible-spectrum information was publicly available + * for which visible-spectrum information was publicly available * (see \tblref{conductor-iors} for the full list). * - * When no parameters are given, the plugin activates the default settings, - * which describe copper with a light amount of roughness modeled using a + * When no parameters are given, the plugin activates the default settings, + * which describe copper with a light amount of roughness modeled using a * Beckmann distribution. * * To get an intuition about the effect of the surface roughness - * parameter $\alpha$, consider the following approximate classification: - * a value of $\alpha=0.001-0.01$ corresponds to a material + * parameter $\alpha$, consider the following approximate classification: + * a value of $\alpha=0.001-0.01$ corresponds to a material * with slight imperfections on an * otherwise smooth surface finish, $\alpha=0.1$ is relatively rough, * and $\alpha=0.3-0.7$ is \emph{extremely} rough (e.g. an etched or ground @@ -125,11 +125,11 @@ MTS_NAMESPACE_BEGIN * \end{xml} * * \subsubsection*{Technical details} - * When rendering with the Ashikhmin-Shirley or Phong microfacet - * distributions, a conversion is used to turn the specified + * When rendering with the Ashikhmin-Shirley or Phong microfacet + * distributions, a conversion is used to turn the specified * $\alpha$ roughness value into the exponents of these distributions. - * This is done in a way, such that the different - * distributions all produce a similar appearance for the same value of + * This is done in a way, such that the different + * distributions all produce a similar appearance for the same value of * $\alpha$. * * The Ashikhmin-Shirley microfacet distribution allows the specification @@ -137,14 +137,14 @@ MTS_NAMESPACE_BEGIN * directions. This can be used to provide a material with a ``brushed'' * appearance. The alignment of the anisotropy will follow the UV * parameterization of the underlying mesh in this case. This also means that - * such an anisotropic material cannot be applied to triangle meshes that + * such an anisotropic material cannot be applied to triangle meshes that * are missing texture coordinates. * - * When using this plugin, you should ideally compile Mitsuba with support for - * spectral rendering to get the most accurate results. While it also works + * When using this plugin, you should ideally compile Mitsuba with support for + * spectral rendering to get the most accurate results. While it also works * in RGB mode, the computations will be more approximate in nature. - * Also note that this material is one-sided---that is, observed from the - * back side, it will be completely black. If this is undesirable, + * Also note that this material is one-sided---that is, observed from the + * back side, it will be completely black. If this is undesirable, * consider using the \pluginref{twosided} BRDF adapter. */ class RoughConductor : public BSDF { @@ -180,7 +180,7 @@ public: m_alphaV = new ConstantFloatTexture(alphaV); } - RoughConductor(Stream *stream, InstanceManager *manager) + RoughConductor(Stream *stream, InstanceManager *manager) : BSDF(stream, manager) { m_distribution = MicrofacetDistribution( (MicrofacetDistribution::EType) stream->readUInt() @@ -198,7 +198,7 @@ public: unsigned int extraFlags = 0; if (m_alphaU != m_alphaV) { extraFlags |= EAnisotropic; - if (m_distribution.getType() != + if (m_distribution.getType() != MicrofacetDistribution::EAshikhminShirley) Log(EError, "Different roughness values along the tangent and " "bitangent directions are only supported when using the " @@ -216,7 +216,7 @@ public: m_specularReflectance = ensureEnergyConservation( m_specularReflectance, "specularReflectance", 1.0f); - m_usesRayDifferentials = + m_usesRayDifferentials = m_alphaU->usesRayDifferentials() || m_alphaV->usesRayDifferentials() || m_specularReflectance->usesRayDifferentials(); @@ -239,12 +239,12 @@ public: return Spectrum(0.0f); /* Calculate the reflection half-vector */ - Vector H = normalize(bRec.wo+bRec.wi); + Vector H = normalize(bRec.wo+bRec.wi); /* Evaluate the roughness */ - Float alphaU = m_distribution.transformRoughness( + Float alphaU = m_distribution.transformRoughness( m_alphaU->eval(bRec.its).average()), - alphaV = m_distribution.transformRoughness( + alphaV = m_distribution.transformRoughness( m_alphaV->eval(bRec.its).average()); /* Evaluate the microsurface normal distribution */ @@ -261,7 +261,7 @@ public: /* Calculate the total amount of reflection */ Float value = D * G / (4.0f * Frame::cosTheta(bRec.wi)); - return m_specularReflectance->eval(bRec.its) * F * value; + return m_specularReflectance->eval(bRec.its) * F * value; } Float pdf(const BSDFSamplingRecord &bRec, EMeasure measure) const { @@ -274,11 +274,11 @@ public: /* Calculate the reflection half-vector */ Vector H = normalize(bRec.wo+bRec.wi); - + /* Evaluate the roughness */ - Float alphaU = m_distribution.transformRoughness( + Float alphaU = m_distribution.transformRoughness( m_alphaU->eval(bRec.its).average()), - alphaV = m_distribution.transformRoughness( + alphaV = m_distribution.transformRoughness( m_alphaV->eval(bRec.its).average()); return m_distribution.pdf(H, alphaU, alphaV) @@ -292,14 +292,14 @@ public: return Spectrum(0.0f); /* Evaluate the roughness */ - Float alphaU = m_distribution.transformRoughness( + Float alphaU = m_distribution.transformRoughness( m_alphaU->eval(bRec.its).average()), - alphaV = m_distribution.transformRoughness( + alphaV = m_distribution.transformRoughness( m_alphaV->eval(bRec.its).average()); /* Sample M, the microsurface normal */ Float microfacetPDF; - const Normal m = m_distribution.sample(sample, + const Normal m = m_distribution.sample(sample, alphaU, alphaV, microfacetPDF); if (microfacetPDF == 0) @@ -336,13 +336,13 @@ public: return Spectrum(0.0f); /* Evaluate the roughness */ - Float alphaU = m_distribution.transformRoughness( + Float alphaU = m_distribution.transformRoughness( m_alphaU->eval(bRec.its).average()), - alphaV = m_distribution.transformRoughness( + alphaV = m_distribution.transformRoughness( m_alphaV->eval(bRec.its).average()); /* Sample M, the microsurface normal */ - const Normal m = m_distribution.sample(sample, + const Normal m = m_distribution.sample(sample, alphaU, alphaV, pdf); if (pdf == 0) @@ -364,7 +364,7 @@ public: Float numerator = m_distribution.eval(m, alphaU, alphaV) * m_distribution.G(bRec.wi, bRec.wo, m, alphaU, alphaV) * dot(bRec.wi, m); - + Float denominator = pdf * Frame::cosTheta(bRec.wi); /* Jacobian of the half-direction mapping */ @@ -434,9 +434,9 @@ private: /** * GLSL port of the rough conductor shader. This version is much more - * approximate -- it only supports the Ashikhmin-Shirley distribution, + * approximate -- it only supports the Ashikhmin-Shirley distribution, * does everything in RGB, and it uses the Schlick approximation to the - * Fresnel reflectance of conductors. When the roughness is lower than + * Fresnel reflectance of conductors. When the roughness is lower than * \alpha < 0.2, the shader clamps it to 0.2 so that it will still perform * reasonably well in a VPL-based preview. */ @@ -444,7 +444,7 @@ class RoughConductorShader : public Shader { public: RoughConductorShader(Renderer *renderer, const Texture *specularReflectance, const Texture *alphaU, const Texture *alphaV, const Spectrum &eta, - const Spectrum &k) : Shader(renderer, EBSDFShader), + const Spectrum &k) : Shader(renderer, EBSDFShader), m_specularReflectance(specularReflectance), m_alphaU(alphaU), m_alphaV(alphaV){ m_specularReflectanceShader = renderer->registerShaderForResource(m_specularReflectance.get()); m_alphaUShader = renderer->registerShaderForResource(m_alphaU.get()); @@ -540,7 +540,7 @@ private: Spectrum m_R0; }; -Shader *RoughConductor::createShader(Renderer *renderer) const { +Shader *RoughConductor::createShader(Renderer *renderer) const { return new RoughConductorShader(renderer, m_specularReflectance.get(), m_alphaU.get(), m_alphaV.get(), m_eta, m_k); } diff --git a/src/bsdfs/roughdielectric.cpp b/src/bsdfs/roughdielectric.cpp index 3ae450c9..dc44c506 100644 --- a/src/bsdfs/roughdielectric.cpp +++ b/src/bsdfs/roughdielectric.cpp @@ -24,9 +24,9 @@ MTS_NAMESPACE_BEGIN -/* Suggestion by Bruce Walter: sample the model using a slightly - wider density function. This in practice limits the importance - weights to values <= 4. +/* Suggestion by Bruce Walter: sample the model using a slightly + wider density function. This in practice limits the importance + weights to values <= 4. */ #define ENLARGE_LOBE_TRICK 1 @@ -35,54 +35,54 @@ MTS_NAMESPACE_BEGIN * \icon{bsdf_roughdielectric} * \parameters{ * \parameter{distribution}{\String}{ - * Specifies the type of microfacet normal distribution + * Specifies the type of microfacet normal distribution * used to model the surface roughness. * \begin{enumerate}[(i)] * \item \code{beckmann}: Physically-based distribution derived from * Gaussian random surfaces. This is the default. * \item \code{ggx}: New distribution proposed by - * Walter et al. \cite{Walter07Microfacet}, which is meant to better handle - * the long tails observed in measurements of ground surfaces. + * Walter et al. \cite{Walter07Microfacet}, which is meant to better handle + * the long tails observed in measurements of ground surfaces. * Renderings with this distribution may converge slowly. * \item \code{phong}: Classical $\cos^p\theta$ distribution. - * Due to the underlying microfacet theory, - * the use of this distribution here leads to more realistic + * Due to the underlying microfacet theory, + * the use of this distribution here leads to more realistic * behavior than the separately available \pluginref{phong} plugin. * \item \code{as}: Anisotropic Phong-style microfacet distribution proposed by * Ashikhmin and Shirley \cite{Ashikhmin2005Anisotropic}.\vspace{-3mm} * \end{enumerate} * } * \parameter{alpha}{\Float\Or\Texture}{ - * Specifies the roughness of the unresolved surface micro-geometry. - * When the Beckmann distribution is used, this parameter is equal to the + * Specifies the roughness of the unresolved surface micro-geometry. + * When the Beckmann distribution is used, this parameter is equal to the * \emph{root mean square} (RMS) slope of the microfacets. This * parameter is only valid when \texttt{distribution=beckmann/phong/ggx}. - * \default{0.1}. + * \default{0.1}. * } * \parameter{alphaU, alphaV}{\Float\Or\Texture}{ - * Specifies the anisotropic roughness values along the tangent and - * bitangent directions. These parameter are only valid when - * \texttt{distribution=as}. \default{0.1}. + * Specifies the anisotropic roughness values along the tangent and + * bitangent directions. These parameter are only valid when + * \texttt{distribution=as}. \default{0.1}. * } * \parameter{intIOR}{\Float\Or\String}{Interior index of refraction specified * numerically or using a known material name. \default{\texttt{bk7} / 1.5046}} * \parameter{extIOR}{\Float\Or\String}{Exterior index of refraction specified * numerically or using a known material name. \default{\texttt{air} / 1.000277}} * \parameter{specular\showbreak Reflectance}{\Spectrum\Or\Texture}{Optional - * factor that can be used to modulate the specular reflection component. Note + * factor that can be used to modulate the specular reflection component. Note * that for physical realism, this parameter should never be touched. \default{1.0}} * \parameter{specular\showbreak Transmittance}{\Spectrum\Or\Texture}{Optional - * factor that can be used to modulate the specular transmission component. Note + * factor that can be used to modulate the specular transmission component. Note * that for physical realism, this parameter should never be touched. \default{1.0}} * }\vspace{4mm} * * This plugin implements a realistic microfacet scattering model for rendering - * rough interfaces between dielectric materials, such as a transition from air to - * ground glass. Microfacet theory describes rough surfaces as an arrangement of - * unresolved and ideally specular facets, whose normal directions are given by + * rough interfaces between dielectric materials, such as a transition from air to + * ground glass. Microfacet theory describes rough surfaces as an arrangement of + * unresolved and ideally specular facets, whose normal directions are given by * a specially chosen \emph{microfacet distribution}. By accounting for shadowing - * and masking effects between these facets, it is possible to reproduce the important - * off-specular reflections peaks observed in real-world measurements of such + * and masking effects between these facets, it is possible to reproduce the important + * off-specular reflections peaks observed in real-world measurements of such * materials. * \renderings{ * \rendering{Anti-glare glass (Beckmann, $\alpha=0.02$)} @@ -93,45 +93,45 @@ MTS_NAMESPACE_BEGIN * * This plugin is essentially the ``roughened'' equivalent of the (smooth) plugin * \pluginref{dielectric}. For very low values of $\alpha$, the two will - * be identical, though scenes using this plugin will take longer to render + * be identical, though scenes using this plugin will take longer to render * due to the additional computational burden of tracking surface roughness. - * + * * The implementation is based on the paper ``Microfacet Models - * for Refraction through Rough Surfaces'' by Walter et al. + * for Refraction through Rough Surfaces'' by Walter et al. * \cite{Walter07Microfacet}. It supports several different types of microfacet - * distributions and has a texturable roughness parameter. Exterior and - * interior IOR values can be specified independently, where ``exterior'' - * refers to the side that contains the surface normal. Similar to the - * \pluginref{dielectric} plugin, IOR values can either be specified - * numerically, or based on a list of known materials (see - * \tblref{dielectric-iors} for an overview). When no parameters are given, - * the plugin activates the default settings, which describe a borosilicate - * glass BK7/air interface with a light amount of roughness modeled using a + * distributions and has a texturable roughness parameter. Exterior and + * interior IOR values can be specified independently, where ``exterior'' + * refers to the side that contains the surface normal. Similar to the + * \pluginref{dielectric} plugin, IOR values can either be specified + * numerically, or based on a list of known materials (see + * \tblref{dielectric-iors} for an overview). When no parameters are given, + * the plugin activates the default settings, which describe a borosilicate + * glass BK7/air interface with a light amount of roughness modeled using a * Beckmann distribution. * * To get an intuition about the effect of the surface roughness - * parameter $\alpha$, consider the following approximate classification: - * a value of $\alpha=0.001-0.01$ corresponds to a material + * parameter $\alpha$, consider the following approximate classification: + * a value of $\alpha=0.001-0.01$ corresponds to a material * with slight imperfections on an * otherwise smooth surface finish, $\alpha=0.1$ is relatively rough, * and $\alpha=0.3-0.7$ is \emph{extremely} rough (e.g. an etched or ground * finish). - * + * * Please note that when using this plugin, it is crucial that the scene contains * meaningful and mutually compatible index of refraction changes---see * \figref{glass-explanation} for an example of what this entails. Also, note that - * the importance sampling implementation of this model is close, but + * the importance sampling implementation of this model is close, but * not always a perfect a perfect match to the underlying scattering distribution, - * particularly for high roughness values and when the \texttt{ggx} - * microfacet distribution is used. Hence, such renderings may + * particularly for high roughness values and when the \texttt{ggx} + * microfacet distribution is used. Hence, such renderings may * converge slowly. * * \subsubsection*{Technical details} - * When rendering with the Ashikhmin-Shirley or Phong microfacet - * distributions, a conversion is used to turn the specified + * When rendering with the Ashikhmin-Shirley or Phong microfacet + * distributions, a conversion is used to turn the specified * $\alpha$ roughness value into the exponents of these distributions. - * This is done in a way, such that the different - * distributions all produce a similar appearance for the same value of + * This is done in a way, such that the different + * distributions all produce a similar appearance for the same value of * $\alpha$. * * The Ashikhmin-Shirley microfacet distribution allows the specification @@ -139,11 +139,11 @@ MTS_NAMESPACE_BEGIN * directions. This can be used to provide a material with a ``brushed'' * appearance. The alignment of the anisotropy will follow the UV * parameterization of the underlying mesh in this case. This also means that - * such an anisotropic material cannot be applied to triangle meshes that + * such an anisotropic material cannot be applied to triangle meshes that * are missing texture coordinates.\newpage * * \renderings{ - * \rendering{Ground glass (GGX, $\alpha$=0.304, + * \rendering{Ground glass (GGX, $\alpha$=0.304, * \lstref{roughdielectric-roughglass})}{bsdf_roughdielectric_ggx_0_304.jpg} * \rendering{Textured roughness (\lstref{roughdielectric-textured})} * {bsdf_roughdielectric_textured.jpg} @@ -206,7 +206,7 @@ public: m_alphaV = new ConstantFloatTexture(alphaV); } - RoughDielectric(Stream *stream, InstanceManager *manager) + RoughDielectric(Stream *stream, InstanceManager *manager) : BSDF(stream, manager) { m_distribution = MicrofacetDistribution( (MicrofacetDistribution::EType) stream->readUInt() @@ -225,7 +225,7 @@ public: unsigned int extraFlags = 0; if (m_alphaU != m_alphaV) { extraFlags |= EAnisotropic; - if (m_distribution.getType() != + if (m_distribution.getType() != MicrofacetDistribution::EAshikhminShirley) Log(EError, "Different roughness values along the tangent and " "bitangent directions are only supported when using the " @@ -238,7 +238,7 @@ public: m_components.clear(); m_components.push_back(EGlossyReflection | EFrontSide - | EBackSide | EUsesSampler | extraFlags + | EBackSide | EUsesSampler | extraFlags | (m_specularReflectance->isConstant() ? 0 : ESpatiallyVarying)); m_components.push_back(EGlossyTransmission | EFrontSide | EBackSide | EUsesSampler | ENonSymmetric | extraFlags @@ -250,7 +250,7 @@ public: m_specularTransmittance = ensureEnergyConservation( m_specularTransmittance, "specularTransmittance", 1.0f); - m_usesRayDifferentials = + m_usesRayDifferentials = m_alphaU->usesRayDifferentials() || m_alphaV->usesRayDifferentials() || m_specularReflectance->usesRayDifferentials() || @@ -264,7 +264,7 @@ public: return Spectrum(0.0f); /* Determine the type of interaction */ - bool reflect = Frame::cosTheta(bRec.wi) + bool reflect = Frame::cosTheta(bRec.wi) * Frame::cosTheta(bRec.wo) > 0; Vector H; @@ -275,7 +275,7 @@ public: return Spectrum(0.0f); /* Calculate the reflection half-vector */ - H = normalize(bRec.wo+bRec.wi); + H = normalize(bRec.wo+bRec.wi); } else { /* Stop if this component was not requested */ if ((bRec.component != -1 && bRec.component != 1) @@ -289,14 +289,14 @@ public: H = normalize(bRec.wi + bRec.wo*eta); } - /* Ensure that the half-vector points into the + /* Ensure that the half-vector points into the same hemisphere as the macrosurface normal */ H *= math::signum(Frame::cosTheta(H)); /* Evaluate the roughness */ - Float alphaU = m_distribution.transformRoughness( + Float alphaU = m_distribution.transformRoughness( m_alphaU->eval(bRec.its).average()), - alphaV = m_distribution.transformRoughness( + alphaV = m_distribution.transformRoughness( m_alphaV->eval(bRec.its).average()); /* Evaluate the microsurface normal distribution */ @@ -312,26 +312,26 @@ public: if (reflect) { /* Calculate the total amount of reflection */ - Float value = F * D * G / + Float value = F * D * G / (4.0f * std::abs(Frame::cosTheta(bRec.wi))); - return m_specularReflectance->eval(bRec.its) * value; + return m_specularReflectance->eval(bRec.its) * value; } else { Float eta = Frame::cosTheta(bRec.wi) > 0.0f ? m_eta : m_invEta; - + /* Calculate the total amount of transmission */ Float sqrtDenom = dot(bRec.wi, H) + eta * dot(bRec.wo, H); - Float value = ((1 - F) * D * G * eta * eta - * dot(bRec.wi, H) * dot(bRec.wo, H)) / + Float value = ((1 - F) * D * G * eta * eta + * dot(bRec.wi, H) * dot(bRec.wo, H)) / (Frame::cosTheta(bRec.wi) * sqrtDenom * sqrtDenom); - /* Missing term in the original paper: account for the solid angle + /* Missing term in the original paper: account for the solid angle compression when tracing radiance -- this is necessary for bidirectional methods */ - Float factor = (bRec.mode == ERadiance) + Float factor = (bRec.mode == ERadiance) ? (Frame::cosTheta(bRec.wi) > 0 ? m_invEta : m_eta) : 1.0f; - return m_specularTransmittance->eval(bRec.its) + return m_specularTransmittance->eval(bRec.its) * std::abs(value * factor * factor); } } @@ -345,7 +345,7 @@ public: && (bRec.typeMask & EGlossyReflection)), hasTransmission = ((bRec.component == -1 || bRec.component == 1) && (bRec.typeMask & EGlossyTransmission)), - reflect = Frame::cosTheta(bRec.wi) + reflect = Frame::cosTheta(bRec.wi) * Frame::cosTheta(bRec.wo) > 0; Vector H; @@ -358,7 +358,7 @@ public: return 0.0f; /* Calculate the reflection half-vector */ - H = normalize(bRec.wo+bRec.wi); + H = normalize(bRec.wo+bRec.wi); /* Jacobian of the half-direction mapping */ dwh_dwo = 1.0f / (4.0f * dot(bRec.wo, H)); @@ -379,14 +379,14 @@ public: dwh_dwo = (eta*eta * dot(bRec.wo, H)) / (sqrtDenom*sqrtDenom); } - /* Ensure that the half-vector points into the + /* Ensure that the half-vector points into the same hemisphere as the macrosurface normal */ H *= math::signum(Frame::cosTheta(H)); /* Evaluate the roughness */ - Float alphaU = m_distribution.transformRoughness( + Float alphaU = m_distribution.transformRoughness( m_alphaU->eval(bRec.its).average()), - alphaV = m_distribution.transformRoughness( + alphaV = m_distribution.transformRoughness( m_alphaV->eval(bRec.its).average()); #if ENLARGE_LOBE_TRICK == 1 @@ -419,9 +419,9 @@ public: return Spectrum(0.0f); /* Evaluate the roughness */ - Float alphaU = m_distribution.transformRoughness( + Float alphaU = m_distribution.transformRoughness( m_alphaU->eval(bRec.its).average()), - alphaV = m_distribution.transformRoughness( + alphaV = m_distribution.transformRoughness( m_alphaV->eval(bRec.its).average()); #if ENLARGE_LOBE_TRICK == 1 @@ -463,7 +463,7 @@ public: /* Side check */ if (Frame::cosTheta(bRec.wi) * Frame::cosTheta(bRec.wo) <= 0) return Spectrum(0.0f); - + result = m_specularReflectance->eval(bRec.its); } else { if (cosThetaT == 0) @@ -479,9 +479,9 @@ public: if (Frame::cosTheta(bRec.wi) * Frame::cosTheta(bRec.wo) >= 0) return Spectrum(0.0f); - /* Radiance must be scaled to account for the solid angle compression + /* Radiance must be scaled to account for the solid angle compression that occurs when crossing the interface. */ - Float factor = (bRec.mode == ERadiance) + Float factor = (bRec.mode == ERadiance) ? (cosThetaT < 0 ? m_invEta : m_eta) : 1.0f; result = m_specularTransmittance->eval(bRec.its) * (factor * factor); @@ -510,9 +510,9 @@ public: return Spectrum(0.0f); /* Evaluate the roughness */ - Float alphaU = m_distribution.transformRoughness( + Float alphaU = m_distribution.transformRoughness( m_alphaU->eval(bRec.its).average()), - alphaV = m_distribution.transformRoughness( + alphaV = m_distribution.transformRoughness( m_alphaV->eval(bRec.its).average()); #if ENLARGE_LOBE_TRICK == 1 @@ -562,7 +562,7 @@ public: /* Side check */ if (Frame::cosTheta(bRec.wi) * Frame::cosTheta(bRec.wo) <= 0) return Spectrum(0.0f); - + result = m_specularReflectance->eval(bRec.its); /* Jacobian of the half-direction mapping */ @@ -576,14 +576,14 @@ public: bRec.eta = cosThetaT < 0 ? m_eta : m_invEta; bRec.sampledComponent = 1; bRec.sampledType = EGlossyTransmission; - + /* Side check */ if (Frame::cosTheta(bRec.wi) * Frame::cosTheta(bRec.wo) >= 0) return Spectrum(0.0f); - - /* Radiance must be scaled to account for the solid angle compression + + /* Radiance must be scaled to account for the solid angle compression that occurs when crossing the interface. */ - Float factor = (bRec.mode == ERadiance) + Float factor = (bRec.mode == ERadiance) ? (cosThetaT < 0 ? m_invEta : m_eta) : 1.0f; result = m_specularTransmittance->eval(bRec.its) * (factor * factor); @@ -669,7 +669,7 @@ private: }; /* Fake glass shader -- it is really hopeless to visualize - this material in the VPL renderer, so let's try to do at least + this material in the VPL renderer, so let's try to do at least something that suggests the presence of a transparent boundary */ class RoughDielectricShader : public Shader { public: @@ -700,7 +700,7 @@ public: MTS_DECLARE_CLASS() }; -Shader *RoughDielectric::createShader(Renderer *renderer) const { +Shader *RoughDielectric::createShader(Renderer *renderer) const { return new RoughDielectricShader(renderer, m_eta); } diff --git a/src/bsdfs/roughdiffuse.cpp b/src/bsdfs/roughdiffuse.cpp index 018699b1..df4c02e5 100644 --- a/src/bsdfs/roughdiffuse.cpp +++ b/src/bsdfs/roughdiffuse.cpp @@ -27,12 +27,12 @@ MTS_NAMESPACE_BEGIN * \icon{bsdf_roughdiffuse} * \parameters{ * \parameter{reflectance}{\Spectrum\Or\Texture}{ - * Specifies the diffuse albedo of the + * Specifies the diffuse albedo of the * material. \default{0.5} * } * \parameter{alpha}{\Spectrum\Or\Texture}{ * Specifies the roughness of the unresolved surface micro-geometry - * using the \emph{root mean square} (RMS) slope of the + * using the \emph{root mean square} (RMS) slope of the * microfacets. \default{0.2} * } * \parameter{useFastApprox}{\Boolean}{ @@ -48,61 +48,61 @@ MTS_NAMESPACE_BEGIN * \rendering{Very rough diffuse surface ($\alpha=0.7$)} * {bsdf_roughdiffuse_0_7} * \vspace{-3mm} - * \caption{The effect of switching from smooth to rough diffuse scattering - * is fairly subtle on this model---generally, there will be higher + * \caption{The effect of switching from smooth to rough diffuse scattering + * is fairly subtle on this model---generally, there will be higher * reflectance at grazing angles, as well as an overall reduced contrast.}\vspace{3mm} * } - * - * This reflectance model describes the interaction of light with a \emph{rough} + * + * This reflectance model describes the interaction of light with a \emph{rough} * diffuse material, such as plaster, sand, clay, or concrete, or ``powdery'' - * surfaces. The underlying theory was developed by Oren and Nayar - * \cite{Oren1994Generalization}, who model the microscopic surface structure as + * surfaces. The underlying theory was developed by Oren and Nayar + * \cite{Oren1994Generalization}, who model the microscopic surface structure as * unresolved planar facets arranged in V-shaped grooves, where each facet * is an ideal diffuse reflector. The model takes into account shadowing, * masking, as well as interreflections between the facets. * - * Since the original publication, this approach has been shown to - * be a good match for many real-world materials, particularly compared + * Since the original publication, this approach has been shown to + * be a good match for many real-world materials, particularly compared * to Lambertian scattering, which does not take surface roughness into account. * * The implementation in Mitsuba uses a surface roughness parameter $\alpha$ that - * is slightly different from the slope-area variance in the original 1994 paper. + * is slightly different from the slope-area variance in the original 1994 paper. * The reason for this change is to make the parameter $\alpha$ portable - * across different models (i.e. \pluginref{roughdielectric}, \pluginref{roughplastic}, + * across different models (i.e. \pluginref{roughdielectric}, \pluginref{roughplastic}, * \pluginref{roughconductor}). * - * To get an intuition about the effect of the - * parameter $\alpha$, consider the following approximate classification: - * a value of $\alpha=0.001-0.01$ corresponds to a material + * To get an intuition about the effect of the + * parameter $\alpha$, consider the following approximate classification: + * a value of $\alpha=0.001-0.01$ corresponds to a material * with slight imperfections on an otherwise smooth surface (for such small - * values, the model will behave identically to \pluginref{diffuse}), $\alpha=0.1$ - * is relatively rough, and $\alpha=0.3-0.7$ is \emph{extremely} rough - * (e.g. an etched or ground surface). + * values, the model will behave identically to \pluginref{diffuse}), $\alpha=0.1$ + * is relatively rough, and $\alpha=0.3-0.7$ is \emph{extremely} rough + * (e.g. an etched or ground surface). * - * Note that this material is one-sided---that is, observed from the - * back side, it will be completely black. If this is undesirable, + * Note that this material is one-sided---that is, observed from the + * back side, it will be completely black. If this is undesirable, * consider using the \pluginref{twosided} BRDF adapter plugin. */ class RoughDiffuse : public BSDF { public: - RoughDiffuse(const Properties &props) + RoughDiffuse(const Properties &props) : BSDF(props) { /* For better compatibility with other models, support both 'reflectance' and 'diffuseReflectance' as parameter names */ m_reflectance = new ConstantSpectrumTexture(props.getSpectrum( - props.hasProperty("reflectance") ? "reflectance" + props.hasProperty("reflectance") ? "reflectance" : "diffuseReflectance", Spectrum(0.5f))); m_useFastApprox = props.getBoolean("useFastApprox", false); m_alpha = new ConstantFloatTexture(props.getFloat("alpha", 0.2f)); } - RoughDiffuse(Stream *stream, InstanceManager *manager) + RoughDiffuse(Stream *stream, InstanceManager *manager) : BSDF(stream, manager) { m_reflectance = static_cast(manager->getInstance(stream)); m_alpha = static_cast(manager->getInstance(stream)); m_useFastApprox = stream->readBool(); - + configure(); } @@ -117,7 +117,7 @@ public: m_usesRayDifferentials = m_reflectance->usesRayDifferentials() || m_alpha->usesRayDifferentials(); - + BSDF::configure(); } @@ -134,11 +134,11 @@ public: /* Conversion from Beckmann-style RMS roughness to Oren-Nayar-style slope-area variance. The factor of 1/sqrt(2) was found to be a perfect fit up - to extreme roughness values (>.5), after which + to extreme roughness values (>.5), after which the match is not as good anymore */ const Float conversionFactor = 1 / std::sqrt((Float) 2); - Float sigma = m_alpha->eval(bRec.its).average() + Float sigma = m_alpha->eval(bRec.its).average() * conversionFactor; const Float sigma2 = sigma*sigma; @@ -160,7 +160,7 @@ public: Float A = 1.0f - 0.5f * sigma2 / (sigma2 + 0.33f), B = 0.45f * sigma2 / (sigma2 + 0.09f), sinAlpha, tanBeta; - + if (Frame::cosTheta(bRec.wi) > Frame::cosTheta(bRec.wo)) { sinAlpha = sinThetaO; tanBeta = sinThetaI / Frame::cosTheta(bRec.wi); @@ -168,7 +168,7 @@ public: sinAlpha = sinThetaI; tanBeta = sinThetaO / Frame::cosTheta(bRec.wo); } - + return m_reflectance->eval(bRec.its) * (INV_PI * Frame::cosTheta(bRec.wo) * (A + B * std::max(cosPhiDiff, (Float) 0.0f) * sinAlpha * tanBeta)); @@ -179,7 +179,7 @@ public: thetaO = math::safe_acos(Frame::cosTheta(bRec.wo)), alpha = std::max(thetaI, thetaO), beta = std::min(thetaI, thetaO); - + Float sinAlpha, sinBeta, tanBeta; if (Frame::cosTheta(bRec.wi) > Frame::cosTheta(bRec.wo)) { sinAlpha = sinThetaO; sinBeta = sinThetaI; @@ -188,38 +188,38 @@ public: sinAlpha = sinThetaI; sinBeta = sinThetaO; tanBeta = sinThetaO / Frame::cosTheta(bRec.wo); } - + Float tmp = sigma2 / (sigma2 + 0.09f), tmp2 = (4*INV_PI*INV_PI) * alpha * beta, tmp3 = 2*beta*INV_PI; - + Float C1 = 1.0f - 0.5f * sigma2 / (sigma2 + 0.33f), C2 = 0.45f * tmp, C3 = 0.125f * tmp * tmp2 * tmp2, C4 = 0.17f * sigma2 / (sigma2 + 0.13f); - + if (cosPhiDiff > 0) C2 *= sinAlpha; else C2 *= sinAlpha - tmp3*tmp3*tmp3; - + /* Compute tan(0.5 * (alpha+beta)) using the half-angle formulae */ Float tanHalf = (sinAlpha + sinBeta) / ( math::safe_sqrt(1.0f - sinAlpha * sinAlpha) + math::safe_sqrt(1.0f - sinBeta * sinBeta)); - + Spectrum rho = m_reflectance->eval(bRec.its), snglScat = rho * (C1 + cosPhiDiff * C2 * tanBeta + (1.0f - std::abs(cosPhiDiff)) * C3 * tanHalf), dblScat = rho * rho * (C4 * (1.0f - cosPhiDiff*tmp3*tmp3)); - + return (snglScat + dblScat) * (INV_PI * Frame::cosTheta(bRec.wo)); } } Float pdf(const BSDFSamplingRecord &bRec, EMeasure measure) const { if (!(bRec.typeMask & EGlossyReflection) || measure != ESolidAngle - || Frame::cosTheta(bRec.wi) <= 0 + || Frame::cosTheta(bRec.wi) <= 0 || Frame::cosTheta(bRec.wo) <= 0) return 0.0f; @@ -227,7 +227,7 @@ public: } Spectrum sample(BSDFSamplingRecord &bRec, const Point2 &sample) const { - if (!(bRec.typeMask & EGlossyReflection) || Frame::cosTheta(bRec.wi) <= 0) + if (!(bRec.typeMask & EGlossyReflection) || Frame::cosTheta(bRec.wi) <= 0) return Spectrum(0.0f); bRec.wo = Warp::squareToCosineHemisphere(sample); @@ -241,7 +241,7 @@ public: Spectrum sample(BSDFSamplingRecord &bRec, Float &pdf, const Point2 &sample) const { if (!(bRec.typeMask & EGlossyReflection) || Frame::cosTheta(bRec.wi) <= 0) return Spectrum(0.0f); - + bRec.wo = Warp::squareToCosineHemisphere(sample); bRec.eta = 1.0f; bRec.sampledComponent = 0; @@ -256,7 +256,7 @@ public: m_reflectance = static_cast(child); if (name == "alpha") m_alpha = static_cast(child); - else + else BSDF::addChild(name, child); } else { BSDF::addChild(name, child); @@ -295,11 +295,11 @@ private: bool m_useFastApprox; }; -// ================ Hardware shader implementation ================ +// ================ Hardware shader implementation ================ class RoughDiffuseShader : public Shader { public: - RoughDiffuseShader(Renderer *renderer, const Texture *reflectance, const Texture *alpha) + RoughDiffuseShader(Renderer *renderer, const Texture *reflectance, const Texture *alpha) : Shader(renderer, EBSDFShader), m_reflectance(reflectance), m_alpha(alpha) { m_reflectanceShader = renderer->registerShaderForResource(m_reflectance.get()); m_alphaShader = renderer->registerShaderForResource(m_alpha.get()); @@ -358,7 +358,7 @@ private: ref m_alphaShader; }; -Shader *RoughDiffuse::createShader(Renderer *renderer) const { +Shader *RoughDiffuse::createShader(Renderer *renderer) const { return new RoughDiffuseShader(renderer, m_reflectance.get(), m_alpha.get()); } diff --git a/src/bsdfs/roughplastic.cpp b/src/bsdfs/roughplastic.cpp index 1f50da4e..5cbf2b97 100644 --- a/src/bsdfs/roughplastic.cpp +++ b/src/bsdfs/roughplastic.cpp @@ -30,34 +30,34 @@ MTS_NAMESPACE_BEGIN * \icon{bsdf_roughplastic} * \parameters{ * \parameter{distribution}{\String}{ - * Specifies the type of microfacet normal distribution + * Specifies the type of microfacet normal distribution * used to model the surface roughness. * \begin{enumerate}[(i)] * \item \code{beckmann}: Physically-based distribution derived from * Gaussian random surfaces. This is the default. * \item \code{ggx}: New distribution proposed by - * Walter et al. \cite{Walter07Microfacet}, which is meant to better handle - * the long tails observed in measurements of ground surfaces. + * Walter et al. \cite{Walter07Microfacet}, which is meant to better handle + * the long tails observed in measurements of ground surfaces. * Renderings with this distribution may converge slowly. * \item \code{phong}: Classical $\cos^p\theta$ distribution. - * Due to the underlying microfacet theory, - * the use of this distribution here leads to more realistic + * Due to the underlying microfacet theory, + * the use of this distribution here leads to more realistic * behavior than the separately available \pluginref{phong} plugin. * \vspace{-3mm} * \end{enumerate} * } * \parameter{alpha}{\Float\Or\Texture}{ - * Specifies the roughness of the unresolved surface micro-geometry. - * When the Beckmann distribution is used, this parameter is equal to the - * \emph{root mean square} (RMS) slope of the microfacets. - * \default{0.1}. + * Specifies the roughness of the unresolved surface micro-geometry. + * When the Beckmann distribution is used, this parameter is equal to the + * \emph{root mean square} (RMS) slope of the microfacets. + * \default{0.1}. * } * \parameter{intIOR}{\Float\Or\String}{Interior index of refraction specified * numerically or using a known material name. \default{\texttt{polypropylene} / 1.49}} * \parameter{extIOR}{\Float\Or\String}{Exterior index of refraction specified * numerically or using a known material name. \default{\texttt{air} / 1.000277}} * \parameter{specular\showbreak Reflectance}{\Spectrum\Or\Texture}{Optional - * factor that can be used to modulate the specular reflection component. Note + * factor that can be used to modulate the specular reflection component. Note * that for physical realism, this parameter should never be touched. \default{1.0}} * \parameter{diffuse\showbreak Reflectance}{\Spectrum\Or\Texture}{Optional * factor used to modulate the diffuse reflection component\default{0.5}} @@ -70,16 +70,16 @@ MTS_NAMESPACE_BEGIN * * \vspace{3mm} * This plugin implements a realistic microfacet scattering model for rendering - * rough dielectric materials with internal scattering, such as plastic. It can - * be interpreted as a fancy version of the Cook-Torrance model and should be - * preferred over heuristic models like \pluginref{phong} and \pluginref{ward} + * rough dielectric materials with internal scattering, such as plastic. It can + * be interpreted as a fancy version of the Cook-Torrance model and should be + * preferred over heuristic models like \pluginref{phong} and \pluginref{ward} * when possible. * - * Microfacet theory describes rough surfaces as an arrangement of unresolved and + * Microfacet theory describes rough surfaces as an arrangement of unresolved and * ideally specular facets, whose normal directions are given by a specially - * chosen \emph{microfacet distribution}. - * By accounting for shadowing and masking effects between these facets, it is - * possible to reproduce the important off-specular reflections peaks observed + * chosen \emph{microfacet distribution}. + * By accounting for shadowing and masking effects between these facets, it is + * possible to reproduce the important off-specular reflections peaks observed * in real-world measurements of such materials. * * \renderings{ @@ -89,33 +89,33 @@ MTS_NAMESPACE_BEGIN * * This plugin is essentially the ``roughened'' equivalent of the (smooth) plugin * \pluginref{plastic}. For very low values of $\alpha$, the two will - * be identical, though scenes using this plugin will take longer to render + * be identical, though scenes using this plugin will take longer to render * due to the additional computational burden of tracking surface roughness. * - * For convenience, this model allows to specify IOR values either numerically, - * or based on a list of known materials (see \tblref{dielectric-iors} on - * \tblpage{dielectric-iors} for an overview). - * When no parameters are given, the plugin activates the defaults, + * For convenience, this model allows to specify IOR values either numerically, + * or based on a list of known materials (see \tblref{dielectric-iors} on + * \tblpage{dielectric-iors} for an overview). + * When no parameters are given, the plugin activates the defaults, * which describe a white polypropylene plastic material with a light amount * of roughness modeled using the Beckmann distribution. * - * Like the \pluginref{plastic} material, this model internally simulates the - * interaction of light with a diffuse base surface coated by a thin dielectric - * layer (where the coating layer is now \emph{rough}). This is a convenient - * abstraction rather than a restriction. In other words, there are many - * materials that can be rendered with this model, even if they might not not - * fit this description perfectly well. + * Like the \pluginref{plastic} material, this model internally simulates the + * interaction of light with a diffuse base surface coated by a thin dielectric + * layer (where the coating layer is now \emph{rough}). This is a convenient + * abstraction rather than a restriction. In other words, there are many + * materials that can be rendered with this model, even if they might not not + * fit this description perfectly well. * * The simplicity of this setup makes it possible to account for interesting * nonlinear effects due to internal scattering, which is controlled by - * the \texttt{nonlinear} parameter. For more details, please refer to the description - * of this parameter given in the the \pluginref{plastic} plugin section + * the \texttt{nonlinear} parameter. For more details, please refer to the description + * of this parameter given in the the \pluginref{plastic} plugin section * on \pluginpage{plastic}. * * * To get an intuition about the effect of the surface roughness - * parameter $\alpha$, consider the following approximate classification: - * a value of $\alpha=0.001-0.01$ corresponds to a material + * parameter $\alpha$, consider the following approximate classification: + * a value of $\alpha=0.001-0.01$ corresponds to a material * with slight imperfections on an * otherwise smooth surface finish, $\alpha=0.1$ is relatively rough, * and $\alpha=0.3-0.7$ is \emph{extremely} rough (e.g. an etched or ground @@ -128,7 +128,7 @@ MTS_NAMESPACE_BEGIN * \caption{ * When asked to do so, this model can account for subtle nonlinear color shifts due * to internal scattering processes. The above images show a textured - * object first rendered using \pluginref{diffuse}, then + * object first rendered using \pluginref{diffuse}, then * \pluginref{roughplastic} with the default parameters, and finally using * \pluginref{roughplastic} and support for nonlinear color shifts. * } @@ -136,17 +136,17 @@ MTS_NAMESPACE_BEGIN * \newpage * \renderings{ * \rendering{Wood material with smooth horizontal stripes}{bsdf_roughplastic_roughtex1} - * \rendering{A material with imperfections at a much smaller scale than what + * \rendering{A material with imperfections at a much smaller scale than what * is modeled e.g. using a bump map.}{bsdf_roughplastic_roughtex2}\vspace{-3mm} * \caption{ * The ability to texture the roughness parameter makes it possible - * to render materials with a structured finish, as well as + * to render materials with a structured finish, as well as * ``smudgy'' objects. * } * } * \vspace{2mm} * \begin{xml}[caption={A material definition for black plastic material with - * a spatially varying roughness.}, + * a spatially varying roughness.}, * label=lst:roughplastic-varyingalpha] * * @@ -164,26 +164,26 @@ MTS_NAMESPACE_BEGIN * * \subsubsection*{Technical details} * The implementation of this model is partly based on the paper ``Microfacet - * Models for Refraction through Rough Surfaces'' by Walter et al. - * \cite{Walter07Microfacet}. Several different types of microfacet - * distributions are supported. Note that the choices are slightly more - * restricted here---in comparison to other rough scattering models in + * Models for Refraction through Rough Surfaces'' by Walter et al. + * \cite{Walter07Microfacet}. Several different types of microfacet + * distributions are supported. Note that the choices are slightly more + * restricted here---in comparison to other rough scattering models in * Mitsuba, anisotropic distributions are not allowed. * * The implementation of this model makes heavy use of a \emph{rough - * Fresnel transmittance} function, which is a generalization of the + * Fresnel transmittance} function, which is a generalization of the * usual Fresnel transmittion coefficient to microfacet surfaces. Unfortunately, - * this function is normally prohibitively expensive, since each - * evaluation involves a numerical integration over the sphere. + * this function is normally prohibitively expensive, since each + * evaluation involves a numerical integration over the sphere. * * To avoid this performance issue, Mitsuba ships with data files - * (contained in the \code{data/microfacet} directory) containing precomputed + * (contained in the \code{data/microfacet} directory) containing precomputed * values of this function over a large range of parameter values. At runtime, * the relevant parts are extracted using tricubic interpolation. * - * When rendering with the Phong microfacet distributions, a conversion - * is used to turn the specified $\alpha$ roughness value into the Phong - * exponent. This is done in a way, such that the different distributions + * When rendering with the Phong microfacet distributions, a conversion + * is used to turn the specified $\alpha$ roughness value into the Phong + * exponent. This is done in a way, such that the different distributions * all produce a similar appearance for the same value of $\alpha$. * */ @@ -223,7 +223,7 @@ public: m_specularSamplingWeight = 0.0f; } - RoughPlastic(Stream *stream, InstanceManager *manager) + RoughPlastic(Stream *stream, InstanceManager *manager) : BSDF(stream, manager) { m_distribution = MicrofacetDistribution( (MicrofacetDistribution::EType) stream->readUInt() @@ -253,11 +253,11 @@ public: m_components.clear(); - m_components.push_back(EGlossyReflection | EFrontSide + m_components.push_back(EGlossyReflection | EFrontSide | ((constAlpha && m_specularReflectance->isConstant()) ? 0 : ESpatiallyVarying)); - m_components.push_back(EDiffuseReflection | EFrontSide - | ((constAlpha && m_diffuseReflectance->isConstant()) + m_components.push_back(EDiffuseReflection | EFrontSide + | ((constAlpha && m_diffuseReflectance->isConstant()) ? 0 : ESpatiallyVarying)); /* Verify the input parameters and fix them if necessary */ @@ -271,7 +271,7 @@ public: Float dAvg = m_diffuseReflectance->getAverage().getLuminance(), sAvg = m_specularReflectance->getAverage().getLuminance(); m_specularSamplingWeight = sAvg / (dAvg + sAvg); - + m_invEta2 = 1.0f / (m_eta*m_eta); if (!m_externalRoughTransmittance.get()) { @@ -283,19 +283,19 @@ public: m_externalRoughTransmittance->checkEta(m_eta); m_externalRoughTransmittance->checkAlpha(m_alpha->getMinimum().average()); m_externalRoughTransmittance->checkAlpha(m_alpha->getMaximum().average()); - + /* Reduce the rough transmittance data to a 2D slice */ m_internalRoughTransmittance = m_externalRoughTransmittance->clone(); m_externalRoughTransmittance->setEta(m_eta); m_internalRoughTransmittance->setEta(1/m_eta); /* If possible, even reduce it to a 1D slice */ - if (constAlpha) + if (constAlpha) m_externalRoughTransmittance->setAlpha( m_alpha->eval(Intersection()).average()); } - m_usesRayDifferentials = + m_usesRayDifferentials = m_specularReflectance->usesRayDifferentials() || m_diffuseReflectance->usesRayDifferentials() || m_alpha->usesRayDifferentials(); @@ -321,7 +321,7 @@ public: (bRec.component == -1 || bRec.component == 0); bool hasDiffuse = (bRec.typeMask & EDiffuseReflection) && (bRec.component == -1 || bRec.component == 1); - + if (measure != ESolidAngle || Frame::cosTheta(bRec.wi) <= 0 || Frame::cosTheta(bRec.wo) <= 0 || @@ -331,7 +331,7 @@ public: /* Evaluate the roughness texture */ Float alpha = m_alpha->eval(bRec.its).average(); Float alphaT = m_distribution.transformRoughness(alpha); - + Spectrum result(0.0f); if (hasSpecular) { /* Calculate the reflection half-vector */ @@ -347,13 +347,13 @@ public: const Float G = m_distribution.G(bRec.wi, bRec.wo, H, alphaT); /* Calculate the specular reflection component */ - Float value = F * D * G / + Float value = F * D * G / (4.0f * Frame::cosTheta(bRec.wi)); - result += m_specularReflectance->eval(bRec.its) * value; + result += m_specularReflectance->eval(bRec.its) * value; } - if (hasDiffuse) { + if (hasDiffuse) { Spectrum diff = m_diffuseReflectance->eval(bRec.its); Float T12 = m_externalRoughTransmittance->eval(Frame::cosTheta(bRec.wi), alpha); Float T21 = m_externalRoughTransmittance->eval(Frame::cosTheta(bRec.wo), alpha); @@ -396,7 +396,7 @@ public: /* Reallocate samples */ probSpecular = (probSpecular*m_specularSamplingWeight) / - (probSpecular*m_specularSamplingWeight + + (probSpecular*m_specularSamplingWeight + (1-probSpecular) * (1-m_specularSamplingWeight)); probDiffuse = 1 - probSpecular; @@ -415,7 +415,7 @@ public: result = prob * dwh_dwo * probSpecular; } - if (hasDiffuse) + if (hasDiffuse) result += probDiffuse * Warp::squareToCosineHemispherePdf(bRec.wo); return result; @@ -426,7 +426,7 @@ public: (bRec.component == -1 || bRec.component == 0); bool hasDiffuse = (bRec.typeMask & EDiffuseReflection) && (bRec.component == -1 || bRec.component == 1); - + if (Frame::cosTheta(bRec.wi) <= 0 || (!hasSpecular && !hasDiffuse)) return Spectrum(0.0f); @@ -444,7 +444,7 @@ public: /* Reallocate samples */ probSpecular = (probSpecular*m_specularSamplingWeight) / - (probSpecular*m_specularSamplingWeight + + (probSpecular*m_specularSamplingWeight + (1-probSpecular) * (1-m_specularSamplingWeight)); if (sample.y <= probSpecular) { @@ -475,7 +475,7 @@ public: /* Guard against numerical imprecisions */ _pdf = pdf(bRec, ESolidAngle); - if (_pdf == 0) + if (_pdf == 0) return Spectrum(0.0f); else return eval(bRec, ESolidAngle) / _pdf; @@ -490,11 +490,11 @@ public: if (child->getClass()->derivesFrom(MTS_CLASS(Texture))) { if (name == "alpha") m_alpha = static_cast(child); - else if (name == "specularReflectance") + else if (name == "specularReflectance") m_specularReflectance = static_cast(child); else if (name == "diffuseReflectance") m_diffuseReflectance = static_cast(child); - else + else BSDF::addChild(name, child); } else { BSDF::addChild(name, child); @@ -543,10 +543,10 @@ private: /** * GLSL port of the rough plastic shader. This version is much more - * approximate -- it only supports the Beckmann distribution, - * does everything in RGB, uses a cheaper shadowing-masking term, and - * it also makes use of the Schlick approximation to the Fresnel - * reflectance of dielectrics. When the roughness is lower than + * approximate -- it only supports the Beckmann distribution, + * does everything in RGB, uses a cheaper shadowing-masking term, and + * it also makes use of the Schlick approximation to the Fresnel + * reflectance of dielectrics. When the roughness is lower than * \alpha < 0.2, the shader clamps it to 0.2 so that it will still perform * reasonably well in a VPL-based preview. There is no support for * non-linear effects due to internal scattering. @@ -554,10 +554,10 @@ private: class RoughPlasticShader : public Shader { public: RoughPlasticShader(Renderer *renderer, const Texture *specularReflectance, - const Texture *diffuseReflectance, const Texture *alpha, Float eta) - : Shader(renderer, EBSDFShader), - m_specularReflectance(specularReflectance), - m_diffuseReflectance(diffuseReflectance), + const Texture *diffuseReflectance, const Texture *alpha, Float eta) + : Shader(renderer, EBSDFShader), + m_specularReflectance(specularReflectance), + m_diffuseReflectance(diffuseReflectance), m_alpha(alpha) { m_specularReflectanceShader = renderer->registerShaderForResource(m_specularReflectance.get()); m_diffuseReflectanceShader = renderer->registerShaderForResource(m_diffuseReflectance.get()); @@ -653,7 +653,7 @@ private: Float m_R0; }; -Shader *RoughPlastic::createShader(Renderer *renderer) const { +Shader *RoughPlastic::createShader(Renderer *renderer) const { return new RoughPlasticShader(renderer, m_specularReflectance.get(), m_diffuseReflectance.get(), m_alpha.get(), m_eta); diff --git a/src/bsdfs/rtrans.h b/src/bsdfs/rtrans.h index e2935b6f..14fbb4cb 100644 --- a/src/bsdfs/rtrans.h +++ b/src/bsdfs/rtrans.h @@ -44,9 +44,9 @@ MTS_NAMESPACE_BEGIN * * Since a numerical integration over the microfacet distribution is involved * in every transmittance evaluation, this function is usually prohibitively - * expensive. That is the motivation for this class, which instead performs + * expensive. That is the motivation for this class, which instead performs * lookups into an extensive precomputed three-dimensional table containing - * appropriately spaced evaluations of this function. The lookups are combined + * appropriately spaced evaluations of this function. The lookups are combined * using tricubic interpolation (more specifically, Catmull-Rom splines). * * The 3D array is parameterized in a way so that the transmittance @@ -54,9 +54,9 @@ MTS_NAMESPACE_BEGIN * quite accurate over a large parameter range (avg. abs. error < 1e-4, * for eta in [1, 4] and RMS roughness in [0, 4]) * - * In many cases, the flexibility to evaluate the rough transmittance - * function for any (ior, roughness, angle)-triple is not actually - * needed, since the index of refraction parameter might always be + * In many cases, the flexibility to evaluate the rough transmittance + * function for any (ior, roughness, angle)-triple is not actually + * needed, since the index of refraction parameter might always be * constant (and potentially also the roughness). * * This class therefore provides the operations \ref setEta() @@ -74,7 +74,7 @@ public: * \brief Load a rough transmittance data file from disk * * \param type - * Denotes the type of a microfacet distribution, + * Denotes the type of a microfacet distribution, * i.e. Beckmann or GGX */ RoughTransmittance(MicrofacetDistribution::EType type) : m_trans(NULL), m_diffTrans(NULL) { @@ -92,7 +92,7 @@ public: fs::path sourceFile = Thread::getThread()->getFileResolver()->resolve( formatString("data/microfacet/%s.dat", name.c_str())); - ref fstream = new FileStream(sourceFile, + ref fstream = new FileStream(sourceFile, FileStream::EReadOnly); fstream->setByteOrder(Stream::ELittleEndian); @@ -106,13 +106,13 @@ public: m_etaSamples = fstream->readSize(); m_alphaSamples = fstream->readSize(); m_thetaSamples = fstream->readSize(); - + m_transSize = 2 * m_etaSamples * m_alphaSamples * m_thetaSamples; m_diffTransSize = 2 * m_etaSamples * m_alphaSamples; - SLog(EDebug, "Loading " SIZE_T_FMT "x" SIZE_T_FMT "x" SIZE_T_FMT + SLog(EDebug, "Loading " SIZE_T_FMT "x" SIZE_T_FMT "x" SIZE_T_FMT " (%s) rough transmittance samples from \"%s\"", 2*m_etaSamples, - m_alphaSamples, m_thetaSamples, + m_alphaSamples, m_thetaSamples, memString((m_transSize + m_diffTransSize) * sizeof(float)).c_str(), sourceFile.string().c_str()); @@ -191,11 +191,11 @@ public: } else if (m_etaFixed) { SAssert(cosTheta >= 0); - Float warpedAlpha = std::pow((alpha - m_alphaMin) + Float warpedAlpha = std::pow((alpha - m_alphaMin) / (m_alphaMax-m_alphaMin), (Float) 0.25f); result = interpCubic2D(Point2(warpedCosTheta, warpedAlpha), - m_trans, Point2(0.0f), Point2(1.0f), + m_trans, Point2(0.0f), Point2(1.0f), Size2(m_thetaSamples, m_alphaSamples)); } else { if (cosTheta < 0) { @@ -205,7 +205,7 @@ public: Float *data = m_trans; if (eta < 1) { - /* Entering a less dense medium -- skip ahead to the + /* Entering a less dense medium -- skip ahead to the second data block */ data += m_etaSamples * m_alphaSamples * m_thetaSamples; eta = 1.0f / eta; @@ -215,22 +215,22 @@ public: eta = m_etaMin; /* Transform the roughness and IOR values into the warped parameter space */ - Float warpedAlpha = std::pow((alpha - m_alphaMin) + Float warpedAlpha = std::pow((alpha - m_alphaMin) / (m_alphaMax-m_alphaMin), (Float) 0.25f); - Float warpedEta = std::pow((eta - m_etaMin) + Float warpedEta = std::pow((eta - m_etaMin) / (m_etaMax-m_etaMin), (Float) 0.25f); - + result = interpCubic3D(Point3(warpedCosTheta, warpedAlpha, warpedEta), - data, Point3(0.0f), Point3(1.0f), + data, Point3(0.0f), Point3(1.0f), Size3(m_thetaSamples, m_alphaSamples, m_etaSamples)); } - return std::min((Float) 1.0f, std::max((Float) 0.0f, result)); + return std::min((Float) 1.0f, std::max((Float) 0.0f, result)); } /** - * \brief Evaluate the \a diffuse rough transmittance for a given + * \brief Evaluate the \a diffuse rough transmittance for a given * index of refraction, roughness, and angle of incidence. * * The diffuse rough transmittance is cosine-weighted integral @@ -247,15 +247,15 @@ public: if (m_alphaFixed && m_etaFixed) { result = m_diffTrans[0]; } else if (m_etaFixed) { - Float warpedAlpha = std::pow((alpha - m_alphaMin) + Float warpedAlpha = std::pow((alpha - m_alphaMin) / (m_alphaMax-m_alphaMin), (Float) 0.25f); - result = interpCubic1D(warpedAlpha, m_diffTrans, + result = interpCubic1D(warpedAlpha, m_diffTrans, 0.0f, 1.0f, m_alphaSamples); } else { Float *data = m_diffTrans; if (eta < 1) { - /* Entering a less dense medium -- skip ahead to the + /* Entering a less dense medium -- skip ahead to the second data block */ data += m_etaSamples * m_alphaSamples; eta = 1.0f / eta; @@ -265,12 +265,12 @@ public: eta = m_etaMin; /* Transform the roughness and IOR values into the warped parameter space */ - Float warpedAlpha = std::pow((alpha - m_alphaMin) + Float warpedAlpha = std::pow((alpha - m_alphaMin) / (m_alphaMax-m_alphaMin), (Float) 0.25f); - Float warpedEta = std::pow((eta - m_etaMin) + Float warpedEta = std::pow((eta - m_etaMin) / (m_etaMax-m_etaMin), (Float) 0.25f); - result = interpCubic2D(Point2(warpedAlpha, warpedEta), data, + result = interpCubic2D(Point2(warpedAlpha, warpedEta), data, Point2(0.0f), Point2(1.0f), Size2(m_alphaSamples, m_etaSamples)); } @@ -290,14 +290,14 @@ public: m_transSize = m_alphaSamples * m_thetaSamples; m_diffTransSize = m_alphaSamples; - SLog(EDebug, "Reducing dimension from 3D to 2D (%s), eta = %f", + SLog(EDebug, "Reducing dimension from 3D to 2D (%s), eta = %f", memString((m_transSize + m_diffTransSize) * sizeof(Float)).c_str(), eta); Float *trans = m_trans, *diffTrans = m_diffTrans; if (eta < 1) { - /* Entering a less dense medium -- skip ahead to the + /* Entering a less dense medium -- skip ahead to the second data block */ trans += m_etaSamples * m_alphaSamples * m_thetaSamples; diffTrans += m_etaSamples * m_alphaSamples; @@ -306,8 +306,8 @@ public: if (eta < m_etaMin) eta = m_etaMin; - - Float warpedEta = std::pow((eta - m_etaMin) + + Float warpedEta = std::pow((eta - m_etaMin) / (m_etaMax-m_etaMin), (Float) 0.25f); Float *newTrans = new Float[m_transSize]; @@ -319,13 +319,13 @@ public: for (size_t i=0; i m_alphaMax) { SLog(EError, "Error: the requested roughness value alpha=%f is" " outside of the supported range [%f, %f]! Please scale " - " your roughness value/texture to lie within this range.", + " your roughness value/texture to lie within this range.", alpha, m_alphaMin, m_alphaMax); } } @@ -392,10 +392,10 @@ public: void checkEta(Float eta) { if (eta < 1) eta = 1/eta; - if (eta < m_etaMin || eta > m_etaMax) + if (eta < m_etaMin || eta > m_etaMax) SLog(EError, "Error: the requested relative index of refraction " "eta=%f is outside of the supported range [%f, %f]! Please " - "update your scene so that it uses realistic IOR values.", + "update your scene so that it uses realistic IOR values.", eta, m_etaMin, m_etaMax); } diff --git a/src/bsdfs/thindielectric.cpp b/src/bsdfs/thindielectric.cpp index b7cde1f9..cc5f9bc7 100644 --- a/src/bsdfs/thindielectric.cpp +++ b/src/bsdfs/thindielectric.cpp @@ -30,21 +30,21 @@ MTS_NAMESPACE_BEGIN * \parameter{extIOR}{\Float\Or\String}{Exterior index of refraction specified * numerically or using a known material name. \default{\texttt{air} / 1.000277}} * \parameter{specular\showbreak Reflectance}{\Spectrum\Or\Texture}{Optional - * factor that can be used to modulate the specular reflection component. Note + * factor that can be used to modulate the specular reflection component. Note * that for physical realism, this parameter should never be touched. \default{1.0}} * \parameter{specular\showbreak Transmittance}{\Spectrum\Or\Texture}{Optional - * factor that can be used to modulate the specular transmission component. Note + * factor that can be used to modulate the specular transmission component. Note * that for physical realism, this parameter should never be touched. \default{1.0}} * } * - * This plugin models a \emph{thin} dielectric material that is embedded inside another - * dielectric---for instance, glass surrounded by air. The interior of the material + * This plugin models a \emph{thin} dielectric material that is embedded inside another + * dielectric---for instance, glass surrounded by air. The interior of the material * is assumed to be so thin that its effect on transmitted rays is negligible, * Hence, light exits such a material without any form of angular deflection * (though there is still specular reflection). * - * This model should be used for things like glass windows that were modeled using only a - * single sheet of triangles or quads. On the other hand, when the window consists of + * This model should be used for things like glass windows that were modeled using only a + * single sheet of triangles or quads. On the other hand, when the window consists of * proper closed geometry, \pluginref{dielectric} is the right choice. This is illustrated below: * * \begin{figure}[h] @@ -62,11 +62,11 @@ MTS_NAMESPACE_BEGIN * An illustration of the difference between the \pluginref{dielectric} and \pluginref{thindielectric} plugins} * \end{figure} * - * The implementation correctly accounts for multiple internal reflections - * inside the thin dielectric at \emph{no significant extra cost}, i.e. paths - * of the type $R, TRT, TR^3T, ..$ for reflection and $TT, TR^2, TR^4T, ..$ for - * refraction, where $T$ and $R$ denote individual reflection and refraction - * events, respectively. + * The implementation correctly accounts for multiple internal reflections + * inside the thin dielectric at \emph{no significant extra cost}, i.e. paths + * of the type $R, TRT, TR^3T, ..$ for reflection and $TT, TR^2, TR^4T, ..$ for + * refraction, where $T$ and $R$ denote individual reflection and refraction + * events, respectively. */ class ThinDielectric : public BSDF { public: @@ -89,7 +89,7 @@ public: props.getSpectrum("specularTransmittance", Spectrum(1.0f))); } - ThinDielectric(Stream *stream, InstanceManager *manager) + ThinDielectric(Stream *stream, InstanceManager *manager) : BSDF(stream, manager) { m_eta = stream->readFloat(); m_specularReflectance = static_cast(manager->getInstance(stream)); @@ -111,18 +111,18 @@ public: m_specularReflectance, "specularReflectance", 1.0f); m_specularTransmittance = ensureEnergyConservation( m_specularTransmittance, "specularTransmittance", 1.0f); - + m_components.clear(); m_components.push_back(EDeltaReflection | EFrontSide | EBackSide | (m_specularReflectance->isConstant() ? 0 : ESpatiallyVarying)); - m_components.push_back(ENull | EFrontSide | EBackSide + m_components.push_back(ENull | EFrontSide | EBackSide | (m_specularTransmittance->isConstant() ? 0 : ESpatiallyVarying)); m_components.clear(); m_components.push_back(ENull | EFrontSide | EBackSide); m_usesRayDifferentials = false; - m_usesRayDifferentials = + m_usesRayDifferentials = m_specularReflectance->usesRayDifferentials() || m_specularTransmittance->usesRayDifferentials(); @@ -331,7 +331,7 @@ private: }; /* Fake glass shader -- it is really hopeless to visualize - this material in the VPL renderer, so let's try to do at least + this material in the VPL renderer, so let's try to do at least something that suggests the presence of a transparent boundary */ class ThinDielectricShader : public Shader { public: @@ -362,7 +362,7 @@ public: MTS_DECLARE_CLASS() }; -Shader *ThinDielectric::createShader(Renderer *renderer) const { +Shader *ThinDielectric::createShader(Renderer *renderer) const { return new ThinDielectricShader(renderer); } diff --git a/src/bsdfs/twosided.cpp b/src/bsdfs/twosided.cpp index 11cf49e8..8593741e 100644 --- a/src/bsdfs/twosided.cpp +++ b/src/bsdfs/twosided.cpp @@ -29,24 +29,24 @@ MTS_NAMESPACE_BEGIN * be turned into a two-sided scattering model. If two BRDFs * are specified, they will be placed on the front and back side, respectively.} * } - * + * * \renderings{ * \unframedrendering{From this angle, the Cornell box scene shows visible back-facing geometry} * {bsdf_twosided_before} * \unframedrendering{Applying the \pluginref{twosided} plugin fixes the rendering} * {bsdf_twosided_after} * } - * - * By default, all non-transmissive scattering models in Mitsuba - * are \emph{one-sided} --- in other words, they absorb all light + * + * By default, all non-transmissive scattering models in Mitsuba + * are \emph{one-sided} --- in other words, they absorb all light * that is received on the interior-facing side of any associated - * surfaces. Holes and visible back-facing parts are thus exposed + * surfaces. Holes and visible back-facing parts are thus exposed * as black regions. * * Usually, this is a good idea, since it will reveal modeling * issues early on. But sometimes one is forced to deal with * improperly closed geometry, where the one-sided behavior is - * bothersome. In that case, this plugin can be used to turn + * bothersome. In that case, this plugin can be used to turn * one-sided scattering models into proper two-sided versions of * themselves. The plugin has no parameters other than a required * nested BSDF specification. It is also possible to supply two @@ -64,10 +64,10 @@ MTS_NAMESPACE_BEGIN */ class TwoSidedBRDF : public BSDF { public: - TwoSidedBRDF(const Properties &props) + TwoSidedBRDF(const Properties &props) : BSDF(props) { } - TwoSidedBRDF(Stream *stream, InstanceManager *manager) + TwoSidedBRDF(Stream *stream, InstanceManager *manager) : BSDF(stream, manager) { m_nestedBRDF[0] = static_cast(manager->getInstance(stream)); m_nestedBRDF[1] = static_cast(manager->getInstance(stream)); @@ -142,7 +142,7 @@ public: if (bRec.component != -1) bRec.component -= m_nestedBRDF[0]->getComponentCount(); } - + Spectrum result = m_nestedBRDF[flipped ? 1 : 0]->sample(bRec, sample); if (flipped) { @@ -226,11 +226,11 @@ protected: }; -// ================ Hardware shader implementation ================ +// ================ Hardware shader implementation ================ class TwoSidedShader : public Shader { public: - TwoSidedShader(Renderer *renderer, + TwoSidedShader(Renderer *renderer, const ref *nestedBRDF) : Shader(renderer, EBSDFShader) { m_nestedBRDF[0] = nestedBRDF[0].get(); m_nestedBRDF[1] = nestedBRDF[1].get(); @@ -286,7 +286,7 @@ private: ref m_nestedBRDFShader[2]; }; -Shader *TwoSidedBRDF::createShader(Renderer *renderer) const { +Shader *TwoSidedBRDF::createShader(Renderer *renderer) const { return new TwoSidedShader(renderer, m_nestedBRDF); } diff --git a/src/bsdfs/ward.cpp b/src/bsdfs/ward.cpp index 966209c0..596419ff 100644 --- a/src/bsdfs/ward.cpp +++ b/src/bsdfs/ward.cpp @@ -31,18 +31,18 @@ MTS_NAMESPACE_BEGIN * \begin{enumerate}[(i)] * \item \code{ward}: The original model by Ward \cite{Ward1992Measuring} * --- suffers from energy loss at grazing angles. - * \item \code{ward-duer}: Corrected Ward model with lower energy loss + * \item \code{ward-duer}: Corrected Ward model with lower energy loss * at grazing angles \cite{Dur2006Improved}. - * Does not always conserve energy. + * Does not always conserve energy. * \item \code{balanced}: Improved version of the \code{ward-duer} * model with energy balance at all angles \cite{Geisler2010New}. * \end{enumerate} * Default: \texttt{balanced} * } * \parameter{alphaU, alphaV}{\Float\Or\Texture}{ - * Specifies the anisotropic roughness values along the tangent and - * bitangent directions. - * \default{0.1}. + * Specifies the anisotropic roughness values along the tangent and + * bitangent directions. + * \default{0.1}. * } * \parameter{specular\showbreak Reflectance}{\Spectrum\Or\Texture}{ * Specifies the weight of the specular reflectance component.\default{0.2}} @@ -57,7 +57,7 @@ MTS_NAMESPACE_BEGIN * This plugin implements the anisotropic Ward reflectance model and * several extensions. They are described in the papers * \begin{enumerate}[(i)] - * \item ``Measuring and Modeling Anisotropic Reflection'' + * \item ``Measuring and Modeling Anisotropic Reflection'' * by Greg Ward \cite{Ward1992Measuring} * \item ``Notes on the Ward BRDF'' by Bruce Walter \cite{Walter2005Notes} * \item ``An Improved Normalization for the Ward Reflectance Model'' @@ -67,19 +67,19 @@ MTS_NAMESPACE_BEGIN * \end{enumerate} * * Like the Phong BRDF, the Ward model does not take the Fresnel reflectance - * of the material into account. In an experimental study by Ngan et al. + * of the material into account. In an experimental study by Ngan et al. * \cite{Ngan2005Experimental}, the Ward model performed noticeably worse than * models based on microfacet theory. * - * For this reason, it is usually preferable to switch to a microfacet model - * that incorporates knowledge about the material's index of refraction. In Mitsuba, - * two such alternatives to \pluginref{ward} are given by the plugins + * For this reason, it is usually preferable to switch to a microfacet model + * that incorporates knowledge about the material's index of refraction. In Mitsuba, + * two such alternatives to \pluginref{ward} are given by the plugins * \pluginref{roughconductor} and \pluginref{roughplastic} (depending on the * material type). * * When using this plugin, note that the diffuse and specular reflectance - * components should add up to a value less than or equal to one (for each - * color channel). Otherwise, they will automatically be scaled appropriately + * components should add up to a value less than or equal to one (for each + * color channel). Otherwise, they will automatically be scaled appropriately * to ensure energy conservation. */ class Ward : public BSDF { @@ -94,14 +94,14 @@ public: EBalanced = 2 }; - Ward(const Properties &props) + Ward(const Properties &props) : BSDF(props) { m_diffuseReflectance = new ConstantSpectrumTexture( props.getSpectrum("diffuseReflectance", Spectrum(0.5f))); m_specularReflectance = new ConstantSpectrumTexture( props.getSpectrum("specularReflectance", Spectrum(0.2f))); - - std::string type = + + std::string type = boost::to_lower_copy(props.getString("variant", "balanced")); if (type == "ward") m_modelVariant = EWard; @@ -125,7 +125,7 @@ public: m_specularSamplingWeight = 0.0f; } - Ward(Stream *stream, InstanceManager *manager) + Ward(Stream *stream, InstanceManager *manager) : BSDF(stream, manager) { m_modelVariant = (EModelVariant) stream->readUInt(); m_diffuseReflectance = static_cast(manager->getInstance(stream)); @@ -161,7 +161,7 @@ public: sAvg = m_specularReflectance->getAverage().getLuminance(); m_specularSamplingWeight = sAvg / (dAvg + sAvg); - m_usesRayDifferentials = + m_usesRayDifferentials = m_diffuseReflectance->usesRayDifferentials() || m_specularReflectance->usesRayDifferentials() || m_alphaU->usesRayDifferentials() || @@ -190,19 +190,19 @@ public: Vector H = bRec.wi+bRec.wo; Float alphaU = m_alphaU->eval(bRec.its).average(); Float alphaV = m_alphaV->eval(bRec.its).average(); - + Float factor1 = 0.0f; switch (m_modelVariant) { case EWard: - factor1 = 1.0f / (4.0f * M_PI * alphaU * alphaV * + factor1 = 1.0f / (4.0f * M_PI * alphaU * alphaV * std::sqrt(Frame::cosTheta(bRec.wi)*Frame::cosTheta(bRec.wo))); break; case EWardDuer: - factor1 = 1.0f / (4.0f * M_PI * alphaU * alphaV * + factor1 = 1.0f / (4.0f * M_PI * alphaU * alphaV * Frame::cosTheta(bRec.wi)*Frame::cosTheta(bRec.wo)); break; case EBalanced: - factor1 = dot(H,H) / (M_PI * alphaU * alphaV + factor1 = dot(H,H) / (M_PI * alphaU * alphaV * std::pow(Frame::cosTheta(H),4)); break; default: @@ -219,7 +219,7 @@ public: result += m_specularReflectance->eval(bRec.its) * specRef; } - if (hasDiffuse) + if (hasDiffuse) result += m_diffuseReflectance->eval(bRec.its) * INV_PI; return result * Frame::cosTheta(bRec.wo); @@ -241,7 +241,7 @@ public: Float alphaU = m_alphaU->eval(bRec.its).average(); Float alphaV = m_alphaV->eval(bRec.its).average(); Vector H = normalize(bRec.wi+bRec.wo); - Float factor1 = 1.0f / (4.0f * M_PI * alphaU * alphaV * + Float factor1 = 1.0f / (4.0f * M_PI * alphaU * alphaV * dot(H, bRec.wi) * std::pow(Frame::cosTheta(H), 3)); Float factor2 = H.x / alphaU, factor3 = H.y / alphaV; @@ -249,11 +249,11 @@ public: specProb = factor1 * math::fastexp(exponent); } - if (hasDiffuse) + if (hasDiffuse) diffuseProb = Warp::squareToCosineHemispherePdf(bRec.wo); if (hasDiffuse && hasSpecular) - return m_specularSamplingWeight * specProb + + return m_specularSamplingWeight * specProb + (1-m_specularSamplingWeight) * diffuseProb; else if (hasDiffuse) return diffuseProb; @@ -290,7 +290,7 @@ public: Float alphaU = m_alphaU->eval(bRec.its).average(); Float alphaV = m_alphaV->eval(bRec.its).average(); - Float phiH = std::atan(alphaV/alphaU + Float phiH = std::atan(alphaV/alphaU * std::tan(2.0f * M_PI * sample.y)); if (sample.y > 0.5f) phiH += M_PI; @@ -319,7 +319,7 @@ public: _pdf = pdf(bRec, ESolidAngle); - if (_pdf == 0) + if (_pdf == 0) return Spectrum(0.0f); else return eval(bRec, ESolidAngle) / _pdf; @@ -367,7 +367,7 @@ public: return std::numeric_limits::infinity(); } - Shader *createShader(Renderer *renderer) const; + Shader *createShader(Renderer *renderer) const; std::string toString() const { std::ostringstream oss; @@ -401,21 +401,21 @@ private: Float m_specularSamplingWeight; }; -// ================ Hardware shader implementation ================ +// ================ Hardware shader implementation ================ /** * GLSL port of the Ward shader. This version only implements the variant - * with energy balance. When the roughness is lower than + * with energy balance. When the roughness is lower than * \alpha < 0.2, the shader clamps it to 0.2 so that it will still perform * reasonably well in a VPL-based preview. */ class WardShader : public Shader { public: - WardShader(Renderer *renderer, + WardShader(Renderer *renderer, const Texture *diffuseColor, const Texture *specularColor, const Texture *alphaU, - const Texture *alphaV) : Shader(renderer, EBSDFShader), + const Texture *alphaV) : Shader(renderer, EBSDFShader), m_diffuseReflectance(diffuseColor), m_specularReflectance(specularColor), m_alphaU(alphaU), m_alphaV(alphaV) { @@ -459,7 +459,7 @@ public: << " float factor1 = dot(H, H)/(3.1415*alphaU*alphaV*cosSqr*cosSqr);" << endl << " float factor2 = H.x / alphaU, factor3 = H.y / alphaV;" << endl << " float exponent = -(factor2*factor2 + factor3*factor3)/(H.z*H.z);" << endl - << " float specRef = factor1 * exp(exponent);" << endl + << " float specRef = factor1 * exp(exponent);" << endl << " return (" << depNames[0] << "(uv) * inv_pi" << endl << " + " << depNames[1] << "(uv) * specRef) * cosTheta(wo);" << endl << "}" << endl @@ -482,7 +482,7 @@ private: ref m_alphaVShader; }; -Shader *Ward::createShader(Renderer *renderer) const { +Shader *Ward::createShader(Renderer *renderer) const { return new WardShader(renderer, m_diffuseReflectance.get(), m_specularReflectance.get(), m_alphaU.get(), m_alphaV.get()); } diff --git a/src/converter/collada.cpp b/src/converter/collada.cpp index 25eed772..56409067 100644 --- a/src/converter/collada.cpp +++ b/src/converter/collada.cpp @@ -76,14 +76,14 @@ enum ESourceType { struct Vec4 { Float x, y, z, w; - inline Vec4(Float x=0, Float y=0, Float z=0, Float w=0) + inline Vec4(Float x=0, Float y=0, Float z=0, Float w=0) : x(x), y(y), z(z), w(w) { } inline void operator+=(const Vec4 &v) { x += v.x; y += v.y; z += v.z; w += v.w; } - + inline Vec4 operator*(Float f) const { return Vec4(x * f, y * f, z * f, w * f); } @@ -143,7 +143,7 @@ std::vector tess_cleanup; VertexData *tess_vdata = NULL; size_t tess_nSources; -VertexData *fetchVertexData(Transform transform, +VertexData *fetchVertexData(Transform transform, const domInputLocal_Array &vertInputs, const domInputLocalOffset_Array &inputs) { VertexData *result = new VertexData(); @@ -256,7 +256,7 @@ struct Vertex { }; /// For using vertices as keys in an associative structure -struct vertex_key_order : public +struct vertex_key_order : public std::binary_function { static int compare(const Vertex &v1, const Vertex &v2) { if (v1.p.x < v2.p.x) return -1; @@ -343,8 +343,8 @@ static inline Float fromSRGBComponent(Float value) { / (Float) (1.0 + 0.055), (Float) 2.4); } -void writeGeometry(ColladaContext &ctx, const std::string &prefixName, std::string id, - int geomIndex, std::string matID, Transform transform, VertexData *vData, +void writeGeometry(ColladaContext &ctx, const std::string &prefixName, std::string id, + int geomIndex, std::string matID, Transform transform, VertexData *vData, TriangleMap &triMap, bool exportShapeGroup) { std::vector vertexBuffer; std::vector triangles; @@ -420,9 +420,9 @@ void writeGeometry(ColladaContext &ctx, const std::string &prefixName, std::stri if (duplicates > 0) { if (triangles.size() == 0) { - SLog(EWarn, "\"%s/%s\": Only contains duplicates (%i triangles) of already-existing geometry. Ignoring.", + SLog(EWarn, "\"%s/%s\": Only contains duplicates (%i triangles) of already-existing geometry. Ignoring.", prefixName.c_str(), id.c_str(), duplicates); - ctx.os << "\t" << endl << endl; return; } else { @@ -431,11 +431,11 @@ void writeGeometry(ColladaContext &ctx, const std::string &prefixName, std::stri } SAssert(triangleIdx == 0); - SLog(EDebug, "\"%s/%s\": Converted " SIZE_T_FMT " triangles, " SIZE_T_FMT + SLog(EDebug, "\"%s/%s\": Converted " SIZE_T_FMT " triangles, " SIZE_T_FMT " vertices (merged " SIZE_T_FMT " vertices).", prefixName.c_str(), id.c_str(), triangles.size(), vertexBuffer.size(), numMerged); - ref mesh = new TriMesh(prefixName + "/" + id, + ref mesh = new TriMesh(prefixName + "/" + id, triangles.size(), vertexBuffer.size(), vData->typeToOffset[ENormal] != -1, vData->typeToOffset[EUV] != -1, @@ -501,7 +501,7 @@ void writeGeometry(ColladaContext &ctx, const std::string &prefixName, std::stri ctx.os << "\t\t\t" << endl; ctx.os << "\t\t" << endl; } - if (matID != "") + if (matID != "") ctx.os << "\t\t" << endl; ctx.os << "\t" << endl << endl; } else { @@ -509,12 +509,12 @@ void writeGeometry(ColladaContext &ctx, const std::string &prefixName, std::stri ctx.os << "\t\t\t" << endl; if (ctx.cvt->m_geometryFile) ctx.os << "\t\t\tm_geometryDict.size() - 1)<< "\"/>" << endl; - if (matID != "") + if (matID != "") ctx.os << "\t\t\t" << endl; ctx.os << "\t\t" << endl << endl; } } - + void exportAnimation(ColladaContext &ctx, const fs::path &path, const std::string &name) { AnimationMap::iterator start = ctx.animations.lower_bound(name); AnimationMap::iterator end = ctx.animations.upper_bound(name); @@ -524,7 +524,7 @@ void exportAnimation(ColladaContext &ctx, const fs::path &path, const std::strin for (AnimationMap::iterator it = start; it != end; ++it) { AbstractAnimationTrack *track = it->second; int type = track->getType(); - if (type == FloatTrack::ERotationX + if (type == FloatTrack::ERotationX || type == FloatTrack::ERotationY || type == FloatTrack::ERotationZ) continue; @@ -535,8 +535,8 @@ void exportAnimation(ColladaContext &ctx, const fs::path &path, const std::strin trafo->serialize(fs); } -void loadGeometry(ColladaContext &ctx, const std::string &instanceName, - std::string prefixName, Transform transform, domGeometry &geom, +void loadGeometry(ColladaContext &ctx, const std::string &instanceName, + std::string prefixName, Transform transform, domGeometry &geom, StringMap &matLookupTable) { std::string identifier; if (geom.getId() != NULL) { @@ -551,7 +551,7 @@ void loadGeometry(ColladaContext &ctx, const std::string &instanceName, } TriangleMap triMap; - SLog(EDebug, "Converting geometry \"%s\" (instantiated by %s)..", identifier.c_str(), + SLog(EDebug, "Converting geometry \"%s\" (instantiated by %s)..", identifier.c_str(), prefixName == "" ? "/" : prefixName.c_str()); domMesh *mesh = geom.getMesh().cast(); if (!mesh) @@ -644,14 +644,14 @@ void loadGeometry(ColladaContext &ctx, const std::string &instanceName, if (invalid) continue; - for (size_t l = 0; lnSources) + for (size_t k=0; knSources) gluTessVertex(tess, &data->glPos[3*temp[k+posOffset]], (GLvoid *) (temp+k)); gluTessEndContour(tess); @@ -713,7 +713,7 @@ void loadGeometry(ColladaContext &ctx, const std::string &instanceName, gluTessBeginPolygon(tess, NULL); gluTessBeginContour(tess); - for (size_t k=0; kglPos[temp[k*data->nSources+posOffset]*3], (GLvoid *) (temp + k*data->nSources)); gluTessEndContour(tess); @@ -756,13 +756,13 @@ void loadGeometry(ColladaContext &ctx, const std::string &instanceName, } } -void loadMaterialParam(ColladaContext &ctx, const std::string &name, +void loadMaterialParam(ColladaContext &ctx, const std::string &name, domCommon_color_or_texture_type *value, bool handleRefs) { if (!value) return; - domCommon_color_or_texture_type_complexType::domColor* color = + domCommon_color_or_texture_type_complexType::domColor* color = value->getColor().cast(); - domCommon_color_or_texture_type_complexType::domTexture* texture = + domCommon_color_or_texture_type_complexType::domTexture* texture = value->getTexture().cast(); if (color && !handleRefs) { domFloat4 &colValue = color->getValue(); @@ -770,7 +770,7 @@ void loadMaterialParam(ColladaContext &ctx, const std::string &name, ctx.os << "\t\t" << endl; } else if (texture && handleRefs) { if (ctx.idToTexture.find(texture->getTexture()) == ctx.idToTexture.end()) { @@ -782,7 +782,7 @@ void loadMaterialParam(ColladaContext &ctx, const std::string &name, } } -void loadMaterialParam(ColladaContext &ctx, const std::string &name, +void loadMaterialParam(ColladaContext &ctx, const std::string &name, domCommon_float_or_param_type *value, bool handleRef) { if (!value) return; @@ -805,7 +805,7 @@ void loadMaterial(ColladaContext &ctx, domMaterial &mat) { identifier = formatString("unnamedMat_%i", unnamedCtr++); } } - + daeURI &effRef = mat.getInstance_effect()->getUrl(); effRef.resolveElement(); domEffect *effect = daeSafeCast(effRef.getElement()); @@ -819,7 +819,7 @@ void loadMaterial(ColladaContext &ctx, domMaterial &mat) { if (!commonProfile) SLog(EError, "Common effect profile not found!"); - /* The following supports a subset of the curious ColladaFX output + /* The following supports a subset of the curious ColladaFX output produced by the Blender COLLADA exporter */ daeTArray > &newParamArray = commonProfile->getNewparam_array(); for (size_t i=0; igetTransparency(); - domCommon_float_or_param_type::domFloat *transparencyValue = + domCommon_float_or_param_type::domFloat *transparencyValue = transparency ? transparency->getFloat() : NULL; if (transparencyValue && transparencyValue->getValue() > 0.5) { ctx.os << "\t" << endl << endl; @@ -1054,7 +1054,7 @@ void loadImage(ColladaContext &ctx, domImage &image) { } SLog(EDebug, "Converting texture \"%s\" ..", identifier.c_str()); - + std::string uri = image.getInit_from()->getValue().str(); std::string filename = cdom::uriToFilePath(uri); if (filename.empty()) /* When uriToFilePath fails, try to use the path as is */ @@ -1077,7 +1077,7 @@ void loadImage(ColladaContext &ctx, domImage &image) { fs::path targetPath = ctx.texturesDirectory / path.filename(); std::string extension = boost::to_lower_copy(path.extension().string()); - if (extension == ".rgb") + if (extension == ".rgb") SLog(EWarn, "Maya RGB images must be converted to PNG, EXR or JPEG! The 'imgcvt' " "utility found in the Maya binary directory can be used to do this."); @@ -1214,9 +1214,9 @@ void loadNode(ColladaContext &ctx, Transform transform, domNode &node, std::stri for (size_t i=0; itypeID() == domRotate::ID()) { - /* Skip rotations labeled as "post-rotationY". Maya and 3ds max export these with some + /* Skip rotations labeled as "post-rotationY". Maya and 3ds max export these with some cameras, which introduces an incorrect 90 degree rotation unless ignored */ - if (element->hasAttribute("sid") && element->getAttribute("sid") == "post-rotationY") + if (element->hasAttribute("sid") && element->getAttribute("sid") == "post-rotationY") continue; daeTArray value = daeSafeCast(element)->getValue(); Vector axis((Float) value.get(0), (Float) value.get(1), (Float) value.get(2)); @@ -1248,9 +1248,9 @@ void loadNode(ColladaContext &ctx, Transform transform, domNode &node, std::stri } else if (element->typeID() == domMatrix::ID()) { daeTArray value = daeSafeCast(element)->getValue(); Matrix4x4 matrix( - (Float) value.get(0), (Float) value.get(1), (Float) value.get(2), (Float) value.get(3), - (Float) value.get(4), (Float) value.get(5), (Float) value.get(6), (Float) value.get(7), - (Float) value.get(8), (Float) value.get(9), (Float) value.get(10), (Float) value.get(11), + (Float) value.get(0), (Float) value.get(1), (Float) value.get(2), (Float) value.get(3), + (Float) value.get(4), (Float) value.get(5), (Float) value.get(6), (Float) value.get(7), + (Float) value.get(8), (Float) value.get(9), (Float) value.get(10), (Float) value.get(11), (Float) value.get(12), (Float) value.get(13), (Float) value.get(14), (Float) value.get(15) ); transform = transform * Transform(matrix); @@ -1309,7 +1309,7 @@ void loadNode(ColladaContext &ctx, Transform transform, domNode &node, std::stri /* Recursively iterate through sub-nodes */ domNode_Array &nodes = node.getNode_array(); - for (size_t i=0; i elements */ @@ -1337,7 +1337,7 @@ void computeRefCounts(ColladaContext &ctx, domNode &node) { /* Recursively iterate through sub-nodes */ domNode_Array &nodes = node.getNode_array(); - for (size_t i=0; i elements */ @@ -1412,7 +1412,7 @@ void loadAnimation(ColladaContext &ctx, domAnimation &anim) { } if (trackType == FloatTrack::EInvalid) { - SLog(EWarn, "Skipping unsupported animation track of type %s.%s", + SLog(EWarn, "Skipping unsupported animation track of type %s.%s", target[1].c_str(), target.size() > 2 ? target[2].c_str() : ""); continue; } @@ -1446,19 +1446,19 @@ void loadAnimation(ColladaContext &ctx, domAnimation &anim) { if (semantic == "INPUT") { domListOfFloats &floatArray = source->getFloat_array()->getValue(); SAssert(stride == 1); - for (size_t i=0; isetTime(i, (Float) floatArray[i]); } else if (semantic == "OUTPUT") { domListOfFloats &floatArray = source->getFloat_array()->getValue(); if (trackType == VectorTrack::ETranslationXYZ || trackType == VectorTrack::EScaleXYZ) { SAssert(stride == 3); for (size_t i=0; isetValue(i, - Vector((Float) floatArray[i*3+0], (Float) floatArray[i*3+1], + ((VectorTrack *) track)->setValue(i, + Vector((Float) floatArray[i*3+0], (Float) floatArray[i*3+1], (Float) floatArray[i*3+2])); } else { SAssert(stride == 1); - for (size_t i=0; isetValue(i, (Float) floatArray[i]); } } else if (semantic == "INTERPOLATION") { @@ -1495,7 +1495,7 @@ void mergeRotations(ColladaContext &ctx) { continue; } - SLog(EDebug, "Converting rotation track of \"%s\" to quaternions ..", + SLog(EDebug, "Converting rotation track of \"%s\" to quaternions ..", key.c_str()); std::set times; @@ -1536,7 +1536,7 @@ GLvoid __stdcall tessVertex(void *data) { tess_data.push_back(raw[i]); } -GLvoid __stdcall tessCombine(GLdouble coords[3], void *vertex_data[4], +GLvoid __stdcall tessCombine(GLdouble coords[3], void *vertex_data[4], GLfloat weight[4], void **outData) { domUint *result = new domUint[tess_nSources], size = 0; tess_cleanup.push_back(result); @@ -1581,7 +1581,7 @@ GLvoid __stdcall tessError(GLenum error) { SLog(EError, "The GLU tesselator generated an error: %s!", gluErrorString(error)); } -void GeometryConverter::convertCollada(const fs::path &inputFile, +void GeometryConverter::convertCollada(const fs::path &inputFile, std::ostream &os, const fs::path &texturesDirectory, const fs::path &meshesDirectory) { @@ -1591,11 +1591,11 @@ void GeometryConverter::convertCollada(const fs::path &inputFile, #if COLLADA_DOM_SUPPORT141 DAE *dae = new DAE(NULL, NULL, "1.4.1"); domCOLLADA *document = dae->open141(inputFile.string()); - if (document == NULL) + if (document == NULL) SLog(EError, "Could not load \"%s\"!", inputFile.string().c_str()); #else DAE *dae = new DAE(); - if (dae->load(inputFile.string().c_str()) != DAE_OK) + if (dae->load(inputFile.string().c_str()) != DAE_OK) SLog(EError, "Could not load \"%s\"!", inputFile.string().c_str()); domCOLLADA *document = dae->getDom(inputFile.string().c_str()); #endif @@ -1606,7 +1606,7 @@ void GeometryConverter::convertCollada(const fs::path &inputFile, /* Configure the GLU tesselator */ tess = gluNewTess(); - if (!tess) + if (!tess) SLog(EError, "Could not allocate a GLU tesselator!"); gluTessCallback(tess, GLU_TESS_VERTEX, reinterpret_cast(&tessVertex)); @@ -1637,34 +1637,34 @@ void GeometryConverter::convertCollada(const fs::path &inputFile, domLibrary_images_Array &libraryImages = document->getLibrary_images_array(); for (size_t i=0; igetImage_array(); - for (size_t j=0; jgetLibrary_materials_array(); for (size_t i=0; igetMaterial_array(); - for (size_t j=0; jgetLibrary_animations_array(); for (size_t i=0; igetAnimation_array(); - for (size_t j=0; jsetParameter(XMLUni::fgDOMErrorHandler, &errorHandler); std::string xmlString = os.str(); - MemBufInputSource* memBufIS = new MemBufInputSource((const XMLByte*) xmlString.c_str(), + MemBufInputSource* memBufIS = new MemBufInputSource((const XMLByte*) xmlString.c_str(), xmlString.length(), "bufID", false); Wrapper4InputSource *wrapper = new Wrapper4InputSource(memBufIS, false); XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc = parser->parse(wrapper); @@ -214,10 +214,10 @@ void GeometryConverter::convert(const fs::path &inputFile, if (id != "" && nodeMap.find(id) != nodeMap.end()) { DOMNode *node = nodeMap[id], *parent = node->getParentNode(); if (nodeName == "append") { - for (DOMNode *child2 = child->getFirstChild(); child2 != 0; child2=child2->getNextSibling()) + for (DOMNode *child2 = child->getFirstChild(); child2 != 0; child2=child2->getNextSibling()) node->insertBefore(doc->importNode(child2, true), NULL); } else if (nodeName == "prepend") { - for (DOMNode *child2 = child->getFirstChild(); child2 != 0; child2=child2->getNextSibling()) + for (DOMNode *child2 = child->getFirstChild(); child2 != 0; child2=child2->getNextSibling()) node->insertBefore(doc->importNode(child2, true), node->getFirstChild()); } else if (nodeName == "remove") { parent->removeChild(node); @@ -240,7 +240,7 @@ void GeometryConverter::convert(const fs::path &inputFile, DOMLSSerializer *serializer = impl->createLSSerializer(); DOMConfiguration *serConf = serializer->getDomConfig(); serConf->setParameter(XMLUni::fgDOMErrorHandler, &errorHandler); - if (serConf->canSetParameter(XMLUni::fgDOMWRTFormatPrettyPrint, true)) + if (serConf->canSetParameter(XMLUni::fgDOMWRTFormatPrettyPrint, true)) serConf->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, true); DOMLSOutput *output = impl->createLSOutput(); MemBufFormatTarget *target = new MemBufFormatTarget(); diff --git a/src/converter/mtsimport.cpp b/src/converter/mtsimport.cpp index e6635ea5..69207a0b 100644 --- a/src/converter/mtsimport.cpp +++ b/src/converter/mtsimport.cpp @@ -1,8 +1,8 @@ /** * Mitsuba COLLADA 1.4 and Wavefront OBJ -> XML converter - * + * * Takes a DAE, ZAE or OBJ file and turns it into a scene description and separate mesh files - * using a compact binary format. All associated files are copied into newly created + * using a compact binary format. All associated files are copied into newly created * 'textures' and 'meshes' directories * * Currently supports the following subset of the COLLADA specification: @@ -15,12 +15,12 @@ * "Software Render Meshes". Triangulation is not required (the code below does this * automatically for arbitrary polygonal meshes). The Light and camera export options * should be activated, since they are off by default. While modeling the scene, it is - * advisable to use light sources with an inverse square falloff. Otherwise, the - * illumination will be competely different when rendering in Mitsuba (the image might + * advisable to use light sources with an inverse square falloff. Otherwise, the + * illumination will be competely different when rendering in Mitsuba (the image might * be pitch black). Note that most BRDFs in Mitsuba treat surfaces as one-sided, thus they * will appear black when seen from the back. * - * The conversion barfs when it gets more than 10MB in one single XML string + * The conversion barfs when it gets more than 10MB in one single XML string * (error: xmlSAX2Characters: huge text node: out of memory). In this case, split the * mesh into smaller pieces or recompile libxml with a higher limit. */ @@ -49,7 +49,7 @@ public: } fs::path locateResource(const fs::path &resource) { - return fs::path(); + return fs::path(); } }; @@ -86,7 +86,7 @@ int importMain(int argc, char **argv) { switch (optchar) { case 'a': { std::vector paths = tokenize(optarg, ";"); - for (int i=(int) paths.size()-1; i>=0; --i) + for (int i=(int) paths.size()-1; i>=0; --i) fileResolver->prependPath(paths[i]); } break; @@ -134,7 +134,7 @@ int importMain(int argc, char **argv) { help(); return -1; } - + ref log = Thread::getThread()->getLogger(); log->setLogLevel(logLevel); @@ -161,7 +161,7 @@ int importMain(int argc, char **argv) { int mts_main(int argc, char **argv) { int retval; - + /* Initialize Xerces-C */ try { XMLPlatformUtils::Initialize(); @@ -212,11 +212,11 @@ int mts_main(int argc, char **argv) { device->shutdown(); session->shutdown(); } catch(const XMLException &toCatch) { - cout << "Caught a Xerces exception: " << + cout << "Caught a Xerces exception: " << XMLString::transcode(toCatch.getMessage()) << endl; retval = -1; } catch(const DOMException &toCatch) { - cout << "Caught a Xerces exception: " << + cout << "Caught a Xerces exception: " << XMLString::transcode(toCatch.getMessage()) << endl; retval = -1; } catch (const std::exception &e) { @@ -226,7 +226,7 @@ int mts_main(int argc, char **argv) { std::cerr << "Caught a critical exeption of unknown type!" << endl; retval = -1; } - + XMLPlatformUtils::Terminate(); /* Shutdown the core framework */ @@ -238,7 +238,7 @@ int mts_main(int argc, char **argv) { PluginManager::staticShutdown(); Object::staticShutdown(); Class::staticShutdown(); - + return retval; } diff --git a/src/converter/obj.cpp b/src/converter/obj.cpp index a35ae1bd..89b014bc 100644 --- a/src/converter/obj.cpp +++ b/src/converter/obj.cpp @@ -16,8 +16,8 @@ along with this program. If not, see . */ -#define BOOST_FILESYSTEM_NO_LIB -#define BOOST_SYSTEM_NO_LIB +#define BOOST_FILESYSTEM_NO_LIB +#define BOOST_SYSTEM_NO_LIB #include #include @@ -28,7 +28,7 @@ std::set availableTextures; -void referenceTexture(GeometryConverter *cvt, std::ostream &os, const std::string ¶meter, +void referenceTexture(GeometryConverter *cvt, std::ostream &os, const std::string ¶meter, const std::string &indent, const fs::path &textureDir, std::string filename) { /* Prevent Linux/OSX fs::path handling issues for OBJ files created on Windows */ for (size_t i=0; i" << endl; } else { referenceTexture(cvt, os, "reflectance", "\t\t", texturesDir, diffuseMap); @@ -103,16 +103,16 @@ void addMaterial(GeometryConverter *cvt, std::ostream &os, const std::string &mt os << indent << "\t" << endl << endl; - if (maskMap != "") + if (maskMap != "") os << "\t" << endl; } -void parseMaterials(GeometryConverter *cvt, std::ostream &os, const fs::path &texturesDir, +void parseMaterials(GeometryConverter *cvt, std::ostream &os, const fs::path &texturesDir, const fs::path &mtlFileName, std::set &mtlList) { SLog(EInfo, "Loading OBJ materials from \"%s\" ..", mtlFileName.string().c_str()); fs::ifstream is(mtlFileName); if (is.bad() || is.fail()) - SLog(EError, "Unexpected I/O error while accessing material file '%s'!", + SLog(EError, "Unexpected I/O error while accessing material file '%s'!", mtlFileName.string().c_str()); std::string buf, line; std::string mtlName; @@ -149,7 +149,7 @@ void parseMaterials(GeometryConverter *cvt, std::ostream &os, const fs::path &te addMaterial(cvt, os, mtlName, texturesDir, diffuse, diffuseMap, maskMap); } -void GeometryConverter::convertOBJ(const fs::path &inputFile, +void GeometryConverter::convertOBJ(const fs::path &inputFile, std::ostream &os, const fs::path &textureDirectory, const fs::path &meshesDirectory) { @@ -214,8 +214,8 @@ void GeometryConverter::convertOBJ(const fs::path &inputFile, os << "\t\t" << endl; } - if (mesh->getBSDF() != NULL && - mtlList.find(mesh->getBSDF()->getID()) != mtlList.end()) { + if (mesh->getBSDF() != NULL && + mtlList.find(mesh->getBSDF()->getID()) != mtlList.end()) { const std::string &matID = mesh->getBSDF()->getID(); os << "\t\t" << endl; } else { diff --git a/src/emitters/area.cpp b/src/emitters/area.cpp index 34aee022..e81a3c32 100644 --- a/src/emitters/area.cpp +++ b/src/emitters/area.cpp @@ -33,16 +33,16 @@ MTS_NAMESPACE_BEGIN * power per unit area per unit steradian. * } * \parameter{samplingWeight}{\Float}{ - * Specifies the relative amount of samples + * Specifies the relative amount of samples * allocated to this emitter. \default{1} * } * } * * This plugin implements an area light, i.e. a light source that emits - * diffuse illumination from the exterior of an arbitrary shape. + * diffuse illumination from the exterior of an arbitrary shape. * Since the emission profile of an area light is completely diffuse, it * has the same apparent brightness regardless of the observer's viewing - * direction. Furthermore, since it occupies a nonzero amount of space, an + * direction. Furthermore, since it occupies a nonzero amount of space, an * area light generally causes scene objects to cast soft shadows. * * When modeling scenes involving area lights, it is preferable @@ -78,7 +78,7 @@ public: m_power = Spectrum(0.0f); /// Don't know the power yet } - AreaLight(Stream *stream, InstanceManager *manager) + AreaLight(Stream *stream, InstanceManager *manager) : Emitter(stream, manager) { m_radiance = Spectrum(stream); m_power = Spectrum(stream); @@ -112,7 +112,7 @@ public: return m_shape->pdfPosition(pRec); } - Spectrum sampleDirection(DirectionSamplingRecord &dRec, + Spectrum sampleDirection(DirectionSamplingRecord &dRec, PositionSamplingRecord &pRec, const Point2 &sample, const Point2 *extra) const { Vector local = Warp::squareToCosineHemisphere(sample); @@ -138,7 +138,7 @@ public: if (dRec.measure != ESolidAngle || dp < 0) dp = 0.0f; - + return INV_PI * dp; } @@ -155,11 +155,11 @@ public: return m_power; } - Spectrum sampleDirect(DirectSamplingRecord &dRec, + Spectrum sampleDirect(DirectSamplingRecord &dRec, const Point2 &sample) const { m_shape->sampleDirect(dRec, sample); - /* Check that the emitter and reference position are oriented correctly + /* Check that the emitter and reference position are oriented correctly with respect to each other. Note that the >= 0 check for 'refN' is intentional -- those sampling requests that specify a reference point within a medium or on a transmissive surface @@ -173,7 +173,7 @@ public: } Float pdfDirect(const DirectSamplingRecord &dRec) const { - /* Check that the emitter and receiver are oriented correctly + /* Check that the emitter and receiver are oriented correctly with respect to each other. */ if (dot(dRec.d, dRec.refN) >= 0 && dot(dRec.d, dRec.n) < 0) { return m_shape->pdfDirect(dRec); @@ -223,15 +223,15 @@ protected: Spectrum m_radiance, m_power; }; -// ================ Hardware shader implementation ================ +// ================ Hardware shader implementation ================ class AreaLightShader : public Shader { public: - AreaLightShader(Renderer *renderer, const Spectrum &radiance) + AreaLightShader(Renderer *renderer, const Spectrum &radiance) : Shader(renderer, EEmitterShader), m_radiance(radiance) { } - - void resolve(const GPUProgram *program, const std::string &evalName, + + void resolve(const GPUProgram *program, const std::string &evalName, std::vector ¶meterIDs) const { parameterIDs.push_back(program->getParameterID(evalName + "_radiance", false)); } @@ -251,7 +251,7 @@ public: << "}" << endl; } - void bind(GPUProgram *program, const std::vector ¶meterIDs, + void bind(GPUProgram *program, const std::vector ¶meterIDs, int &textureUnitOffset) const { program->setParameter(parameterIDs[0], m_radiance); } @@ -261,7 +261,7 @@ private: Spectrum m_radiance; }; -Shader *AreaLight::createShader(Renderer *renderer) const { +Shader *AreaLight::createShader(Renderer *renderer) const { return new AreaLightShader(renderer, m_radiance); } diff --git a/src/emitters/collimated.cpp b/src/emitters/collimated.cpp index 7db50901..bc55ad33 100644 --- a/src/emitters/collimated.cpp +++ b/src/emitters/collimated.cpp @@ -35,17 +35,17 @@ MTS_NAMESPACE_BEGIN * \default{1} * } * \parameter{samplingWeight}{\Float}{ - * Specifies the relative amount of samples + * Specifies the relative amount of samples * allocated to this emitter. \default{1} * } * } * - * This emitter plugin implements a collimated beam source, which + * This emitter plugin implements a collimated beam source, which * radiates a specified amount of power along a fixed ray. * It can be thought of as the limit of a spot light as its field * of view tends to zero. * - * Such a emitter is useful for conducting virtual experiments and + * Such a emitter is useful for conducting virtual experiments and * testing the renderer for correctness. * * By default, the emitter is located at the origin and radiates @@ -60,12 +60,12 @@ public: m_power = props.getSpectrum("power", Spectrum(1.0f)); - if (props.getTransform("toWorld", Transform()).hasScale()) + if (props.getTransform("toWorld", Transform()).hasScale()) Log(EError, "Scale factors in the emitter-to-world " "transformation are not allowed!"); } - CollimatedBeamEmitter(Stream *stream, InstanceManager *manager) + CollimatedBeamEmitter(Stream *stream, InstanceManager *manager) : Emitter(stream, manager) { configure(); m_power = Spectrum(stream); @@ -93,7 +93,7 @@ public: return (pRec.measure == EDiscrete) ? 1.0f : 0.0f; } - Spectrum sampleDirection(DirectionSamplingRecord &dRec, + Spectrum sampleDirection(DirectionSamplingRecord &dRec, PositionSamplingRecord &pRec, const Point2 &sample, const Point2 *extra) const { dRec.d = pRec.n; diff --git a/src/emitters/constant.cpp b/src/emitters/constant.cpp index 092ebe3d..3c391bf2 100644 --- a/src/emitters/constant.cpp +++ b/src/emitters/constant.cpp @@ -32,7 +32,7 @@ MTS_NAMESPACE_BEGIN * power per unit area per unit steradian. * } * \parameter{samplingWeight}{\Float}{ - * Specifies the relative amount of samples + * Specifies the relative amount of samples * allocated to this emitter. \default{1} * } * } @@ -40,7 +40,7 @@ MTS_NAMESPACE_BEGIN * This plugin implements a constant environment emitter, which surrounds * the scene and radiates diffuse illumination towards it. This is often * a good default light source when the goal is to visualize some loaded - * geometry that uses basic (e.g. diffuse) materials. + * geometry that uses basic (e.g. diffuse) materials. */ class ConstantBackgroundEmitter : public Emitter { public: @@ -49,7 +49,7 @@ public: m_radiance = props.getSpectrum("radiance", Spectrum(1.0f)); } - ConstantBackgroundEmitter(Stream *stream, InstanceManager *manager) + ConstantBackgroundEmitter(Stream *stream, InstanceManager *manager) : Emitter(stream, manager) { m_radiance = Spectrum(stream); m_sceneBSphere = BSphere(stream); @@ -76,7 +76,7 @@ public: configure(); } - Transform trafo = + Transform trafo = Transform::translate(Vector(m_sceneBSphere.center)) * Transform::scale(Vector(m_sceneBSphere.radius)); @@ -93,7 +93,7 @@ public: void configure() { Emitter::configure(); - Float surfaceArea = 4 * M_PI * + Float surfaceArea = 4 * M_PI * m_sceneBSphere.radius * m_sceneBSphere.radius; m_invSurfaceArea = 1 / surfaceArea; m_power = m_radiance * surfaceArea * M_PI; @@ -126,7 +126,7 @@ public: return m_invSurfaceArea; } - Spectrum sampleDirection(DirectionSamplingRecord &dRec, + Spectrum sampleDirection(DirectionSamplingRecord &dRec, PositionSamplingRecord &pRec, const Point2 &sample, const Point2 *extra) const { Vector local = Warp::squareToCosineHemisphere(sample); @@ -142,7 +142,7 @@ public: if (dRec.measure != ESolidAngle || dp < 0) dp = 0.0f; - + return Spectrum(INV_PI * dp); } @@ -170,7 +170,7 @@ public: return m_radiance * (4 * M_PI * M_PI * m_geoBSphere.radius * m_geoBSphere.radius); } - Spectrum sampleDirect(DirectSamplingRecord &dRec, + Spectrum sampleDirect(DirectSamplingRecord &dRec, const Point2 &sample) const { Vector d; Float pdf; @@ -193,10 +193,10 @@ public: Ray ray(dRec.ref, d, 0); Float nearT, farT; dRec.pdf = 0.0f; - if (!m_sceneBSphere.rayIntersect(ray, nearT, farT)) + if (!m_sceneBSphere.rayIntersect(ray, nearT, farT)) return Spectrum(0.0f); - if (nearT >= 0 || farT <= 0) + if (nearT >= 0 || farT <= 0) return Spectrum(0.0f); dRec.p = ray(farT); @@ -217,24 +217,24 @@ public: Float pdfDirect(const DirectSamplingRecord &dRec) const { Float pdfSA; - if (!dRec.refN.isZero()) + if (!dRec.refN.isZero()) pdfSA = INV_PI * std::max((Float) 0.0f, dot(dRec.d, dRec.refN)); - else + else pdfSA = Warp::squareToUniformSpherePdf(); if (dRec.measure == ESolidAngle) return pdfSA; else if (dRec.measure == EArea) - return pdfSA * absDot(dRec.d, dRec.n) + return pdfSA * absDot(dRec.d, dRec.n) / (dRec.dist * dRec.dist); else return 0.0f; } AABB getAABB() const { - /* The scene sets its bounding box so that it contains all shapes and + /* The scene sets its bounding box so that it contains all shapes and emitters, but this particular emitter always wants to be *a little* - bigger than the scene. To avoid a silly recursion, just return a + bigger than the scene. To avoid a silly recursion, just return a point here. */ return AABB(m_sceneBSphere.center); } @@ -247,7 +247,7 @@ public: Float nearT, farT; if (!m_sceneBSphere.rayIntersect(ray, nearT, farT) || nearT > 0 || farT < 0) { - Log(EWarn, "fillDirectSamplingRecord(): internal error!"); + Log(EWarn, "fillDirectSamplingRecord(): internal error!"); return false; } @@ -285,15 +285,15 @@ protected: Float m_invSurfaceArea; }; -// ================ Hardware shader implementation ================ +// ================ Hardware shader implementation ================ class ConstantBackgroundEmitterShader : public Shader { public: - ConstantBackgroundEmitterShader(Renderer *renderer, const Spectrum &radiance) + ConstantBackgroundEmitterShader(Renderer *renderer, const Spectrum &radiance) : Shader(renderer, EEmitterShader), m_radiance(radiance * M_PI) { } - void resolve(const GPUProgram *program, const std::string &evalName, + void resolve(const GPUProgram *program, const std::string &evalName, std::vector ¶meterIDs) const { parameterIDs.push_back(program->getParameterID(evalName + "_radiance", false)); } @@ -312,7 +312,7 @@ public: << "}" << endl; } - void bind(GPUProgram *program, const std::vector ¶meterIDs, + void bind(GPUProgram *program, const std::vector ¶meterIDs, int &textureUnitOffset) const { program->setParameter(parameterIDs[0], m_radiance); } @@ -322,7 +322,7 @@ private: Spectrum m_radiance; }; -Shader *ConstantBackgroundEmitter::createShader(Renderer *renderer) const { +Shader *ConstantBackgroundEmitter::createShader(Renderer *renderer) const { return new ConstantBackgroundEmitterShader(renderer, m_radiance); } diff --git a/src/emitters/directional.cpp b/src/emitters/directional.cpp index 5c82397c..25ea9bbb 100644 --- a/src/emitters/directional.cpp +++ b/src/emitters/directional.cpp @@ -40,12 +40,12 @@ MTS_NAMESPACE_BEGIN * \default{1} * } * \parameter{samplingWeight}{\Float}{ - * Specifies the relative amount of samples + * Specifies the relative amount of samples * allocated to this emitter. \default{1} * } * } * - * This emitter plugin implements a distant directional source, which + * This emitter plugin implements a distant directional source, which * radiates a specified power per unit area along a fixed direction. * By default, the emitter radiates in the direction of the postive Z axis. */ @@ -66,13 +66,13 @@ public: m_worldTransform = new AnimatedTransform( Transform::lookAt(Point(0.0f), Point(d), u)); } else { - if (props.getTransform("toWorld", Transform()).hasScale()) + if (props.getTransform("toWorld", Transform()).hasScale()) Log(EError, "Scale factors in the emitter-to-world " "transformation are not allowed!"); } } - DirectionalEmitter(Stream *stream, InstanceManager *manager) + DirectionalEmitter(Stream *stream, InstanceManager *manager) : Emitter(stream, manager) { m_normalIrradiance = Spectrum(stream); m_bsphere = BSphere(stream); @@ -104,7 +104,7 @@ public: const Transform &trafo = m_worldTransform->eval(pRec.time); Point2 p = Warp::squareToUniformDiskConcentric(sample); - + Vector perpOffset = trafo(Vector(p.x, p.y, 0) * m_bsphere.radius); Vector d = trafo(Vector(0, 0, 1)); @@ -123,7 +123,7 @@ public: return (pRec.measure == EArea) ? m_invSurfaceArea : 0.0f; } - Spectrum sampleDirection(DirectionSamplingRecord &dRec, + Spectrum sampleDirection(DirectionSamplingRecord &dRec, PositionSamplingRecord &pRec, const Point2 &sample, const Point2 *extra) const { dRec.d = pRec.n; @@ -157,7 +157,7 @@ public: } Spectrum sampleDirect(DirectSamplingRecord &dRec, const Point2 &sample) const { - const Transform &trafo = m_worldTransform->eval(dRec.time); + const Transform &trafo = m_worldTransform->eval(dRec.time); Vector d = trafo(Vector(0,0,1)); Point diskCenter = m_bsphere.center - d*m_bsphere.radius; @@ -173,7 +173,7 @@ public: dRec.d = -d; dRec.n = Normal(d); dRec.dist = distance; - + dRec.pdf = 1.0f; dRec.measure = EDiscrete; return m_normalIrradiance; @@ -207,11 +207,11 @@ private: Float m_invSurfaceArea; }; -// ================ Hardware shader implementation ================ +// ================ Hardware shader implementation ================ class DirectionalEmitterShader : public Shader { public: - DirectionalEmitterShader(Renderer *renderer) + DirectionalEmitterShader(Renderer *renderer) : Shader(renderer, EEmitterShader) { } void generateCode(std::ostringstream &oss, const std::string &evalName, @@ -224,7 +224,7 @@ public: MTS_DECLARE_CLASS() }; -Shader *DirectionalEmitter::createShader(Renderer *renderer) const { +Shader *DirectionalEmitter::createShader(Renderer *renderer) const { return new DirectionalEmitterShader(renderer); } diff --git a/src/emitters/envmap.cpp b/src/emitters/envmap.cpp index 09af7b6e..e2374052 100644 --- a/src/emitters/envmap.cpp +++ b/src/emitters/envmap.cpp @@ -43,7 +43,7 @@ MTS_NAMESPACE_BEGIN * must be in latitude-longitude format. * } * \parameter{scale}{\Float}{ - * A scale factor that is applied to the + * A scale factor that is applied to the * radiance values stored in the input image. \default{1} * } * \parameter{toWorld}{\Transform}{ @@ -52,8 +52,8 @@ MTS_NAMESPACE_BEGIN * } * \parameter{gamma}{\Float}{ * Optional parameter to override the gamma value of the source bitmap, - * where 1 indicates a linear color space and the special value -1 - * corresponds to sRGB. \default{automatically detect based on the + * where 1 indicates a linear color space and the special value -1 + * corresponds to sRGB. \default{automatically detect based on the * image type and metadata} * } * \parameter{cache}{\Boolean}{ @@ -62,14 +62,14 @@ MTS_NAMESPACE_BEGIN * \default{automatic---use caching for images larger than 1M pixels.} * } * \parameter{samplingWeight}{\Float}{ - * Specifies the relative amount of samples + * Specifies the relative amount of samples * allocated to this emitter. \default{1} * } * } * \renderings{ - * \rendering{The museum environment map by Bernhard Vogl that is used + * \rendering{The museum environment map by Bernhard Vogl that is used * in many example renderings in this document}{emitter_envmap_example} - * \unframedrendering{Coordinate conventions used when mapping the input + * \unframedrendering{Coordinate conventions used when mapping the input * image onto the sphere.}{emitter_envmap_axes} * } * @@ -77,22 +77,22 @@ MTS_NAMESPACE_BEGIN * which is a type of light source that is well-suited for representing ``natural'' * illumination. Many images in this document are made using the environment map * shown in (a). - * + * * The implementation loads a captured illumination environment from a image in * latitude-longitude format and turns it into an infinitely distant emitter. - * The image could either be be a processed photograph or a rendering made using the + * The image could either be be a processed photograph or a rendering made using the * \pluginref{spherical} sensor. The direction conventions of this transformation * are shown in (b). - * The plugin can work with all types of images that are natively supported by Mitsuba - * (i.e. JPEG, PNG, OpenEXR, RGBE, TGA, and BMP). In practice, a good environment - * map will contain high-dynamic range data that can only be represented using the - * OpenEXR or RGBE file formats. - * High quality free light probes are available on Paul Debevec's website + * The plugin can work with all types of images that are natively supported by Mitsuba + * (i.e. JPEG, PNG, OpenEXR, RGBE, TGA, and BMP). In practice, a good environment + * map will contain high-dynamic range data that can only be represented using the + * OpenEXR or RGBE file formats. + * High quality free light probes are available on Paul Debevec's website * (\url{http://gl.ict.usc.edu/Data/HighResProbes}) and Bernhard Vogl's website * (\url{http://dativ.at/lightprobes/}). * - * Like the \pluginref{bitmap} texture, this plugin generates a cache file - * named \emph{filename}\code{.mip} when given a large input image. This + * Like the \pluginref{bitmap} texture, this plugin generates a cache file + * named \emph{filename}\code{.mip} when given a large input image. This * significantly accelerates the loading times of subsequent renderings. When this * is not desired, specify \code{cache=false} to the plugin. */ @@ -102,7 +102,7 @@ public: typedef TSpectrum SpectrumHalf; typedef TMIPMap MIPMap; - EnvironmentMap(const Properties &props) : Emitter(props), + EnvironmentMap(const Properties &props) : Emitter(props), m_mipmap(NULL), m_cdfRows(NULL), m_cdfCols(NULL), m_rowWeights(NULL) { m_type |= EOnSurface | EEnvironmentEmitter; uint64_t timestamp = 0; @@ -125,8 +125,8 @@ public: timestamp = (uint64_t) fs::last_write_time(m_filename, ec); if (ec.value()) Log(EError, "Could not determine modification time of \"%s\"!", m_filename.string().c_str()); - - /* Create MIP map a cache when the environment map is large, and + + /* Create MIP map a cache when the environment map is large, and reuse cache files that have been created previously */ cacheFile = m_filename; cacheFile.replace_extension(".mip"); @@ -136,13 +136,13 @@ public: /* Gamma override */ m_gamma = props.getFloat("gamma", 0); - /* These are reasonable MIP map defaults for environment maps, I don't + /* These are reasonable MIP map defaults for environment maps, I don't think there is a need to expose them through plugin parameters */ EMIPFilterType filterType = EEWA; Float maxAnisotropy = 10.0f; if (tryReuseCache && MIPMap::validateCacheFile(cacheFile, timestamp, - ENVMAP_PIXELFORMAT, ReconstructionFilter::ERepeat, + ENVMAP_PIXELFORMAT, ReconstructionFilter::ERepeat, ReconstructionFilter::EClamp, filterType, m_gamma)) { /* Reuse an existing MIP map cache file */ m_mipmap = new MIPMap(cacheFile, maxAnisotropy); @@ -162,7 +162,7 @@ public: Log(EError, "Environment maps images must be smaller than 65536 " " pixels in width and height"); - /* (Re)generate the MIP map hierarchy; downsample using a + /* (Re)generate the MIP map hierarchy; downsample using a 2-lobed Lanczos reconstruction filter */ Properties rfilterProps("lanczos"); rfilterProps.setInteger("lobes", 2); @@ -172,7 +172,7 @@ public: rfilter->configure(); /* Potentially create a new MIP map cache file */ - bool createCache = !cacheFile.empty() && props.getBoolean("cache", + bool createCache = !cacheFile.empty() && props.getBoolean("cache", bitmap->getSize().x * bitmap->getSize().y > 1024*1024); m_mipmap = new MIPMap(bitmap, ENVMAP_PIXELFORMAT, Bitmap::EFloat, @@ -188,7 +188,7 @@ public: m_scale = props.getFloat("scale", 1.0f); } - EnvironmentMap(Stream *stream, InstanceManager *manager) : Emitter(stream, manager), + EnvironmentMap(Stream *stream, InstanceManager *manager) : Emitter(stream, manager), m_mipmap(NULL), m_cdfRows(NULL), m_cdfCols(NULL), m_rowWeights(NULL) { m_filename = stream->readString(); Log(EDebug, "Unserializing texture \"%s\"", m_filename.filename().string().c_str()); @@ -240,7 +240,7 @@ public: m_geoBSphere.serialize(stream); if (!m_filename.empty() && fs::exists(m_filename)) { - /* We still have access to the original image -- use that, since + /* We still have access to the original image -- use that, since it is probably much smaller than the in-memory representation */ ref is = new FileStream(m_filename, FileStream::EReadOnly); stream->writeSize(is->getSize()); @@ -261,30 +261,30 @@ public: Emitter::configure(); if (!m_rowWeights) { - /// Build CDF tables to sample the environment map + /// Build CDF tables to sample the environment map const MIPMap::Array2DType &array = m_mipmap->getArray(); m_size = array.getSize(); - + size_t nEntries = (size_t) (m_size.x + 1) * (size_t) m_size.y, totalStorage = sizeof(float) * (m_size.x + 1 + nEntries); - + Log(EInfo, "Precomputing data structures for environment map sampling (%s)", memString(totalStorage).c_str()); - + ref timer = new Timer(); m_cdfCols = new float[nEntries]; m_cdfRows = new float[m_size.y + 1]; m_rowWeights = new Float[m_size.y]; - + size_t colPos = 0, rowPos = 0; Float rowSum = 0.0f; - - /* Build a marginal & conditional cumulative distribution + + /* Build a marginal & conditional cumulative distribution function over luminances weighted by sin(theta) */ m_cdfRows[rowPos++] = 0; for (int y=0; y 0 || farT < 0) { - Log(EWarn, "fillDirectSamplingRecord(): internal error!"); + Log(EWarn, "fillDirectSamplingRecord(): internal error!"); return false; } @@ -432,27 +432,27 @@ public: /** * A note regarding sampleArea()/sampleDirection(): * - * Mitsuba's emitter/sensor API permits sampling the spatial and directional - * components separately (in that order!). As nice as this is for bidirectional - * techniques, it is unfortunately very difficult to reconcile with the default - * environment map strategy of importance sampling a direction *first* from the - * environment, followed by (*second*) uniformly picking a position on a hyperplane + * Mitsuba's emitter/sensor API permits sampling the spatial and directional + * components separately (in that order!). As nice as this is for bidirectional + * techniques, it is unfortunately very difficult to reconcile with the default + * environment map strategy of importance sampling a direction *first* from the + * environment, followed by (*second*) uniformly picking a position on a hyperplane * perpendicular to that direction. * * Therefore, the following compromise is implemented: * 1. sampleArea(): uniformly sample a position on the scene's bounding sphere * 2. sampleDirection(): importance sample a direction from the environment map * - * This is not that great, as many useless samples will be generated. Note however + * This is not that great, as many useless samples will be generated. Note however * that rendering scenes by tracing from the environment side is usually a * terrible strategy in any case, so at least not much is lost by making it worse. * * The direct illumination sampling code (\ref sampleDirect()), and the combined - * position + direction code (\ref sampleRay) both does the right thing and are + * position + direction code (\ref sampleRay) both does the right thing and are * not affected by any of this. Many of the bidirectional rendering * algorithms in Mitsuba can make use of direct illumination sampling strategies. */ - Spectrum sampleDirection(DirectionSamplingRecord &dRec, + Spectrum sampleDirection(DirectionSamplingRecord &dRec, PositionSamplingRecord &pRec, const Point2 &sample, const Point2 *extra) const { @@ -526,10 +526,10 @@ public: this class to be consistent with respect to each other. */ Ray ray(dRec.ref, trafo(d), 0); Float nearT, farT; - if (value.isZero() || pdf == 0 || !m_sceneBSphere.rayIntersect(ray, nearT, farT) + if (value.isZero() || pdf == 0 || !m_sceneBSphere.rayIntersect(ray, nearT, farT) || nearT >= 0 || farT <= 0) { dRec.pdf = 0.0f; - return Spectrum(0.0f); + return Spectrum(0.0f); } dRec.pdf = pdf; @@ -549,16 +549,16 @@ public: if (dRec.measure == ESolidAngle) return pdfSA; else if (dRec.measure == EArea) - return pdfSA * absDot(dRec.d, dRec.n) + return pdfSA * absDot(dRec.d, dRec.n) / (dRec.dist * dRec.dist); else return 0.0f; } AABB getAABB() const { - /* The scene sets its bounding box so that it contains all shapes and + /* The scene sets its bounding box so that it contains all shapes and emitters, but this particular emitter always wants to be *a little* - bigger than the scene. To avoid a silly recursion, just return a + bigger than the scene. To avoid a silly recursion, just return a point here. */ return AABB(m_sceneBSphere.center); } @@ -569,8 +569,8 @@ public: uint32_t row = sampleReuse(m_cdfRows, m_size.y, sample.y), col = sampleReuse(m_cdfCols + row * (m_size.x+1), m_size.x, sample.x); - /* Using the remaining bits of precision to shift the sample by an offset - drawn from a tent function. This effectively creates a sampling strategy + /* Using the remaining bits of precision to shift the sample by an offset + drawn from a tent function. This effectively creates a sampling strategy for a linearly interpolated environment map */ Point2 pos = Point2((Float) col, (Float) row) + Warp::squareToTent(sample); @@ -671,11 +671,11 @@ private: Vector2 m_pixelSize; }; -// ================ Hardware shader implementation ================ +// ================ Hardware shader implementation ================ class EnvironmentMapShader : public Shader { public: - EnvironmentMapShader(Renderer *renderer, const fs::path &filename, ref bitmap, + EnvironmentMapShader(Renderer *renderer, const fs::path &filename, ref bitmap, const Transform &worldToEmitter, Float scale) : Shader(renderer, EEmitterShader) { std::string name = filename.filename().string(); if (name.empty()) @@ -687,7 +687,7 @@ public: m_gpuTexture->initAndRelease(); m_worldToEmitter = worldToEmitter; m_scale = scale; - m_useCustomTextureFiltering = + m_useCustomTextureFiltering = renderer->getCapabilities()->isSupported(RendererCapabilities::ECustomTextureFiltering); } @@ -733,7 +733,7 @@ public: oss << "}" << endl; } - void bind(GPUProgram *program, const std::vector ¶meterIDs, + void bind(GPUProgram *program, const std::vector ¶meterIDs, int &textureUnitOffset) const { m_gpuTexture->bind(textureUnitOffset++); program->setParameter(parameterIDs[0], m_gpuTexture.get()); diff --git a/src/emitters/point.cpp b/src/emitters/point.cpp index aecc823c..5741dbf7 100644 --- a/src/emitters/point.cpp +++ b/src/emitters/point.cpp @@ -43,12 +43,12 @@ MTS_NAMESPACE_BEGIN * \default{1} * } * \parameter{samplingWeight}{\Float}{ - * Specifies the relative amount of samples + * Specifies the relative amount of samples * allocated to this emitter. \default{1} * } * } * - * This sensor plugin implements a simple point light source, which + * This sensor plugin implements a simple point light source, which * uniformly radiates illumination into all directions. */ @@ -68,7 +68,7 @@ public: m_intensity = props.getSpectrum("intensity", Spectrum(1.0f)); } - PointEmitter(Stream *stream, InstanceManager *manager) + PointEmitter(Stream *stream, InstanceManager *manager) : Emitter(stream, manager) { configure(); m_intensity = Spectrum(stream); @@ -97,7 +97,7 @@ public: return (pRec.measure == EDiscrete) ? 1.0f : 0.0f; } - Spectrum sampleDirection(DirectionSamplingRecord &dRec, + Spectrum sampleDirection(DirectionSamplingRecord &dRec, PositionSamplingRecord &pRec, const Point2 &sample, const Point2 *extra) const { @@ -159,7 +159,7 @@ public: oss << "PointEmitter[" << endl << " worldTransform = " << indent(m_worldTransform.toString()) << "," << endl << " intensity = " << m_intensity.toString() << "," << endl - << " medium = " << indent(m_medium.toString()) + << " medium = " << indent(m_medium.toString()) << "]"; return oss.str(); } @@ -172,15 +172,15 @@ private: }; -// ================ Hardware shader implementation ================ +// ================ Hardware shader implementation ================ class PointEmitterShader : public Shader { public: - PointEmitterShader(Renderer *renderer, const Spectrum &intensity) + PointEmitterShader(Renderer *renderer, const Spectrum &intensity) : Shader(renderer, EEmitterShader), m_intensity(intensity) { } - - void resolve(const GPUProgram *program, const std::string &evalName, + + void resolve(const GPUProgram *program, const std::string &evalName, std::vector ¶meterIDs) const { parameterIDs.push_back(program->getParameterID(evalName + "_intensity", false)); } @@ -198,7 +198,7 @@ public: << "}" << endl; } - void bind(GPUProgram *program, const std::vector ¶meterIDs, + void bind(GPUProgram *program, const std::vector ¶meterIDs, int &textureUnitOffset) const { program->setParameter(parameterIDs[0], m_intensity); } @@ -208,7 +208,7 @@ private: Spectrum m_intensity; }; -Shader *PointEmitter::createShader(Renderer *renderer) const { +Shader *PointEmitter::createShader(Renderer *renderer) const { return new PointEmitterShader(renderer, m_intensity); } diff --git a/src/emitters/sky.cpp b/src/emitters/sky.cpp index 3dfccc41..fe3a559b 100644 --- a/src/emitters/sky.cpp +++ b/src/emitters/sky.cpp @@ -37,24 +37,24 @@ MTS_NAMESPACE_BEGIN * \parameters{ * \parameter{turbidity}{\Float}{ * This parameter determines the amount of aerosol present - * in the atmosphere. + * in the atmosphere. * Valid range: 1-10. \default{3, corresponding to a clear sky in a temperate climate} * } * \parameter{albedo}{\Spectrum}{Specifies the ground albedo \default{0.15}} * \parameter{year, month, day}{\Integer}{Denote the date of the * observation \default{2010, 07, 10}} - * \parameter{hour,minute,\showbreak second}{\Float}{Local time + * \parameter{hour,minute,\showbreak second}{\Float}{Local time * at the location of the observer in 24-hour format\default{15, 00, 00, * i.e. 3PM}} * \parameter{latitude, longitude, timezone}{\Float}{ - * These three parameters specify the oberver's latitude and longitude - * in degrees, and the local timezone offset in hours, which are required + * These three parameters specify the oberver's latitude and longitude + * in degrees, and the local timezone offset in hours, which are required * to compute the sun's position. \default{35.6894, 139.6917, 9 --- Tokyo, Japan} * } - * \parameter{sunDirection}{\Vector}{Allows to manually + * \parameter{sunDirection}{\Vector}{Allows to manually * override the sun direction in world space. When this value - * is provided, parameters pertaining to the computation - * of the sun direction (\code{year, hour, latitude,} etc. + * is provided, parameters pertaining to the computation + * of the sun direction (\code{year, hour, latitude,} etc. * are unnecessary. \default{none} * } * \parameter{stretch}{\Float}{ @@ -68,7 +68,7 @@ MTS_NAMESPACE_BEGIN * emitted by the sky emitter. \default{1} * } * \parameter{samplingWeight}{\Float}{ - * Specifies the relative amount of samples + * Specifies the relative amount of samples * allocated to this emitter. \default{1} * } * } @@ -83,32 +83,32 @@ MTS_NAMESPACE_BEGIN * \tinyrendering{5PM}{emitter_sky_small_17} * \tinyrendering{6:30 PM}{emitter_sky_small_1830}\hfill * \vspace{-2mm} - * \caption{Time series at the default settings (Equidistant fisheye + * \caption{Time series at the default settings (Equidistant fisheye * projection of the sky onto a disk. East is left.)} * \vspace{3mm} * } * * This plugin provides the physically-based skylight model by - * Ho\v{s}ek and Wilkie \cite{Hosek2012Analytic}. It can be used to - * create predictive daylight renderings of scenes under clear skies, + * Ho\v{s}ek and Wilkie \cite{Hosek2012Analytic}. It can be used to + * create predictive daylight renderings of scenes under clear skies, * which is useful for architectural and computer vision applications. - * The implementation in Mitsuba is based on code that was + * The implementation in Mitsuba is based on code that was * generously provided by the authors. * * The model has two main parameters: the turbidity of the atmosphere * and the position of the sun. * The position of the sun in turn depends on a number of secondary - * parameters, including the \code{latitude}, \code{longitude}, + * parameters, including the \code{latitude}, \code{longitude}, * and \code{timezone} at the location of the observer, as well as the * current \code{year}, \code{month}, \code{day}, \code{hour}, * \code{minute}, and \code{second}. - * Using all of these, the elevation and azimuth of the sun are computed - * using the PSA algorithm by Blanco et al. \cite{Blanco2001Computing}, + * Using all of these, the elevation and azimuth of the sun are computed + * using the PSA algorithm by Blanco et al. \cite{Blanco2001Computing}, * which is accurate to about 0.5 arcminutes (\nicefrac{1}{120} degrees). * Note that this algorithm does not account for daylight * savings time where it is used, hence a manual correction of the * time may be necessary. - * For detailed coordinate and timezone information of various cities, see + * For detailed coordinate and timezone information of various cities, see * \url{http://www.esrl.noaa.gov/gmd/grad/solcalc}. * * If desired, the world-space solar vector may also be specified @@ -132,12 +132,12 @@ MTS_NAMESPACE_BEGIN * manifests in a halo around the sun, as well as color fringes near the * horizon. * Smaller turbidity values ($\sim 1-2$) produce an - * arctic-like clear blue sky, whereas larger values ($\sim 8-10$) + * arctic-like clear blue sky, whereas larger values ($\sim 8-10$) * create an atmosphere that is more typical of a warm, humid day. * Note that this model does not aim to reproduce overcast, cloudy, or foggy * atmospheres with high corresponding turbidity values. An photographic * environment map may be more appropriate in such cases. - + * The default coordinate system of the emitter associates the up * direction with the $+Y$ axis. The east direction is associated with $+X$ * and the north direction is equal to $+Z$. To change this coordinate @@ -145,17 +145,17 @@ MTS_NAMESPACE_BEGIN * (see \lstref{sky-up} for an example). * * By default, the emitter will not emit any light below the - * horizon, which means that these regions are black when + * horizon, which means that these regions are black when * observed directly. By setting the \code{stretch} parameter to values * between $1$ and $2$, the sky can be extended to cover these directions - * as well. This is of course a complete kludge and only meant as a quick + * as well. This is of course a complete kludge and only meant as a quick * workaround for scenes that are not properly set up. * * Instead of evaluating the full sky model every on every radiance query, - * the implementation precomputes a low resolution environment map - * (512$\times$ 256) of the entire sky that is then forwarded to the + * the implementation precomputes a low resolution environment map + * (512$\times$ 256) of the entire sky that is then forwarded to the * \pluginref{envmap} plugin---this dramatically improves rendering - * performance. This resolution is generally plenty since the sky radiance + * performance. This resolution is generally plenty since the sky radiance * distribution is so smooth, but it it can be adjusted manually if * necessary using the \code{resolution} parameter. * @@ -177,17 +177,17 @@ MTS_NAMESPACE_BEGIN * \subsubsection*{Physical units and spectral rendering} * Like the \code{blackbody} emission profile (Page~\pageref{sec:blackbody}), * the sky model introduces physical units into the rendering process. - * The radiance values computed by this plugin have units of power ($W$) per + * The radiance values computed by this plugin have units of power ($W$) per * unit area ($m^{-2}$) per steradian ($sr^{-1}$) per unit wavelength ($nm^{-1}$). * If these units are inconsistent with your scene description, you may use the * optional \texttt{scale} parameter to adjust them. - * - * When Mitsuba is compiled for spectral rendering, the plugin switches + * + * When Mitsuba is compiled for spectral rendering, the plugin switches * from RGB to a spectral variant of the skylight model, which relies on - * precomputed data between $320$ and $720 nm$ sampled at $40nm$-increments. + * precomputed data between $320$ and $720 nm$ sampled at $40nm$-increments. * * \subsubsection*{Ground albedo} - * The albedo of the ground (e.g. due to rock, snow, or vegetation) can have a + * The albedo of the ground (e.g. due to rock, snow, or vegetation) can have a * noticeable and nonlinear effect on the appearance of the sky. * \figref{sky_groundalbedo} shows an example of this effect. By default, * the ground albedo is set to a 15% gray. @@ -207,7 +207,7 @@ MTS_NAMESPACE_BEGIN * \medrendering{\code{albedo}=0%}{emitter_sky_albedo_0} * \medrendering{\code{albedo}=100%}{emitter_sky_albedo_1} * \medrendering{\code{albedo}=20% green}{emitter_sky_albedo_green} - * \caption{\label{fig:sky_groundalbedo}Influence + * \caption{\label{fig:sky_groundalbedo}Influence * of the ground albedo on the apperance of the sky} * } */ @@ -250,7 +250,7 @@ public: configure(); } - SkyEmitter(Stream *stream, InstanceManager *manager) + SkyEmitter(Stream *stream, InstanceManager *manager) : Emitter(stream, manager) { m_scale = stream->readFloat(); m_turbidity = stream->readFloat(); @@ -306,14 +306,14 @@ public: ref timer = new Timer(); Log(EDebug, "Rasterizing skylight emitter to an %ix%i environment map ..", m_resolution, m_resolution/2); - ref bitmap = new Bitmap(SKY_PIXELFORMAT, Bitmap::EFloat, + ref bitmap = new Bitmap(SKY_PIXELFORMAT, Bitmap::EFloat, Vector2i(m_resolution, m_resolution/2)); Point2 factor((2*M_PI) / bitmap->getWidth(), M_PI / bitmap->getHeight()); #if defined(MTS_OPENMP) - #pragma omp parallel for + #pragma omp parallel for #endif for (int y=0; ygetHeight(); ++y) { Float theta = (y+.5f) * factor.y; @@ -338,7 +338,7 @@ public: debugBitmap->clear(); #if defined(MTS_OPENMP) - #pragma omp parallel for + #pragma omp parallel for #endif for (int y=0; ygetFloat32Data() + ((y + border) * fsize + border) * 3; @@ -393,10 +393,10 @@ public: std::string toString() const { std::ostringstream oss; oss << "SkyEmitter[" << endl - << " turbidity = " << m_turbidity << "," << endl - << " sunPos = " << m_sun.toString() << endl - << " resolution = " << m_resolution << endl - << " stretch = " << m_stretch << endl + << " turbidity = " << m_turbidity << "," << endl + << " sunPos = " << m_sun.toString() << endl + << " resolution = " << m_resolution << endl + << " stretch = " << m_stretch << endl << " scale = " << m_scale << endl << "]"; return oss.str(); diff --git a/src/emitters/spot.cpp b/src/emitters/spot.cpp index d6c5c5bd..4acb24c6 100644 --- a/src/emitters/spot.cpp +++ b/src/emitters/spot.cpp @@ -40,13 +40,13 @@ MTS_NAMESPACE_BEGIN * An optional texture to be projected along the spot light * } * \parameter{samplingWeight}{\Float}{ - * Specifies the relative amount of samples + * Specifies the relative amount of samples * allocated to this emitter. \default{1} * } * } * * This plugin provides a spot light with a linear falloff. - * In its local coordinate system, the spot light is positioned at the origin + * In its local coordinate system, the spot light is positioned at the origin * and points along the positive Z direction. It can be conveniently * reoriented using the \code{lookat} tag, e.g.: * \begin{xml} @@ -59,7 +59,7 @@ MTS_NAMESPACE_BEGIN * \end{xml} * * The intensity linearly ramps up from \code{cutoffAngle} - * to \code{beamWidth} (both specified in degrees), after which it remains at + * to \code{beamWidth} (both specified in degrees), after which it remains at * the maximum value. A projection texture may optionally be supplied. */ @@ -77,7 +77,7 @@ public: props.getSpectrum("texture", Spectrum(1.0f))); } - SpotEmitter(Stream *stream, InstanceManager *manager) + SpotEmitter(Stream *stream, InstanceManager *manager) : Emitter(stream, manager) { m_texture = static_cast(manager->getInstance(stream)); m_intensity = Spectrum(stream); @@ -104,7 +104,7 @@ public: inline Spectrum falloffCurve(const Vector &d) const { const Float cosTheta = Frame::cosTheta(d); - + if (cosTheta <= m_cosCutoffAngle) return Spectrum(0.0f); @@ -142,7 +142,7 @@ public: return (pRec.measure == EDiscrete) ? 1.0f : 0.0f; } - Spectrum sampleDirection(DirectionSamplingRecord &dRec, + Spectrum sampleDirection(DirectionSamplingRecord &dRec, PositionSamplingRecord &pRec, const Point2 &sample, const Point2 *extra) const { @@ -162,7 +162,7 @@ public: Spectrum evalDirection(const DirectionSamplingRecord &dRec, const PositionSamplingRecord &pRec) const { const Transform &trafo = m_worldTransform->eval(pRec.time); - return (dRec.measure == ESolidAngle) ? + return (dRec.measure == ESolidAngle) ? falloffCurve(trafo.inverse()(dRec.d)) * INV_FOURPI : Spectrum(0.0f); } @@ -236,16 +236,16 @@ private: Float m_cosBeamWidth, m_cosCutoffAngle, m_invTransitionWidth; }; -// ================ Hardware shader implementation ================ +// ================ Hardware shader implementation ================ class SpotEmitterShader : public Shader { public: - SpotEmitterShader(Renderer *renderer, Transform worldToEmitter, - Float invTransitionWidth, Float cutoffAngle, Float cosCutoffAngle, - Float cosBeamWidth, Float uvFactor, const Texture *texture) + SpotEmitterShader(Renderer *renderer, Transform worldToEmitter, + Float invTransitionWidth, Float cutoffAngle, Float cosCutoffAngle, + Float cosBeamWidth, Float uvFactor, const Texture *texture) : Shader(renderer, EEmitterShader), m_worldToEmitter(worldToEmitter), - m_invTransitionWidth(invTransitionWidth), m_cutoffAngle(cutoffAngle), - m_cosCutoffAngle(cosCutoffAngle), m_cosBeamWidth(cosBeamWidth), + m_invTransitionWidth(invTransitionWidth), m_cutoffAngle(cutoffAngle), + m_cosCutoffAngle(cosCutoffAngle), m_cosBeamWidth(cosBeamWidth), m_uvFactor(uvFactor), m_texture(texture) { m_textureShader = renderer->registerShaderForResource(m_texture.get()); } @@ -311,8 +311,8 @@ private: ref m_texture; ref m_textureShader; }; - -Shader *SpotEmitter::createShader(Renderer *renderer) const { + +Shader *SpotEmitter::createShader(Renderer *renderer) const { const Transform &trafo = m_worldTransform->eval(0.0f); return new SpotEmitterShader(renderer, trafo.inverse(), diff --git a/src/emitters/sun.cpp b/src/emitters/sun.cpp index f21a9705..f17a7b64 100644 --- a/src/emitters/sun.cpp +++ b/src/emitters/sun.cpp @@ -23,9 +23,9 @@ #include "sunsky/sunmodel.h" MTS_NAMESPACE_BEGIN - -/* Apparent radius of the sun as seen from the earth (in degrees). - This is an approximation--the actual value is somewhere between + +/* Apparent radius of the sun as seen from the earth (in degrees). + This is an approximation--the actual value is somewhere between 0.526 and 0.545 depending on the time of year */ #define SUN_APP_RADIUS 0.5358 @@ -40,23 +40,23 @@ MTS_NAMESPACE_BEGIN * \order{7} * \parameters{ * \parameter{turbidity}{\Float}{ - * This parameter determines the amount of aerosol present in the atmosphere. + * This parameter determines the amount of aerosol present in the atmosphere. * Valid range: 2-10. \default{3, corresponding to a clear sky in a temperate climate} * } * \parameter{year, month, day}{\Integer}{Denote the date of the * observation \default{2010, 07, 10}} - * \parameter{hour,minute,\showbreak second}{\Float}{Local time + * \parameter{hour,minute,\showbreak second}{\Float}{Local time * at the location of the observer in 24-hour format\default{15, 00, 00, * i.e. 3PM}} * \parameter{latitude, longitude, timezone}{\Float}{ - * These three parameters specify the oberver's latitude and longitude - * in degrees, and the local timezone offset in hours, which are required + * These three parameters specify the oberver's latitude and longitude + * in degrees, and the local timezone offset in hours, which are required * to compute the sun's position. \default{35.6894, 139.6917, 9 --- Tokyo, Japan} * } - * \parameter{sunDirection}{\Vector}{Allows to manually + * \parameter{sunDirection}{\Vector}{Allows to manually * override the sun direction in world space. When this value - * is provided, parameters pertaining to the computation - * of the sun direction (\code{year, hour, latitude,} etc. + * is provided, parameters pertaining to the computation + * of the sun direction (\code{year, hour, latitude,} etc. * are unnecessary. \default{none} * } * \parameter{resolution}{\Integer}{Specifies the horizontal resolution of the precomputed @@ -66,34 +66,34 @@ MTS_NAMESPACE_BEGIN * emitted by the sun emitter. \default{1} * } * \parameter{samplingWeight}{\Float}{ - * Specifies the relative amount of samples + * Specifies the relative amount of samples * allocated to this emitter. \default{1} * } * } - * This plugin implements the physically-based sun model proposed by - * Preetham et al. \cite{Preetham1999Practical}. Using the provided position - * and time information (see \pluginref{sky} for details), it can determine the + * This plugin implements the physically-based sun model proposed by + * Preetham et al. \cite{Preetham1999Practical}. Using the provided position + * and time information (see \pluginref{sky} for details), it can determine the * position of the sun as seen from the position of the observer. * - * The radiance arriving at the earth surface is then found based on the spectral - * emission profile of the sun and the extinction cross-section of the + * The radiance arriving at the earth surface is then found based on the spectral + * emission profile of the sun and the extinction cross-section of the * atmosphere (which depends on the \code{turbidity} and the zenith angle of the sun). * * Like the \code{blackbody} emission profile (Page~\pageref{sec:blackbody}), * the sun model introduces physical units into the rendering process. - * The radiance values computed by this plugin have units of power ($W$) per + * The radiance values computed by this plugin have units of power ($W$) per * unit area ($m^{-2}$) per steradian ($sr^{-1}$) per unit wavelength ($nm^{-1}$). * If these units are inconsistent with your scene description, you may use the * optional \texttt{scale} parameter to adjust them. * - * This plugin supplies proper spectral power distributions when Mitsuba is - * compiled in spectral rendering mode. Otherwise, they are simply projected onto + * This plugin supplies proper spectral power distributions when Mitsuba is + * compiled in spectral rendering mode. Otherwise, they are simply projected onto * a linear RGB color space. - * + * * \remarks{ * \item The sun is an intense light source that subtends a tiny solid angle. * This can be a problem for certain rendering techniques (e.g. path - * tracing), which produce high variance output (i.e. noise in renderings) + * tracing), which produce high variance output (i.e. noise in renderings) * when the scene also contains specular or glossy or materials. * } */ @@ -109,7 +109,7 @@ public: m_stretch = props.getFloat("stretch", 1.0f); } - SunEmitter(Stream *stream, InstanceManager *manager) + SunEmitter(Stream *stream, InstanceManager *manager) : Emitter(stream, manager) { m_scale = stream->readFloat(); m_sunRadiusScale = stream->readFloat(); @@ -147,8 +147,8 @@ public: if (i != 0) return NULL; /* Rasterizing the sphere to an environment map and checking the - individual pixels for coverage (which is what Mitsuba 0.3.0 did) - was slow and not very effective; for instance the power varied + individual pixels for coverage (which is what Mitsuba 0.3.0 did) + was slow and not very effective; for instance the power varied dramatically with resolution changes. Since the sphere generally just covers a few pixels, the code below rasterizes it much more efficiently by generating a few thousand QMC samples. @@ -162,12 +162,12 @@ public: /* Ratio of the sphere that is covered by the sun */ Float coveredPortion = 0.5f * (1 - cosTheta); - /* Approx. number of samples that need to be generated, + /* Approx. number of samples that need to be generated, be very conservative */ size_t nSamples = (size_t) std::max((Float) 100, (pixelCount * coveredPortion * 1000)); - ref bitmap = new Bitmap(SUN_PIXELFORMAT, Bitmap::EFloat, + ref bitmap = new Bitmap(SUN_PIXELFORMAT, Bitmap::EFloat, Vector2i(m_resolution, m_resolution/2)); bitmap->clear(); Frame frame(m_sunDir); @@ -176,9 +176,9 @@ public: bitmap->getHeight() / M_PI); Spectrum *target = (Spectrum *) bitmap->getFloatData(); - Spectrum value = + Spectrum value = m_radiance * (2 * M_PI * (1-std::cos(m_theta))) * - (bitmap->getWidth() * bitmap->getHeight()) + (bitmap->getWidth() * bitmap->getHeight()) / (2.0f * M_PI * M_PI * (Float) nSamples); for (size_t i=0; i bitmap = new Bitmap(SUNSKY_PIXELFORMAT, Bitmap::EFloat, + ref bitmap = new Bitmap(SUNSKY_PIXELFORMAT, Bitmap::EFloat, Vector2i(resolution, resolution/2)); Point2 factor((2*M_PI) / bitmap->getWidth(), @@ -122,12 +122,12 @@ public: ref timer = new Timer(); Log(EDebug, "Rasterizing sun & skylight emitter to an %ix%i environment map ..", resolution, resolution/2); - + Spectrum *data = (Spectrum *) bitmap->getFloatData(); /* First, rasterize the sky */ #if defined(MTS_OPENMP) - #pragma omp parallel for + #pragma omp parallel for #endif for (int y=0; ygetHeight(); ++y) { Float theta = (y+.5f) * factor.y; @@ -138,14 +138,14 @@ public: RayDifferential ray(Point(0.0f), toSphere(SphericalCoordinates(theta, phi)), 0.0f); - + *target++ = sky->evalEnvironment(ray); } } /* Rasterizing the sphere to an environment map and checking the - individual pixels for coverage (which is what Mitsuba 0.3.0 did) - was slow and not very effective; for instance the power varied + individual pixels for coverage (which is what Mitsuba 0.3.0 did) + was slow and not very effective; for instance the power varied dramatically with resolution changes. Since the sphere generally just covers a few pixels, the code below rasterizes it much more efficiently by generating a few thousand QMC samples. @@ -155,7 +155,7 @@ public: by the sun */ SphericalCoordinates sun = computeSunCoordinates(props); - Spectrum sunRadiance = computeSunRadiance(sun.elevation, + Spectrum sunRadiance = computeSunRadiance(sun.elevation, props.getFloat("turbidity", 3.0f)) * sunScale; sun.elevation *= props.getFloat("stretch", 1.0f); Frame sunFrame = Frame(toSphere(sun)); @@ -167,7 +167,7 @@ public: /* Ratio of the sphere that is covered by the sun */ Float coveredPortion = 0.5f * (1 - cosTheta); - /* Approx. number of samples that need to be generated, + /* Approx. number of samples that need to be generated, be very conservative */ size_t nSamples = (size_t) std::max((Float) 100, (pixelCount * coveredPortion * 1000)); @@ -175,9 +175,9 @@ public: factor = Point2(bitmap->getWidth() / (2*M_PI), bitmap->getHeight() / M_PI); - Spectrum value = + Spectrum value = sunRadiance * (2 * M_PI * (1-std::cos(theta))) * - (bitmap->getWidth() * bitmap->getHeight()) + (bitmap->getWidth() * bitmap->getHeight()) / (2.0f * M_PI * M_PI * (Float) nSamples); for (size_t i=0; iconfigs[wl], - turbidity, - albedo, + datasets[wl], + state->configs[wl], + turbidity, + albedo, elevation ); - state->radiances[wl] = + state->radiances[wl] = ArHosekSkyModel_CookRadianceConfiguration( datasetsRad[wl], - turbidity, + turbidity, albedo, elevation ); @@ -279,8 +279,8 @@ void arhosekskymodelstate_free( double arhosekskymodel_radiance( ArHosekSkyModelState * state, - double theta, - double gamma, + double theta, + double gamma, double wavelength ) { @@ -290,12 +290,12 @@ double arhosekskymodel_radiance( double interp = fmod((wavelength - 320.0 ) / 40.0, 1.0); - double val_low = + double val_low = ArHosekSkyModel_GetRadianceInternal( - state->configs[low_wl], - theta, - gamma - ) + state->configs[low_wl], + theta, + gamma + ) * state->radiances[low_wl]; if(interp < 1e-6) @@ -303,7 +303,7 @@ double arhosekskymodel_radiance( double result = (1.0 - interp) * val_low; - if (low_wl+1 < 11) + if (low_wl+1 < 11) result += interp * ArHosekSkyModel_GetRadianceInternal( state->configs[low_wl+1], theta, gamma) * state->radiances[low_wl+1]; @@ -314,62 +314,62 @@ double arhosekskymodel_radiance( // xyz and versions ArHosekTristimSkyModelState * arhosek_xyz_skymodelstate_alloc_init( - const double turbidity, - const double albedo, + const double turbidity, + const double albedo, const double elevation ) { ArHosekTristimSkyModelState * state = new ArHosekTristimSkyModelState(); - + for( unsigned int channel = 0; channel < 3; ++channel ) { ArHosekSkyModel_CookConfiguration( - datasetsXYZ[channel], - state->configs[channel], - turbidity, - albedo, + datasetsXYZ[channel], + state->configs[channel], + turbidity, + albedo, elevation ); - - state->radiances[channel] = + + state->radiances[channel] = ArHosekSkyModel_CookRadianceConfiguration( datasetsXYZRad[channel], - turbidity, + turbidity, albedo, elevation ); } - + return state; } ArHosekTristimSkyModelState * arhosek_rgb_skymodelstate_alloc_init( - const double turbidity, - const double albedo, + const double turbidity, + const double albedo, const double elevation ) { ArHosekTristimSkyModelState * state = new ArHosekTristimSkyModelState(); - + for( unsigned int channel = 0; channel < 3; ++channel ) { ArHosekSkyModel_CookConfiguration( - datasetsRGB[channel], - state->configs[channel], - turbidity, - albedo, + datasetsRGB[channel], + state->configs[channel], + turbidity, + albedo, elevation ); - - state->radiances[channel] = + + state->radiances[channel] = ArHosekSkyModel_CookRadianceConfiguration( datasetsRGBRad[channel], - turbidity, + turbidity, albedo, elevation ); } - + return state; } @@ -382,16 +382,16 @@ void arhosek_tristim_skymodelstate_free( double arhosek_tristim_skymodel_radiance( ArHosekTristimSkyModelState * state, - double theta, - double gamma, + double theta, + double gamma, int channel ) { return ArHosekSkyModel_GetRadianceInternal( - state->configs[channel], - theta, - gamma - ) + state->configs[channel], + theta, + gamma + ) * state->radiances[channel]; } diff --git a/src/emitters/sunsky/skymodel.h b/src/emitters/sunsky/skymodel.h index 8f5058ae..e0adf5e5 100644 --- a/src/emitters/sunsky/skymodel.h +++ b/src/emitters/sunsky/skymodel.h @@ -4,7 +4,7 @@ This source is published under the following 3-clause BSD license. Copyright (c) 2012, Lukas Hosek and Alexander Wilkie All rights reserved. -Redistribution and use in source and binary forms, with or without +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright @@ -12,8 +12,8 @@ modification, are permitted provided that the following conditions are met: * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * None of the names of the contributors may be used to endorse or promote - products derived from this software without specific prior written + * None of the names of the contributors may be used to endorse or promote + products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND @@ -37,25 +37,25 @@ presented in the SIGGRAPH 2012 paper "An Analytic Model for Full Spectral Sky-Dome Radiance" - by + by Lukas Hosek and Alexander Wilkie Charles University in Prague, Czech Republic Version: 1.2, August 23rd, 2012 - + Version history: 1.2 RGB version added. -1.1 The coefficients of the spectral model are now scaled so that the output - is given in physical units: W / (m^-2 * sr * nm). Also, the output of the +1.1 The coefficients of the spectral model are now scaled so that the output + is given in physical units: W / (m^-2 * sr * nm). Also, the output of the XYZ model is now no longer scaled to the range [0...1]. Instead, it is the result of a simple conversion from spectral data via the CIE 2 degree - standard observer matching functions. Therefore, after multiplication + standard observer matching functions. Therefore, after multiplication with 683 lm / W, the Y channel now corresponds to luminance in lm. - + 1.0 Initial release (May 11th, 2012). @@ -68,9 +68,9 @@ an updated version of this code has been published! /* This code is taken from ART, a rendering research system written in a -mix of C99 / Objective C. Since ART is not a small system and is intended to -be inter-operable with other libraries, and since C does not have namespaces, -the structures and functions in ART all have to have the somewhat wordy +mix of C99 / Objective C. Since ART is not a small system and is intended to +be inter-operable with other libraries, and since C does not have namespaces, +the structures and functions in ART all have to have the somewhat wordy canonical names that begin with Ar.../ar..., like those seen in this example. Usage information: @@ -91,7 +91,7 @@ assume that "albedo" is defined as double albedo[num_channels]; -with a ground albedo value between [0,1] for each channel. The solar elevation +with a ground albedo value between [0,1] for each channel. The solar elevation is given in radians. for ( unsigned int i = 0; i < num_channels; i++ ) @@ -119,7 +119,7 @@ on the skydome determined via the angles theta and gamma works as follows: gamma, channel_center[i] ); - + The variable "channel_center" is assumed to hold the channel center wavelengths for each of the num_channels samples of the spectrum we are building. @@ -161,12 +161,12 @@ typedef struct ArHosekSkyModelState { ArHosekSkyModelConfiguration configs[11]; double radiances[11]; -} +} ArHosekSkyModelState; ArHosekSkyModelState * arhosekskymodelstate_alloc_init( - const double turbidity, - const double albedo, + const double turbidity, + const double albedo, const double elevation ); @@ -176,8 +176,8 @@ void arhosekskymodelstate_free( double arhosekskymodel_radiance( ArHosekSkyModelState * state, - double theta, - double gamma, + double theta, + double gamma, double wavelength ); @@ -189,18 +189,18 @@ typedef struct ArHosekTristimSkyModelState { ArHosekSkyModelConfiguration configs[3]; double radiances[3]; -} +} ArHosekTristimSkyModelState; ArHosekTristimSkyModelState * arhosek_xyz_skymodelstate_alloc_init( - const double turbidity, - const double albedo, + const double turbidity, + const double albedo, const double elevation ); ArHosekTristimSkyModelState * arhosek_rgb_skymodelstate_alloc_init( - const double turbidity, - const double albedo, + const double turbidity, + const double albedo, const double elevation ); @@ -210,7 +210,7 @@ void arhosek_tristim_skymodelstate_free( double arhosek_tristim_skymodel_radiance( ArHosekTristimSkyModelState * state, - double theta, - double gamma, + double theta, + double gamma, int channel ); diff --git a/src/emitters/sunsky/skymodeldata.h b/src/emitters/sunsky/skymodeldata.h index 9d49b5b4..0eb9a24c 100644 --- a/src/emitters/sunsky/skymodeldata.h +++ b/src/emitters/sunsky/skymodeldata.h @@ -4,7 +4,7 @@ This source is published under the following 3-clause BSD license. Copyright (c) 2012, Lukas Hosek and Alexander Wilkie All rights reserved. -Redistribution and use in source and binary forms, with or without +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright @@ -12,8 +12,8 @@ modification, are permitted provided that the following conditions are met: * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * None of the names of the contributors may be used to endorse or promote - products derived from this software without specific prior written + * None of the names of the contributors may be used to endorse or promote + products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND @@ -37,23 +37,23 @@ presented in the SIGGRAPH 2012 paper "An Analytic Model for Full Spectral Sky-Dome Radiance" - by + by Lukas Hosek and Alexander Wilkie Charles University in Prague, Czech Republic Version: 1.1, July 4th, 2012 - + Version history: -1.1 The coefficients of the spectral model are now scaled so that the output - is given in physical units: W / (m^-2 * sr * nm). Also, the output of the +1.1 The coefficients of the spectral model are now scaled so that the output + is given in physical units: W / (m^-2 * sr * nm). Also, the output of the XYZ model is now no longer scaled to the range [0...1]. Instead, it is the result of a simple conversion from spectral data via the CIE 2 degree - standard observer matching functions. Therefore, after multiplication + standard observer matching functions. Therefore, after multiplication with 683 lm / W, the Y channel now corresponds to luminance in lm. - + 1.0 Initial release (May 11th, 2012). @@ -70,7 +70,7 @@ space version of the model. */ -double dataset320[] = +double dataset320[] = { // albedo 0, turbidity 1 -1.341049e+001, @@ -1174,7 +1174,7 @@ double dataset320[] = 6.227585e-001, }; -double datasetRad320[] = +double datasetRad320[] = { // albedo 0, turbidity 1 9.282016e-004, @@ -1318,7 +1318,7 @@ double datasetRad320[] = 8.244103e-002, }; -double dataset360[] = +double dataset360[] = { // albedo 0, turbidity 1 -2.974290e+000, @@ -2422,7 +2422,7 @@ double dataset360[] = 7.279518e-001, }; -double datasetRad360[] = +double datasetRad360[] = { // albedo 0, turbidity 1 2.494129e-003, @@ -2566,7 +2566,7 @@ double datasetRad360[] = 1.427310e-001, }; -double dataset400[] = +double dataset400[] = { // albedo 0, turbidity 1 -1.869600e+000, @@ -3670,7 +3670,7 @@ double dataset400[] = 7.086504e-001, }; -double datasetRad400[] = +double datasetRad400[] = { // albedo 0, turbidity 1 5.767645e-003, @@ -3814,7 +3814,7 @@ double datasetRad400[] = 2.328116e-001, }; -double dataset440[] = +double dataset440[] = { // albedo 0, turbidity 1 -1.397312e+000, @@ -4918,7 +4918,7 @@ double dataset440[] = 6.840186e-001, }; -double datasetRad440[] = +double datasetRad440[] = { // albedo 0, turbidity 1 9.406889e-003, @@ -5062,7 +5062,7 @@ double datasetRad440[] = 2.803810e-001, }; -double dataset480[] = +double dataset480[] = { // albedo 0, turbidity 1 -1.255072e+000, @@ -6166,7 +6166,7 @@ double dataset480[] = 6.747408e-001, }; -double datasetRad480[] = +double datasetRad480[] = { // albedo 0, turbidity 1 1.367487e-002, @@ -6310,7 +6310,7 @@ double datasetRad480[] = 3.053035e-001, }; -double dataset520[] = +double dataset520[] = { // albedo 0, turbidity 1 -1.171338e+000, @@ -7414,7 +7414,7 @@ double dataset520[] = 6.713422e-001, }; -double datasetRad520[] = +double datasetRad520[] = { // albedo 0, turbidity 1 1.459826e-002, @@ -7558,7 +7558,7 @@ double datasetRad520[] = 2.692918e-001, }; -double dataset560[] = +double dataset560[] = { // albedo 0, turbidity 1 -1.121223e+000, @@ -8662,7 +8662,7 @@ double dataset560[] = 5.872694e-001, }; -double datasetRad560[] = +double datasetRad560[] = { // albedo 0, turbidity 1 1.518543e-002, @@ -8806,7 +8806,7 @@ double datasetRad560[] = 2.394514e-001, }; -double dataset600[] = +double dataset600[] = { // albedo 0, turbidity 1 -1.120756e+000, @@ -9910,7 +9910,7 @@ double dataset600[] = 6.545784e-001, }; -double datasetRad600[] = +double datasetRad600[] = { // albedo 0, turbidity 1 1.605147e-002, @@ -10054,7 +10054,7 @@ double datasetRad600[] = 2.260782e-001, }; -double dataset640[] = +double dataset640[] = { // albedo 0, turbidity 1 -1.113346e+000, @@ -11158,7 +11158,7 @@ double dataset640[] = 6.650112e-001, }; -double datasetRad640[] = +double datasetRad640[] = { // albedo 0, turbidity 1 1.479989e-002, @@ -11302,7 +11302,7 @@ double datasetRad640[] = 2.043633e-001, }; -double dataset680[] = +double dataset680[] = { // albedo 0, turbidity 1 -1.112655e+000, @@ -12406,7 +12406,7 @@ double dataset680[] = 6.710888e-001, }; -double datasetRad680[] = +double datasetRad680[] = { // albedo 0, turbidity 1 1.320908e-002, @@ -12550,7 +12550,7 @@ double datasetRad680[] = 1.851691e-001, }; -double dataset720[] = +double dataset720[] = { // albedo 0, turbidity 1 -1.110553e+000, @@ -13654,7 +13654,7 @@ double dataset720[] = 6.917938e-001, }; -double datasetRad720[] = +double datasetRad720[] = { // albedo 0, turbidity 1 1.130152e-002, @@ -13828,7 +13828,7 @@ double* datasetsRad[] = datasetRad720 }; -double datasetXYZ1[] = +double datasetXYZ1[] = { // albedo 0, turbidity 1 -1.117110e+000, @@ -14932,7 +14932,7 @@ double datasetXYZ1[] = 6.597854e-001, }; -double datasetXYZRad1[] = +double datasetXYZRad1[] = { // albedo 0, turbidity 1 1.560219e+000, @@ -15076,7 +15076,7 @@ double datasetXYZRad1[] = 2.523432e+001, }; -double datasetXYZ2[] = +double datasetXYZ2[] = { // albedo 0, turbidity 1 -1.129389e+000, @@ -16180,7 +16180,7 @@ double datasetXYZ2[] = 6.470981e-001, }; -double datasetXYZRad2[] = +double datasetXYZRad2[] = { // albedo 0, turbidity 1 1.632341e+000, @@ -16324,7 +16324,7 @@ double datasetXYZRad2[] = 2.641780e+001, }; -double datasetXYZ3[] = +double datasetXYZ3[] = { // albedo 0, turbidity 1 -1.311923e+000, @@ -17428,7 +17428,7 @@ double datasetXYZ3[] = 6.786333e-001, }; -double datasetXYZRad3[] = +double datasetXYZRad3[] = { // albedo 0, turbidity 1 1.168084e+000, @@ -17586,7 +17586,7 @@ double* datasetsXYZRad[] = datasetXYZRad3 }; -double datasetRGB1[] = +double datasetRGB1[] = { // albedo 0, turbidity 1 -1.099459e+000, @@ -18690,7 +18690,7 @@ double datasetRGB1[] = 6.658012e-001, }; -double datasetRGBRad1[] = +double datasetRGBRad1[] = { // albedo 0, turbidity 1 1.962684e+000, @@ -18834,7 +18834,7 @@ double datasetRGBRad1[] = 2.574284e+001, }; -double datasetRGB2[] = +double datasetRGB2[] = { // albedo 0, turbidity 1 -1.140530e+000, @@ -19938,7 +19938,7 @@ double datasetRGB2[] = 6.588427e-001, }; -double datasetRGBRad2[] = +double datasetRGBRad2[] = { // albedo 0, turbidity 1 1.590330e+000, @@ -20082,7 +20082,7 @@ double datasetRGBRad2[] = 2.643066e+001, }; -double datasetRGB3[] = +double datasetRGB3[] = { // albedo 0, turbidity 1 -1.372629e+000, @@ -21186,7 +21186,7 @@ double datasetRGB3[] = 6.966285e-001, }; -double datasetRGBRad3[] = +double datasetRGBRad3[] = { // albedo 0, turbidity 1 9.926518e-001, diff --git a/src/emitters/sunsky/sunmodel.h b/src/emitters/sunsky/sunmodel.h index bebd998f..2bd58131 100644 --- a/src/emitters/sunsky/sunmodel.h +++ b/src/emitters/sunsky/sunmodel.h @@ -81,7 +81,7 @@ struct SphericalCoordinates { std::string toString() const { std::ostringstream oss; - oss << "SphericalCoordinates[elevation = " << radToDeg(elevation) + oss << "SphericalCoordinates[elevation = " << radToDeg(elevation) << ", azimuth = " << radToDeg(azimuth) << "]"; return oss.str(); } @@ -108,7 +108,7 @@ SphericalCoordinates fromSphere(const Vector &d) { * \brief Compute the elevation and azimuth of the sun as seen by an observer * at \c location at the date and time specified in \c dateTime. * - * Based on "Computing the Solar Vector" by Manuel Blanco-Muriel, + * Based on "Computing the Solar Vector" by Manuel Blanco-Muriel, * Diego C. Alarcon-Padilla, Teodoro Lopez-Moratalla, and Martin Lara-Coira, * in "Solar energy", vol 27, number 5, 2001 by Pergamon Press. */ @@ -127,30 +127,30 @@ SphericalCoordinates computeSunCoordinates(const DateTimeRecord &dateTime, const and JD 2451545.0, which is noon 1 January 2000 Universal Time */ { // Calculate time of the day in UT decimal hours - decHours = dateTime.hour - location.timezone + + decHours = dateTime.hour - location.timezone + (dateTime.minute + dateTime.second / 60.0 ) / 60.0; // Calculate current Julian Day int liAux1 = (dateTime.month-14) / 12; - int liAux2 = (1461*(dateTime.year + 4800 + liAux1)) / 4 + int liAux2 = (1461*(dateTime.year + 4800 + liAux1)) / 4 + (367 * (dateTime.month - 2 - 12 * liAux1)) / 12 - (3 * ((dateTime.year + 4900 + liAux1) / 100)) / 4 + dateTime.day - 32075; double dJulianDate = (double) liAux2 - 0.5 + decHours / 24.0; - // Calculate difference between current Julian Day and JD 2451545.0 + // Calculate difference between current Julian Day and JD 2451545.0 elapsedJulianDays = dJulianDate - 2451545.0; } - /* Calculate ecliptic coordinates (ecliptic longitude and obliquity of the - ecliptic in radians but without limiting the angle to be less than 2*Pi + /* Calculate ecliptic coordinates (ecliptic longitude and obliquity of the + ecliptic in radians but without limiting the angle to be less than 2*Pi (i.e., the result may be greater than 2*Pi) */ { double omega = 2.1429 - 0.0010394594 * elapsedJulianDays; double meanLongitude = 4.8950630 + 0.017202791698 * elapsedJulianDays; // Radians double anomaly = 6.2400600 + 0.0172019699 * elapsedJulianDays; - eclipticLongitude = meanLongitude + 0.03341607 * std::sin(anomaly) + eclipticLongitude = meanLongitude + 0.03341607 * std::sin(anomaly) + 0.00034894 * std::sin(2*anomaly) - 0.0001134 - 0.0000203 * std::sin(omega); @@ -158,8 +158,8 @@ SphericalCoordinates computeSunCoordinates(const DateTimeRecord &dateTime, const + 0.0000396 * std::cos(omega); } - /* Calculate celestial coordinates ( right ascension and declination ) in radians - but without limiting the angle to be less than 2*Pi (i.e., the result may be + /* Calculate celestial coordinates ( right ascension and declination ) in radians + but without limiting the angle to be less than 2*Pi (i.e., the result may be greater than 2*Pi) */ { double sinEclipticLongitude = std::sin(eclipticLongitude); @@ -176,13 +176,13 @@ SphericalCoordinates computeSunCoordinates(const DateTimeRecord &dateTime, const double greenwichMeanSiderealTime = 6.6974243242 + 0.0657098283 * elapsedJulianDays + decHours; - double localMeanSiderealTime = degToRad((Float) ((greenwichMeanSiderealTime * 15 + double localMeanSiderealTime = degToRad((Float) ((greenwichMeanSiderealTime * 15 + location.longitude))); double latitudeInRadians = degToRad(location.latitude); double cosLatitude = std::cos(latitudeInRadians); double sinLatitude = std::sin(latitudeInRadians); - + double hourAngle = localMeanSiderealTime - rightAscension; double cosHourAngle = std::cos(hourAngle); @@ -193,7 +193,7 @@ SphericalCoordinates computeSunCoordinates(const DateTimeRecord &dateTime, const dX = std::tan(declination) * cosLatitude - sinLatitude * cosHourAngle; azimuth = std::atan2(dY, dX); - if (azimuth < 0.0) + if (azimuth < 0.0) azimuth += 2*M_PI; // Parallax Correction @@ -236,7 +236,7 @@ SphericalCoordinates computeSunCoordinates(const Properties &props) { SphericalCoordinates coords = computeSunCoordinates(dateTime, location); SLog(EDebug, "Computed sun position for %s and %s: %s", - location.toString().c_str(), dateTime.toString().c_str(), + location.toString().c_str(), dateTime.toString().c_str(), coords.toString().c_str()); return coords; @@ -251,21 +251,21 @@ SphericalCoordinates computeSunCoordinates(const Properties &props) { // k_o Spectrum table from pg 127, MI. Float k_oWavelengths[64] = { 300, 305, 310, 315, 320, 325, 330, 335, 340, 345, - 350, 355, 445, 450, 455, 460, 465, 470, 475, 480, - 485, 490, 495, 500, 505, 510, 515, 520, 525, 530, - 535, 540, 545, 550, 555, 560, 565, 570, 575, 580, - 585, 590, 595, 600, 605, 610, 620, 630, 640, 650, - 660, 670, 680, 690, 700, 710, 720, 730, 740, 750, + 350, 355, 445, 450, 455, 460, 465, 470, 475, 480, + 485, 490, 495, 500, 505, 510, 515, 520, 525, 530, + 535, 540, 545, 550, 555, 560, 565, 570, 575, 580, + 585, 590, 595, 600, 605, 610, 620, 630, 640, 650, + 660, 670, 680, 690, 700, 710, 720, 730, 740, 750, 760, 770, 780, 790 }; Float k_oAmplitudes[65] = { - 10.0, 4.8, 2.7, 1.35, .8, .380, .160, .075, .04, .019, .007, - .0, .003, .003, .004, .006, .008, .009, .012, .014, .017, - .021, .025, .03, .035, .04, .045, .048, .057, .063, .07, - .075, .08, .085, .095, .103, .110, .12, .122, .12, .118, - .115, .12, .125, .130, .12, .105, .09, .079, .067, .057, - .048, .036, .028, .023, .018, .014, .011, .010, .009, + 10.0, 4.8, 2.7, 1.35, .8, .380, .160, .075, .04, .019, .007, + .0, .003, .003, .004, .006, .008, .009, .012, .014, .017, + .021, .025, .03, .035, .04, .045, .048, .057, .063, .07, + .075, .08, .085, .095, .103, .110, .12, .122, .12, .118, + .115, .12, .125, .130, .12, .105, .09, .079, .067, .057, + .048, .036, .028, .023, .018, .014, .011, .010, .009, .007, .004, .0, .0 }; @@ -294,10 +294,10 @@ Float k_waAmplitudes[13] = { /* Wavelengths corresponding to the table below */ Float solWavelengths[38] = { - 380, 390, 400, 410, 420, 430, 440, 450, - 460, 470, 480, 490, 500, 510, 520, 530, - 540, 550, 560, 570, 580, 590, 600, 610, - 620, 630, 640, 650, 660, 670, 680, 690, + 380, 390, 400, 410, 420, 430, 440, 450, + 460, 470, 480, 490, 500, 510, 520, 530, + 540, 550, 560, 570, 580, 590, 600, 610, + 620, 630, 640, 650, 660, 670, 680, 690, 700, 710, 720, 730, 740, 750 }; @@ -334,25 +334,25 @@ Spectrum computeSunRadiance(Float theta, Float turbidity) { Float tauR = math::fastexp(-m * 0.008735f * std::pow(lambda/1000.0f, (Float) -4.08)); // Aerosol (water + dust) attenuation - // beta - amount of aerosols present + // beta - amount of aerosols present // alpha - ratio of small to large particle sizes. (0:4,usually 1.3) - // Results agree with the graph (pg 121, MI) + // Results agree with the graph (pg 121, MI) const Float alpha = 1.3f; Float tauA = math::fastexp(-m * beta * std::pow(lambda/1000.0f, -alpha)); // lambda should be in um - // Attenuation due to ozone absorption - // lOzone - amount of ozone in cm(NTP) - // Results agree with the graph (pg 128, MI) + // Attenuation due to ozone absorption + // lOzone - amount of ozone in cm(NTP) + // Results agree with the graph (pg 128, MI) const Float lOzone = .35f; Float tauO = math::fastexp(-m * k_oCurve.eval(lambda) * lOzone); - // Attenuation due to mixed gases absorption + // Attenuation due to mixed gases absorption // Results agree with the graph (pg 131, MI) Float tauG = math::fastexp(-1.41f * k_gCurve.eval(lambda) * m / std::pow(1 + 118.93f * k_gCurve.eval(lambda) * m, (Float) 0.45f)); - // Attenuation due to water vapor absorbtion - // w - precipitable water vapor in centimeters (standard = 2) + // Attenuation due to water vapor absorbtion + // w - precipitable water vapor in centimeters (standard = 2) // Results agree with the graph (pg 132, MI) const Float w = 2.0; Float tauWA = math::fastexp(-0.2385f * k_waCurve.eval(lambda) * w * m / diff --git a/src/films/hdrfilm.cpp b/src/films/hdrfilm.cpp index 818cf41f..adac3f14 100644 --- a/src/films/hdrfilm.cpp +++ b/src/films/hdrfilm.cpp @@ -45,12 +45,12 @@ MTS_NAMESPACE_BEGIN * \code{xyza}, \code{spectrum}, and \code{spectrumAlpha}. In the latter two cases, * the number of written channels depends on the value assigned to * \code{SPECTRUM\_SAMPLES} during compilation (see Section~\ref{sec:compiling} - * section for details) + * section for details) * \default{\code{rgba}} * } - * \parameter{componentFormat}{\String}{Specifies the desired floating + * \parameter{componentFormat}{\String}{Specifies the desired floating * point component format used for OpenEXR output. The options are - * \code{float16}, \code{float32}, or \code{uint32}. + * \code{float16}, \code{float32}, or \code{uint32}. * \default{\code{float16}} * } * \parameter{cropOffsetX, cropOffsetY, cropWidth, cropHeight}{\Integer}{ @@ -63,33 +63,33 @@ MTS_NAMESPACE_BEGIN * information is permanently saved. * \default{\code{true}, i.e. attach it} * } - * \parameter{banner}{\Boolean}{Include a small Mitsuba banner in the + * \parameter{banner}{\Boolean}{Include a small Mitsuba banner in the * output image? \default{\code{true}} * } * \parameter{highQualityEdges}{\Boolean}{ - * If set to \code{true}, regions slightly outside of the film - * plane will also be sampled. This may improve the image - * quality at the edges, especially when using very large - * reconstruction filters. In general, this is not needed though. + * If set to \code{true}, regions slightly outside of the film + * plane will also be sampled. This may improve the image + * quality at the edges, especially when using very large + * reconstruction filters. In general, this is not needed though. * \default{\code{false}, i.e. disabled} * } * \parameter{\Unnamed}{\RFilter}{Reconstruction filter that should * be used by the film. \default{\code{gaussian}, a windowed Gaussian filter}} * } - * + * * This is the default film plugin that is used when none is explicitly * specified. It stores the captured image as a high dynamic range OpenEXR file - * and tries to preserve the rendering as much as possible by not performing any - * kind of post processing, such as gamma correction---the output file + * and tries to preserve the rendering as much as possible by not performing any + * kind of post processing, such as gamma correction---the output file * will record linear radiance values. - * - * When writing OpenEXR files, the film will either produce a luminance, luminance/alpha, - * RGB(A), XYZ(A) tristimulus, or spectrum/spectrum-alpha-based bitmap having a - * \code{float16}, \code{float32}, or \code{uint32}-based internal representation - * based on the chosen parameters. + * + * When writing OpenEXR files, the film will either produce a luminance, luminance/alpha, + * RGB(A), XYZ(A) tristimulus, or spectrum/spectrum-alpha-based bitmap having a + * \code{float16}, \code{float32}, or \code{uint32}-based internal representation + * based on the chosen parameters. * The default configuration is RGBA with a \code{float16} component format, - * which is appropriate for most purposes. Note that the spectral output options - * only make sense when using a custom build of Mitsuba that has spectral + * which is appropriate for most purposes. Note that the spectral output options + * only make sense when using a custom build of Mitsuba that has spectral * rendering enabled. This is not the case for the downloadable release builds. * * The plugin can also write RLE-compressed files in the Radiance RGBE format @@ -102,9 +102,9 @@ MTS_NAMESPACE_BEGIN * \code{rgb} or \code{luminance} pixel formats. * Due to the superior accuracy and adoption of OpenEXR, the use of these * two alternative formats is discouraged however. - * - * When RGB output is selected, the measured spectral power distributions are - * converted to linear RGB based on the CIE 1931 XYZ color matching curves and + * + * When RGB output is selected, the measured spectral power distributions are + * converted to linear RGB based on the CIE 1931 XYZ color matching curves and * the ITU-R Rec. BT.709-3 primaries with a D65 white point. * * \begin{xml}[caption=Instantiation of a film that writes a full-HD RGBA OpenEXR file without the Mitsuba banner] @@ -207,7 +207,7 @@ public: m_storage = new ImageBlock(Bitmap::ESpectrumAlphaWeight, m_cropSize); } - HDRFilm(Stream *stream, InstanceManager *manager) + HDRFilm(Stream *stream, InstanceManager *manager) : Film(stream, manager) { m_banner = stream->readBool(); m_attachLog = stream->readBool(); @@ -224,7 +224,7 @@ public: stream->writeUInt(m_pixelFormat); stream->writeUInt(m_componentFormat); } - + void clear() { m_storage->clear(); } @@ -236,10 +236,10 @@ public: void setBitmap(const Bitmap *bitmap, Float multiplier) { bitmap->convert(m_storage->getBitmap(), multiplier); } - + void addBitmap(const Bitmap *bitmap, Float multiplier) { /* Currently, only accumulating spectrum-valued floating point images - is supported. This function basically just exists to support the + is supported. This function basically just exists to support the somewhat peculiar film updates done by BDPT */ Vector2i size = bitmap->getSize(); @@ -264,7 +264,7 @@ public: } } - bool develop(const Point2i &sourceOffset, const Vector2i &size, + bool develop(const Point2i &sourceOffset, const Vector2i &size, const Point2i &targetOffset, Bitmap *target) const { const Bitmap *source = m_storage->getBitmap(); const FormatConverter *cvt = FormatConverter::getInstance( @@ -274,9 +274,9 @@ public: size_t sourceBpp = source->getBytesPerPixel(); size_t targetBpp = target->getBytesPerPixel(); - const uint8_t *sourceData = source->getUInt8Data() + const uint8_t *sourceData = source->getUInt8Data() + (sourceOffset.x + sourceOffset.y * source->getWidth()) * sourceBpp; - uint8_t *targetData = target->getUInt8Data() + uint8_t *targetData = target->getUInt8Data() + (targetOffset.x + targetOffset.y * target->getWidth()) * targetBpp; if (size.x == m_cropSize.x) { @@ -310,7 +310,7 @@ public: m_pixelFormat, m_componentFormat); if (m_banner && m_cropSize.x > bannerWidth+5 && m_cropSize.y > bannerHeight + 5) { - int xoffs = m_cropSize.x - bannerWidth - 5, + int xoffs = m_cropSize.x - bannerWidth - 5, yoffs = m_cropSize.y - bannerHeight - 5; for (int y=0; ywrite(m_fileFormat, stream); } - + bool destinationExists(const fs::path &baseName) const { fs::path filename = baseName; std::string extension = (m_fileFormat == Bitmap::EOpenEXR) ? ".exr" : ".rgbe"; diff --git a/src/films/ldrfilm.cpp b/src/films/ldrfilm.cpp index 5c746931..b26f2ca1 100644 --- a/src/films/ldrfilm.cpp +++ b/src/films/ldrfilm.cpp @@ -33,7 +33,7 @@ MTS_NAMESPACE_BEGIN * \default{768, 576} * } * \parameter{fileFormat}{\Integer}{ - * The desired output file format: + * The desired output file format: * \code{png} or \code{jpeg}. \default{\code{png}} * } * \parameter{pixelFormat}{\String}{Specifies the pixel format @@ -42,12 +42,12 @@ MTS_NAMESPACE_BEGIN * and \code{rgb} or \code{luminance} for JPEG output. * } * \parameter{tonemapMethod}{\String}{ - * Method used to tonemap recorded radiance values + * Method used to tonemap recorded radiance values * \vspace{-2mm} * \begin{enumerate}[(i)] * \item \code{gamma}: Exposure and gamma correction (default) * \vspace{-1mm} - * \item \code{reinhard}: Apply the the + * \item \code{reinhard}: Apply the the * tonemapping technique by Reinhard et al. \cite{Reinhard2002Photographic} * followd by gamma correction. * \vspace{-4mm} @@ -64,15 +64,15 @@ MTS_NAMESPACE_BEGIN * \default{0, i.e. do not change the exposure} * } * \parameter{key}{\Float}{ - * When \code{reinhard} tonemapping is active, this parameter in $(0,1]$ specifies - * whether a low-key or high-key image is desired. + * When \code{reinhard} tonemapping is active, this parameter in $(0,1]$ specifies + * whether a low-key or high-key image is desired. * \default{0.18, corresponding to a middle-grey} * } * \parameter{burn}{\Float}{ * When \code{reinhard} tonemapping is active, this parameter in $[0,1]$ specifies how much * highlights can burn out. \default{0, i.e. map all luminance values into the displayable range} * } - * \parameter{banner}{\Boolean}{Include a banner in the + * \parameter{banner}{\Boolean}{Include a banner in the * output image?\default{\code{true}} * } * \parameter{cropOffsetX, cropOffsetY, cropWidth, cropHeight}{\Integer}{ @@ -81,33 +81,33 @@ MTS_NAMESPACE_BEGIN * regions. \default{Unused} * } * \parameter{highQualityEdges}{\Boolean}{ - * If set to \code{true}, regions slightly outside of the film - * plane will also be sampled. This may improve image + * If set to \code{true}, regions slightly outside of the film + * plane will also be sampled. This may improve image * quality at the edges, but is not needed in general. * \default{\code{false}} * } * \parameter{\Unnamed}{\RFilter}{Reconstruction filter that should * be used by the film. \default{\code{gaussian}, a windowed Gaussian filter}} * } - * This plugin implements a low dynamic range film that can write out 8-bit PNG - * and JPEG images. It also provides basic tonemapping techniques to map recorded + * This plugin implements a low dynamic range film that can write out 8-bit PNG + * and JPEG images. It also provides basic tonemapping techniques to map recorded * radiance values into a reasonable displayable range. * * This film is a good choice when low dynamic range output is desired * and the rendering setup can be configured to capture the relevant portion - * of the dynamic range reliably enough so that the original HDR data can safely + * of the dynamic range reliably enough so that the original HDR data can safely * be discarded. When this is not the case, it may be easier to use \pluginref{hdrfilm} * along with the batch tonemapper (\secref{tonemapper}). * - * By default, the plugin assumes that no special tonemapping needs to be done and simply - * applies an exposure multiplier and sRGB gamma curve to the recorded radiance values - * before converting them to 8 bit. When the dynamic range varies greatly, it may be - * preferable to use the photographic tonemapping technique by Reinhard et al. + * By default, the plugin assumes that no special tonemapping needs to be done and simply + * applies an exposure multiplier and sRGB gamma curve to the recorded radiance values + * before converting them to 8 bit. When the dynamic range varies greatly, it may be + * preferable to use the photographic tonemapping technique by Reinhard et al. * \cite{Reinhard2002Photographic}, which can be activated by setting \code{tonemapMethod=reinhard}. * * Note that the interactive tonemapper that is available in the graphical user interface \code{mtsgui} * interoperates with this plugin. In particular, when saving the scene - * (\emph{File}$\to$\emph{Save}), the currently active tonemapper + * (\emph{File}$\to$\emph{Save}), the currently active tonemapper * settings are automatically exported into the updated scene file. * * The RGB values exported by this plugin correspond to the ITU-R Rec. BT. 709-3 @@ -179,7 +179,7 @@ public: m_storage = new ImageBlock(Bitmap::ESpectrumAlphaWeight, m_cropSize); } - LDRFilm(Stream *stream, InstanceManager *manager) + LDRFilm(Stream *stream, InstanceManager *manager) : Film(stream, manager) { m_hasBanner = stream->readBool(); m_pixelFormat = (Bitmap::EPixelFormat) stream->readUInt(); @@ -217,7 +217,7 @@ public: void addBitmap(const Bitmap *bitmap, Float multiplier) { /* Currently, only accumulating spectrum-valued floating point images - is supported. This function basically just exists to support the + is supported. This function basically just exists to support the somewhat peculiar film updates done by BDPT */ Vector2i size = bitmap->getSize(); @@ -242,7 +242,7 @@ public: } } - bool develop(const Point2i &sourceOffset, const Vector2i &size, + bool develop(const Point2i &sourceOffset, const Vector2i &size, const Point2i &targetOffset, Bitmap *target) const { const Bitmap *source = m_storage->getBitmap(); const FormatConverter *cvt = FormatConverter::getInstance( @@ -252,9 +252,9 @@ public: size_t sourceBpp = source->getBytesPerPixel(); size_t targetBpp = target->getBytesPerPixel(); - const uint8_t *sourceData = source->getUInt8Data() + const uint8_t *sourceData = source->getUInt8Data() + (sourceOffset.x + sourceOffset.y * source->getWidth()) * sourceBpp; - uint8_t *targetData = target->getUInt8Data() + uint8_t *targetData = target->getUInt8Data() + (targetOffset.x + targetOffset.y * target->getWidth()) * targetBpp; if (size.x == m_cropSize.x) { @@ -283,15 +283,15 @@ public: void develop() { Log(EDebug, "Developing film .."); - + ref bitmap = m_storage->getBitmap(); Float multiplier = 1.0f; - + if (m_tonemapMethod == EReinhard) { bitmap = bitmap->convert(m_pixelFormat, Bitmap::EFloat); Float logAvgLuminance = 0, maxLuminance = 0; /* Unused */ - bitmap->tonemapReinhard(logAvgLuminance, maxLuminance, + bitmap->tonemapReinhard(logAvgLuminance, maxLuminance, m_reinhardKey, m_reinhardBurn); Log(EInfo, "Tonemapping finished (log-avg luminance=%f, max luminance=%f)", logAvgLuminance, maxLuminance); @@ -302,7 +302,7 @@ public: bitmap = bitmap->convert(m_pixelFormat, Bitmap::EUInt8, m_gamma, multiplier); if (m_hasBanner && m_cropSize.x > bannerWidth+5 && m_cropSize.y > bannerHeight + 5) { - int xoffs = m_cropSize.x - bannerWidth - 5, + int xoffs = m_cropSize.x - bannerWidth - 5, yoffs = m_cropSize.y - bannerHeight - 5; for (int y=0; ywrite(m_fileFormat, stream); } - + bool destinationExists(const fs::path &baseName) const { fs::path filename = baseName; std::string extension; diff --git a/src/films/mfilm.cpp b/src/films/mfilm.cpp index 5f0a1175..97107f89 100644 --- a/src/films/mfilm.cpp +++ b/src/films/mfilm.cpp @@ -49,18 +49,18 @@ MTS_NAMESPACE_BEGIN * } * \parameter{pixelFormat}{\String}{Specifies the desired pixel format * of the generated image. The options are \code{luminance}, - * \code{luminanceAlpha}, \code{rgb}, \code{rgba}, \code{spectrum}, + * \code{luminanceAlpha}, \code{rgb}, \code{rgba}, \code{spectrum}, * and \code{spectrumAlpha}. In the latter two cases, * the number of written channels depends on the value assigned to * \code{SPECTRUM\_SAMPLES} during compilation (see Section~\ref{sec:compiling} * section for details) \default{\code{rgba}} * } * \parameter{highQualityEdges}{\Boolean}{ - * If set to \code{true}, regions slightly outside of the film - * plane will also be sampled. This may improve the image - * quality at the edges, especially when using very large + * If set to \code{true}, regions slightly outside of the film + * plane will also be sampled. This may improve the image + * quality at the edges, especially when using very large * reconstruction filters. In general (and particularly using the - * default box filter), this is not needed though. + * default box filter), this is not needed though. * \default{\code{false}, i.e. disabled} * } * \parameter{\Unnamed}{\RFilter}{Reconstruction filter that should @@ -70,10 +70,10 @@ MTS_NAMESPACE_BEGIN * \renderings{ * \rendering{Importing and tonemapping an image in Mathematica}{film_mfilm_mathematica.jpg} * } - * - * This plugin provides a camera film that exports spectrum, RGB, XYZ, or + * + * This plugin provides a camera film that exports spectrum, RGB, XYZ, or * luminance values as a matrix to a MATLAB or Mathematica ASCII file. This is - * useful when running Mitsuba as simulation step as part of a + * useful when running Mitsuba as simulation step as part of a * larger virtual experiment. It can also come in handy when * verifying parts of the renderer using an automated test suite. */ @@ -87,7 +87,7 @@ public: MFilm(const Properties &props) : Film(props) { std::string pixelFormat = boost::to_lower_copy( props.getString("pixelFormat", "luminance")); - + std::string fileFormat = boost::to_lower_copy( props.getString("fileFormat", "matlab")); @@ -133,7 +133,7 @@ public: m_storage = new ImageBlock(Bitmap::ESpectrumAlphaWeight, m_cropSize); } - MFilm(Stream *stream, InstanceManager *manager) + MFilm(Stream *stream, InstanceManager *manager) : Film(stream, manager) { m_pixelFormat = (Bitmap::EPixelFormat) stream->readUInt(); m_fileFormat = (EMode) stream->readUInt(); @@ -159,7 +159,7 @@ public: Film::configure(); } - + void clear() { m_storage->clear(); } @@ -174,7 +174,7 @@ public: void addBitmap(const Bitmap *bitmap, Float multiplier) { /* Currently, only accumulating spectrum-valued floating point images - is supported. This function basically just exists to support the + is supported. This function basically just exists to support the somewhat peculiar film updates done by BDPT */ Vector2i size = bitmap->getSize(); @@ -199,7 +199,7 @@ public: } } - bool develop(const Point2i &sourceOffset, const Vector2i &size, + bool develop(const Point2i &sourceOffset, const Vector2i &size, const Point2i &targetOffset, Bitmap *target) const { const Bitmap *source = m_storage->getBitmap(); const FormatConverter *cvt = FormatConverter::getInstance( @@ -209,9 +209,9 @@ public: size_t sourceBpp = source->getBytesPerPixel(); size_t targetBpp = target->getBytesPerPixel(); - const uint8_t *sourceData = source->getUInt8Data() + const uint8_t *sourceData = source->getUInt8Data() + (sourceOffset.x + sourceOffset.y * source->getWidth()) * sourceBpp; - uint8_t *targetData = target->getUInt8Data() + uint8_t *targetData = target->getUInt8Data() + (targetOffset.x + targetOffset.y * target->getWidth()) * targetBpp; if (size.x == m_cropSize.x) { @@ -250,7 +250,7 @@ public: m_pixelFormat, Bitmap::EFloat); Log(EInfo, "Writing image to \"%s\" ..", filename.filename().string().c_str()); - + fs::ofstream os(filename); if (!os.good() || os.fail()) Log(EError, "Output file cannot be created!"); diff --git a/src/films/tiledhdrfilm.cpp b/src/films/tiledhdrfilm.cpp index 1a5ae858..0f15b59e 100644 --- a/src/films/tiledhdrfilm.cpp +++ b/src/films/tiledhdrfilm.cpp @@ -52,10 +52,10 @@ MTS_NAMESPACE_BEGIN * \code{xyza}, \code{spectrum}, and \code{spectrumAlpha}. In the latter two cases, * the number of written channels depends on the value assigned to * \code{SPECTRUM\_SAMPLES} during compilation (see Section~\ref{sec:compiling} - * section for details) + * section for details) * \default{\code{rgba}} * } - * \parameter{componentFormat}{\String}{Specifies the desired floating + * \parameter{componentFormat}{\String}{Specifies the desired floating * point component format used for the output. The options are * \code{float16}, \code{float32}, or \code{uint32} * \default{\code{float16}} @@ -64,30 +64,30 @@ MTS_NAMESPACE_BEGIN * \parameter{\Unnamed}{\RFilter}{Reconstruction filter that should * be used by the film. \default{\code{gaussian}, a windowed Gaussian filter}} * } - * + * * This plugin implements a camera film that stores the captured image * as a \emph{tiled} high dynamic-range OpenEXR file. It is very similar to * \pluginref{hdrfilm}, the main difference being that it does not keep * the rendered image in memory. Instead, image tiles are directly written * to disk as they are being rendered, which enables renderings of extremely * large output images that would otherwise not fit into memory (e.g. - * 100K$\times$100K). + * 100K$\times$100K). * * When the image can fit into memory, usage of this plugin is discouraged: - * due to the extra overhead of tracking image tiles, the rendering process - * will be slower, and the output files also generally do not compress as + * due to the extra overhead of tracking image tiles, the rendering process + * will be slower, and the output files also generally do not compress as * well as those produced by \pluginref{hdrfilm}. * - * Based on the provided parameter values, the film will either write a luminance, - * luminance/alpha, RGB(A), XYZ(A) tristimulus, or spectrum/spectrum-alpha-based - * bitmap having a \code{float16}, \code{float32}, or \code{uint32}-based + * Based on the provided parameter values, the film will either write a luminance, + * luminance/alpha, RGB(A), XYZ(A) tristimulus, or spectrum/spectrum-alpha-based + * bitmap having a \code{float16}, \code{float32}, or \code{uint32}-based * internal representation. The default is RGBA and \code{float16}. * Note that the spectral output options only make sense when using a - * custom compiled Mitsuba distribution that has spectral rendering + * custom compiled Mitsuba distribution that has spectral rendering * enabled. This is not the case for the downloadable release builds. * - * When RGB output is selected, the measured spectral power distributions are - * converted to linear RGB based on the CIE 1931 XYZ color matching curves and + * When RGB output is selected, the measured spectral power distributions are + * converted to linear RGB based on the CIE 1931 XYZ color matching curves and * the ITU-R Rec. BT.709 primaries with a D65 white point. * * \remarks{ @@ -149,7 +149,7 @@ public: "tiled EXR film. Please disable it."); } - TiledHDRFilm(Stream *stream, InstanceManager *manager) + TiledHDRFilm(Stream *stream, InstanceManager *manager) : Film(stream, manager), m_output(NULL), m_frameBuffer(NULL) { m_pixelFormat = (Bitmap::EPixelFormat) stream->readUInt(); m_componentFormat = (Bitmap::EComponentFormat) stream->readUInt(); @@ -217,7 +217,7 @@ public: "float16, float32, or uint32)"); return; } - + Imf::ChannelList &channels = header.channels(); if (pixelFormat == Bitmap::ELuminance || pixelFormat == Bitmap::ELuminanceAlpha) { channels.insert("Y", Imf::Channel(compType)); @@ -256,7 +256,7 @@ public: m_pixelStride = channelCount * compStride; m_rowStride = m_pixelStride * m_blockSize; char *ptr = (char *) m_tile->getUInt8Data(); - + if (pixelFormat == Bitmap::ELuminance || pixelFormat == Bitmap::ELuminanceAlpha) { m_frameBuffer->insert("Y", Imf::Slice(compType, ptr, m_pixelStride, m_rowStride)); ptr += compStride; } else if (pixelFormat == Bitmap::ERGB || pixelFormat == Bitmap::ERGBA || @@ -271,7 +271,7 @@ public: m_frameBuffer->insert(name.c_str(), Imf::Slice(compType, ptr, m_pixelStride, m_rowStride)); ptr += compStride; } } - + if (m_pixelFormat == Bitmap::ERGBA || m_pixelFormat == Bitmap::EXYZA || m_pixelFormat == Bitmap::ELuminanceAlpha) m_frameBuffer->insert("A", Imf::Slice(compType, ptr, m_pixelStride, m_rowStride)); @@ -342,13 +342,13 @@ public: if (x < 0 || y < 0 || x >= m_blocksH || y >= m_blocksV) return; - uint32_t idx = (uint32_t) x + (uint32_t) y * m_blocksH; + uint32_t idx = (uint32_t) x + (uint32_t) y * m_blocksH; std::map::iterator it = m_origBlocks.find(idx); if (it == m_origBlocks.end()) return; ImageBlock *origBlock = it->second; - if (origBlock == NULL) + if (origBlock == NULL) return; /* This could be accelerated using some counters */ @@ -366,7 +366,7 @@ public: } ImageBlock *mergedBlock = m_mergedBlocks[idx]; - if (mergedBlock == NULL) + if (mergedBlock == NULL) return; /* All neighboring blocks are there -- join overlapping regions */ @@ -391,7 +391,7 @@ public: size_t sourceBpp = source->getBytesPerPixel(); size_t targetBpp = m_tile->getBytesPerPixel(); - const uint8_t *sourceData = source->getUInt8Data() + const uint8_t *sourceData = source->getUInt8Data() + mergedBlock->getBorderSize() * sourceBpp * (1 + source->getWidth()); uint8_t *targetData = m_tile->getUInt8Data(); @@ -412,14 +412,14 @@ public: size_t ptrOffset = mergedBlock->getOffset().x * m_pixelStride + mergedBlock->getOffset().y * m_rowStride; - for (Imf::FrameBuffer::Iterator it = m_frameBuffer->begin(); + for (Imf::FrameBuffer::Iterator it = m_frameBuffer->begin(); it != m_frameBuffer->end(); ++it) it.slice().base -= ptrOffset; m_output->setFrameBuffer(*m_frameBuffer); m_output->writeTile(x, y); - for (Imf::FrameBuffer::Iterator it = m_frameBuffer->begin(); + for (Imf::FrameBuffer::Iterator it = m_frameBuffer->begin(); it != m_frameBuffer->end(); ++it) it.slice().base += ptrOffset; @@ -430,7 +430,7 @@ public: m_mergedBlocks[idx] = NULL; } - bool develop(const Point2i &sourceOffset, const Vector2i &size, + bool develop(const Point2i &sourceOffset, const Vector2i &size, const Point2i &targetOffset, Bitmap *target) const { target->fill(targetOffset, size, Spectrum(0.0f)); return false; /* Not supported by the tiled EXR film! */ @@ -446,19 +446,19 @@ public: m_frameBuffer = NULL; m_tile = NULL; - for (std::vector::iterator it = m_freeBlocks.begin(); - it != m_freeBlocks.end(); ++it) + for (std::vector::iterator it = m_freeBlocks.begin(); + it != m_freeBlocks.end(); ++it) (*it)->decRef(); m_freeBlocks.clear(); - for (std::map::iterator it = m_origBlocks.begin(); + for (std::map::iterator it = m_origBlocks.begin(); it != m_origBlocks.end(); ++it) { if ((*it).second) (*it).second->decRef(); } m_origBlocks.clear(); - - for (std::map::iterator it = m_mergedBlocks.begin(); + + for (std::map::iterator it = m_mergedBlocks.begin(); it != m_mergedBlocks.end(); ++it) { if ((*it).second) (*it).second->decRef(); diff --git a/src/integrators/bdpt/bdpt.cpp b/src/integrators/bdpt/bdpt.cpp index b79dcce1..cfcddce6 100644 --- a/src/integrators/bdpt/bdpt.cpp +++ b/src/integrators/bdpt/bdpt.cpp @@ -28,13 +28,13 @@ MTS_NAMESPACE_BEGIN * \parameter{maxDepth}{\Integer}{Specifies the longest path depth * in the generated output image (where \code{-1} corresponds to $\infty$). * A value of \code{1} will only render directly visible light sources. - * \code{2} will lead to single-bounce (direct-only) illumination, + * \code{2} will lead to single-bounce (direct-only) illumination, * and so on. \default{\code{-1}} * } * \parameter{lightImage}{\Boolean}{Include sampling strategies that connect * paths traced from emitters directly to the camera? (i.e. what \pluginref{ptracer} does) * This improves the effectiveness of bidirectional path tracing - * but severely increases the local and remote communication + * but severely increases the local and remote communication * overhead, since large \emph{light images} must be transferred between threads * or over the network. See the text below for a more detailed explanation. * \default{include these strategies, i.e. \code{true}} @@ -42,12 +42,12 @@ MTS_NAMESPACE_BEGIN * \parameter{sampleDirect}{\Boolean}{Enable direct sampling strategies? This is a generalization * of direct illumination sampling that works with both emitters and sensors. Usually a good idea. * \default{use direct sampling, i.e. \code{true}}} - * \parameter{rrDepth}{\Integer}{Specifies the minimum path depth, after - * which the implementation will start to use the ``russian roulette'' + * \parameter{rrDepth}{\Integer}{Specifies the minimum path depth, after + * which the implementation will start to use the ``russian roulette'' * path termination criterion. \default{\code{5}} * } * } - * + * ** \renderings{ * \rendering{Path tracer, 32 samples/pixel}{integrator_bdpt_path} * \rendering{Bidirectional path tracer, 32 samples/pixel}{integrator_bdpt_bdpt} @@ -69,7 +69,7 @@ MTS_NAMESPACE_BEGIN * recording of particles that hit the sensor.}\vspace{-3mm} * } * \renderings{ - * \unframedbigrendering{The individual sampling strategies that comprise BDPT, but + * \unframedbigrendering{The individual sampling strategies that comprise BDPT, but * \emph{without} multiple importance sampling. $s$ denotes the number of steps * taken from the emitters, and $t$ denotes the number of steps from the sensor. * Note how almost every strategy has deficiencies of some kind} {integrator_bdpt_unweighted.pdf} @@ -82,9 +82,9 @@ MTS_NAMESPACE_BEGIN * importance sampling, as proposed by Veach and Guibas \cite{Veach1994Bidirectional}. * * A bidirectional path tracer computes radiance estimates by starting two separate - * random walks from an emitter and a sensor. The resulting \emph{subpaths} are + * random walks from an emitter and a sensor. The resulting \emph{subpaths} are * connected at every possible interaction vertex, creating a large number of complete paths - * of different lengths. These paths are then used to estimate the amount of + * of different lengths. These paths are then used to estimate the amount of * radiance that is transferred from the emitter to a pixel on the sensor. * * Generally, some of the created paths will be undesirable, since they lead to @@ -93,9 +93,9 @@ MTS_NAMESPACE_BEGIN * paths based on their predicted utility. * * The bidirectional path tracer in Mitsuba is a complete implementation of the - * technique that handles all sampling strategies, including those that involve - * direct interactions with the sensor. For this purpose, finite-aperture sensors - * are explicitly represented by surfaces in the scene so that they can be + * technique that handles all sampling strategies, including those that involve + * direct interactions with the sensor. For this purpose, finite-aperture sensors + * are explicitly represented by surfaces in the scene so that they can be * intersected by random walks started at emitters. * * Bidirectional path tracing is a relatively ``heavy'' rendering technique---for @@ -105,19 +105,19 @@ MTS_NAMESPACE_BEGIN * * The code parallelizes over multiple cores and machines, but with one caveat: * some of the BDPT path sampling strategies are incompatble with the usual - * approach of rendering an image tile by tile, since they can potentially + * approach of rendering an image tile by tile, since they can potentially * contribute to \emph{any} pixel on the screen. This means that each * rendering work unit must be associated with a full-sized image! * When network render nodes are involved or the resolution of this \emph{light image} - * is very high, a bottleneck can arise where more work is spent accumulating or + * is very high, a bottleneck can arise where more work is spent accumulating or * transmitting these images than actual rendering. * * There are two possible resorts should this situation arise: the first one - * is to reduce the number of work units so that there is approximately one - * unit per core (and hence one image to transmit per core). This can be done by - * increasing the block size in the GUI preferences or passing the \code{-b} - * parameter to the \code{mitsuba} executable. The second option is to simply - * disable these sampling strategies at the cost of reducing the + * is to reduce the number of work units so that there is approximately one + * unit per core (and hence one image to transmit per core). This can be done by + * increasing the block size in the GUI preferences or passing the \code{-b} + * parameter to the \code{mitsuba} executable. The second option is to simply + * disable these sampling strategies at the cost of reducing the * effectiveness of bidirectional path tracing (particularly, when rendering * caustics). For this, set \code{lightImage} to \code{false}. * When rendering an image of a reasonable resolution without network nodes, @@ -126,7 +126,7 @@ MTS_NAMESPACE_BEGIN * \remarks{ * \item This integrator does not work with dipole-style subsurface * scattering models. - * \item This integrator does not yet work with certain non-reciprocal BSDFs (i.e. + * \item This integrator does not yet work with certain non-reciprocal BSDFs (i.e. * \pluginref{bump}, but this will be addressed in the future * } */ @@ -142,7 +142,7 @@ public: #if BDPT_DEBUG == 1 if (m_config.maxDepth == -1 || m_config.maxDepth > 6) { - /* Limit the maximum depth when rendering image + /* Limit the maximum depth when rendering image matrices in BDPT debug mode (the number of these images grows quadratically with depth) */ Log(EWarn, "Limiting max. path depth to 6 to avoid an " @@ -169,7 +169,7 @@ public: m_config.serialize(stream); } - bool preprocess(const Scene *scene, RenderQueue *queue, + bool preprocess(const Scene *scene, RenderQueue *queue, const RenderJob *job, int sceneResID, int sensorResID, int samplerResID) { Integrator::preprocess(scene, queue, job, sceneResID, @@ -186,7 +186,7 @@ public: Scheduler::getInstance()->cancel(m_process); } - void configureSampler(const Scene *scene, Sampler *sampler) { + void configureSampler(const Scene *scene, Sampler *sampler) { /* Prepare the sampler for tile-based rendering */ sampler->setFilmResolution(scene->getFilm()->getCropSize(), true); } @@ -205,7 +205,7 @@ public: Log(EInfo, "Starting render job (%ix%i, " SIZE_T_FMT " samples, " SIZE_T_FMT " %s, " SSE_STR ") ..", film->getCropSize().x, film->getCropSize().y, sampleCount, nCores, nCores == 1 ? "core" : "cores"); - + m_config.blockSize = scene->getBlockSize(); m_config.cropSize = film->getCropSize(); m_config.sampleCount = sampleCount; diff --git a/src/integrators/bdpt/bdpt.h b/src/integrators/bdpt/bdpt.h index 7d46340a..29d90723 100644 --- a/src/integrators/bdpt/bdpt.h +++ b/src/integrators/bdpt/bdpt.h @@ -24,7 +24,7 @@ /** * When the following is set to "1", the Bidirectional Path Tracer * will generate a series of debugging images that split up the final - * rendering into the weighted contributions of the individual sampling + * rendering into the weighted contributions of the individual sampling * strategies. */ //#define BDPT_DEBUG 1 @@ -75,7 +75,7 @@ struct BDPTConfiguration { void dump() const { SLog(EDebug, "Bidirectional path tracer configuration:"); SLog(EDebug, " Maximum path depth : %i", maxDepth); - SLog(EDebug, " Image size : %ix%i", + SLog(EDebug, " Image size : %ix%i", cropSize.x, cropSize.y); SLog(EDebug, " Direct sampling strategies : %s", sampleDirect ? "yes" : "no"); diff --git a/src/integrators/bdpt/bdpt_proc.cpp b/src/integrators/bdpt/bdpt_proc.cpp index b17c9822..0ef85c64 100644 --- a/src/integrators/bdpt/bdpt_proc.cpp +++ b/src/integrators/bdpt/bdpt_proc.cpp @@ -83,15 +83,15 @@ public: /* Determine the necessary random walk depths based on properties of the endpoints */ - int emitterDepth = m_config.maxDepth, + int emitterDepth = m_config.maxDepth, sensorDepth = m_config.maxDepth; /* Go one extra step if the sensor can be intersected */ - if (!m_scene->hasDegenerateSensor() && emitterDepth != -1) + if (!m_scene->hasDegenerateSensor() && emitterDepth != -1) ++emitterDepth; /* Go one extra step if there are emitters that can be intersected */ - if (!m_scene->hasDegenerateEmitters() && sensorDepth != -1) + if (!m_scene->hasDegenerateEmitters() && sensorDepth != -1) ++sensorDepth; for (size_t i=0; igenerate(offset); for (size_t j = 0; jgetSampleCount(); j++) { - if (stop) + if (stop) break; if (needsTimeSample) @@ -110,8 +110,8 @@ public: sensorSubpath.initialize(m_scene, time, ERadiance, m_pool); /* Perform a random walk using alternating steps on each path */ - Path::alternatingRandomWalkFromPixel(m_scene, m_sampler, - emitterSubpath, emitterDepth, sensorSubpath, + Path::alternatingRandomWalkFromPixel(m_scene, m_sampler, + emitterSubpath, emitterDepth, sensorSubpath, sensorDepth, offset, m_config.rrDepth, m_pool); evaluate(result, emitterSubpath, sensorSubpath); @@ -147,7 +147,7 @@ public: for (size_t i=1; iweight[EImportance] * - emitterSubpath.vertex(i-1)->rrWeight * + emitterSubpath.vertex(i-1)->rrWeight * emitterSubpath.edge(i-1)->weight[EImportance]; for (size_t i=1; i= 0; --s) { /* Determine the range of sensor vertices to be traversed, while respecting the specified maximum path length */ - int minT = std::max(2-s, m_config.lightImage ? 0 : 2), + int minT = std::max(2-s, m_config.lightImage ? 0 : 2), maxT = (int) sensorSubpath.vertexCount() - 1; if (m_config.maxDepth != -1) maxT = std::min(maxT, m_config.maxDepth + 1 - s); for (int t = maxT; t >= minT; --t) { - PathVertex + PathVertex *vsPred = emitterSubpath.vertexOrNull(s-1), *vtPred = sensorSubpath.vertexOrNull(t-1), *vs = emitterSubpath.vertex(s), *vt = sensorSubpath.vertex(t); - PathEdge + PathEdge *vsEdge = emitterSubpath.edgeOrNull(s-1), *vtEdge = sensorSubpath.edgeOrNull(t-1); @@ -190,7 +190,7 @@ public: /* Will receive the path weight of the (s, t)-connection */ Spectrum value; - /* Account for the terms of the measurement contribution + /* Account for the terms of the measurement contribution function that are coupled to the connection endpoints */ if (vs->isEmitterSupernode()) { /* If possible, convert 'vt' into an emitter sample */ @@ -218,7 +218,7 @@ public: if (vt->isDegenerate()) continue; /* Generate a position on an emitter using direct sampling */ - value = radianceWeights[t] * vt->sampleDirect(scene, m_sampler, + value = radianceWeights[t] * vt->sampleDirect(scene, m_sampler, &tempEndpoint, &tempEdge, &tempSample, EImportance); if (value.isZero()) continue; @@ -229,7 +229,7 @@ public: if (vs->isDegenerate()) continue; /* Generate a position on the sensor using direct sampling */ - value = importanceWeights[s] * vs->sampleDirect(scene, m_sampler, + value = importanceWeights[s] * vs->sampleDirect(scene, m_sampler, &tempEndpoint, &tempEdge, &tempSample, ERadiance); if (value.isZero()) continue; @@ -257,10 +257,10 @@ public: the creation of additional vertices (index-matched boundaries etc.) */ int interactions = remaining; // backup if (value.isZero() || !connectionEdge.pathConnectAndCollapse( - scene, vsEdge, vs, vt, vtEdge, interactions)) + scene, vsEdge, vs, vt, vtEdge, interactions)) continue; - /* Account for the terms of the measurement contribution + /* Account for the terms of the measurement contribution function that are coupled to the connection edge */ if (!sampleDirect) value *= connectionEdge.evalCached(vs, vt, PathEdge::EGeneralizedGeometricTerm); @@ -285,7 +285,7 @@ public: if (sampleDirect) { /* Now undo the previous change */ if (t == 1) - sensorSubpath.swapEndpoints(vtPred, vtEdge, vt); + sensorSubpath.swapEndpoints(vtPred, vtEdge, vt); else emitterSubpath.swapEndpoints(vsPred, vsEdge, vs); } @@ -295,11 +295,11 @@ public: continue; #if BDPT_DEBUG == 1 - /* When the debug mode is on, collect samples - separately for each sampling strategy. Note: the - following piece of code artificially increases the + /* When the debug mode is on, collect samples + separately for each sampling strategy. Note: the + following piece of code artificially increases the exposure of longer paths */ - Spectrum splatValue = value * (m_config.showWeighted + Spectrum splatValue = value * (m_config.showWeighted ? miWeight : 1.0f);// * std::pow(2.0f, s+t-3.0f)); wr->putDebugSample(s, t, samplePos, splatValue); #endif @@ -365,7 +365,7 @@ void BDPTProcess::processResult(const WorkResult *wr, bool cancelled) { const ImageBlock *lightImage = m_result->getLightImage(); m_result->put(result); if (m_parent->isInteractive()) { - /* Modify the finished image block so that it includes the light image contributions, + /* Modify the finished image block so that it includes the light image contributions, which creates a more intuitive preview of the rendering process. This is not 100% correct but doesn't matter, as the shown image will be properly re-developed every 2 seconds and once more when the rendering process finishes */ @@ -378,7 +378,7 @@ void BDPTProcess::processResult(const WorkResult *wr, bool cancelled) { Vector2i size = block->getSize(); for (int y=0; ygetFloatData() + const Float *source = sourceBitmap->getFloatData() + (offset.x + (y+offset.y) * sourceBitmap->getWidth()) * SPECTRUM_SAMPLES; Float *dest = destBitmap->getFloatData() + (borderSize + (y + borderSize) * destBitmap->getWidth()) * (SPECTRUM_SAMPLES + 2); @@ -395,10 +395,10 @@ void BDPTProcess::processResult(const WorkResult *wr, bool cancelled) { m_film->put(block); - /* Re-develop the entire image every two seconds if partial results are - visible (e.g. in a graphical user interface). This only applies when + /* Re-develop the entire image every two seconds if partial results are + visible (e.g. in a graphical user interface). This only applies when there is a light image. */ - bool developFilm = m_config.lightImage && + bool developFilm = m_config.lightImage && (m_parent->isInteractive() && m_refreshTimer->getMilliseconds() > 2000); m_queue->signalWorkEnd(m_parent, result->getImageBlock()); diff --git a/src/integrators/bdpt/bdpt_wr.cpp b/src/integrators/bdpt/bdpt_wr.cpp index e861ce19..60899535 100644 --- a/src/integrators/bdpt/bdpt_wr.cpp +++ b/src/integrators/bdpt/bdpt_wr.cpp @@ -26,7 +26,7 @@ MTS_NAMESPACE_BEGIN /* Work result */ /* ==================================================================== */ -BDPTWorkResult::BDPTWorkResult(const BDPTConfiguration &conf, +BDPTWorkResult::BDPTWorkResult(const BDPTConfiguration &conf, const ReconstructionFilter *rfilter, Vector2i blockSize) { /* Stores the 'camera image' -- this can be blocked when spreading out work to multiple workers */ @@ -38,7 +38,7 @@ BDPTWorkResult::BDPTWorkResult(const BDPTConfiguration &conf, m_block->setSize(blockSize); if (conf.lightImage) { - /* Stores the 'light image' -- every worker requires a + /* Stores the 'light image' -- every worker requires a full-resolution version, since contributions of s==0 and s==1 paths can affect any pixel of this bitmap */ m_lightImage = new ImageBlock(Bitmap::ESpectrum, @@ -88,7 +88,7 @@ void BDPTWorkResult::clear() { #if BDPT_DEBUG == 1 /* In debug mode, this function allows to dump the contributions of the individual sampling strategies to a series of images */ -void BDPTWorkResult::dump(const BDPTConfiguration &conf, +void BDPTWorkResult::dump(const BDPTConfiguration &conf, const fs::path &prefix, const fs::path &stem) const { Float weight = (Float) 1.0f / (Float) conf.sampleCount; for (int k = 1; k<=conf.maxDepth; ++k) { @@ -96,9 +96,9 @@ void BDPTWorkResult::dump(const BDPTConfiguration &conf, size_t s = k+1-t; Bitmap *bitmap = const_cast(m_debugBlocks[strategyIndex(s, t)]->getBitmap()); ref ldrBitmap = bitmap->convert(Bitmap::ERGB, Bitmap::EUInt8, -1, weight); - fs::path filename = + fs::path filename = prefix / fs::path(formatString("%s_k%02i_s%02i_t%02i.png", stem.filename().string().c_str(), k, s, t)); - ref targetFile = new FileStream(filename, + ref targetFile = new FileStream(filename, FileStream::ETruncReadWrite); ldrBitmap->write(Bitmap::EPNG, targetFile, 1); } diff --git a/src/integrators/bdpt/bdpt_wr.h b/src/integrators/bdpt/bdpt_wr.h index 25921a40..93fb4b97 100644 --- a/src/integrators/bdpt/bdpt_wr.h +++ b/src/integrators/bdpt/bdpt_wr.h @@ -30,8 +30,8 @@ MTS_NAMESPACE_BEGIN /* ==================================================================== */ /** - Bidirectional path tracing needs its own WorkResult implementation, - since each rendering thread simultaneously renders to a small 'camera + Bidirectional path tracing needs its own WorkResult implementation, + since each rendering thread simultaneously renders to a small 'camera image' block and potentially a full-resolution 'light image'. */ class BDPTWorkResult : public WorkResult { @@ -54,10 +54,10 @@ public: #if BDPT_DEBUG == 1 /* In debug mode, this function allows to dump the contributions of the individual sampling strategies to a series of images */ - void dump(const BDPTConfiguration &conf, + void dump(const BDPTConfiguration &conf, const fs::path &prefix, const fs::path &stem) const; - inline void putDebugSample(int s, int t, const Point2 &sample, + inline void putDebugSample(int s, int t, const Point2 &sample, const Spectrum &spec) { m_debugBlocks[strategyIndex(s, t)]->put(sample, (const Float *) &spec); } @@ -74,7 +74,7 @@ public: inline const ImageBlock *getImageBlock() const { return m_block.get(); } - + inline const ImageBlock *getLightImage() const { return m_lightImage.get(); } @@ -82,7 +82,7 @@ public: inline void setSize(const Vector2i &size) { m_block->setSize(size); } - + inline void setOffset(const Point2i &offset) { m_block->setOffset(offset); } diff --git a/src/integrators/direct/ao.cpp b/src/integrators/direct/ao.cpp index 3c64c5e7..7bd71cbf 100644 --- a/src/integrators/direct/ao.cpp +++ b/src/integrators/direct/ao.cpp @@ -28,10 +28,10 @@ MTS_NAMESPACE_BEGIN * \default{1}} * * \parameter{rayLength}{\Float}{Specifies the world-space length of the - * ambient occlusion rays that will be cast. \default{\code{-1}, i.e. automatic}}. + * ambient occlusion rays that will be cast. \default{\code{-1}, i.e. automatic}}. * } * \renderings{ - * \rendering{A view of the scene on page \pageref{fig:rungholt}, rendered using + * \rendering{A view of the scene on page \pageref{fig:rungholt}, rendered using * the Ambient Occlusion integrator}{integrator_ao} * \rendering{A corresponding rendering created using the standard \pluginref{path} tracer}{integrator_ao_path} * } @@ -69,8 +69,8 @@ public: sampler->request2DArray(m_shadingSamples); } - bool preprocess(const Scene *scene, RenderQueue *queue, - const RenderJob *job, int sceneResID, int sensorResID, + bool preprocess(const Scene *scene, RenderQueue *queue, + const RenderJob *job, int sceneResID, int sensorResID, int samplerResID) { Integrator::preprocess(scene, queue, job, sceneResID, sensorResID, samplerResID); @@ -86,15 +86,15 @@ public: Spectrum Li(0.0f); Point2 sample; - /* Perform the first ray intersection (or ignore if the + /* Perform the first ray intersection (or ignore if the intersection has already been provided). */ if (!rRec.rayIntersect(ray)) { - /* If no intersection could be found, possibly return + /* If no intersection could be found, possibly return radiance from a background emitter */ return Spectrum(1.0f); } - /* Figure out how many shading samples to take, and where the + /* Figure out how many shading samples to take, and where the required random numbers should come from */ Point2 *sampleArray = &sample; size_t numShadingSamples = m_shadingSamples; diff --git a/src/integrators/direct/direct.cpp b/src/integrators/direct/direct.cpp index 3e846404..0d77f61e 100644 --- a/src/integrators/direct/direct.cpp +++ b/src/integrators/direct/direct.cpp @@ -23,8 +23,8 @@ MTS_NAMESPACE_BEGIN /*! \plugin{direct}{Direct illumination integrator} * \order{1} * \parameters{ - * \parameter{shadingSamples}{\Integer}{This convenience parameter can be - * used to set both \code{emitterSamples} and \code{bsdfSamples} at + * \parameter{shadingSamples}{\Integer}{This convenience parameter can be + * used to set both \code{emitterSamples} and \code{bsdfSamples} at * the same time.} * \parameter{emitterSamples}{\Integer}{Optional more fine-grained * parameter: specifies the number of samples that should be generated @@ -46,30 +46,30 @@ MTS_NAMESPACE_BEGIN * \caption{ * \label{fig:integrator-direct} * This plugin implements two different strategies for computing the - * direct illumination on surfaces. Both of them are dynamically + * direct illumination on surfaces. Both of them are dynamically * combined then obtain a robust rendering algorithm. * } * } * * This integrator implements a direct illumination technique that makes use - * of \emph{multiple importance sampling}: for each pixel sample, the + * of \emph{multiple importance sampling}: for each pixel sample, the * integrator generates a user-specifiable number of BSDF and emitter * samples and combines them using the power heuristic. Usually, the BSDF - * sampling technique works very well on glossy objects but does badly + * sampling technique works very well on glossy objects but does badly * everywhere else (\subfigref{integrator-direct}{a}), while the opposite - * is true for the emitter sampling technique + * is true for the emitter sampling technique * (\subfigref{integrator-direct}{b}). By combining these approaches, one * can obtain a rendering technique that works well in both cases * (\subfigref{integrator-direct}{c}). * - * The number of samples spent on either technique is configurable, hence - * it is also possible to turn this plugin into an emitter sampling-only + * The number of samples spent on either technique is configurable, hence + * it is also possible to turn this plugin into an emitter sampling-only * or BSDF sampling-only integrator. * * For best results, combine the direct illumination integrator with the * low-discrepancy sample generator (\code{ldsampler}). Generally, the number - * of pixel samples of the sample generator can be kept relatively - * low (e.g. \code{sampleCount=4}), whereas the \code{shadingSamples} + * of pixel samples of the sample generator can be kept relatively + * low (e.g. \code{sampleCount=4}), whereas the \code{shadingSamples} * parameter of this integrator should be increased until the variance in * the output renderings is acceptable. * @@ -137,10 +137,10 @@ public: Spectrum Li(0.0f); Point2 sample; - /* Perform the first ray intersection (or ignore if the + /* Perform the first ray intersection (or ignore if the intersection has already been provided). */ if (!rRec.rayIntersect(ray)) { - /* If no intersection could be found, possibly return + /* If no intersection could be found, possibly return radiance from a background emitter */ if (rRec.type & RadianceQueryRecord::EEmittedRadiance) return scene->evalEnvironment(ray); @@ -162,7 +162,7 @@ public: || (m_strictNormals && dot(ray.d, its.geoFrame.n) * Frame::cosTheta(its.wi) >= 0)) { /* Only render the direct illumination component if - * + * * 1. It was requested * 2. The surface has an associated BSDF (i.e. it isn't an index- * matched medium transition -- this is not supported by 'direct') @@ -198,7 +198,7 @@ public: } else { sample = rRec.nextSample2D(); sampleArray = &sample; } - + DirectSamplingRecord dRec(its); if (bsdf->getType() & BSDF::ESmooth) { /* Only use direct illumination sampling when the surface's @@ -208,7 +208,7 @@ public: Spectrum value = scene->sampleEmitterDirect(dRec, sampleArray[i]); if (!value.isZero()) { const Emitter *emitter = static_cast(dRec.object); - + /* Allocate a record for querying the BSDF */ BSDFSamplingRecord bRec(its, its.toLocal(dRec.d)); @@ -221,7 +221,7 @@ public: Float bsdfPdf = emitter->isOnSurface() ? bsdf->pdf(bRec) : 0; /* Weight using the power heuristic */ - const Float weight = miWeight(dRec.pdf * fracLum, + const Float weight = miWeight(dRec.pdf * fracLum, bsdfPdf * fracBSDF) * weightLum; Li += value * bsdfVal * weight; @@ -270,7 +270,7 @@ public: } else { /* Intersected nothing -- perhaps there is an environment map? */ const Emitter *env = scene->getEnvironmentEmitter(); - + if (!env) continue; @@ -279,13 +279,13 @@ public: continue; } - /* Compute the prob. of generating that direction using the + /* Compute the prob. of generating that direction using the implemented direct illumination sampling technique */ - const Float lumPdf = (!(bRec.sampledType & BSDF::EDelta)) ? + const Float lumPdf = (!(bRec.sampledType & BSDF::EDelta)) ? scene->pdfEmitterDirect(dRec) : 0; - + /* Weight using the power heuristic */ - const Float weight = miWeight(bsdfPdf * fracBSDF, + const Float weight = miWeight(bsdfPdf * fracBSDF, lumPdf * fracLum) * weightBSDF; Li += value * bsdfVal * weight; diff --git a/src/integrators/erpt/erpt.cpp b/src/integrators/erpt/erpt.cpp index 84f5d580..6fb9d336 100644 --- a/src/integrators/erpt/erpt.cpp +++ b/src/integrators/erpt/erpt.cpp @@ -30,7 +30,7 @@ MTS_NAMESPACE_BEGIN * \parameter{maxDepth}{\Integer}{Specifies the longest path depth * in the generated output image (where \code{-1} corresponds to $\infty$). * A value of \code{1} will only render directly visible light sources. - * \code{2} will lead to single-bounce (direct-only) illumination, + * \code{2} will lead to single-bounce (direct-only) illumination, * and so on. \default{\code{-1}} * } * \parameter{numChains}{\Float}{ @@ -55,10 +55,10 @@ MTS_NAMESPACE_BEGIN * } * \parameter{[lens,multiChain,\!\!\!\!\newline caustic,manifold]\showbreak * \newline Perturbation}{\Boolean}{ - * These parameters can be used to pick the individual perturbation + * These parameters can be used to pick the individual perturbation * strategies that will be used to explore path space. By default, the original set * by Veach and Guibas is enabled (i.e. everything except the manifold - * perturbation). + * perturbation). * } * \parameter{lambda}{\Float}{ * Jump size of the manifold perturbation \default{\code{50}}} @@ -69,7 +69,7 @@ MTS_NAMESPACE_BEGIN * chandelier on the left}{integrator_mept_tableware} * \vspace{-2mm} * \caption{An interior scene with complex specular and near-specular light paths, - * illuminated entirely through caustics. Rendered by this plugin + * illuminated entirely through caustics. Rendered by this plugin * using the manifold perturbation. This scene was designed by Olesya * Isaenko.\vspace{2mm}} * } @@ -79,7 +79,7 @@ MTS_NAMESPACE_BEGIN * the torus.}{integrator_erpt_seeds} * \medrendering{Result after running the perturbations of Veach and Guibas * for 800 steps. Some convergence issues remain.}{integrator_erpt_mlt} - * \medrendering{Result after running the manifold + * \medrendering{Result after running the manifold * perturbation for the same amount of time}{integrator_erpt_mept} * } * @@ -87,8 +87,8 @@ MTS_NAMESPACE_BEGIN * combines Path Tracing with the perturbation strategies of Metropolis Light Transport. * * - * An initial set of \emph{seed paths} is generated using a standard bidirectional - * path tracer, and for each one, a MLT-style Markov Chain is subsequently started + * An initial set of \emph{seed paths} is generated using a standard bidirectional + * path tracer, and for each one, a MLT-style Markov Chain is subsequently started * and executed for some number of steps. * This has the effect of redistributing the energy of the individual samples * over a larger area, hence the name of this method. @@ -98,9 +98,9 @@ MTS_NAMESPACE_BEGIN * \caption{Another view, now with exterior lighting.} * \vspace{-2mm} * \end{wrapfigure} - * This is often a good choice when a (bidirectional) path tracer produces mostly reasonable + * This is often a good choice when a (bidirectional) path tracer produces mostly reasonable * results except that it finds certain important types of light paths too rarely. - * ERPT can + * ERPT can * then explore all of the neighborhing paths as well, to prevent the * original sample from showing up as a ``bright pixel'' in the output image. * @@ -108,7 +108,7 @@ MTS_NAMESPACE_BEGIN * the same rules for selecting them apply. In contrast to the original * paper by Cline et al., the Mitsuba implementation uses a bidirectional * (rather than an unidirectional) bidirectional path tracer to create seed paths. - * Also, since they add bias to the output, this plugin does not use the image + * Also, since they add bias to the output, this plugin does not use the image * post-processing filters proposed by the authors. * * The mechanism for selecting Markov Chain seed paths deserves an @@ -118,8 +118,8 @@ MTS_NAMESPACE_BEGIN * generator. This should be large enough so that the integrator has a * representative set of light paths to work with. * - * Subsequently, one or more of these candidates are chosen (determined by - * \code{numChains} and \code{maxChains} parameter). For each one, a Markov + * Subsequently, one or more of these candidates are chosen (determined by + * \code{numChains} and \code{maxChains} parameter). For each one, a Markov * Chain is created that has an initial configuration matching the seed path. * It is simulated for \code{chainLength} iterations, and each intermediate * state is recorded in the output image. @@ -142,11 +142,11 @@ public: m_config.separateDirect = m_config.directSamples >= 0; /* Number of samples used to estimate the average contribution of a - single sample. In contrast to MLT/PSSMLT, this parameter just + single sample. In contrast to MLT/PSSMLT, this parameter just influences the heuristics that guide how many Markov Chains to start for a sample. Usually, there is little reason to change it */ m_config.luminanceSamples = props.getInteger("luminanceSamples", 15000); - + /* Selectively enable/disable the bidirectional mutation. This is probably not desireable for ERPT, since the path tracing stage is responsible for generating good seed paths.. */ @@ -161,7 +161,7 @@ public: /* Selectively enable/disable the multi-chain perturbation */ m_config.multiChainPerturbation = props.getBoolean("multiChainPerturbation", true); - /* Selectively enable/disable the manifold perturbation */ + /* Selectively enable/disable the manifold perturbation */ m_config.manifoldPerturbation = props.getBoolean("manifoldPerturbation", false); m_config.probFactor = props.getFloat("probFactor", props.getFloat("lambda", 50)); m_config.avgAngleChangeSurface = props.getFloat("avgAngleChangeSurface", 0); @@ -179,7 +179,7 @@ public: virtual ~EnergyRedistributionPathTracing() { } - void configureSampler(const Scene *scene, Sampler *sampler) { + void configureSampler(const Scene *scene, Sampler *sampler) { /* Prepare the sampler for tile-based rendering */ sampler->setFilmResolution(scene->getFilm()->getCropSize(), true); } @@ -189,7 +189,7 @@ public: m_config.serialize(stream); } - bool preprocess(const Scene *scene, RenderQueue *queue, + bool preprocess(const Scene *scene, RenderQueue *queue, const RenderJob *job, int sceneResID, int sensorResID, int samplerResID) { Integrator::preprocess(scene, queue, job, sceneResID, @@ -218,15 +218,15 @@ public: size_t sampleCount = sampler->getSampleCount(); Log(EInfo, "Starting render job (%ix%i, " SIZE_T_FMT - " %s, " SSE_STR ", " SIZE_T_FMT " samples/pixel) ..", - film->getCropSize().x, film->getCropSize().y, nCores, + " %s, " SSE_STR ", " SIZE_T_FMT " samples/pixel) ..", + film->getCropSize().x, film->getCropSize().y, nCores, nCores == 1 ? "core" : "cores", sampleCount); ref indepSampler = static_cast (PluginManager::getInstance()-> createObject(MTS_CLASS(Sampler), Properties("independent"))); indepSampler->configure(); - ref pathSampler = new PathSampler(PathSampler::EBidirectional, scene, + ref pathSampler = new PathSampler(PathSampler::EBidirectional, scene, indepSampler, indepSampler, indepSampler, m_config.maxDepth, 10, m_config.separateDirect, true, true); @@ -238,7 +238,7 @@ public: ref directImage; if (m_config.separateDirect && m_config.directSamples > 0) { - directImage = BidirectionalUtils::renderDirectComponent(scene, + directImage = BidirectionalUtils::renderDirectComponent(scene, sceneResID, sensorResID, queue, job, m_config.directSamples); if (directImage == NULL) return false; @@ -253,10 +253,10 @@ public: clonedSampler->incRef(); indepSamplers[i] = clonedSampler.get(); } - int indepSamplerResID = sched->registerMultiResource(indepSamplers); + int indepSamplerResID = sched->registerMultiResource(indepSamplers); for (size_t i=0; idecRef(); - + process->bindResource("scene", sceneResID); process->bindResource("sensor", sensorResID); process->bindResource("sampler", samplerResID); diff --git a/src/integrators/erpt/erpt.h b/src/integrators/erpt/erpt.h index eec9fb7e..f447af25 100644 --- a/src/integrators/erpt/erpt.h +++ b/src/integrators/erpt/erpt.h @@ -78,7 +78,7 @@ struct ERPTConfiguration { luminance, luminanceSamples); SLog(EDebug, " Universal perturb. factor : %f", probFactor); SLog(EDebug, " Manifold max iterations : %i", MTS_MANIFOLD_MAX_ITERATIONS); - SLog(EDebug, " Quantiles : %f (surfaces), %f (media)", + SLog(EDebug, " Quantiles : %f (surfaces), %f (media)", MTS_MANIFOLD_QUANTILE_SURFACE, MTS_MANIFOLD_QUANTILE_MEDIUM); } diff --git a/src/integrators/erpt/erpt_proc.cpp b/src/integrators/erpt/erpt_proc.cpp index d2b8ce05..13708297 100644 --- a/src/integrators/erpt/erpt_proc.cpp +++ b/src/integrators/erpt/erpt_proc.cpp @@ -31,9 +31,9 @@ MTS_NAMESPACE_BEGIN -static StatsCounter statsAccepted("Energy redistribution path tracing", +static StatsCounter statsAccepted("Energy redistribution path tracing", "Accepted mutations", EPercentage); -static StatsCounter statsChainsPerPixel("Energy redistribution path tracing", +static StatsCounter statsChainsPerPixel("Energy redistribution path tracing", "Chains started per pixel", EAverage); /* ==================================================================== */ @@ -45,7 +45,7 @@ public: Point2i origOffset; Vector2i origSize; - ERPTWorkResult(const Vector2i &size, const ReconstructionFilter *filter) + ERPTWorkResult(const Vector2i &size, const ReconstructionFilter *filter) : ImageBlock(Bitmap::ESpectrum, size, filter) { } void load(Stream *stream) { @@ -67,15 +67,15 @@ public: class ERPTRenderer : public WorkProcessor { public: - ERPTRenderer(const ERPTConfiguration &conf) + ERPTRenderer(const ERPTConfiguration &conf) : m_config(conf) { } - ERPTRenderer(Stream *stream, InstanceManager *manager) + ERPTRenderer(Stream *stream, InstanceManager *manager) : WorkProcessor(stream, manager) { m_config = ERPTConfiguration(stream); } - + void serialize(Stream *stream, InstanceManager *manager) const { m_config.serialize(stream); } @@ -103,7 +103,7 @@ public: m_scene->wakeup(NULL, m_resources); m_scene->initializeBidirectional(); - m_pathSampler = new PathSampler(PathSampler::EBidirectional, m_scene, + m_pathSampler = new PathSampler(PathSampler::EBidirectional, m_scene, m_sampler, m_sampler, m_sampler, m_config.maxDepth, 10, m_config.separateDirect, true, true); @@ -111,7 +111,7 @@ public: /* Jump sizes recommended by Eric Veach */ Float minJump = 0.1f, coveredArea = 0.05f; - + /* Register all available mutators */ if (m_config.bidirectionalMutation) m_mutators.push_back(new BidirectionalMutator(m_scene, m_indepSampler, @@ -167,7 +167,7 @@ public: if (numChains == 0) return; - Float depositionEnergy = weight / (m_sampler->getSampleCount() + Float depositionEnergy = weight / (m_sampler->getSampleCount() * meanChains * m_config.chainLength); DiscreteDistribution suitabilities(m_mutators.size()); @@ -180,7 +180,7 @@ public: size_t mutations = 0; #if defined(MTS_BD_DEBUG_HEAVY) - if (!path.verify(m_scene, EImportance, oss)) + if (!path.verify(m_scene, EImportance, oss)) Log(EError, "Started ERPT with an invalid path: %s", oss.str().c_str()); #endif @@ -200,7 +200,7 @@ public: int mutatorIdx = -1; bool success = false; Mutator *mutator = NULL; - + if (suitabilities.normalize() == 0) { /* No mutator can handle this path -- give up */ accumulatedWeight += m_config.chainLength - it; @@ -245,7 +245,7 @@ public: #endif accumulatedWeight += 1-a; - + /* Accept with probability 'a' */ if (a == 1 || m_indepSampler->next1D() < a) { Spectrum value = relWeight * (accumulatedWeight * depositionEnergy); @@ -292,14 +292,14 @@ public: m_result = static_cast(workResult); m_result->origOffset = rect->getOffset(); m_result->origSize = rect->getSize(); - + m_hilbertCurve.initialize(TVector2(rect->getSize())); m_result->clear(); - boost::function callback + boost::function callback = boost::bind(&ERPTRenderer::pathCallback, this, _1, _2, _3, _4, &stop); for (size_t i=0; i(manager->getInstance(stream)); m_maxSampleFactor = stream->readInt(); @@ -108,7 +108,7 @@ public: m_subIntegrator->configureSampler(scene, sampler); } - bool preprocess(const Scene *scene, RenderQueue *queue, const RenderJob *job, + bool preprocess(const Scene *scene, RenderQueue *queue, const RenderJob *job, int sceneResID, int sensorResID, int samplerResID) { if (!SamplingIntegrator::preprocess(scene, queue, job, sceneResID, sensorResID, samplerResID)) return false; @@ -160,12 +160,12 @@ public: boost::math::normal dist(0, 1); m_quantile = (Float) boost::math::quantile(dist, 1-m_pValue/2); - Log(EInfo, "Configuring for a %.1f%% confidence interval, quantile=%f, avg. luminance=%f", + Log(EInfo, "Configuring for a %.1f%% confidence interval, quantile=%f, avg. luminance=%f", (1-m_pValue)*100, m_quantile, m_averageLuminance); return true; } - void renderBlock(const Scene *scene, const Sensor *sensor, + void renderBlock(const Scene *scene, const Sensor *sensor, Sampler *sampler, ImageBlock *block, const bool &stop, const std::vector< TPoint2 > &points) const { typedef TSpectrum SpectrumAlphaWeight; @@ -180,7 +180,7 @@ public: RayDifferential eyeRay; RadianceQueryRecord rRec(scene, sampler); - Float diffScaleFactor = 1.0f / + Float diffScaleFactor = 1.0f / std::sqrt((Float) sampler->getSampleCount()); Point2 apertureSample(0.5f); @@ -198,12 +198,12 @@ public: Point2i offset = Point2i(points[i]) + Vector2i(block->getOffset()); sampler->generate(offset); - /* Before starting to place samples within the area of a single pixel, the - following takes a snapshot of all surrounding spectrum+weight+alpha + /* Before starting to place samples within the area of a single pixel, the + following takes a snapshot of all surrounding spectrum+weight+alpha values. Those are then used later to ensure that adjacent pixels will not be disproportionately biased by this pixel's contributions. */ for (int y=0; y<2*borderSize+1; ++y) { - SpectrumAlphaWeight *src = target + ((y+points[i].y) + SpectrumAlphaWeight *src = target + ((y+points[i].y) * block->getBitmap()->getWidth() + points[i].x); SpectrumAlphaWeight *dst = snapshot + y*(2*borderSize+1); memcpy(dst, src, sizeof(SpectrumAlphaWeight) * (2*borderSize+1)); @@ -258,24 +258,24 @@ public: /* Relative error heuristic */ Float base = std::max(mean, m_averageLuminance * 0.01f); - if (m_verbose && (sampleCount % 100) == 0) - Log(EDebug, "%i samples, mean=%f, stddev=%f, std error=%f, ci width=%f, max allowed=%f", sampleCount, mean, + if (m_verbose && (sampleCount % 100) == 0) + Log(EDebug, "%i samples, mean=%f, stddev=%f, std error=%f, ci width=%f, max allowed=%f", sampleCount, mean, std::sqrt(variance), stdError, ciWidth, base * m_maxError); if (ciWidth <= m_maxError * base) break; } } - - /* Ensure that a large amounts of samples in one pixel do not + + /* Ensure that a large amounts of samples in one pixel do not bias neighboring pixels (due to the reconstruction filter) */ Float factor = 1.0f / sampleCount; for (int y=0; y<2*borderSize+1; ++y) { - SpectrumAlphaWeight *dst = target + ((y+points[i].y) + SpectrumAlphaWeight *dst = target + ((y+points[i].y) * block->getBitmap()->getWidth() + points[i].x); SpectrumAlphaWeight *backup = snapshot + y*(2*borderSize+1); - for (int x=0; x<2*borderSize+1; ++x) + for (int x=0; x<2*borderSize+1; ++x) dst[x] = backup[x] * (1-factor) + dst[x] * factor; } } @@ -285,8 +285,8 @@ public: return m_subIntegrator->Li(ray, rRec); } - Spectrum E(const Scene *scene, const Intersection &its, const Medium *medium, - Sampler *sampler, int nSamples, bool includeIndirect) const { + Spectrum E(const Scene *scene, const Intersection &its, const Medium *medium, + Sampler *sampler, int nSamples, bool includeIndirect) const { return m_subIntegrator->E(scene, its, medium, sampler, nSamples, includeIndirect); } @@ -301,7 +301,7 @@ public: stream->writeFloat(m_averageLuminance); stream->writeFloat(m_pValue); } - + void bindUsedResources(ParallelProcess *proc) const { m_subIntegrator->bindUsedResources(proc); } diff --git a/src/integrators/misc/irrcache.cpp b/src/integrators/misc/irrcache.cpp index 2e627f52..492f5fc9 100644 --- a/src/integrators/misc/irrcache.cpp +++ b/src/integrators/misc/irrcache.cpp @@ -26,17 +26,17 @@ MTS_NAMESPACE_BEGIN * \parameters{ * \parameter{resolution}{\Integer}{Elevational resolution of the stratified * final gather hemisphere. The azimuthal resolution is two times this value. \default{14, i.e. $2\cdot14^2$=392 samples in total}} - * \parameter{quality}{\Float}{Quality factor (the $\kappa$ parameter of + * \parameter{quality}{\Float}{Quality factor (the $\kappa$ parameter of * Tabellion et al. \cite{Tabellion2004Approximate})\default{1.0, which is adequate for most cases}} * \parameter{gradients}{\Boolean}{Use irradiance gradients \cite{Ward1992Irradiance}?\default{\code{true}}} * \parameter{clampNeighbor}{\Boolean}{Use neighbor clamping \cite{Krivanek2006Making}?\default{\code{true}}} * \parameter{clampScreen}{\Boolean}{Use a screen-space clamping criterion \cite{Tabellion2004Approximate}? \default{\code{true}}} - * \parameter{overture}{\Boolean}{Do an overture pass before starting the main rendering process? + * \parameter{overture}{\Boolean}{Do an overture pass before starting the main rendering process? * Usually a good idea.\default{\code{true}}} * \parameter{quality\showbreak Adjustment}{\Float}{When an overture pass is used, Mitsuba subsequently reduces * the quality parameter by this amount to interpolate amongst more samples, creating a visually * smoother result. \default{0.5}} - * \parameter{indirectOnly}{\Boolean}{Only show the indirect illumination? This can be useful to check + * \parameter{indirectOnly}{\Boolean}{Only show the indirect illumination? This can be useful to check * the interpolation quality. \default{\code{false}}} * \parameter{debug}{\Boolean}{Visualize the sample placement? \default{\code{false}}} * } @@ -44,10 +44,10 @@ MTS_NAMESPACE_BEGIN * \unframedbigrendering{Illustration of the effect of the different optimizatations * that are provided by this plugin}{integrator_irrcache} * } - * This ``meta-integrator'' implements \emph{irradiance caching} by Ward and Heckbert + * This ``meta-integrator'' implements \emph{irradiance caching} by Ward and Heckbert * \cite{Ward1988Ray}. This method computes and caches irradiance information at a sparse * set of scene locations and efficiently determines approximate values at other - * locations using interpolation. + * locations using interpolation. * * This plugin only provides the caching and interpolation part---another plugin * is still needed to do the actual computation of irradiance values at cache points. @@ -69,14 +69,14 @@ MTS_NAMESPACE_BEGIN * addition of samples as rendering proceeds. * * Note that wrapping an integrator into \pluginref{irrcache} adds one extra - * light bounce. For instance, the method resulting from using \pluginref{direct} + * light bounce. For instance, the method resulting from using \pluginref{direct} * in an irradiance cache renders two-bounce direct illumination. * * The generality of this implementation allows it to be used in conjunction - * with photon mapping (the most likely application) as well as all other + * with photon mapping (the most likely application) as well as all other * sampling-based integrators in Mitsuba. Several optimizations are used to - * improve the achieved interpolation quality, namely irradiance gradients - * \cite{Ward1992Irradiance}, neighbor clamping \cite{Krivanek2006Making}, a screen-space + * improve the achieved interpolation quality, namely irradiance gradients + * \cite{Ward1992Irradiance}, neighbor clamping \cite{Krivanek2006Making}, a screen-space * clamping metric and an improved error function \cite{Tabellion2004Approximate}. */ @@ -84,7 +84,7 @@ class IrradianceCacheIntegrator : public SamplingIntegrator { public: IrradianceCacheIntegrator(const Properties &props) : SamplingIntegrator(props) { /* Elevational resolution of the stratified final gather hemisphere. - The azimuthal resolution is three times this value. Default: + The azimuthal resolution is three times this value. Default: 2*14^2=392 samples */ m_resolution = props.getInteger("resolution", 14); /* If set to true, the irradiance cache will be filled by a @@ -104,15 +104,15 @@ public: /* Should irradiance gradients be used? Generally, this will significantly improve the interpolation quality.*/ m_gradients = props.getBoolean("gradients", true); - /* Should neighbor clamping [Krivanek et al.] be used? This - propagates geometry information amongst close-by samples + /* Should neighbor clamping [Krivanek et al.] be used? This + propagates geometry information amongst close-by samples and generally leads to better sample placement. */ m_clampNeighbor = props.getBoolean("clampNeighbor", true); /* If set to true, the influence region of samples will be clamped - using the screen-space metric by [Tabellion et al.]? + using the screen-space metric by [Tabellion et al.]? Turning this off may lead to excessive sample placement. */ m_clampScreen = props.getBoolean("clampScreen", true); - /* If set to true, direct illumination will be suppressed - + /* If set to true, direct illumination will be suppressed - useful for checking the interpolation quality */ m_indirectOnly = props.getBoolean("indirectOnly", false); @@ -122,7 +122,7 @@ public: Assert(m_qualityAdjustment > 0 && m_qualityAdjustment <= 1); } - IrradianceCacheIntegrator(Stream *stream, InstanceManager *manager) + IrradianceCacheIntegrator(Stream *stream, InstanceManager *manager) : SamplingIntegrator(stream, manager) { m_irrCache = static_cast(manager->getInstance(stream)); m_subIntegrator = static_cast(manager->getInstance(stream)); @@ -158,7 +158,7 @@ public: m_subIntegrator->configureSampler(scene, sampler); m_diffScaleFactor = std::sqrt((Float) sampler->getSampleCount()); } - + void bindUsedResources(ParallelProcess *proc) const { m_subIntegrator->bindUsedResources(proc); } @@ -217,7 +217,7 @@ public: if (m_overture) { int subIntegratorResID = sched->registerResource(m_subIntegrator); - ref proc = new OvertureProcess(job, m_resolution, m_gradients, + ref proc = new OvertureProcess(job, m_resolution, m_gradients, m_clampNeighbor, m_clampScreen, m_quality); m_proc = proc; proc->bindResource("scene", sceneResID); @@ -262,7 +262,7 @@ public: if (rRec.rayIntersect(ray)) { const BSDF *bsdf = its.getBSDF(ray); - if (bsdf && (bsdf->getType() & BSDF::EAll) == BSDF::EDiffuseReflection && + if (bsdf && (bsdf->getType() & BSDF::EAll) == BSDF::EDiffuseReflection && (rRec.type & RadianceQueryRecord::EIndirectSurfaceRadiance)) { Spectrum E; @@ -277,7 +277,7 @@ public: rRec.type ^= RadianceQueryRecord::EIndirectSurfaceRadiance; - return E * bsdf->getDiffuseReflectance(its) * INV_PI + + return E * bsdf->getDiffuseReflectance(its) * INV_PI + m_subIntegrator->Li(ray, rRec); } } @@ -308,7 +308,7 @@ public: for (unsigned int k=0; kgetN(); k++) { HemisphereSampler::SampleEntry &entry = (*hs)(j, k); entry.dist = std::numeric_limits::infinity(); - rRec2.recursiveQuery(rRec, + rRec2.recursiveQuery(rRec, RadianceQueryRecord::ERadianceNoEmission | RadianceQueryRecord::EDistance); rRec2.extra = 1; rRec2.sampler = sampler; @@ -317,7 +317,7 @@ public: sampler->advance(); } } - + hs->process(rRec.its); /* Undo ray differential scaling done by the integrator */ if (ray.hasDifferentials) @@ -326,7 +326,7 @@ public: E = hs->getIrradiance(); } - Spectrum E(const Scene *scene, const Intersection &its, const Medium *medium, + Spectrum E(const Scene *scene, const Intersection &its, const Medium *medium, Sampler *sampler, int nSamples, bool handleIndirect) const { Spectrum EDir(0.0f), EIndir(0.0f); DirectSamplingRecord dRec(its); @@ -339,7 +339,7 @@ public: if (!directRadiance.isZero()) { Float dp = dot(dRec.d, its.shFrame.n); - if (dp > 0) + if (dp > 0) EDir += directRadiance * dp; } } @@ -348,7 +348,7 @@ public: RadianceQueryRecord rRec(scene, sampler); rRec.newQuery(RadianceQueryRecord::ERadianceNoEmission, medium); rRec.its = its; - if (!m_irrCache->get(rRec.its, EIndir)) + if (!m_irrCache->get(rRec.its, EIndir)) handleMiss(RayDifferential(), rRec, EIndir); } diff --git a/src/integrators/misc/irrcache_proc.cpp b/src/integrators/misc/irrcache_proc.cpp index e2e37597..e2ddaa68 100644 --- a/src/integrators/misc/irrcache_proc.cpp +++ b/src/integrators/misc/irrcache_proc.cpp @@ -25,9 +25,9 @@ MTS_NAMESPACE_BEGIN /* Parallel overture pass implementation (worker) */ class OvertureWorker : public WorkProcessor { public: - OvertureWorker(int resolution, bool gradients, bool clampNeighbor, + OvertureWorker(int resolution, bool gradients, bool clampNeighbor, bool clampScreen, Float quality) : m_resolution(resolution), m_gradients(gradients), - m_clampNeighbor(clampNeighbor), m_clampScreen(clampScreen), + m_clampNeighbor(clampNeighbor), m_clampScreen(clampScreen), m_quality(quality) { } @@ -73,7 +73,7 @@ public: m_hs = new HemisphereSampler(m_resolution, 3*m_resolution); } - void process(const WorkUnit *workUnit, WorkResult *workResult, + void process(const WorkUnit *workUnit, WorkResult *workResult, const bool &stop) { const RectangularWorkUnit *rect = static_cast(workUnit); IrradianceRecordVector *result = static_cast(workResult); @@ -90,7 +90,7 @@ public: for (int y = sy; y < ey; y++) { for (int x = sx; x < ex; x++) { - if (stop) + if (stop) break; Point2 pixelSample(x + .5f, y + .5f); RayDifferential ray; @@ -178,9 +178,9 @@ std::string IrradianceRecordVector::toString() const { return oss.str(); } -OvertureProcess::OvertureProcess(const RenderJob *job, int resolution, bool gradients, - bool clampNeighbor, bool clampScreen, Float quality) : m_job(job), m_resolution(resolution), - m_gradients(gradients), m_clampNeighbor(clampNeighbor), +OvertureProcess::OvertureProcess(const RenderJob *job, int resolution, bool gradients, + bool clampNeighbor, bool clampScreen, Float quality) : m_job(job), m_resolution(resolution), + m_gradients(gradients), m_clampNeighbor(clampNeighbor), m_clampScreen(clampScreen), m_quality(quality), m_progress(NULL) { m_resultCount = 0; m_resultMutex = new Mutex(); diff --git a/src/integrators/misc/irrcache_proc.h b/src/integrators/misc/irrcache_proc.h index cd13bfce..b95bea6f 100644 --- a/src/integrators/misc/irrcache_proc.h +++ b/src/integrators/misc/irrcache_proc.h @@ -71,14 +71,14 @@ private: */ class OvertureProcess : public BlockedImageProcess { public: - OvertureProcess(const RenderJob *job, int resolution, bool gradients, + OvertureProcess(const RenderJob *job, int resolution, bool gradients, bool clampNeighbor, bool clampScreen, Float quality); inline const IrradianceRecordVector *getSamples() const { return m_samples.get(); } - ref createWorkProcessor() const; + ref createWorkProcessor() const; void processResult(const WorkResult *wr, bool cancelled); void bindResource(const std::string &name, int id); diff --git a/src/integrators/mlt/mlt.cpp b/src/integrators/mlt/mlt.cpp index 7e40250b..a5df2575 100644 --- a/src/integrators/mlt/mlt.cpp +++ b/src/integrators/mlt/mlt.cpp @@ -28,7 +28,7 @@ MTS_NAMESPACE_BEGIN * \parameter{maxDepth}{\Integer}{Specifies the longest path depth * in the generated output image (where \code{-1} corresponds to $\infty$). * A value of \code{1} will only render directly visible light sources. - * \code{2} will lead to single-bounce (direct-only) illumination, + * \code{2} will lead to single-bounce (direct-only) illumination, * and so on. \default{\code{-1}} * } * \parameter{directSamples}{\Integer}{ @@ -52,7 +52,7 @@ MTS_NAMESPACE_BEGIN * See \pluginref{pssmlt} for details.\!\default{{\footnotesize\code{false}}}\!} * \parameter{bidirectional\showbreak\newline Mutation,\vspace{1mm} * [lens,multiChain,\newline caustic,manifold]\showbreak\newline Perturbation}{\Boolean}{ - * These parameters can be used to pick the individual mutation and perturbation + * These parameters can be used to pick the individual mutation and perturbation * strategies that will be used to explore path space. By default, the original set * by Veach and Guibas is enabled (i.e. everything except the manifold * perturbation). It is possible to extend @@ -61,7 +61,7 @@ MTS_NAMESPACE_BEGIN * \parameter{lambda}{\Float}{ * Jump size of the manifold perturbation \default{50}} * } - * Metropolis Light Transport (MLT) is a seminal rendering technique proposed by Veach and + * Metropolis Light Transport (MLT) is a seminal rendering technique proposed by Veach and * Guibas \cite{Veach1997Metropolis}, which applies the Metropolis-Hastings * algorithm to the path-space formulation of light transport. * Please refer to the \pluginref{pssmlt} page for a general description of MLT-type @@ -73,16 +73,16 @@ MTS_NAMESPACE_BEGIN * does this exploration by piggybacking on another rendering technique and * ``manipulating'' the random number stream that drives it, whereas MLT does * not use such an indirection: it operates directly on the actual light - * paths. + * paths. * - * This means that the algorithm has access to considerably more + * This means that the algorithm has access to considerably more * information about the problem to be solved, which allows it to perform a - * directed exploration of certain classes of light paths. The main downside + * directed exploration of certain classes of light paths. The main downside * is that the implementation is rather complex, which may make it more - * susceptible to unforeseen problems. + * susceptible to unforeseen problems. * Mitsuba reproduces the full MLT - * algorithm except for the lens subpath mutation\footnote{In experiments, - * it was not found to produce sigificant convergence improvements and was + * algorithm except for the lens subpath mutation\footnote{In experiments, + * it was not found to produce sigificant convergence improvements and was * subsequently removed.}. In addition, the plugin also provides the * manifold perturbation proposed by Jakob and Marschner \cite{Jakob2012Manifold}. * @@ -92,8 +92,8 @@ MTS_NAMESPACE_BEGIN * * To explore the space of light paths, MLT iteratively makes changes * to a light path, which can either be large-scale \emph{mutations} or small-scale - * \emph{perturbations}. Roughly speaking, the \emph{bidirectional mutation} is used - * to jump between different classes of light paths, and each one of the perturbations is + * \emph{perturbations}. Roughly speaking, the \emph{bidirectional mutation} is used + * to jump between different classes of light paths, and each one of the perturbations is * responsible for efficiently exploring some of these classes. * All mutation and perturbation strategies can be mixed and matched as * desired, though for the algorithm to work properly, the bidirectional @@ -104,15 +104,15 @@ MTS_NAMESPACE_BEGIN * \begin{enumerate}[(a)] * \item \emph{Lens perturbation}: this perturbation slightly varies the outgoing * direction at the camera and propagates the resulting ray until it encounters - * the first non-specular object. The perturbation then attempts to create a connection to the + * the first non-specular object. The perturbation then attempts to create a connection to the * (unchanged) remainder of the path. * \item \emph{Caustic perturbation}: essentially a lens perturbation * that proceeds in the opposite direction. * \item \emph{Multi-chain perturbation}: used when there are several chains * of specular interactions, as seen in the swimming pool example above. * After an initial lens perturbation, a cascade of additional perturbations - * is required until a connection to the - * remainder of the path can finally be established. Depending on the + * is required until a connection to the + * remainder of the path can finally be established. Depending on the * path type, the entire path may be changed by this. * \item \emph{Manifold perturbation}: this perturbation was designed to * subsume and extend the previous three approaches. @@ -120,22 +120,22 @@ MTS_NAMESPACE_BEGIN * position along the path, proceeding in either direction. Upon encountering * a chain of specular interactions, it numerically solves for a * connection path (as opposed to the cascading mechanism employed by the - * multi-chain perturbation). + * multi-chain perturbation). * \end{enumerate} */ class MLT : public Integrator { public: MLT(const Properties &props) : Integrator(props) { - /* Longest visualized path length (-1=infinite). - A value of 1 will visualize only directly visible light - sources. 2 will lead to single-bounce (direct-only) + /* Longest visualized path length (-1=infinite). + A value of 1 will visualize only directly visible light + sources. 2 will lead to single-bounce (direct-only) illumination, and so on. */ m_config.maxDepth = props.getInteger("maxDepth", -1); /* This setting can be very useful to reduce noise in dark regions of the image: it activates two-stage MLT, where a nested MLT renderer - first creates a tiny version of the output image. In a second pass, - the full version is then rendered, while making use of information + first creates a tiny version of the output image. In a second pass, + the full version is then rendered, while making use of information about the image-space luminance distribution found in the first pass. Two-stage MLT is very useful in making the noise characteristics more uniform over time image -- specifically, since MLT tends to get @@ -146,7 +146,7 @@ public: of the downsampled image created in the first pass (i.e. setting this to 16 means that the horizontal/vertical resolution will be 16 times lower). When the two-stage process introduces noisy halos around - very bright image regions, it might might be good to reduce this + very bright image regions, it might might be good to reduce this parameter to 4 or even 1. Generally though, it should be safe to leave it unchanged. */ m_config.firstStageSizeReduction = props.getInteger("firstStageSizeReduction", 16); @@ -155,29 +155,29 @@ public: two-stage MLT approach know that it is running the first stage */ m_config.firstStage= props.getBoolean("firstStage", false); - /* Number of samples used to estimate the total luminance + /* Number of samples used to estimate the total luminance received by the scene's sensor */ m_config.luminanceSamples = props.getInteger("luminanceSamples", 100000); - /* This parameter can be used to specify the samples per pixel used to + /* This parameter can be used to specify the samples per pixel used to render the direct component. Should be a power of two (otherwise, it will be rounded to the next one). When set to zero or less, the direct illumination component will be hidden, which is useful - for analyzing the component rendered by MLT. When set to -1, + for analyzing the component rendered by MLT. When set to -1, MLT will handle direct illumination as well */ m_config.directSamples = props.getInteger("directSamples", 16); m_config.separateDirect = m_config.directSamples >= 0; /* Specifies the number of parallel work units required for - multithreaded and network rendering. When set to -1, the + multithreaded and network rendering. When set to -1, the amount will default to four times the number of cores. Note that - every additional work unit entails a significant amount of - communication overhead (a full-sized floating put image must be - transmitted), hence it is important to set this value as low as - possible, while ensuring that there are enough units to keep all + every additional work unit entails a significant amount of + communication overhead (a full-sized floating put image must be + transmitted), hence it is important to set this value as low as + possible, while ensuring that there are enough units to keep all workers busy. */ m_config.workUnits = props.getInteger("workUnits", -1); - + /* Selectively enable/disable the bidirectional mutation */ m_config.bidirectionalMutation = props.getBoolean("bidirectionalMutation", true); @@ -190,7 +190,7 @@ public: /* Selectively enable/disable the multi-chain perturbation */ m_config.multiChainPerturbation = props.getBoolean("multiChainPerturbation", true); - /* Selectively enable/disable the manifold perturbation */ + /* Selectively enable/disable the manifold perturbation */ m_config.manifoldPerturbation = props.getBoolean("manifoldPerturbation", false); m_config.probFactor = props.getFloat("probFactor", props.getFloat("lambda", 50)); @@ -211,7 +211,7 @@ public: m_config.serialize(stream); } - bool preprocess(const Scene *scene, RenderQueue *queue, + bool preprocess(const Scene *scene, RenderQueue *queue, const RenderJob *job, int sceneResID, int sensorResID, int samplerResID) { Integrator::preprocess(scene, queue, job, sceneResID, @@ -261,12 +261,12 @@ public: Vector2i cropSize = film->getCropSize();; Log(EInfo, "Starting %srender job (%ix%i, " SIZE_T_FMT - " %s, " SSE_STR ", approx. " SIZE_T_FMT " mutations/pixel) ..", + " %s, " SSE_STR ", approx. " SIZE_T_FMT " mutations/pixel) ..", nested ? "nested " : "", cropSize.x, cropSize.y, nCores, nCores == 1 ? "core" : "cores", sampleCount); if (m_config.workUnits <= 0) - m_config.workUnits = std::max((int) std::ceil((cropSize.x + m_config.workUnits = std::max((int) std::ceil((cropSize.x * cropSize.y * sampleCount) / 200000.0f), 1); m_config.nMutations = (cropSize.x * cropSize.y * @@ -274,27 +274,27 @@ public: ref directImage; if (m_config.separateDirect && m_config.directSamples > 0 && !nested) { - directImage = BidirectionalUtils::renderDirectComponent(scene, + directImage = BidirectionalUtils::renderDirectComponent(scene, sceneResID, sensorResID, queue, job, m_config.directSamples); if (directImage == NULL) return false; } ref rplSampler = new ReplayableSampler(); - ref pathSampler = new PathSampler(PathSampler::EBidirectional, scene, + ref pathSampler = new PathSampler(PathSampler::EBidirectional, scene, rplSampler, rplSampler, rplSampler, m_config.maxDepth, 10, m_config.separateDirect, true); - + std::vector pathSeeds; - ref process = new MLTProcess(job, queue, + ref process = new MLTProcess(job, queue, m_config, directImage, pathSeeds); - m_config.luminance = pathSampler->generateSeeds(m_config.luminanceSamples, + m_config.luminance = pathSampler->generateSeeds(m_config.luminanceSamples, m_config.workUnits, false, pathSeeds); pathSeeds.clear(); - - m_config.luminance = pathSampler->generateSeeds(m_config.luminanceSamples, + + m_config.luminance = pathSampler->generateSeeds(m_config.luminanceSamples, m_config.workUnits, true, pathSeeds); if (!nested) diff --git a/src/integrators/mlt/mlt.h b/src/integrators/mlt/mlt.h index 092ed736..00184648 100644 --- a/src/integrators/mlt/mlt.h +++ b/src/integrators/mlt/mlt.h @@ -84,7 +84,7 @@ struct MLTConfiguration { SLog(EDebug, " Mutations per work unit : " SIZE_T_FMT, nMutations); SLog(EDebug, " Universal perturb. factor : %f", probFactor); SLog(EDebug, " Manifold max iterations : %i", MTS_MANIFOLD_MAX_ITERATIONS); - SLog(EDebug, " Quantiles : %f (surfaces), %f (media)", + SLog(EDebug, " Quantiles : %f (surfaces), %f (media)", MTS_MANIFOLD_QUANTILE_SURFACE, MTS_MANIFOLD_QUANTILE_MEDIUM); if (timeout) SLog(EDebug, " Timeout : " SIZE_T_FMT, timeout); diff --git a/src/integrators/mlt/mlt_proc.cpp b/src/integrators/mlt/mlt_proc.cpp index e90116a9..610df074 100644 --- a/src/integrators/mlt/mlt_proc.cpp +++ b/src/integrators/mlt/mlt_proc.cpp @@ -28,7 +28,7 @@ MTS_NAMESPACE_BEGIN //#define MTS_BD_DEBUG_HEAVY -static StatsCounter statsAccepted("Path Space MLT", +static StatsCounter statsAccepted("Path Space MLT", "Accepted mutations", EPercentage); static StatsCounter forcedAcceptance("Path Space MLT", "Number of forced acceptances"); @@ -39,11 +39,11 @@ static StatsCounter forcedAcceptance("Path Space MLT", class MLTRenderer : public WorkProcessor { public: - MLTRenderer(const MLTConfiguration &conf) + MLTRenderer(const MLTConfiguration &conf) : m_config(conf) { } - MLTRenderer(Stream *stream, InstanceManager *manager) + MLTRenderer(Stream *stream, InstanceManager *manager) : WorkProcessor(stream, manager) { m_config = MLTConfiguration(stream); } @@ -78,7 +78,7 @@ public: m_rplSampler = static_cast( static_cast(getResource("rplSampler"))->clone().get()); - m_pathSampler = new PathSampler(PathSampler::EBidirectional, m_scene, + m_pathSampler = new PathSampler(PathSampler::EBidirectional, m_scene, m_rplSampler, m_rplSampler, m_rplSampler, m_config.maxDepth, 10, m_config.separateDirect, true); @@ -86,7 +86,7 @@ public: /* Jump sizes recommended by Eric Veach */ Float minJump = 0.1f, coveredArea = 0.05f; - + /* Register all available mutators */ if (m_config.bidirectionalMutation) m_mutators.push_back(new BidirectionalMutator(m_scene, m_sampler, @@ -125,14 +125,14 @@ public: m_pathSampler->reconstructPath(wu->getSeed(), *current); relWeight = current->getRelativeWeight(); BDAssert(!relWeight.isZero()); - + DiscreteDistribution suitabilities(m_mutators.size()); MutationRecord muRec; ref timer = new Timer(); size_t consecRejections = 0; Float accumulatedWeight = 0; - + #if defined(MTS_DEBUG_FP) enableFPExceptions(); #endif @@ -143,7 +143,7 @@ public: #endif for (size_t mutationCtr=0; mutationCtr < m_config.nMutations && !stop; ++mutationCtr) { - if (wu->getTimeout() > 0 && (mutationCtr % 8192) == 0 && + if (wu->getTimeout() > 0 && (mutationCtr % 8192) == 0 && (int) timer->getMilliseconds() > wu->getTimeout()) break; @@ -154,11 +154,11 @@ public: #if defined(MTS_BD_DEBUG_HEAVY) current->clone(backup, *m_pool); #endif - + size_t mutatorIdx = 0; bool success = false; Mutator *mutator = NULL; - + if (suitabilities.normalize() == 0) { /* No mutator can handle this path -- give up */ size_t skip = m_config.nMutations - mutationCtr; @@ -189,7 +189,7 @@ public: fail = true; if (fail) Log(EError, "Detected an unexpected path modification outside of the " - "specifed range after a mutation of type %s (k=%i)!", + "specifed range after a mutation of type %s (k=%i)!", muRec.toString().c_str(), current->length()); } backup.release(*m_pool); @@ -218,7 +218,7 @@ public: Point2i propPosI( std::min(std::max(0, (int) propPos.x), size.x-1), std::min(std::max(0, (int) propPos.y), size.y-1)); - + Float curValue = luminanceValues[curPosI.x + curPosI.y * size.x]; Float propValue = luminanceValues[propPosI.x + propPosI.y * size.x]; @@ -246,7 +246,7 @@ public: } accumulatedWeight += 1-a; - + /* Accept with probability 'a' */ if (a == 1 || m_sampler->next1D() < a) { current->release(muRec.l, muRec.m+1, *m_pool); @@ -289,7 +289,7 @@ public: #if defined(MTS_DEBUG_FP) disableFPExceptions(); #endif - + current->release(*m_pool); delete current; delete proposed; @@ -318,9 +318,9 @@ private: /* Parallel process */ /* ==================================================================== */ -MLTProcess::MLTProcess(const RenderJob *parent, RenderQueue *queue, +MLTProcess::MLTProcess(const RenderJob *parent, RenderQueue *queue, const MLTConfiguration &conf, const Bitmap *directImage, - const std::vector &seeds) : m_job(parent), m_queue(queue), + const std::vector &seeds) : m_job(parent), m_queue(queue), m_config(conf), m_progress(NULL), m_seeds(seeds) { m_directImage = directImage; m_timeoutTimer = new Timer(); @@ -357,7 +357,7 @@ void MLTProcess::develop() { avgLuminance /= (Float) pixelCount; Float luminanceFactor = m_config.luminance / avgLuminance; - + for (size_t i=0; iupdate(++m_resultCounter); m_refreshTimeout = std::min(2000U, m_refreshTimeout * 2); - /* Re-develop the entire image every two seconds if partial results are + /* Re-develop the entire image every two seconds if partial results are visible (e.g. in a graphical user interface). Do it a bit more often at the beginning. */ if (m_job->isInteractive() && m_refreshTimer->getMilliseconds() > m_refreshTimeout) @@ -405,7 +405,7 @@ ParallelProcess::EStatus MLTProcess::generateWork(WorkUnit *unit, int worker) { void MLTProcess::bindResource(const std::string &name, int id) { ParallelProcess::bindResource(name, id); - if (name == "sensor") { + if (name == "sensor") { m_film = static_cast(Scheduler::getInstance()->getResource(id))->getFilm(); if (m_progress) delete m_progress; diff --git a/src/integrators/path/path.cpp b/src/integrators/path/path.cpp index 98ab1c4e..19ed0466 100644 --- a/src/integrators/path/path.cpp +++ b/src/integrators/path/path.cpp @@ -29,11 +29,11 @@ static StatsCounter avgPathLength("Path tracer", "Average path length", EAverage * \parameter{maxDepth}{\Integer}{Specifies the longest path depth * in the generated output image (where \code{-1} corresponds to $\infty$). * A value of \code{1} will only render directly visible light sources. - * \code{2} will lead to single-bounce (direct-only) illumination, + * \code{2} will lead to single-bounce (direct-only) illumination, * and so on. \default{\code{-1}} * } - * \parameter{rrDepth}{\Integer}{Specifies the minimum path depth, after - * which the implementation will start to use the ``russian roulette'' + * \parameter{rrDepth}{\Integer}{Specifies the minimum path depth, after + * which the implementation will start to use the ``russian roulette'' * path termination criterion. \default{\code{5}} * } * \parameter{strictNormals}{\Boolean}{Be strict about potential @@ -44,10 +44,10 @@ static StatsCounter avgPathLength("Path tracer", "Average path length", EAverage * This integrator implements a basic path tracer and is a \emph{good default choice} * when there is no strong reason to prefer another method. * - * To use the path tracer appropriately, it is instructive to know roughly how + * To use the path tracer appropriately, it is instructive to know roughly how * it works: its main operation is to trace many light paths using \emph{random walks} * starting from the sensor. A single random walk is shown below, which entails - * casting a ray associated with a pixel in the output image and searching for + * casting a ray associated with a pixel in the output image and searching for * the first visible intersection. A new direction is then chosen at the intersection, * and the ray-casting step repeats over and over again (until one of several * stopping criteria applies). @@ -55,8 +55,8 @@ static StatsCounter avgPathLength("Path tracer", "Average path length", EAverage * \includegraphics[width=.7\textwidth]{images/integrator_path_figure.pdf} * \end{center} * At every intersection, the path tracer tries to create a connection to - * the light source in an attempt to find a \emph{complete} path along which - * light can flow from the emitter to the sensor. This of course only works + * the light source in an attempt to find a \emph{complete} path along which + * light can flow from the emitter to the sensor. This of course only works * when there is no occluding object between the intersection and the emitter. * * This directly translates into a category of scenes where @@ -66,9 +66,9 @@ static StatsCounter avgPathLength("Path tracer", "Average path length", EAverage * to render when this area light is inside a glass enclosure (which * effectively counts as an occluder). * - * Like the \pluginref{direct} plugin, the path tracer internally relies on multiple importance + * Like the \pluginref{direct} plugin, the path tracer internally relies on multiple importance * sampling to combine BSDF and emitter samples. The main difference in comparison - * to the former plugin is that it considers light paths of arbitrary length to compute + * to the former plugin is that it considers light paths of arbitrary length to compute * both direct and indirect illumination. * * For good results, combine the path tracer with one of the @@ -79,24 +79,24 @@ static StatsCounter avgPathLength("Path tracer", "Average path length", EAverage * to suppress the inherently faceted appearance of the underlying geometry. These * ``fake'' normals are not without problems, however. They can lead to paradoxical * situations where a light ray impinges on an object from a direction that is classified as ``outside'' - * according to the shading normal, and ``inside'' according to the true geometric normal. + * according to the shading normal, and ``inside'' according to the true geometric normal. * * The \code{strictNormals} - * parameter specifies the intended behavior when such cases arise. The default (\code{false}, i.e. ``carry on'') + * parameter specifies the intended behavior when such cases arise. The default (\code{false}, i.e. ``carry on'') * gives precedence to information given by the shading normal and considers such light paths to be valid. * This can theoretically cause light ``leaks'' through boundaries, but it is not much of a problem in practice. * * When set to \code{true}, the path tracer detects inconsistencies and ignores these paths. When objects - * are poorly tesselated, this latter option may cause them to lose a significant amount of the incident + * are poorly tesselated, this latter option may cause them to lose a significant amount of the incident * radiation (or, in other words, they will look dark). * * The bidirectional integrators in Mitsuba (\pluginref{bdpt}, \pluginref{pssmlt}, \pluginref{mlt} ...) * implicitly have \code{strictNormals} set to \code{true}. Hence, another use of this parameter * is to match renderings created by these methods. - * + * * \remarks{ * \item This integrator does not handle participating media - * \item This integrator has poor convergence properties when rendering + * \item This integrator has poor convergence properties when rendering * caustics and similar effects. In this case, \pluginref{bdpt} or * one of the photon mappers may be preferable. * } @@ -117,7 +117,7 @@ public: RayDifferential ray(r); Spectrum Li(0.0f); - /* Perform the first ray intersection (or ignore if the + /* Perform the first ray intersection (or ignore if the intersection has already been provided). */ rRec.rayIntersect(ray); ray.mint = Epsilon; @@ -127,7 +127,7 @@ public: while (rRec.depth <= m_maxDepth || m_maxDepth < 0) { if (!its.isValid()) { - /* If no intersection could be found, potentially return + /* If no intersection could be found, potentially return radiance from a environment luminaire if it exists */ if (rRec.type & RadianceQueryRecord::EEmittedRadiance) Li += throughput * scene->evalEnvironment(ray); @@ -144,8 +144,8 @@ public: if (its.hasSubsurface() && (rRec.type & RadianceQueryRecord::ESubsurfaceRadiance)) Li += throughput * its.LoSub(scene, rRec.sampler, -ray.d, rRec.depth); - if ((rRec.depth >= m_maxDepth && m_maxDepth > 0) - || (m_strictNormals && dot(ray.d, its.geoFrame.n) + if ((rRec.depth >= m_maxDepth && m_maxDepth > 0) + || (m_strictNormals && dot(ray.d, its.geoFrame.n) * Frame::cosTheta(its.wi) >= 0)) { /* Only continue if: @@ -162,12 +162,12 @@ public: /* Estimate the direct illumination if this is requested */ DirectSamplingRecord dRec(its); - if (rRec.type & RadianceQueryRecord::EDirectSurfaceRadiance && + if (rRec.type & RadianceQueryRecord::EDirectSurfaceRadiance && (bsdf->getType() & BSDF::ESmooth)) { Spectrum value = scene->sampleEmitterDirect(dRec, rRec.nextSample2D()); if (!value.isZero()) { const Emitter *emitter = static_cast(dRec.object); - + /* Allocate a record for querying the BSDF */ BSDFSamplingRecord bRec(its, its.toLocal(dRec.d), ERadiance); @@ -178,7 +178,7 @@ public: if (!bsdfVal.isZero() && (!m_strictNormals || dot(its.geoFrame.n, dRec.d) * Frame::cosTheta(bRec.wo) > 0)) { - /* Calculate prob. of having generated that direction + /* Calculate prob. of having generated that direction using BSDF sampling */ Float bsdfPdf = (emitter->isOnSurface() && dRec.measure == ESolidAngle) ? bsdf->pdf(bRec) : 0; @@ -198,9 +198,9 @@ public: Float bsdfPdf; BSDFSamplingRecord bRec(its, rRec.sampler, ERadiance); Spectrum bsdfWeight = bsdf->sample(bRec, bsdfPdf, rRec.nextSample2D()); - if (bsdfWeight.isZero()) + if (bsdfWeight.isZero()) break; - + /* Prevent light leaks due to the use of shading normals */ const Vector wo = its.toWorld(bRec.wo); Float woDotGeoN = dot(its.geoFrame.n, wo); @@ -240,11 +240,11 @@ public: /* If a luminaire was hit, estimate the local illumination and weight using the power heuristic */ - if (hitEmitter && + if (hitEmitter && (rRec.type & RadianceQueryRecord::EDirectSurfaceRadiance)) { - /* Compute the prob. of generating that direction using the + /* Compute the prob. of generating that direction using the implemented direct illumination sampling technique */ - const Float lumPdf = (!(bRec.sampledType & BSDF::EDelta)) ? + const Float lumPdf = (!(bRec.sampledType & BSDF::EDelta)) ? scene->pdfEmitterDirect(dRec) : 0; Li += throughput * value * miWeight(bsdfPdf, lumPdf); } @@ -253,20 +253,20 @@ public: /* Indirect illumination */ /* ==================================================================== */ - /* Set the recursive query type. Stop if no surface was hit by the + /* Set the recursive query type. Stop if no surface was hit by the BSDF sample or if indirect illumination was not requested */ - if (!its.isValid() || !(rRec.type & RadianceQueryRecord::EIndirectSurfaceRadiance)) + if (!its.isValid() || !(rRec.type & RadianceQueryRecord::EIndirectSurfaceRadiance)) break; rRec.type = RadianceQueryRecord::ERadianceNoEmission; if (rRec.depth++ >= m_rrDepth) { /* Russian roulette: try to keep path weights equal to one, - while accounting for the solid angle compression at refractive - index boundaries. Stop with at least some probability to avoid + while accounting for the solid angle compression at refractive + index boundaries. Stop with at least some probability to avoid getting stuck (e.g. due to total internal reflection) */ Float q = std::min(throughput.max() * eta * eta, (Float) 0.95f); - if (rRec.nextSample1D() >= q) + if (rRec.nextSample1D() >= q) break; throughput /= q; } diff --git a/src/integrators/path/volpath.cpp b/src/integrators/path/volpath.cpp index 4de5f467..f5fa25b0 100644 --- a/src/integrators/path/volpath.cpp +++ b/src/integrators/path/volpath.cpp @@ -29,11 +29,11 @@ static StatsCounter avgPathLength("Volumetric path tracer", "Average path length * \parameter{maxDepth}{\Integer}{Specifies the longest path depth * in the generated output image (where \code{-1} corresponds to $\infty$). * A value of \code{1} will only render directly visible light sources. - * \code{2} will lead to single-bounce (direct-only) illumination, + * \code{2} will lead to single-bounce (direct-only) illumination, * and so on. \default{\code{-1}} * } - * \parameter{rrDepth}{\Integer}{Specifies the minimum path depth, after - * which the implementation will start to use the ``russian roulette'' + * \parameter{rrDepth}{\Integer}{Specifies the minimum path depth, after + * which the implementation will start to use the ``russian roulette'' * path termination criterion. \default{\code{5}} * } * \parameter{strictNormals}{\Boolean}{Be strict about potential @@ -42,17 +42,17 @@ static StatsCounter avgPathLength("Volumetric path tracer", "Average path length * } * * This plugin provides a volumetric path tracer that can be used to - * compute approximate solutions to the radiative transfer equation. + * compute approximate solutions to the radiative transfer equation. * Its implementation makes use of multiple importance sampling to - * combine BSDF and phase function sampling with direct illumination - * sampling strategies. On surfaces, this integrator behaves exactly + * combine BSDF and phase function sampling with direct illumination + * sampling strategies. On surfaces, this integrator behaves exactly * like the standard path tracer. * * \remarks{ - * \item This integrator will generally perform poorly when rendering + * \item This integrator will generally perform poorly when rendering * participating media that have a different index of refraction compared * to the surrounding medium. - * \item This integrator has poor convergence properties when rendering + * \item This integrator has poor convergence properties when rendering * caustics and similar effects. In this case, \pluginref{bdpt} or * one of the photon mappers may be preferable. * } @@ -75,7 +75,7 @@ public: bool scattered = false; Float eta = 1.0f; - /* Perform the first ray intersection (or ignore if the + /* Perform the first ray intersection (or ignore if the intersection has already been provided). */ rRec.rayIntersect(ray); @@ -99,7 +99,7 @@ public: /* ==================================================================== */ /* Luminaire sampling */ /* ==================================================================== */ - + /* Estimate the single scattering component if this is requested */ DirectSamplingRecord dRec(mRec.p, mRec.time); @@ -107,7 +107,7 @@ public: int interactions = m_maxDepth - rRec.depth - 1; Spectrum value = scene->sampleAttenuatedEmitterDirect( - dRec, rRec.medium, interactions, + dRec, rRec.medium, interactions, rRec.nextSample2D(), rRec.sampler); if (!value.isZero()) { @@ -118,10 +118,10 @@ public: Float phaseVal = phase->eval(pRec); if (phaseVal != 0) { - /* Calculate prob. of having sampled that direction using + /* Calculate prob. of having sampled that direction using phase function sampling */ Float phasePdf = (emitter->isOnSurface() && dRec.measure == ESolidAngle - && interactions == 0) + && interactions == 0) ? phase->pdf(pRec) : (Float) 0.0f; /* Weight using the power heuristic */ @@ -130,7 +130,7 @@ public: } } } - + /* ==================================================================== */ /* Phase function sampling */ /* ==================================================================== */ @@ -143,7 +143,7 @@ public: bool hitEmitter = false; Spectrum value; - + /* Trace a ray in this direction */ ray = Ray(mRec.p, pRec.wo, ray.time); ray.mint = 0; @@ -184,13 +184,13 @@ public: /* ==================================================================== */ /* Stop if multiple scattering was not requested */ - if (!(rRec.type & RadianceQueryRecord::EIndirectMediumRadiance)) + if (!(rRec.type & RadianceQueryRecord::EIndirectMediumRadiance)) break; rRec.type = RadianceQueryRecord::ERadianceNoEmission; scattered = true; } else { - /* Sample + /* Sample tau(x, y) (Surface integral). This happens with probability mRec.pdfFailure Account for this and multiply by the proper per-color-channel transmittance. */ @@ -198,13 +198,13 @@ public: throughput *= mRec.transmittance / mRec.pdfFailure; if (!its.isValid()) { - /* If no intersection could be found, possibly return + /* If no intersection could be found, possibly return attenuated radiance from a background luminaire */ if (rRec.type & RadianceQueryRecord::EEmittedRadiance) Li += throughput * scene->evalEnvironment(ray); break; } - + /* Possibly include emitted radiance if requested */ if (its.isEmitter() && (rRec.type & RadianceQueryRecord::EEmittedRadiance)) Li += throughput * its.Le(-ray.d); @@ -215,11 +215,11 @@ public: if (rRec.depth >= m_maxDepth && m_maxDepth != -1) break; - + /* Prevent light leaks due to the use of shading normals */ Float wiDotGeoN = -dot(its.geoFrame.n, ray.d), wiDotShN = Frame::cosTheta(its.wi); - if (wiDotGeoN * wiDotShN < 0 && m_strictNormals) + if (wiDotGeoN * wiDotShN < 0 && m_strictNormals) break; /* ==================================================================== */ @@ -230,7 +230,7 @@ public: DirectSamplingRecord dRec(its); /* Estimate the direct illumination if this is requested */ - if (rRec.type & RadianceQueryRecord::EDirectSurfaceRadiance && + if (rRec.type & RadianceQueryRecord::EDirectSurfaceRadiance && (bsdf->getType() & BSDF::ESmooth)) { int interactions = m_maxDepth - rRec.depth - 1; @@ -240,23 +240,23 @@ public: if (!value.isZero()) { const Emitter *emitter = static_cast(dRec.object); - + /* Evaluate BSDF * cos(theta) */ BSDFSamplingRecord bRec(its, its.toLocal(dRec.d)); const Spectrum bsdfVal = bsdf->eval(bRec); Float woDotGeoN = dot(its.geoFrame.n, dRec.d); - + /* Prevent light leaks due to the use of shading normals */ if (!bsdfVal.isZero() && (!m_strictNormals || woDotGeoN * Frame::cosTheta(bRec.wo) > 0)) { - /* Calculate prob. of having generated that direction + /* Calculate prob. of having generated that direction using BSDF sampling */ Float bsdfPdf = (emitter->isOnSurface() && dRec.measure == ESolidAngle - && interactions == 0) + && interactions == 0) ? bsdf->pdf(bRec) : (Float) 0.0f; - + /* Weight using the power heuristic */ const Float weight = miWeight(dRec.pdf, bsdfPdf); Li += throughput * value * bsdfVal * weight; @@ -320,9 +320,9 @@ public: weight using the power heuristic */ if (hitEmitter && (rRec.type & RadianceQueryRecord::EDirectSurfaceRadiance) && !((bRec.sampledType & BSDF::ENull) && scattered)) { - Spectrum transmittance = rRec.medium ? + Spectrum transmittance = rRec.medium ? rRec.medium->evalTransmittance(Ray(ray, 0, its.t)) : Spectrum(1.0f); - const Float emitterPdf = (!(bRec.sampledType & BSDF::EDelta)) ? + const Float emitterPdf = (!(bRec.sampledType & BSDF::EDelta)) ? scene->pdfEmitterDirect(dRec) : 0; Li += throughput * value * transmittance * miWeight(bsdfPdf, emitterPdf); } @@ -330,23 +330,23 @@ public: /* ==================================================================== */ /* Indirect illumination */ /* ==================================================================== */ - + /* Stop if indirect illumination was not requested */ - if (!(rRec.type & RadianceQueryRecord::EIndirectSurfaceRadiance)) + if (!(rRec.type & RadianceQueryRecord::EIndirectSurfaceRadiance)) break; rRec.type = RadianceQueryRecord::ERadianceNoEmission; - scattered |= bRec.sampledType != BSDF::ENull; + scattered |= bRec.sampledType != BSDF::ENull; } if (rRec.depth++ >= m_rrDepth) { /* Russian roulette: try to keep path weights equal to one, - while accounting for the solid angle compression at refractive - index boundaries. Stop with at least some probability to avoid + while accounting for the solid angle compression at refractive + index boundaries. Stop with at least some probability to avoid getting stuck (e.g. due to total internal reflection) */ Float q = std::min(throughput.max() * eta * eta, (Float) 0.95f); - if (rRec.nextSample1D() >= q) + if (rRec.nextSample1D() >= q) break; throughput /= q; } diff --git a/src/integrators/photonmapper/bre.cpp b/src/integrators/photonmapper/bre.cpp index c17c6ea2..dcfc431b 100644 --- a/src/integrators/photonmapper/bre.cpp +++ b/src/integrators/photonmapper/bre.cpp @@ -100,7 +100,7 @@ BeamRadianceEstimator::BeamRadianceEstimator(Stream *stream, InstanceManager *ma } void BeamRadianceEstimator::serialize(Stream *stream, InstanceManager *manager) const { - Log(EDebug, "Serializing a BRE data structure (%s)", + Log(EDebug, "Serializing a BRE data structure (%s)", memString(m_photonCount * sizeof(BRENode)).c_str()); stream->writeSize(m_photonCount); stream->writeSize(m_depth); diff --git a/src/integrators/photonmapper/bre.h b/src/integrators/photonmapper/bre.h index 9bdc4229..b44acf5b 100644 --- a/src/integrators/photonmapper/bre.h +++ b/src/integrators/photonmapper/bre.h @@ -58,7 +58,7 @@ protected: /// Fit a hierarchy of bounding boxes to the stored photons AABB buildHierarchy(IndexType index); - + /// Blurring kernel used by the BRE inline Float K2(Float sqrParam) const { Float tmp = 1-sqrParam; @@ -66,10 +66,10 @@ protected: } /** - * \brief Return whether or not the inner node of the + * \brief Return whether or not the inner node of the * specified index has a right child node. * - * This function is available for convenience and abstracts away some + * This function is available for convenience and abstracts away some * details about the underlying node representation. */ inline bool hasRightChild(IndexType index) const { diff --git a/src/integrators/photonmapper/photonmapper.cpp b/src/integrators/photonmapper/photonmapper.cpp index caae6ef9..cbda46f9 100644 --- a/src/integrators/photonmapper/photonmapper.cpp +++ b/src/integrators/photonmapper/photonmapper.cpp @@ -26,14 +26,14 @@ MTS_NAMESPACE_BEGIN /*!\plugin{photonmapper}{Photon map integrator} * \order{6} * \parameters{ - * \parameter{directSamples}{\Integer}{Number of samples used for the + * \parameter{directSamples}{\Integer}{Number of samples used for the * direct illumination component \default{16}} * \parameter{glossySamples}{\Integer}{Number of samples used for the indirect * illumination component of glossy materials \default{32}} * \parameter{maxDepth}{\Integer}{Specifies the longest path depth * in the generated output image (where \code{-1} corresponds to $\infty$). * A value of \code{1} will only render directly visible light sources. - * \code{2} will lead to single-bounce (direct-only) illumination, + * \code{2} will lead to single-bounce (direct-only) illumination, * and so on. \default{\code{-1}} * } * \parameter{globalPhotons}{\Integer}{Number of photons that will be collected for the global photon map\default{250000}} @@ -43,15 +43,15 @@ MTS_NAMESPACE_BEGIN * \parameter{causticLookup\showbreak Radius}{\Float}{Maximum radius of photon lookups in the caustic photon map (relative to the scene size)\default{0.0125}} * \parameter{lookupSize}{\Integer}{Number of photons that should be fetched in photon map queries\default{120}} * \parameter{granularity}{\Integer}{ - * Granularity of photon tracing work units for the purpose + * Granularity of photon tracing work units for the purpose * of parallelization (in \# of shot particles) \default{0, i.e. decide automatically} * } - * \parameter{rrDepth}{\Integer}{Specifies the minimum path depth, after - * which the implementation will start to use the ``russian roulette'' + * \parameter{rrDepth}{\Integer}{Specifies the minimum path depth, after + * which the implementation will start to use the ``russian roulette'' * path termination criterion. \default{\code{5}} * } * } - * This plugin implements the two-pass photon mapping algorithm as proposed by Jensen \cite{Jensen1996Global}. + * This plugin implements the two-pass photon mapping algorithm as proposed by Jensen \cite{Jensen1996Global}. * The implementation partitions the illumination into three different classes (diffuse, caustic, and volumetric), * and builds a separate photon map for each class. * @@ -69,8 +69,8 @@ MTS_NAMESPACE_BEGIN * \rendering{Rendered using plain photon mapping}{integrator_photonmapper_1} * \rendering{Rendered using photon mapping together with irradiance caching}{integrator_photonmapper_2} * \vspace{-2mm} - * \caption{\label{fig:pmap-blotchy}Sponza atrium illuminated by a point light and rendered using 5 million photons. - * Irradiance caching significantly accelerates the rendering time and eliminates the ``blotchy'' + * \caption{\label{fig:pmap-blotchy}Sponza atrium illuminated by a point light and rendered using 5 million photons. + * Irradiance caching significantly accelerates the rendering time and eliminates the ``blotchy'' * kernel density estimation artifacts. Model courtesy of Marko Dabrovic.} * } * @@ -90,14 +90,14 @@ public: m_glossySamples = props.getInteger("glossySamples", 32); /* Depth to start using russian roulette when tracing photons */ m_rrDepth = props.getInteger("rrDepth", 5); - /* Longest visualized path length (\c -1 = infinite). + /* Longest visualized path length (\c -1 = infinite). A value of \c 1 will visualize only directly visible light sources. \c 2 will lead to single-bounce (direct-only) illumination, and so on. */ m_maxDepth = props.getInteger("maxDepth", -1); /** * When encountering an ideally specular material, the photon mapper places * a sample on each lobe (e.g. reflection *and* transmission). This leads - * to an exponential growth in running time but greatly reduces variance and + * to an exponential growth in running time but greatly reduces variance and * is therefore usually worth it. This parameter specifies after how many * bounces this behavior should be stopped. */ @@ -131,7 +131,7 @@ public: Log(EError, "maxDepth must be greater than zero!"); } else if (m_maxDepth == -1) { /** - * An infinite depth is currently not supported, since + * An infinite depth is currently not supported, since * the photon tracing step uses a Halton sequence * that is based on a finite-sized prime number table */ @@ -221,7 +221,7 @@ public: m_invGlossySamples = 1.0f / m_glossySamples; } - bool preprocess(const Scene *scene, RenderQueue *queue, const RenderJob *job, + bool preprocess(const Scene *scene, RenderQueue *queue, const RenderJob *job, int sceneResID, int sensorResID, int samplerResID) { SamplingIntegrator::preprocess(scene, queue, job, sceneResID, sensorResID, samplerResID); /* Create a deterministic sampler for the photon gathering step */ @@ -235,7 +235,7 @@ public: clonedSampler->incRef(); samplers[i] = clonedSampler.get(); } - int qmcSamplerID = sched->registerMultiResource(samplers); + int qmcSamplerID = sched->registerMultiResource(samplers); for (size_t i=0; idecRef(); @@ -264,7 +264,7 @@ public: if (proc->getReturnStatus() != ParallelProcess::ESuccess) return false; - Log(EDebug, "Global photon map full. Shot " SIZE_T_FMT " particles, excess photons due to parallelism: " + Log(EDebug, "Global photon map full. Shot " SIZE_T_FMT " particles, excess photons due to parallelism: " SIZE_T_FMT, proc->getShotParticles(), proc->getExcessPhotons()); ref globalPhotonMap = proc->getPhotonMap(); @@ -291,11 +291,11 @@ public: sched->schedule(proc); sched->wait(proc); m_proc = NULL; - + if (proc->getReturnStatus() != ParallelProcess::ESuccess) return false; - Log(EDebug, "Caustic photon map full. Shot " SIZE_T_FMT " particles, excess photons due to parallelism: " + Log(EDebug, "Caustic photon map full. Shot " SIZE_T_FMT " particles, excess photons due to parallelism: " SIZE_T_FMT, proc->getShotParticles(), proc->getExcessPhotons()); ref causticPhotonMap = proc->getPhotonMap(); @@ -326,7 +326,7 @@ public: if (proc->getReturnStatus() != ParallelProcess::ESuccess) return false; - Log(EDebug, "Volume photon map full. Shot " SIZE_T_FMT " particles, excess photons due to parallelism: " + Log(EDebug, "Volume photon map full. Shot " SIZE_T_FMT " particles, excess photons due to parallelism: " SIZE_T_FMT, proc->getShotParticles(), proc->getExcessPhotons()); ref volumePhotonMap = proc->getPhotonMap(); @@ -346,7 +346,7 @@ public: return true; } - + void setParent(ConfigurableObject *parent) { if (parent->getClass()->derivesFrom(MTS_CLASS(SamplingIntegrator))) m_parentIntegrator = static_cast(parent); @@ -393,10 +393,10 @@ public: bool cacheQuery = (rRec.extra & RadianceQueryRecord::ECacheQuery); bool adaptiveQuery = (rRec.extra & RadianceQueryRecord::EAdaptiveQuery); - /* Perform the first ray intersection (or ignore if the + /* Perform the first ray intersection (or ignore if the intersection has already been provided). */ rRec.rayIntersect(ray); - + if (rRec.medium) { Ray mediumRaySegment(ray, 0, its.t); transmittance = rRec.medium->evalTransmittance(mediumRaySegment); @@ -407,7 +407,7 @@ public: } if (!its.isValid()) { - /* If no intersection could be found, possibly return + /* If no intersection could be found, possibly return attenuated radiance from a background luminaire */ if (rRec.type & RadianceQueryRecord::EEmittedRadiance) LiSurf = scene->evalEnvironment(ray); @@ -415,7 +415,7 @@ public: } /* Possibly include emitted radiance if requested */ - if (its.isEmitter() && (rRec.type & RadianceQueryRecord::EEmittedRadiance)) + if (its.isEmitter() && (rRec.type & RadianceQueryRecord::EEmittedRadiance)) LiSurf += its.Le(-ray.d); /* Include radiance from a subsurface scattering model if requested */ @@ -453,7 +453,7 @@ public: Spectrum bsdfVal = bsdf->sample(bRec, Point2(0.0f)); if (bsdfVal.isZero()) continue; - + rRec2.recursiveQuery(rRec, RadianceQueryRecord::ERadiance); RayDifferential bsdfRay(its.p, its.toWorld(bRec.wo), ray.time); if (its.isMediumTransition()) @@ -470,7 +470,7 @@ public: numBSDFSamples; Float weightLum, weightBSDF; - + if (rRec.depth > 1 || cacheQuery || adaptiveQuery) { /* This integrator is used recursively by another integrator. Be less accurate as this sample will not directly be observed. */ @@ -486,7 +486,7 @@ public: weightBSDF = m_invGlossySamples; } } - + if (numEmitterSamples > 1) { sampleArray = rRec.sampler->next2DArray(m_directSamples); } else { @@ -498,40 +498,40 @@ public: for (int i=0; isampleAttenuatedEmitterDirect( - dRec, its, rRec.medium, interactions, + dRec, its, rRec.medium, interactions, sampleArray[i], rRec.sampler); - + /* Estimate the direct illumination if this is requested */ if (!value.isZero()) { const Emitter *emitter = static_cast(dRec.object); - + /* Allocate a record for querying the BSDF */ BSDFSamplingRecord bRec(its, its.toLocal(dRec.d)); - + /* Evaluate BSDF * cos(theta) */ const Spectrum bsdfVal = bsdf->eval(bRec); - + if (!bsdfVal.isZero()) { /* Calculate prob. of having sampled that direction using BSDF sampling */ Float bsdfPdf = (emitter->isOnSurface() && dRec.measure == ESolidAngle - && interactions == 0) + && interactions == 0) ? bsdf->pdf(bRec) : (Float) 0.0f; - + /* Weight using the power heuristic */ - const Float weight = miWeight(dRec.pdf * numEmitterSamples, + const Float weight = miWeight(dRec.pdf * numEmitterSamples, bsdfPdf * numBSDFSamples) * weightLum; LiSurf += value * bsdfVal * weight; } } } } - + /* ==================================================================== */ /* BSDF sampling */ /* ==================================================================== */ - + if (numBSDFSamples > 1) { sampleArray = rRec.sampler->next2DArray( std::max(m_directSamples, m_glossySamples)); @@ -549,7 +549,7 @@ public: Spectrum bsdfVal = bsdf->sample(bRec, bsdfPdf, sampleArray[i]); if (bsdfVal.isZero()) continue; - + /* Trace a ray in this direction */ RayDifferential bsdfRay(its.p, its.toWorld(bRec.wo), ray.time); @@ -574,13 +574,13 @@ public: } if (hitEmitter) { - const Float emitterPdf = (!(bRec.sampledType & BSDF::EDelta)) ? + const Float emitterPdf = (!(bRec.sampledType & BSDF::EDelta)) ? scene->pdfEmitterDirect(dRec) : 0; - Spectrum transmittance = rRec2.medium ? + Spectrum transmittance = rRec2.medium ? rRec2.medium->evalTransmittance(Ray(bsdfRay, 0, bsdfIts.t)) : Spectrum(1.0f); - const Float weight = miWeight(bsdfPdf * numBSDFSamples, + const Float weight = miWeight(bsdfPdf * numBSDFSamples, emitterPdf * numEmitterSamples) * weightBSDF; LiSurf += value * bsdfVal * weight * transmittance; @@ -588,7 +588,7 @@ public: /* Recurse */ if (!isDiffuse && (rRec.type & RadianceQueryRecord::EIndirectSurfaceRadiance) && !cacheQuery) { - rRec2.recursiveQuery(rRec, + rRec2.recursiveQuery(rRec, RadianceQueryRecord::ERadianceNoEmission); rRec2.type ^= RadianceQueryRecord::EIntersection; @@ -623,7 +623,7 @@ public: Spectrum bsdfVal = bsdf->sample(bRec, bsdfPdf, sampleArray[i]); if (bsdfVal.isZero()) continue; - rRec2.recursiveQuery(rRec, + rRec2.recursiveQuery(rRec, RadianceQueryRecord::ERadianceNoEmission); RayDifferential bsdfRay(its.p, its.toWorld(bRec.wo), ray.time); diff --git a/src/integrators/photonmapper/ppm.cpp b/src/integrators/photonmapper/ppm.cpp index f543d6ae..f031791d 100644 --- a/src/integrators/photonmapper/ppm.cpp +++ b/src/integrators/photonmapper/ppm.cpp @@ -28,37 +28,37 @@ MTS_NAMESPACE_BEGIN * \parameter{maxDepth}{\Integer}{Specifies the longest path depth * in the generated output image (where \code{-1} corresponds to $\infty$). * A value of \code{1} will only render directly visible light sources. - * \code{2} will lead to single-bounce (direct-only) illumination, + * \code{2} will lead to single-bounce (direct-only) illumination, * and so on. \default{\code{-1}} * } * \parameter{photonCount}{\Integer}{Number of photons to be shot per iteration\default{250000}} - * \parameter{initialRadius}{\Float}{Initial radius of gather points in world space units. + * \parameter{initialRadius}{\Float}{Initial radius of gather points in world space units. * \default{0, i.e. decide automatically}} * \parameter{alpha}{\Float}{Radius reduction parameter \code{alpha} from the paper\default{0.7}} * \parameter{granularity}{\Integer}{ - Granularity of photon tracing work units for the purpose + Granularity of photon tracing work units for the purpose of parallelization (in \# of shot particles) \default{0, i.e. decide automatically} * } - * \parameter{rrDepth}{\Integer}{Specifies the minimum path depth, after - * which the implementation will start to use the ``russian roulette'' + * \parameter{rrDepth}{\Integer}{Specifies the minimum path depth, after + * which the implementation will start to use the ``russian roulette'' * path termination criterion. \default{\code{5}} * } * } - * This plugin implements the progressive photon mapping algorithm by Hachisuka et al. + * This plugin implements the progressive photon mapping algorithm by Hachisuka et al. * \cite{Hachisuka2008Progressive}. Progressive photon mapping is a variant of photon * mapping that alternates between photon shooting and gathering passes that involve * a relatively small (e.g. 250K) numbers of photons that are subsequently discarded. * - * This is done in a way such that the variance and bias of the resulting output + * This is done in a way such that the variance and bias of the resulting output * vanish as the number of passes tends to infinity. The progressive nature of this * method enables renderings with an effectively arbitrary number of photons - * without exhausting the available system memory. + * without exhausting the available system memory. * - * The desired sample count specified in the sample generator configuration + * The desired sample count specified in the sample generator configuration * determines how many photon query points are created per pixel. It should not be * set too high, since the rendering time is approximately proportional to - * this number. For good results, use between 2-4 samples along with the - * \code{ldsampler}. Once started, the rendering process continues indefinitely + * this number. For good results, use between 2-4 samples along with the + * \code{ldsampler}. Once started, the rendering process continues indefinitely * until it is manually stopped. * * \remarks{ @@ -98,7 +98,7 @@ public: m_alpha = props.getFloat("alpha", .7); /* Number of photons to shoot in each iteration */ m_photonCount = props.getInteger("photonCount", 250000); - /* Granularity of the work units used in parallelizing the + /* Granularity of the work units used in parallelizing the particle tracing task (default: choose automatically). */ m_granularity = props.getInteger("granularity", 0); /* Longest visualized path length (-1=infinite). When a positive value is @@ -110,7 +110,7 @@ public: /* Indicates if the gathering steps should be canceled if not enough photons are generated. */ m_autoCancelGathering = props.getBoolean("autoCancelGathering", true); m_mutex = new Mutex(); - if (m_maxDepth <= 1 && m_maxDepth != -1) + if (m_maxDepth <= 1 && m_maxDepth != -1) Log(EError, "Maximum depth must either be set to \"-1\" or \"2\" or higher!"); } @@ -120,7 +120,7 @@ public: m_workUnits.clear(); } - void configureSampler(const Scene *scene, Sampler *sampler) { + void configureSampler(const Scene *scene, Sampler *sampler) { /* Prepare the sampler for bucket-based rendering */ sampler->setFilmResolution(scene->getFilm()->getCropSize(), true); } @@ -144,19 +144,19 @@ public: return true; } - bool render(Scene *scene, RenderQueue *queue, + bool render(Scene *scene, RenderQueue *queue, const RenderJob *job, int sceneResID, int sensorResID, int samplerResID) { ref sched = Scheduler::getInstance(); ref sensor = scene->getSensor(); ref film = sensor->getFilm(); size_t nCores = sched->getCoreCount(); Sampler *sensorSampler = (Sampler *) sched->getResource(samplerResID, 0); - + size_t sampleCount = sensorSampler->getSampleCount(); Vector2i cropSize = film->getCropSize(); Point2i cropOffset = film->getCropOffset(); - Log(EInfo, "Starting render job (%ix%i, " SIZE_T_FMT " %s, " SIZE_T_FMT - " %s, " SSE_STR ") ..", cropSize.x, cropSize.y, sampleCount, + Log(EInfo, "Starting render job (%ix%i, " SIZE_T_FMT " %s, " SIZE_T_FMT + " %s, " SSE_STR ") ..", cropSize.x, cropSize.y, sampleCount, sampleCount == 1 ? "sample" : "samples", nCores, nCores == 1 ? "core" : "cores"); m_running = true; @@ -184,7 +184,7 @@ public: samplers[i] = clonedSampler.get(); } - int indepSamplerResID = sched->registerMultiResource(samplers); + int indepSamplerResID = sched->registerMultiResource(samplers); for (size_t i=0; igetCoreCount(); ++i) samplers[i]->decRef(); @@ -203,7 +203,7 @@ public: PPMWorkUnit *wu = new PPMWorkUnit(); m_workUnits[xofs/blockSize+yofs/blockSize*blocksW] = wu; - wu->block = new ImageBlock(Bitmap::ESpectrumAlphaWeight, + wu->block = new ImageBlock(Bitmap::ESpectrumAlphaWeight, Vector2i(blockSize), film->getReconstructionFilter()); wu->block->setOffset(Point2i(cropOffset.x + xofs, cropOffset.y + yofs)); wu->gatherPoints.clear(); @@ -226,10 +226,10 @@ public: if (needsTimeSample) timeSample = sensorSampler->next1D(); sample.x += x; sample.y += y; - sensor->sampleRayDifferential(sensorRay, sample, + sensor->sampleRayDifferential(sensorRay, sample, apertureSample, timeSample); size_t offset = wu->gatherPoints.size(); - int count = createGatherPoints(scene, sensorRay, sample, + int count = createGatherPoints(scene, sensorRay, sample, sensorSampler, Spectrum(1.0f), wu->gatherPoints, 1); const Float fcount = static_cast(count); for (int i = 0; i &gatherPoints, int depth) { int count = 0; if (depth >= m_maxDepth && m_maxDepth != -1) @@ -291,7 +291,7 @@ public: const Float rrProb = depth < 4 ? 1 : 0.8f; if (sampler->next1D() < rrProb) { RayDifferential recursiveRay(p.its.p, p.its.toWorld(bRec.wo), ray.time); - count += createGatherPoints(scene, recursiveRay, sample, sampler, + count += createGatherPoints(scene, recursiveRay, sample, sampler, weight * bsdfVal / rrProb, gatherPoints, depth+1); } } @@ -307,9 +307,9 @@ public: return count; } - void photonMapPass(int it, RenderQueue *queue, const RenderJob *job, + void photonMapPass(int it, RenderQueue *queue, const RenderJob *job, Film *film, int sceneResID, int sensorResID, int samplerResID) { - Log(EInfo, "Performing a photon mapping pass %i (" SIZE_T_FMT " photons so far)", + Log(EInfo, "Performing a photon mapping pass %i (" SIZE_T_FMT " photons so far)", it, m_totalPhotons); ref sched = Scheduler::getInstance(); @@ -328,7 +328,7 @@ public: ref photonMap = proc->getPhotonMap(); photonMap->build(); - Log(EDebug, "Photon map full. Shot " SIZE_T_FMT " particles, excess photons due to parallelism: " + Log(EDebug, "Photon map full. Shot " SIZE_T_FMT " particles, excess photons due to parallelism: " SIZE_T_FMT, proc->getShotParticles(), proc->getExcessPhotons()); Log(EInfo, "Gathering .."); @@ -348,7 +348,7 @@ public: GatherPoint &g = wu->gatherPoints[i]; if (g.radius == 0) { - /* Generate a black sample -- necessary for proper + /* Generate a black sample -- necessary for proper sample weight computation at surface boundaries */ wu->block->put(g.sample, g.emission, 1); continue; diff --git a/src/integrators/photonmapper/sppm.cpp b/src/integrators/photonmapper/sppm.cpp index 6fb2c0e0..58811832 100644 --- a/src/integrators/photonmapper/sppm.cpp +++ b/src/integrators/photonmapper/sppm.cpp @@ -20,7 +20,7 @@ #include #include #include - + #if defined(MTS_OPENMP) # include #endif @@ -33,30 +33,30 @@ MTS_NAMESPACE_BEGIN * \parameter{maxDepth}{\Integer}{Specifies the longest path depth * in the generated output image (where \code{-1} corresponds to $\infty$). * A value of \code{1} will only render directly visible light sources. - * \code{2} will lead to single-bounce (direct-only) illumination, + * \code{2} will lead to single-bounce (direct-only) illumination, * and so on. \default{\code{-1}} * } * \parameter{photonCount}{\Integer}{Number of photons to be shot per iteration\default{250000}} - * \parameter{initialRadius}{\Float}{Initial radius of gather points in world space units. + * \parameter{initialRadius}{\Float}{Initial radius of gather points in world space units. * \default{0, i.e. decide automatically}} * \parameter{alpha}{\Float}{Radius reduction parameter \code{alpha} from the paper\default{0.7}} * \parameter{granularity}{\Integer}{ - Granularity of photon tracing work units for the purpose + Granularity of photon tracing work units for the purpose of parallelization (in \# of shot particles) \default{0, i.e. decide automatically} * } - * \parameter{rrDepth}{\Integer}{Specifies the minimum path depth, after - * which the implementation will start to use the ``russian roulette'' + * \parameter{rrDepth}{\Integer}{Specifies the minimum path depth, after + * which the implementation will start to use the ``russian roulette'' * path termination criterion. \default{\code{5}} * } * } - * This plugin implements stochastic progressive photon mapping by Hachisuka et al. - * \cite{Hachisuka2009Stochastic}. This algorithm is an extension of progressive photon - * mapping (\pluginref{ppm}) that improves convergence + * This plugin implements stochastic progressive photon mapping by Hachisuka et al. + * \cite{Hachisuka2009Stochastic}. This algorithm is an extension of progressive photon + * mapping (\pluginref{ppm}) that improves convergence * when rendering scenes involving depth-of-field, motion blur, and glossy reflections. * * Note that the implementation of \pluginref{sppm} in Mitsuba ignores the sampler - * configuration---hence, the usual steps of choosing a sample generator and a desired - * number of samples per pixel are not necessary. As with \pluginref{ppm}, once started, + * configuration---hence, the usual steps of choosing a sample generator and a desired + * number of samples per pixel are not necessary. As with \pluginref{ppm}, once started, * the rendering process continues indefinitely until it is manually stopped. * * \remarks{ @@ -90,7 +90,7 @@ public: m_alpha = props.getFloat("alpha", .7); /* Number of photons to shoot in each iteration */ m_photonCount = props.getInteger("photonCount", 250000); - /* Granularity of the work units used in parallelizing the + /* Granularity of the work units used in parallelizing the particle tracing task (default: choose automatically). */ m_granularity = props.getInteger("granularity", 0); /* Longest visualized path length (-1=infinite). When a positive value is @@ -102,7 +102,7 @@ public: /* Indicates if the gathering steps should be canceled if not enough photons are generated. */ m_autoCancelGathering = props.getBoolean("autoCancelGathering", true); m_mutex = new Mutex(); - if (m_maxDepth <= 1 && m_maxDepth != -1) + if (m_maxDepth <= 1 && m_maxDepth != -1) Log(EError, "Maximum depth must be set to \"2\" or higher!"); } @@ -134,14 +134,14 @@ public: return true; } - bool render(Scene *scene, RenderQueue *queue, + bool render(Scene *scene, RenderQueue *queue, const RenderJob *job, int sceneResID, int sensorResID, int unused) { ref sched = Scheduler::getInstance(); ref sensor = scene->getSensor(); ref film = sensor->getFilm(); size_t nCores = sched->getCoreCount(); - Log(EInfo, "Starting render job (%ix%i, " SIZE_T_FMT " %s, " SSE_STR ") ..", - film->getCropSize().x, film->getCropSize().y, + Log(EInfo, "Starting render job (%ix%i, " SIZE_T_FMT " %s, " SSE_STR ") ..", + film->getCropSize().x, film->getCropSize().y, nCores, nCores == 1 ? "core" : "cores"); Vector2i cropSize = film->getCropSize(); @@ -188,9 +188,9 @@ public: #endif int it=0; - while (m_running) { + while (m_running) { distributedRTPass(scene, samplers); - photonMapPass(++it, queue, job, film, sceneResID, + photonMapPass(++it, queue, job, film, sceneResID, sensorResID, samplerResID); } @@ -261,13 +261,13 @@ public: gatherPoint.depth = -1; break; } - + const BSDF *bsdf = gatherPoint.its.getBSDF(); /* Create hit point if this is a diffuse material or a glossy one, and there has been a previous interaction with a glossy material */ - if ((bsdf->getType() & BSDF::EAll) == BSDF::EDiffuseReflection || + if ((bsdf->getType() & BSDF::EAll) == BSDF::EDiffuseReflection || (bsdf->getType() & BSDF::EAll) == BSDF::EDiffuseTransmission || (depth + 1 > m_maxDepth && m_maxDepth != -1)) { gatherPoint.weight = weight; @@ -282,7 +282,7 @@ public: gatherPoint.depth = -1; break; } - ray = RayDifferential(gatherPoint.its.p, + ray = RayDifferential(gatherPoint.its.p, gatherPoint.its.toWorld(bRec.wo), ray.time); ++depth; } @@ -299,9 +299,9 @@ public: } } - void photonMapPass(int it, RenderQueue *queue, const RenderJob *job, + void photonMapPass(int it, RenderQueue *queue, const RenderJob *job, Film *film, int sceneResID, int sensorResID, int samplerResID) { - Log(EInfo, "Performing a photon mapping pass %i (" SIZE_T_FMT " photons so far)", + Log(EInfo, "Performing a photon mapping pass %i (" SIZE_T_FMT " photons so far)", it, m_totalPhotons); ref sched = Scheduler::getInstance(); @@ -320,7 +320,7 @@ public: ref photonMap = proc->getPhotonMap(); photonMap->build(); - Log(EDebug, "Photon map full. Shot " SIZE_T_FMT " particles, excess photons due to parallelism: " + Log(EDebug, "Photon map full. Shot " SIZE_T_FMT " particles, excess photons due to parallelism: " SIZE_T_FMT, proc->getShotParticles(), proc->getExcessPhotons()); Log(EInfo, "Gathering .."); @@ -347,7 +347,7 @@ public: flux = Spectrum(0.0f); } - if (N == 0 && !gp.emission.isZero()) + if (N == 0 && !gp.emission.isZero()) gp.N = N = 1; if (N+M == 0) { @@ -356,8 +356,8 @@ public: Float ratio = (N + m_alpha * M) / (N + M); gp.radius = gp.radius * std::sqrt(ratio); - gp.flux = (gp.flux + - gp.weight * flux + + gp.flux = (gp.flux + + gp.weight * flux + gp.emission * (Float) proc->getShotParticles() * M_PI * gp.radius*gp.radius) * ratio; gp.N = N + m_alpha * M; contrib = gp.flux / ((Float) m_totalEmitted * gp.radius*gp.radius * M_PI); diff --git a/src/integrators/pssmlt/pssmlt.cpp b/src/integrators/pssmlt/pssmlt.cpp index 825acaea..2787aeb4 100644 --- a/src/integrators/pssmlt/pssmlt.cpp +++ b/src/integrators/pssmlt/pssmlt.cpp @@ -41,20 +41,20 @@ MTS_NAMESPACE_BEGIN * \parameter{maxDepth}{\Integer}{Specifies the longest path depth * in the generated output image (where \code{-1} corresponds to $\infty$). * A value of \code{1} will only render directly visible light sources. - * \code{2} will lead to single-bounce (direct-only) illumination, + * \code{2} will lead to single-bounce (direct-only) illumination, * and so on. \default{\code{-1}} * } * \parameter{directSamples}{\Integer}{ - * By default, this plugin renders the direct illumination component - * separately using an optimized direct illumination sampling strategy + * By default, this plugin renders the direct illumination component + * separately using an optimized direct illumination sampling strategy * that uses low-discrepancy number sequences for superior performance * (in other words, it is \emph{not} rendered by PSSMLT). This * parameter specifies the number of samples allocated to that method. To * force PSSMLT to be responsible for the direct illumination * component as well, set this parameter to \code{-1}. \default{16} * } - * \parameter{rrDepth}{\Integer}{Specifies the minimum path depth, after - * which the implementation will start to use the ``russian roulette'' + * \parameter{rrDepth}{\Integer}{Specifies the minimum path depth, after + * which the implementation will start to use the ``russian roulette'' * path termination criterion. \default{\code{5}} * } * \parameter{luminanceSamples}{\Integer}{ @@ -86,30 +86,30 @@ MTS_NAMESPACE_BEGIN * of a path\vspace{-5mm}} * } * In contrast to simple methods like path tracing that render - * images by performing a na\"ive and memoryless random search for light paths, - * PSSMLT actively searches for \emph{relevant} light paths (as is the case - * for other MCMC methods). Once such a path is found, the algorithm tries to + * images by performing a na\"ive and memoryless random search for light paths, + * PSSMLT actively searches for \emph{relevant} light paths (as is the case + * for other MCMC methods). Once such a path is found, the algorithm tries to * explore neighboring paths to amortize the cost of the search. This can * significantly improve the convergence rate of difficult input. * Scenes that were already relatively easy to render usually don't benefit - * much from PSSMLT, since the MCMC data management causes additional + * much from PSSMLT, since the MCMC data management causes additional * computational overheads. * * An interesting aspect of PSSMLT is that it performs this exploration * of light paths by perturbing the ``random numbers'' that were initially - * used to construct the path. Subsequent regeneration of the path using the + * used to construct the path. Subsequent regeneration of the path using the * perturbed numbers yields a new path in a slightly different configuration, and * this process repeats over and over again. * The path regeneration step is fairly general and this is what makes * the method powerful: in particular, it is possible to use PSSMLT as a * layer on top of an existing method to create a new ``metropolized'' - * version of the rendering algorithm that is enhanced with a certain + * version of the rendering algorithm that is enhanced with a certain * degree of adaptiveness as described earlier. * - * The PSSMLT implementation in Mitsuba can operate on top of either a simple - * unidirectional volumetric path tracer or a fully-fledged bidirectional path - * tracer with multiple importance sampling, and this choice is controlled by the - * \code{bidirectional} flag. The unidirectional path tracer is generally + * The PSSMLT implementation in Mitsuba can operate on top of either a simple + * unidirectional volumetric path tracer or a fully-fledged bidirectional path + * tracer with multiple importance sampling, and this choice is controlled by the + * \code{bidirectional} flag. The unidirectional path tracer is generally * much faster, but it produces lower-quality samples. Depending on the input, either may be preferable. * \vspace{-7mm} * \paragraph{Caveats:} @@ -117,20 +117,20 @@ MTS_NAMESPACE_BEGIN * to know. The first one is that they only render ``relative'' output images, * meaning that there is a missing scale factor that must be applied to * obtain proper scene radiance values. The implementation in Mitsuba relies - * on an additional Monte Carlo estimator to recover this scale factor. By - * default, it uses 100K samples (controlled by the \code{luminanceSamples} + * on an additional Monte Carlo estimator to recover this scale factor. By + * default, it uses 100K samples (controlled by the \code{luminanceSamples} * parameter), which should be adequate for most applications. * * The second caveat is that the amount of computational expense * associated with a pixel in the output image is roughly proportional to * its intensity. This means that when a bright object (e.g. the sun) is * visible in a rendering, most resources are committed to rendering the - * sun disk at the cost of increased variance everywhere else. Since this is + * sun disk at the cost of increased variance everywhere else. Since this is * usually not desired, the \code{twoStage} parameter can be used to - * enable \emph{Two-stage MLT} in this case. + * enable \emph{Two-stage MLT} in this case. * - * In this mode of operation, the renderer first creates a low-resolution - * version of the output image to determine the approximate distribution of + * In this mode of operation, the renderer first creates a low-resolution + * version of the output image to determine the approximate distribution of * luminance values. The second stage then performs the actual rendering, while * using the previously collected information to ensure that * the amount of time spent rendering each pixel is uniform. @@ -153,9 +153,9 @@ public: /* Note: a bunch of the parameters below are not publicly exposed, because there is really little sense for most users to ever change them. */ - /* Longest visualized path length (-1=infinite). - A value of 1 will visualize only directly visible light - sources. 2 will lead to single-bounce (direct-only) + /* Longest visualized path length (-1=infinite). + A value of 1 will visualize only directly visible light + sources. 2 will lead to single-bounce (direct-only) illumination, and so on. */ m_config.maxDepth = props.getInteger("maxDepth", -1); @@ -167,13 +167,13 @@ public: Otherwise, the implementation reverts to a basic path tracer. Generally, the bidirectinal path tracer should be noticably better, so it's best to this setting at its default. */ - m_config.technique = props.getBoolean("bidirectional", true) ? + m_config.technique = props.getBoolean("bidirectional", true) ? PathSampler::EBidirectional : PathSampler::EUnidirectional; /* This setting can be very useful to reduce noise in dark regions of the image: it activates two-stage MLT, where a nested MLT renderer - first creates a tiny version of the output image. In a second pass, - the full version is then rendered, while making use of information + first creates a tiny version of the output image. In a second pass, + the full version is then rendered, while making use of information about the image-space luminance distribution found in the first pass. Two-stage MLT is very useful in making the noise characteristics more uniform over time image -- specifically, since MLT tends to get @@ -183,8 +183,8 @@ public: /* When running two-stage MLT, this parameter determines the size of the downsampled image created in the first pass (i.e. setting this to 16 means that the horizontal/vertical resolution will be 16 times - lower). Usually, it's fine to leave this parameter unchanged. When - the two-stage process introduces noisy halos around very bright image + lower). Usually, it's fine to leave this parameter unchanged. When + the two-stage process introduces noisy halos around very bright image regions, it can be set to a lower value */ m_config.firstStageSizeReduction = props.getInteger( "firstStageSizeReduction", 16); @@ -193,31 +193,31 @@ public: two-stage MLT approach know that it is running the first stage */ m_config.firstStage= props.getBoolean("firstStage", false); - /* Number of samples used to estimate the total luminance + /* Number of samples used to estimate the total luminance received by the sensor's sensor */ m_config.luminanceSamples = props.getInteger("luminanceSamples", 100000); - /* Probability of creating large mutations in the [Kelemen et. al] + /* Probability of creating large mutations in the [Kelemen et. al] MLT variant. The default is 0.3. */ m_config.pLarge = props.getFloat("pLarge", 0.3f); - /* This parameter can be used to specify the samples per pixel used to + /* This parameter can be used to specify the samples per pixel used to render the direct component. Should be a power of two (otherwise, it will be rounded to the next one). When set to zero or less, the direct illumination component will be hidden, which is useful - for analyzing the component rendered by MLT. When set to -1, + for analyzing the component rendered by MLT. When set to -1, PSSMLT will handle direct illumination as well */ m_config.directSamples = props.getInteger("directSamples", 16); m_config.separateDirect = m_config.directSamples >= 0; - /* Should the multiple importance sampling-based weight computation by + /* Should the multiple importance sampling-based weight computation by Kelemen et al. be used? Otherwise, the implementation falls back to the 'use of expectations' technique from Veach-style MLT. */ m_config.kelemenStyleWeights = props.getBoolean("kelemenStyleWeights", true); /* Should an optimized direct illumination sampling strategy be used for s=1 paths? (as opposed to plain emission sampling). Usually - a good idea. Note that this setting only applies when the + a good idea. Note that this setting only applies when the bidirectional path tracer is used internally. The optimization affects all paths, not just the ones contributing direct illumination, hence it is completely unrelated to the separateDirect @@ -233,12 +233,12 @@ public: m_config.mutationSizeLow < m_config.mutationSizeHigh); /* Specifies the number of parallel work units required for - multithreaded and network rendering. When set to -1, the + multithreaded and network rendering. When set to -1, the amount will default to four times the number of cores. Note that - every additional work unit entails a significant amount of - communication overhead (a full-sized floating put image must be - transmitted), hence it is important to set this value as low as - possible, while ensuring that there are enough units to keep all + every additional work unit entails a significant amount of + communication overhead (a full-sized floating put image must be + transmitted), hence it is important to set this value as low as + possible, while ensuring that there are enough units to keep all workers busy. */ m_config.workUnits = props.getInteger("workUnits", -1); @@ -260,7 +260,7 @@ public: m_config.serialize(stream); } - bool preprocess(const Scene *scene, RenderQueue *queue, + bool preprocess(const Scene *scene, RenderQueue *queue, const RenderJob *job, int sceneResID, int sensorResID, int samplerResID) { Integrator::preprocess(scene, queue, job, sceneResID, @@ -312,15 +312,15 @@ public: Vector2i cropSize = film->getCropSize();; Log(EInfo, "Starting %srender job (%ix%i, " SIZE_T_FMT - " %s, " SSE_STR ", approx. " SIZE_T_FMT " mutations/pixel) ..", + " %s, " SSE_STR ", approx. " SIZE_T_FMT " mutations/pixel) ..", nested ? "nested " : "", cropSize.x, cropSize.y, nCores, nCores == 1 ? "core" : "cores", sampleCount); - size_t desiredMutationsPerWorkUnit = + size_t desiredMutationsPerWorkUnit = m_config.technique == PathSampler::EBidirectional ? 100000 : 200000; - if (m_config.workUnits <= 0) - m_config.workUnits = std::max((int) std::ceil((cropSize.x + if (m_config.workUnits <= 0) + m_config.workUnits = std::max((int) std::ceil((cropSize.x * cropSize.y * sampleCount) / (Float) desiredMutationsPerWorkUnit), 1); m_config.nMutations = (cropSize.x * cropSize.y * @@ -328,7 +328,7 @@ public: ref directImage; if (m_config.separateDirect && m_config.directSamples > 0 && !nested) { - directImage = BidirectionalUtils::renderDirectComponent(scene, + directImage = BidirectionalUtils::renderDirectComponent(scene, sceneResID, sensorResID, queue, job, m_config.directSamples); if (directImage == NULL) return false; @@ -336,19 +336,19 @@ public: std::vector pathSeeds; ref rplSampler = new ReplayableSampler(); - ref pathSampler = new PathSampler(m_config.technique, scene, + ref pathSampler = new PathSampler(m_config.technique, scene, rplSampler, rplSampler, rplSampler, m_config.maxDepth, m_config.rrDepth, m_config.separateDirect, m_config.directSampling); - ref process = new PSSMLTProcess(job, queue, + ref process = new PSSMLTProcess(job, queue, m_config, directImage, pathSeeds); - - m_config.luminance = pathSampler->generateSeeds(m_config.luminanceSamples, + + m_config.luminance = pathSampler->generateSeeds(m_config.luminanceSamples, m_config.workUnits, false, pathSeeds); if (!nested) m_config.dump(); - + /* Create a sampler instance for each worker */ ref mltSampler = new PSSMLTSampler(m_config); std::vector mltSamplers(scheduler->getCoreCount()); @@ -373,7 +373,7 @@ public: m_process = NULL; scheduler->unregisterResource(rplSamplerResID); process->develop(); - + return process->getReturnStatus() == ParallelProcess::ESuccess; } diff --git a/src/integrators/pssmlt/pssmlt_proc.cpp b/src/integrators/pssmlt/pssmlt_proc.cpp index f7e1899e..96727a80 100644 --- a/src/integrators/pssmlt/pssmlt_proc.cpp +++ b/src/integrators/pssmlt/pssmlt_proc.cpp @@ -27,22 +27,22 @@ MTS_NAMESPACE_BEGIN /* Worker implementation */ /* ==================================================================== */ -StatsCounter largeStepRatio("Primary sample space MLT", +StatsCounter largeStepRatio("Primary sample space MLT", "Accepted large steps", EPercentage); -StatsCounter smallStepRatio("Primary sample space MLT", +StatsCounter smallStepRatio("Primary sample space MLT", "Accepted small steps", EPercentage); -StatsCounter acceptanceRate("Primary sample space MLT", +StatsCounter acceptanceRate("Primary sample space MLT", "Overall acceptance rate", EPercentage); -StatsCounter forcedAcceptance("Primary sample space MLT", +StatsCounter forcedAcceptance("Primary sample space MLT", "Number of forced acceptances"); class PSSMLTRenderer : public WorkProcessor { public: - PSSMLTRenderer(const PSSMLTConfiguration &conf) + PSSMLTRenderer(const PSSMLTConfiguration &conf) : m_config(conf) { } - PSSMLTRenderer(Stream *stream, InstanceManager *manager) + PSSMLTRenderer(Stream *stream, InstanceManager *manager) : WorkProcessor(stream, manager) { m_config = PSSMLTConfiguration(stream); } @@ -80,8 +80,8 @@ public: m_emitterSampler = new PSSMLTSampler(m_origSampler); m_directSampler = new PSSMLTSampler(m_origSampler); - m_pathSampler = new PathSampler(m_config.technique, m_scene, - m_emitterSampler, m_sensorSampler, m_directSampler, m_config.maxDepth, + m_pathSampler = new PathSampler(m_config.technique, m_scene, + m_emitterSampler, m_sensorSampler, m_directSampler, m_config.maxDepth, m_config.rrDepth, m_config.separateDirect, m_config.directSampling); } @@ -119,10 +119,10 @@ public: m_emitterSampler->accept(); m_directSampler->accept(); - /* Sanity check -- the luminance should match the one from + /* Sanity check -- the luminance should match the one from the warmup phase - an error here would indicate inconsistencies regarding the use of random numbers during sample generation */ - if (std::abs((current->luminance - seed.luminance) + if (std::abs((current->luminance - seed.luminance) / seed.luminance) > Epsilon) Log(EError, "Error when reconstructing a seed path: luminance " "= %f, but expected luminance = %f", current->luminance, seed.luminance); @@ -133,7 +133,7 @@ public: Float cumulativeWeight = 0; current->normalize(m_config.importanceMap); for (uint64_t mutationCtr=0; mutationCtrgetTimeout() > 0 && (mutationCtr % 8192) == 0 + if (wu->getTimeout() > 0 && (mutationCtr % 8192) == 0 && (int) timer->getMilliseconds() > wu->getTimeout()) break; @@ -171,7 +171,7 @@ public: accept = (a == 1) || (random->nextFloat() < a); } else { if (m_config.kelemenStyleWeights) - currentWeight = current->luminance + currentWeight = current->luminance / (current->luminance/m_config.luminance + m_config.pLarge); else currentWeight = 1; @@ -183,7 +183,7 @@ public: if (accept) { for (size_t k=0; ksize(); ++k) { Spectrum value = current->getValue(k) * cumulativeWeight; - if (!value.isZero()) + if (!value.isZero()) result->put(current->getPosition(k), &value[0]); } @@ -205,7 +205,7 @@ public: } else { for (size_t k=0; ksize(); ++k) { Spectrum value = proposed->getValue(k) * proposedWeight; - if (!value.isZero()) + if (!value.isZero()) result->put(proposed->getPosition(k), &value[0]); } @@ -213,9 +213,9 @@ public: m_emitterSampler->reject(); m_directSampler->reject(); acceptanceRate.incrementBase(1); - if (largeStep) + if (largeStep) largeStepRatio.incrementBase(1); - else + else smallStepRatio.incrementBase(1); } } @@ -254,9 +254,9 @@ private: /* Parallel process */ /* ==================================================================== */ -PSSMLTProcess::PSSMLTProcess(const RenderJob *parent, RenderQueue *queue, +PSSMLTProcess::PSSMLTProcess(const RenderJob *parent, RenderQueue *queue, const PSSMLTConfiguration &conf, const Bitmap *directImage, - const std::vector &seeds) : m_job(parent), m_queue(queue), + const std::vector &seeds) : m_job(parent), m_queue(queue), m_config(conf), m_progress(NULL), m_seeds(seeds) { m_directImage = directImage; m_timeoutTimer = new Timer(); @@ -293,7 +293,7 @@ void PSSMLTProcess::develop() { avgLuminance /= (Float) pixelCount; Float luminanceFactor = m_config.luminance / avgLuminance; - + for (size_t i=0; iupdate(++m_resultCounter); m_refreshTimeout = std::min(2000U, m_refreshTimeout * 2); - /* Re-develop the entire image every two seconds if partial results are + /* Re-develop the entire image every two seconds if partial results are visible (e.g. in a graphical user interface). */ if (m_job->isInteractive() && m_refreshTimer->getMilliseconds() > m_refreshTimeout) develop(); @@ -340,7 +340,7 @@ ParallelProcess::EStatus PSSMLTProcess::generateWork(WorkUnit *unit, int worker) void PSSMLTProcess::bindResource(const std::string &name, int id) { ParallelProcess::bindResource(name, id); - if (name == "sensor") { + if (name == "sensor") { m_film = static_cast(Scheduler::getInstance()->getResource(id))->getFilm(); if (m_progress) delete m_progress; diff --git a/src/integrators/pssmlt/pssmlt_sampler.cpp b/src/integrators/pssmlt/pssmlt_sampler.cpp index ce6fac46..2b4e8aad 100644 --- a/src/integrators/pssmlt/pssmlt_sampler.cpp +++ b/src/integrators/pssmlt/pssmlt_sampler.cpp @@ -34,7 +34,7 @@ PSSMLTSampler::PSSMLTSampler(PSSMLTSampler *sampler) : Sampler(Properties()), configure(); } -PSSMLTSampler::PSSMLTSampler(Stream *stream, InstanceManager *manager) +PSSMLTSampler::PSSMLTSampler(Stream *stream, InstanceManager *manager) : Sampler(stream, manager) { m_random = static_cast(manager->getInstance(stream)); m_s1 = stream->readFloat(); @@ -74,7 +74,7 @@ void PSSMLTSampler::reset() { } void PSSMLTSampler::reject() { - for (size_t i=0; inextFloat(); @@ -107,13 +107,13 @@ public: /// Accept a mutation void accept(); - + /// Reject a mutation void reject(); /// Replace the underlying random number generator inline void setRandom(Random *random) { m_random = random; } - + /// Return the underlying random number generator inline Random *getRandom() { return m_random; } @@ -136,7 +136,7 @@ protected: Float value; size_t modify; - inline SampleStruct(Float value) : value(value), modify(0) { } + inline SampleStruct(Float value) : value(value), modify(0) { } }; ref m_random; diff --git a/src/integrators/ptracer/ptracer.cpp b/src/integrators/ptracer/ptracer.cpp index 28d3cf3d..264b2ca5 100644 --- a/src/integrators/ptracer/ptracer.cpp +++ b/src/integrators/ptracer/ptracer.cpp @@ -26,17 +26,17 @@ MTS_NAMESPACE_BEGIN * \parameter{maxDepth}{\Integer}{Specifies the longest path depth * in the generated output image (where \code{-1} corresponds to $\infty$). * A value of \code{1} will only render directly visible light sources. - * \code{2} will lead to single-bounce (direct-only) illumination, + * \code{2} will lead to single-bounce (direct-only) illumination, * and so on. \default{\code{-1}} * } - * \parameter{rrDepth}{\Integer}{Specifies the minimum path depth, after - * which the implementation will start to use the ``russian roulette'' + * \parameter{rrDepth}{\Integer}{Specifies the minimum path depth, after + * which the implementation will start to use the ``russian roulette'' * path termination criterion. \default{\code{5}} * } * \parameter{granularity}{\Integer}{ - * Specifies the work unit granularity used to parallize the the particle + * Specifies the work unit granularity used to parallize the the particle * tracing task. This should be set high enough so that accumulating - * partially exposed images (and potentially sending them over the network) + * partially exposed images (and potentially sending them over the network) * is not the bottleneck. * \default{200K particles per work unit, i.e. \code{200000}} * } @@ -48,30 +48,30 @@ MTS_NAMESPACE_BEGIN * } * } * - * This plugin implements a simple adjoint particle tracer. It does + * This plugin implements a simple adjoint particle tracer. It does * essentially the exact opposite of the simple volumetric path tracer - * (\pluginref[volpathsimple]{volpath\_simple}): instead of tracing rays from - * the sensor and attempting to connect them to the light source, this - * integrator shoots particles from the light source and attempts to connect + * (\pluginref[volpathsimple]{volpath\_simple}): instead of tracing rays from + * the sensor and attempting to connect them to the light source, this + * integrator shoots particles from the light source and attempts to connect * them to the sensor. * * Usually, this is a relatively useless rendering technique due to * its high variance, but there are some cases where it excels. - * In particular, it does a good job on scenes where most scattering + * In particular, it does a good job on scenes where most scattering * events are directly visible to the camera. * - * When rendering with a finite-aperture sensor (e.g. \pluginref{thinlens}) - * this integrator is able to intersect the actual aperture, which allows + * When rendering with a finite-aperture sensor (e.g. \pluginref{thinlens}) + * this integrator is able to intersect the actual aperture, which allows * it to handle certain caustic paths that would otherwise not be visible. * * It also supports a specialized ``brute force'' mode, where the integrator * does not attempt to create connections to the sensor and purely relies on * hitting it via ray tracing. This is one of the worst conceivable rendering - * and not recommended for any applications. It is mainly included for + * and not recommended for any applications. It is mainly included for * debugging purposes. * * The number of traced particles is given by the number of ``samples per - * pixel'' of the sample generator times the pixel count of the output image. + * pixel'' of the sample generator times the pixel count of the output image. * For instance, 16 samples per pixel on a 512$\times$512 image will cause 4M particles * to be generated. * @@ -88,11 +88,11 @@ public: /* Longest visualized path length (-1=infinite). A value of 1 will produce a black image, since this integrator - does not visualize directly visible light sources, + does not visualize directly visible light sources, 2 will lead to single-bounce (direct-only) illumination, and so on. */ m_maxDepth = props.getInteger("maxDepth", -1); - /* Granularity of the work units used in parallelizing + /* Granularity of the work units used in parallelizing the particle tracing task (default: 200K samples). Should be high enough so that sending and accumulating the partially exposed films is not the bottleneck. */ @@ -107,8 +107,8 @@ public: if (m_maxDepth <= 0 && m_maxDepth != -1) Log(EError, "'maxDepth' must be set to -1 (infinite) or a value greater than zero!"); } - - AdjointParticleTracer(Stream *stream, InstanceManager *manager) + + AdjointParticleTracer(Stream *stream, InstanceManager *manager) : Integrator(stream, manager) { m_maxDepth = stream->readInt(); m_rrDepth = stream->readInt(); @@ -142,15 +142,15 @@ public: Scheduler::getInstance()->cancel(m_process); } - bool render(Scene *scene, RenderQueue *queue, + bool render(Scene *scene, RenderQueue *queue, const RenderJob *job, int sceneResID, int sensorResID, int samplerResID) { ref scheduler = Scheduler::getInstance(); ref sensor = scene->getSensor(); const Film *film = sensor->getFilm(); size_t sampleCount = scene->getSampler()->getSampleCount(); size_t nCores = scheduler->getCoreCount(); - Log(EInfo, "Starting render job (%ix%i, " SIZE_T_FMT " samples, " SIZE_T_FMT - " %s, " SSE_STR ") ..", film->getCropSize().x, film->getCropSize().y, + Log(EInfo, "Starting render job (%ix%i, " SIZE_T_FMT " samples, " SIZE_T_FMT + " %s, " SSE_STR ") ..", film->getCropSize().x, film->getCropSize().y, sampleCount, nCores, nCores == 1 ? "core" : "cores"); int maxPtracerDepth = m_maxDepth - 1; diff --git a/src/integrators/ptracer/ptracer_proc.cpp b/src/integrators/ptracer/ptracer_proc.cpp index 6cac9756..b5a2886f 100644 --- a/src/integrators/ptracer/ptracer_proc.cpp +++ b/src/integrators/ptracer/ptracer_proc.cpp @@ -19,7 +19,7 @@ #include "ptracer_proc.h" MTS_NAMESPACE_BEGIN - + /* ==================================================================== */ /* Work result impl. */ /* ==================================================================== */ @@ -61,7 +61,7 @@ void CaptureParticleWorker::prepare() { } ref CaptureParticleWorker::clone() const { - return new CaptureParticleWorker(m_maxDepth, + return new CaptureParticleWorker(m_maxDepth, m_maxPathDepth, m_rrDepth, m_bruteForce); } @@ -70,7 +70,7 @@ ref CaptureParticleWorker::createWorkResult() const { return new CaptureParticleWorkResult(film->getCropSize(), m_rfilter.get()); } -void CaptureParticleWorker::process(const WorkUnit *workUnit, WorkResult *workResult, +void CaptureParticleWorker::process(const WorkUnit *workUnit, WorkResult *workResult, const bool &stop) { const RangeWorkUnit *range = static_cast(workUnit); m_workResult = static_cast(workResult); @@ -91,7 +91,7 @@ void CaptureParticleWorker::handleEmission(const PositionSamplingRecord &pRec, Spectrum value = weight * m_scene->sampleAttenuatedSensorDirect( dRec, medium, maxInteractions, m_sampler->next2D(), m_sampler); - if (value.isZero()) + if (value.isZero()) return; const Emitter *emitter = static_cast(pRec.object); @@ -110,7 +110,7 @@ void CaptureParticleWorker::handleSurfaceInteraction(int depth, return; const Sensor *sensor = its.shape->getSensor(); - if (sensor != m_sensor) + if (sensor != m_sensor) return; Vector wi = its.toWorld(its.wi); @@ -123,7 +123,7 @@ void CaptureParticleWorker::handleSurfaceInteraction(int depth, return; } - if (m_bruteForce || (depth >= m_maxPathDepth && m_maxPathDepth > 0)) + if (m_bruteForce || (depth >= m_maxPathDepth && m_maxPathDepth > 0)) return; int maxInteractions = m_maxPathDepth - depth - 1; @@ -137,7 +137,7 @@ void CaptureParticleWorker::handleSurfaceInteraction(int depth, return; const BSDF *bsdf = its.getBSDF(); - + Vector wo = dRec.d; BSDFSamplingRecord bRec(its, its.toLocal(wo), EImportance); @@ -145,7 +145,7 @@ void CaptureParticleWorker::handleSurfaceInteraction(int depth, Vector wi = its.toWorld(its.wi); Float wiDotGeoN = dot(its.geoFrame.n, wi), woDotGeoN = dot(its.geoFrame.n, wo); - if (wiDotGeoN * Frame::cosTheta(bRec.wi) <= 0 || + if (wiDotGeoN * Frame::cosTheta(bRec.wi) <= 0 || woDotGeoN * Frame::cosTheta(bRec.wo) <= 0) return; @@ -160,14 +160,14 @@ void CaptureParticleWorker::handleSurfaceInteraction(int depth, } void CaptureParticleWorker::handleMediumInteraction(int depth, bool caustic, - const MediumSamplingRecord &mRec, const Medium *medium, const Vector &wi, + const MediumSamplingRecord &mRec, const Medium *medium, const Vector &wi, const Spectrum &weight) { - if (m_bruteForce || (depth >= m_maxPathDepth && m_maxPathDepth > 0)) + if (m_bruteForce || (depth >= m_maxPathDepth && m_maxPathDepth > 0)) return; DirectSamplingRecord dRec(mRec); - + int maxInteractions = m_maxPathDepth - depth - 1; Spectrum value = weight * m_scene->sampleAttenuatedSensorDirect( @@ -193,17 +193,17 @@ void CaptureParticleWorker::handleMediumInteraction(int depth, bool caustic, /* ==================================================================== */ void CaptureParticleProcess::develop() { - Float weight = (m_accum->getWidth() * m_accum->getHeight()) + Float weight = (m_accum->getWidth() * m_accum->getHeight()) / (Float) m_receivedResultCount; m_film->setBitmap(m_accum->getBitmap(), weight); m_queue->signalRefresh(m_job); } void CaptureParticleProcess::processResult(const WorkResult *wr, bool cancelled) { - const CaptureParticleWorkResult *result + const CaptureParticleWorkResult *result = static_cast(wr); const RangeWorkUnit *range = result->getRangeWorkUnit(); - if (cancelled) + if (cancelled) return; LockGuard lock(m_resultMutex); @@ -224,7 +224,7 @@ void CaptureParticleProcess::bindResource(const std::string &name, int id) { } ref CaptureParticleProcess::createWorkProcessor() const { - return new CaptureParticleWorker(m_maxDepth, m_maxPathDepth, + return new CaptureParticleWorker(m_maxDepth, m_maxPathDepth, m_rrDepth, m_bruteForce); } diff --git a/src/integrators/ptracer/ptracer_proc.h b/src/integrators/ptracer/ptracer_proc.h index 51c38eea..15ede4c4 100644 --- a/src/integrators/ptracer/ptracer_proc.h +++ b/src/integrators/ptracer/ptracer_proc.h @@ -36,7 +36,7 @@ MTS_NAMESPACE_BEGIN */ class CaptureParticleWorkResult : public ImageBlock { public: - inline CaptureParticleWorkResult(const Vector2i &res, const ReconstructionFilter *filter) + inline CaptureParticleWorkResult(const Vector2i &res, const ReconstructionFilter *filter) : ImageBlock(Bitmap::ESpectrum, res, filter) { setOffset(Point2i(0, 0)); setSize(res); @@ -74,7 +74,7 @@ protected: */ class CaptureParticleWorker : public ParticleTracer { public: - inline CaptureParticleWorker(int maxDepth, int maxPathDepth, + inline CaptureParticleWorker(int maxDepth, int maxPathDepth, int rrDepth, bool bruteForce) : ParticleTracer(maxDepth, rrDepth, true), m_maxPathDepth(maxPathDepth), m_bruteForce(bruteForce) { } @@ -85,12 +85,12 @@ public: void prepare(); ref clone() const; ref createWorkResult() const; - void process(const WorkUnit *workUnit, WorkResult *workResult, + void process(const WorkUnit *workUnit, WorkResult *workResult, const bool &stop); - + /** * Handles particles emitted by a light source - if a connection to the - * sensor is possible, compute the importance and accumulate in the proper + * sensor is possible, compute the importance and accumulate in the proper * pixel of the accumulation buffer. */ void handleEmission(const PositionSamplingRecord &pRec, @@ -98,7 +98,7 @@ public: /** * Handles particles interacting with a surface - if a connection to the - * sensor is possible, compute the importance and accumulate in the proper + * sensor is possible, compute the importance and accumulate in the proper * pixel of the accumulation buffer. */ void handleSurfaceInteraction(int depth, bool caustic, @@ -107,7 +107,7 @@ public: /** * Handles particles interacting with a medium - if a connection to the - * sensor is possible, compute the importance and accumulate in the proper + * sensor is possible, compute the importance and accumulate in the proper * pixel of the accumulation buffer. */ void handleMediumInteraction(int depth, bool caustic, @@ -135,11 +135,11 @@ private: */ class CaptureParticleProcess : public ParticleProcess { public: - CaptureParticleProcess(const RenderJob *job, RenderQueue *queue, - size_t sampleCount, size_t granularity, int maxDepth, + CaptureParticleProcess(const RenderJob *job, RenderQueue *queue, + size_t sampleCount, size_t granularity, int maxDepth, int maxPathDepth, int rrDepth, bool bruteForce) - : ParticleProcess(ParticleProcess::ETrace, sampleCount, - granularity, "Rendering", job), m_job(job), m_queue(queue), + : ParticleProcess(ParticleProcess::ETrace, sampleCount, + granularity, "Rendering", job), m_job(job), m_queue(queue), m_maxDepth(maxDepth), m_maxPathDepth(maxPathDepth), m_rrDepth(rrDepth), m_bruteForce(bruteForce) { } diff --git a/src/integrators/vpl/vpl.cpp b/src/integrators/vpl/vpl.cpp index 003f82b6..cbd636e5 100644 --- a/src/integrators/vpl/vpl.cpp +++ b/src/integrators/vpl/vpl.cpp @@ -45,20 +45,20 @@ MTS_NAMESPACE_BEGIN * } * } * - * This integrator implements a hardware-accelerated global illumination - * rendering technique based on the Instant Radiosity method by Keller + * This integrator implements a hardware-accelerated global illumination + * rendering technique based on the Instant Radiosity method by Keller * \cite{Keller1997Instant}. This is the same approach that is also used in * Mitsuba's real-time preview; the reason for providing it as a separate * integrator plugin is to enable automated (e.g. scripted) usage. * - * The method roughly works as follows: during a pre-process pass, any present direct - * and indirect illumination is converted into a set of \emph{virtual point light} - * sources (VPLs). The scene is then separately rendered many times, each time using + * The method roughly works as follows: during a pre-process pass, any present direct + * and indirect illumination is converted into a set of \emph{virtual point light} + * sources (VPLs). The scene is then separately rendered many times, each time using * a different VPL as a source of illumination. All of the renderings created in this - * manner are accumulated to create the final output image. + * manner are accumulated to create the final output image. * * Because the individual rendering steps can be exectuted on a - * graphics card, it is possible to render many (i.e. 100-1000) VPLs + * graphics card, it is possible to render many (i.e. 100-1000) VPLs * per second. The method is not without problems, however. In particular, * it performs poorly when rendering glossy materials, and it produces * artifacts in corners and creases . Mitsuba automatically limits @@ -72,7 +72,7 @@ MTS_NAMESPACE_BEGIN * blotches appear in corners and creases.}{integrator_vpl_clamping0} * \rendering{\code{clamping=0.3}: Higher clamping factors remove these * artifacts, but they lead to visible energy loss (the rendering - * is too dark in certain areas). The default of \code{0.1} is + * is too dark in certain areas). The default of \code{0.1} is * usually reasonable.}{integrator_vpl_clamping03} * } */ @@ -89,7 +89,7 @@ public: m_session = Session::create(); m_device = Device::create(m_session); m_renderer = Renderer::create(m_session); - + m_random = new Random(); } @@ -104,7 +104,7 @@ public: Transform projTransform = sensor->getProjectionTransform(apertureSample, aaSample); Transform worldTransform = sensor->getWorldTransform()->eval( - sensor->getShutterOpen() + + sensor->getShutterOpen() + m_random->nextFloat() * sensor->getShutterOpenTime()); m_shaderManager->setVPL(vpl); m_framebuffer->activateTarget(); @@ -140,7 +140,7 @@ public: m_cancel = true; } - bool render(Scene *scene, RenderQueue *queue, + bool render(Scene *scene, RenderQueue *queue, const RenderJob *job, int sceneResID, int sensorResID, int samplerResID) { ref sensor = scene->getSensor(); ref film = sensor->getFilm(); @@ -225,7 +225,7 @@ public: m_renderer->blitTexture(m_framebuffer, true); m_accumBuffer->releaseTarget(); - if ((i%20) == 0) { + if ((i%20) == 0) { m_renderer->flush(); m_renderer->checkError(); } diff --git a/src/libbidir/common.cpp b/src/libbidir/common.cpp index aeaa9e1a..7b52b494 100644 --- a/src/libbidir/common.cpp +++ b/src/libbidir/common.cpp @@ -47,8 +47,8 @@ std::string MutationRecord::toString() const { std::ostringstream oss; oss << "MutationRecord[" << "type=" << type - << ", l=" << l - << ", m=" << m + << ", l=" << l + << ", m=" << m << ", kd=" << m-l << ", ka=" << ka << ", weight=" << weight.toString() diff --git a/src/libbidir/edge.cpp b/src/libbidir/edge.cpp index edf7921d..6ad50fb1 100644 --- a/src/libbidir/edge.cpp +++ b/src/libbidir/edge.cpp @@ -24,7 +24,7 @@ MTS_NAMESPACE_BEGIN static StatsCounter mediumInconsistencies("Bidirectional layer", "Medium inconsistencies in connect()"); -bool PathEdge::sampleNext(const Scene *scene, Sampler *sampler, +bool PathEdge::sampleNext(const Scene *scene, Sampler *sampler, const PathVertex *pred, const Ray &ray, PathVertex *succ, ETransportMode mode) { /* First, check if there is a surface in the sampled direction */ @@ -64,9 +64,9 @@ bool PathEdge::sampleNext(const Scene *scene, Sampler *sampler, return true; } -bool PathEdge::perturbDirection(const Scene *scene, - const PathVertex *pred, const Ray &ray, Float dist, - PathVertex::EVertexType desiredType, PathVertex *succ, +bool PathEdge::perturbDirection(const Scene *scene, + const PathVertex *pred, const Ray &ray, Float dist, + PathVertex::EVertexType desiredType, PathVertex *succ, ETransportMode mode) { /* First, check if there is a surface in the sampled direction */ Intersection &its = succ->getIntersection(); @@ -76,14 +76,14 @@ bool PathEdge::perturbDirection(const Scene *scene, next vertex is invalid or a surface or medium scattering event */ MediumSamplingRecord mRec; - bool wantMedium = + bool wantMedium = desiredType == PathVertex::EMediumInteraction; if ((wantMedium && dist > its.t) || dist <= 0) return false; if (medium) - medium->eval(Ray(ray, 0, + medium->eval(Ray(ray, 0, wantMedium ? std::min(dist, its.t) : its.t), mRec); if (medium && wantMedium) { @@ -109,7 +109,7 @@ bool PathEdge::perturbDirection(const Scene *scene, } else { pdf[mode] = succ->isMediumInteraction() ? mRec.pdfSuccess : mRec.pdfFailure; pdf[1-mode] = pred->isMediumInteraction() ? mRec.pdfSuccessRev : mRec.pdfFailure; - if (pdf[mode] == 0 || pdf[1-mode] == 0) + if (pdf[mode] == 0 || pdf[1-mode] == 0) return false; weight[mode] = mRec.transmittance / pdf[mode]; weight[1-mode] = mRec.transmittance / pdf[1-mode]; @@ -133,7 +133,7 @@ Spectrum PathEdge::evalTransmittance(const PathVertex *pred, const PathVertex *s Ray(a, d/length, 0, length, pred->getTime())); } -Float PathEdge::evalPdf(const PathVertex *pred, +Float PathEdge::evalPdf(const PathVertex *pred, const PathVertex *succ) const { if (succ->isSupernode()) return 0.0f; @@ -143,7 +143,7 @@ Float PathEdge::evalPdf(const PathVertex *pred, Point a = pred->getPosition(), b = succ->getPosition(); Vector d(b-a); - + Float length = d.length(); Ray ray(a, d/length, 0, length, pred->getTime()); @@ -154,9 +154,9 @@ Float PathEdge::evalPdf(const PathVertex *pred, mRec.pdfSuccess : mRec.pdfFailure; } -Spectrum PathEdge::evalCached(const PathVertex *pred, const PathVertex *succ, +Spectrum PathEdge::evalCached(const PathVertex *pred, const PathVertex *succ, unsigned int what) const { - /* Extract the requested information based on what is currently cached in the + /* Extract the requested information based on what is currently cached in the vertex. The actual computation that has to happen here is pretty awful, but it works. It might be worth to change the caching scheme to make this function simpler in a future revision */ @@ -196,18 +196,18 @@ Spectrum PathEdge::evalCached(const PathVertex *pred, const PathVertex *succ, result *= absDot(succ->getShadingNormal(), d); } - if (what & EInverseSquareFalloff) + if (what & EInverseSquareFalloff) result /= length * length; - if (what & ETransmittance) + if (what & ETransmittance) result *= weight[EImportance] * pdf[EImportance]; } return result; } -bool PathEdge::connect(const Scene *scene, - const PathEdge *predEdge, const PathVertex *vs, +bool PathEdge::connect(const Scene *scene, + const PathEdge *predEdge, const PathVertex *vs, const PathVertex *vt, const PathEdge *succEdge) { if (vs->isEmitterSupernode() || vt->isSensorSupernode()) { @@ -227,7 +227,7 @@ bool PathEdge::connect(const Scene *scene, length = d.length(); d /= length; - Ray ray(vtp, d, vt->isOnSurface() ? Epsilon : 0, length * + Ray ray(vtp, d, vt->isOnSurface() ? Epsilon : 0, length * (vs->isOnSurface() ? (1-ShadowEpsilon) : 1), vs->getTime()); /* Check for occlusion */ @@ -257,7 +257,7 @@ bool PathEdge::connect(const Scene *scene, pdf[ERadiance] = vs->isMediumInteraction() ? mRec.pdfSuccess : mRec.pdfFailure; /* Fail if there is no throughput */ - if (mRec.transmittance.isZero() || pdf[EImportance] == 0 || pdf[ERadiance] == 0) + if (mRec.transmittance.isZero() || pdf[EImportance] == 0 || pdf[ERadiance] == 0) return false; weight[EImportance] = mRec.transmittance / pdf[EImportance]; @@ -271,8 +271,8 @@ bool PathEdge::connect(const Scene *scene, return true; } -bool PathEdge::pathConnect(const Scene *scene, const PathEdge *predEdge, - const PathVertex *vs, Path &result, const PathVertex *vt, +bool PathEdge::pathConnect(const Scene *scene, const PathEdge *predEdge, + const PathVertex *vs, Path &result, const PathVertex *vt, const PathEdge *succEdge, int maxInteractions, MemoryPool &pool) { BDAssert(result.edgeCount() == 0 && result.vertexCount() == 0); @@ -302,7 +302,7 @@ bool PathEdge::pathConnect(const Scene *scene, const PathEdge *predEdge, } Float lengthFactor = vs->isOnSurface() ? (1-ShadowEpsilon) : 1; - Ray ray(vtp, d, vt->isOnSurface() ? Epsilon : 0, + Ray ray(vtp, d, vt->isOnSurface() ? Epsilon : 0, remaining * lengthFactor, vs->getTime()); const Medium *medium = vt->getTargetMedium(succEdge, d); @@ -334,7 +334,7 @@ bool PathEdge::pathConnect(const Scene *scene, const PathEdge *predEdge, edge->pdf[EImportance] = (interactions > 0 || !vt->isMediumInteraction()) ? mRec.pdfFailure : mRec.pdfSuccessRev; - if (edge->pdf[ERadiance] == 0 || edge->pdf[EImportance] == 0 + if (edge->pdf[ERadiance] == 0 || edge->pdf[EImportance] == 0 || mRec.transmittance.isZero()) { /* Zero transmittance */ result.release(pool); @@ -357,7 +357,7 @@ bool PathEdge::pathConnect(const Scene *scene, const PathEdge *predEdge, ray.maxt = remaining * lengthFactor; const BSDF *bsdf = its.getBSDF(); - + /* Account for the ENull interaction */ Vector wo = its.toLocal(ray.d); BSDFSamplingRecord bRec(its, -wo, wo, ERadiance); @@ -370,18 +370,18 @@ bool PathEdge::pathConnect(const Scene *scene, const PathEdge *predEdge, PathVertex *vertex = pool.allocVertex(); vertex->type = PathVertex::ESurfaceInteraction; - vertex->degenerate = !(bsdf->hasComponent(BSDF::ESmooth) + vertex->degenerate = !(bsdf->hasComponent(BSDF::ESmooth) || its.shape->isEmitter() || its.shape->isSensor()); vertex->measure = EDiscrete; vertex->componentType = BSDF::ENull; vertex->pdf[EImportance] = vertex->pdf[ERadiance] = nullPdf; - vertex->weight[EImportance] = vertex->weight[ERadiance] + vertex->weight[EImportance] = vertex->weight[ERadiance] = bsdf->eval(bRec, EDiscrete) / nullPdf; vertex->rrWeight = 1.0f; vertex->getIntersection() = its; result.append(vertex); - if (its.isMediumTransition()) { + if (its.isMediumTransition()) { const Medium *expected = its.getTargetMedium(-ray.d); if (medium != expected) { #if defined(MTS_BD_TRACE) @@ -423,8 +423,8 @@ bool PathEdge::pathConnect(const Scene *scene, const PathEdge *predEdge, return true; } -bool PathEdge::pathConnectAndCollapse(const Scene *scene, const PathEdge *predEdge, - const PathVertex *vs, const PathVertex *vt, +bool PathEdge::pathConnectAndCollapse(const Scene *scene, const PathEdge *predEdge, + const PathVertex *vs, const PathVertex *vt, const PathEdge *succEdge, int &interactions) { if (vs->isEmitterSupernode() || vt->isSensorSupernode()) { Float radianceTransport = vt->isSensorSupernode() ? 1.0f : 0.0f, @@ -520,7 +520,7 @@ bool PathEdge::pathConnectAndCollapse(const Scene *scene, const PathEdge *predEd pdf[EImportance] *= nullPdf; pdf[ERadiance] *= nullPdf; - if (its.isMediumTransition()) { + if (its.isMediumTransition()) { const Medium *expected = its.getTargetMedium(-ray.d); if (medium != expected) { #if defined(MTS_BD_TRACE) diff --git a/src/libbidir/manifold.cpp b/src/libbidir/manifold.cpp index 596b8bf1..c5690da0 100644 --- a/src/libbidir/manifold.cpp +++ b/src/libbidir/manifold.cpp @@ -50,7 +50,7 @@ static StatsCounter statsUpdateFailed( static StatsCounter statsMaxManifold( "Specular manifold", "Max. manifold size", EMaximumValue); -SpecularManifold::SpecularManifold(const Scene *scene, int maxIterations) +SpecularManifold::SpecularManifold(const Scene *scene, int maxIterations) : m_scene(scene) { m_maxIterations = maxIterations > 0 ? maxIterations : MTS_MANIFOLD_MAX_ITERATIONS; @@ -73,7 +73,7 @@ bool SpecularManifold::init(const Path &path, int start, int end) { /* When the endpoint is on an orthographic camera or directional light source, switch to a directionally pinned vertex instead */ if (vs->getType() & (PathVertex::ESensorSample | PathVertex::EEmitterSample)) { - const PositionSamplingRecord &pRec + const PositionSamplingRecord &pRec = vs->getPositionSamplingRecord(); uint32_t type = static_cast(pRec.object)->getType() & (AbstractEmitter::EDeltaDirection | AbstractEmitter::EDeltaPosition); @@ -219,7 +219,7 @@ bool SpecularManifold::computeTangents() { if (ili == 0) return false; - ili = 1/ili; wi *= ili; + ili = 1/ili; wi *= ili; if (v[0].type == EReflection || v[0].type == ERefraction) { Float eta = v[0].eta; @@ -229,9 +229,9 @@ bool SpecularManifold::computeTangents() { Vector H; Float ilh; if (normalizeH) { - /* Generally compute derivatives with respect to the normalized - half-vector. When given an index-matched refraction event, - don't perform this normalization, since the desired vertex + /* Generally compute derivatives with respect to the normalized + half-vector. When given an index-matched refraction event, + don't perform this normalization, since the desired vertex configuration is actually where H = 0. */ if (dot(wi, v[0].gn) < 0) @@ -245,7 +245,7 @@ bool SpecularManifold::computeTangents() { ilh = 1.0f; } - /* Orient the half-vector so that it points in the same + /* Orient the half-vector so that it points in the same hemisphere as the geometric surface normal */ Float dot_H_n = dot(v[0].n, H), @@ -277,7 +277,7 @@ bool SpecularManifold::computeTangents() { /* Derivatives of C with respect to x_i */ dH_du = -v[0].dpdu * (ili + ilo) + wi * (dot(wi, v[0].dpdu) * ili) + wo * (dot(wo, v[0].dpdu) * ilo); - dH_dv = -v[0].dpdv * (ili + ilo) + wi * (dot(wi, v[0].dpdv) * ili) + dH_dv = -v[0].dpdv * (ili + ilo) + wi * (dot(wi, v[0].dpdv) * ili) + wo * (dot(wo, v[0].dpdv) * ilo); if (normalizeH) { @@ -301,7 +301,7 @@ bool SpecularManifold::computeTangents() { } v[0].c = Matrix2x2( - dot(dH_du, s), dot(dH_dv, s), + dot(dH_du, s), dot(dH_dv, s), dot(dH_du, t), dot(dH_dv, t)); /* Store the microfacet normal wrt. the local (orthonormal) shading frame */ @@ -349,7 +349,7 @@ bool SpecularManifold::computeTangents() { Vector ds_dcur_v = cross(dt_dcur_v, wi) + cross(t, dwi_dcur_v); /* Some tangential projections */ - Vector2 + Vector2 t_cur_dpdu (dot(v[ 0].dpdu, s), dot(v[ 0].dpdu, t)), t_cur_dpdv (dot(v[ 0].dpdv, s), dot(v[ 0].dpdv, t)), t_next_dpdu(dot(v[ 1].dpdu, s), dot(v[ 1].dpdu, t)), @@ -379,7 +379,7 @@ bool SpecularManifold::computeTangents() { /* Find the tangent space with respect to translation of the last vertex. For this, we must solve a tridiagonal system. The following is - simplified version of the block tridiagonal LU factorization algorithm + simplified version of the block tridiagonal LU factorization algorithm for this specific problem */ Matrix2x2 Li; if (!m_vertices[0].b.invert(Li)) @@ -393,7 +393,7 @@ bool SpecularManifold::computeTangents() { m_vertices[n-1].Tp = -Li * m_vertices[n-1].c; - for (int i=n-2; i>=0; --i) + for (int i=n-2; i>=0; --i) m_vertices[i].Tp = -m_vertices[i].u * m_vertices[i+1].Tp; return true; } @@ -439,7 +439,7 @@ bool SpecularManifold::project(const Vector &d) { ray.setOrigin(its.p); ray.setDirection(reflect(-ray.d, m)); } else if (vertex.type == ERefraction) { - if (!m_scene->rayIntersect(ray, its)) + if (!m_scene->rayIntersect(ray, its)) return false; Vector n = its.shFrame.n, @@ -460,7 +460,7 @@ bool SpecularManifold::project(const Vector &d) { invLength = 1.0f / length; /* Check for occlusion */ - if (m_scene->rayIntersect(Ray(ray, Epsilon, length))) + if (m_scene->rayIntersect(Ray(ray, Epsilon, length))) return false; vertex.p = ray(length); @@ -535,7 +535,7 @@ bool SpecularManifold::move(const Point &target, const Normal &n) { statsSuccessfulWalks.incrementBase(); - Float invScale = 1.0f / std::max(std::max(std::abs(target.x), + Float invScale = 1.0f / std::max(std::max(std::abs(target.x), std::abs(target.y)), std::abs(target.z)); Float stepSize = 1; @@ -551,9 +551,9 @@ bool SpecularManifold::move(const Point &target, const Normal &n) { Float dist = rel.length(), newDist; if (dist * invScale < MTS_MANIFOLD_EPSILON) { /* Check for an annoying corner-case where the last - two vertices converge to the same point (this can + two vertices converge to the same point (this can happen e.g. on rough planar reflectors) */ - dist = (m_vertices[m_vertices.size()-1].p + dist = (m_vertices[m_vertices.size()-1].p - m_vertices[m_vertices.size()-2].p).length(); if (dist * invScale < Epsilon) { return false; @@ -584,7 +584,7 @@ bool SpecularManifold::move(const Point &target, const Normal &n) { return false; } - /* Take a step using the computed tangents and project + /* Take a step using the computed tangents and project back on the manifold */ #if MTS_MANIFOLD_DEBUG == 1 const SimpleVertex &last = m_vertices[m_vertices.size()-1]; @@ -648,7 +648,7 @@ bool SpecularManifold::update(Path &path, int start, int end) { &v = m_vertices[j], &vn = m_vertices[j+1]; - PathVertex + PathVertex *pred = path.vertexOrNull(i-step), *vertex = path.vertex(i), *succ = path.vertex(i+step); @@ -694,8 +694,8 @@ bool SpecularManifold::update(Path &path, int start, int end) { } i += step; } else if (!v.degenerate) { - if (!vertex->perturbDirection(m_scene, - pred, predEdge, succEdge, succ, d, + if (!vertex->perturbDirection(m_scene, + pred, predEdge, succEdge, succ, d, length, desiredType, mode)) { #if MTS_MANIFOLD_DEBUG == 1 cout << "update(): failed in perturbDirection()" << endl; @@ -704,7 +704,7 @@ bool SpecularManifold::update(Path &path, int start, int end) { return false; } - Float relerr = (vn.p - succ->getPosition()).length() / + Float relerr = (vn.p - succ->getPosition()).length() / std::max(std::max(std::abs(vn.p.x), std::abs(vn.p.y)), std::abs(vn.p.z)); @@ -723,7 +723,7 @@ bool SpecularManifold::update(Path &path, int start, int end) { else compType = BSDF::EDeltaReflection; - if (!vertex->propagatePerturbation(m_scene, + if (!vertex->propagatePerturbation(m_scene, pred, predEdge, succEdge, succ, compType, length, desiredType, mode)) { #if MTS_MANIFOLD_DEBUG == 1 @@ -733,7 +733,7 @@ bool SpecularManifold::update(Path &path, int start, int end) { return false; } - Float relerr = (vn.p - succ->getPosition()).length() / + Float relerr = (vn.p - succ->getPosition()).length() / std::max(std::max(std::abs(vn.p.x), std::abs(vn.p.y)), std::abs(vn.p.z)); if (relerr > 1e-3f) { @@ -792,7 +792,7 @@ Float SpecularManifold::det(const Path &path, int a, int b, int c) { m_vertices[b_idx].c.setZero(); if (nSpecular == 0) { - /* The chain only consists of glossy vertices -- simply compute the + /* The chain only consists of glossy vertices -- simply compute the determinant of the block tridiagonal matrix A. See D.K. Salkuyeh, Comments on "A note on a three-term recurrence for a @@ -814,9 +814,9 @@ Float SpecularManifold::det(const Path &path, int a, int b, int c) { return std::abs(1 / det); } else { /* The chain contains both glossy and specular materials. Compute the - determinant of A^-1, where rows corresponding to specular vertices + determinant of A^-1, where rows corresponding to specular vertices have been crossed out. The performance of the following is probably - terrible (lots of dynamic memory allocation), but it works and + terrible (lots of dynamic memory allocation), but it works and this case happens rarely enough .. */ Eigen::Matrix A(2*(nGlossy + nSpecular), 2*(nGlossy + nSpecular)); @@ -902,7 +902,7 @@ Float SpecularManifold::G(const Path &path, int a, int b) { if (std::abs(a-b) == 1) { if (a > b) std::swap(a, b); - return path.edge(a)->evalCached(path.vertex(a), + return path.edge(a)->evalCached(path.vertex(a), path.vertex(b), PathEdge::EGeometricTerm)[0]; } diff --git a/src/libbidir/mut_bidir.cpp b/src/libbidir/mut_bidir.cpp index 75b169d9..abdc6daf 100644 --- a/src/libbidir/mut_bidir.cpp +++ b/src/libbidir/mut_bidir.cpp @@ -22,14 +22,14 @@ MTS_NAMESPACE_BEGIN -static StatsCounter statsAccepted("Bidirectional mutation", +static StatsCounter statsAccepted("Bidirectional mutation", "Acceptance rate", EPercentage); -static StatsCounter statsGenerated("Bidirectional mutation", +static StatsCounter statsGenerated("Bidirectional mutation", "Successful generation rate", EPercentage); BidirectionalMutator::BidirectionalMutator(const Scene *scene, - Sampler *sampler, MemoryPool &pool, int kmin, int kmax) : - m_scene(scene), m_sampler(sampler), m_pool(pool), + Sampler *sampler, MemoryPool &pool, int kmin, int kmax) : + m_scene(scene), m_sampler(sampler), m_pool(pool), m_kmin(kmin), m_kmax(kmax) { } @@ -38,7 +38,7 @@ BidirectionalMutator::~BidirectionalMutator() { } Mutator::EMutationType BidirectionalMutator::getType() const { return EBidirectionalMutation; } - + Float BidirectionalMutator::suitability(const Path &path) const { return 1.0f; } @@ -56,12 +56,12 @@ bool BidirectionalMutator::sampleMutation( desiredLength.configure(k, m_kmin, m_kmax); int kPrime = desiredLength.sample(m_sampler->next1D()); - /* Sample the length of the deletion (in # of edges, 1 means + /* Sample the length of the deletion (in # of edges, 1 means no vertices are removed). When kPrime is smaller than k, we must delete at least k-kPrime+1 edges to be able to achieve the desired path length. - - When k==kPrime, we must delete *something*, or the mutation + + When k==kPrime, we must delete *something*, or the mutation is trivial, hence the conditional below expression. */ int minDeletion = std::max((k == kPrime) ? 2 : 1, k-kPrime+1); @@ -76,7 +76,7 @@ bool BidirectionalMutator::sampleMutation( int lMin = 0, lMax = k - kd; if (kd == 1 || ka == 1) { /* This will help to avoid certain path changes that would otherwise - always be rejected. Specifically, we don't want to remove the sensor + always be rejected. Specifically, we don't want to remove the sensor or emitter sample vertex, and we don't want to insert vertices between a sensor/emitter sample and its supernode */ lMin++; lMax--; @@ -91,7 +91,7 @@ bool BidirectionalMutator::sampleMutation( if (m_temp.size() == 0) return false; - int l = m_temp[std::min((int) (m_temp.size() * + int l = m_temp[std::min((int) (m_temp.size() * m_sampler->next1D()), (int) m_temp.size()-1)]; int m = l+kd; @@ -104,17 +104,17 @@ bool BidirectionalMutator::sampleMutation( /* Sample the number of SIS-type steps to take from the emitter direction */ int s = std::min(sMin + (int) ((sMax-sMin+1) * m_sampler->next1D()), sMax); - int t = ka - s - 1; + int t = ka - s - 1; /* Check a few assumptions */ - BDAssert(ka >= 1 && kd >= 1 && kd <= k - && l >= lMin && l <= lMax + BDAssert(ka >= 1 && kd >= 1 && kd <= k + && l >= lMin && l <= lMax && kPrime == k - kd + ka && kPrime >= m_kmin && kPrime <= m_kmax); /* Construct a mutation record */ - muRec = MutationRecord(EBidirectionalMutation, l, m, ka, + muRec = MutationRecord(EBidirectionalMutation, l, m, ka, source.getPrefixSuffixWeight(l, m)); /* Keep some statistics */ @@ -146,28 +146,28 @@ bool BidirectionalMutator::sampleMutation( proposal.append(connectionEdge); proposal.append(m_tempPath, 0, m_tempPath.vertexCount(), true); - BDAssert(proposal.length() == kPrime && + BDAssert(proposal.length() == kPrime && proposal.vertexCount() == proposal.edgeCount() + 1); - const PathVertex + const PathVertex *vsPred = l+s > 0 ? proposal.vertex(l+s-1) : NULL, *vtPred = l+s+2 <= kPrime ? proposal.vertex(l+s+2) : NULL; const PathEdge *vsEdge = l+s > 0 ? proposal.edge(l+s-1) : NULL, *vtEdge = l+s+1 < kPrime ? proposal.edge(l+s+1) : NULL; - /* Now try to connect the two subpaths and reject + /* Now try to connect the two subpaths and reject the proposal if there is no throughput */ PathVertex *vs = proposal.vertex(l+s), *vt = proposal.vertex(l+s+1); - if (!PathVertex::connect(m_scene, vsPred, + if (!PathVertex::connect(m_scene, vsPred, vsEdge, vs, connectionEdge, vt, vtEdge, vtPred)) { proposal.release(l, l+ka+1, m_pool); return false; } - if (m >= k-1) + if (m >= k-1) proposal.vertex(kPrime-1)->updateSamplePosition( proposal.vertex(kPrime-2)); @@ -177,7 +177,7 @@ bool BidirectionalMutator::sampleMutation( Float BidirectionalMutator::pmfMutation(const Path &source, const MutationRecord &muRec) const { TwoTailedGeoDistr desiredLength(2), deletionLength(2); - const int k = source.length(), m = muRec.m, l = muRec.l, + const int k = source.length(), m = muRec.m, l = muRec.l, kd = m - l, ka = muRec.ka, kPrime = k - kd + ka; int minDeletion = std::max((k == kPrime) ? 2 : 1, k-kPrime+1); @@ -188,7 +188,7 @@ Float BidirectionalMutator::pmfMutation(const Path &source, const MutationRecord ++sMin; else if (m == k && m_scene->hasDegenerateSensor()) --sMax; - + int lMin = 0, lMax = k - kd, ctr = 0; if (kd == 1 || ka == 1) { lMin++; lMax--; @@ -210,13 +210,13 @@ Float BidirectionalMutator::pmfMutation(const Path &source, const MutationRecord Float factor2 = deletionLength.pmf(kd); Float factor3 = 1 / (Float) ctr; Float factor4 = (Float) 1 / (Float) (sMax-sMin+1); - + return factor1 * factor2 * factor3 * factor4; } Float BidirectionalMutator::Q(const Path &source, const Path &proposal, const MutationRecord &muRec) const { - const int k = source.length(), l = muRec.l, + const int k = source.length(), l = muRec.l, m = muRec.m, ka = muRec.ka, mPrime = l+ka; Spectrum *importanceWeights = (Spectrum *) alloca(ka * sizeof(Spectrum)), @@ -245,7 +245,7 @@ Float BidirectionalMutator::Q(const Path &source, const Path &proposal, Float result = 0.0f; for (int s = sMin; s <= sMax; ++s) { const PathEdge *edge = proposal.edge(l+s); - const PathVertex *vs = proposal.vertex(l+s), + const PathVertex *vs = proposal.vertex(l+s), *vt = proposal.vertex(l+s+1); int t = ka - s - 1; @@ -253,7 +253,7 @@ Float BidirectionalMutator::Q(const Path &source, const Path &proposal, if (!vs->isConnectable() || !vt->isConnectable()) continue; - Spectrum weight = importanceWeights[s] + Spectrum weight = importanceWeights[s] * radianceWeights[t] * edge->evalCached(vs, vt, PathEdge::EEverything) * muRec.weight; diff --git a/src/libbidir/mut_caustic.cpp b/src/libbidir/mut_caustic.cpp index 20dc8ee1..b5790c9d 100644 --- a/src/libbidir/mut_caustic.cpp +++ b/src/libbidir/mut_caustic.cpp @@ -21,9 +21,9 @@ MTS_NAMESPACE_BEGIN -static StatsCounter statsAccepted("Caustic perturbation", +static StatsCounter statsAccepted("Caustic perturbation", "Acceptance rate", EPercentage); -static StatsCounter statsGenerated("Caustic perturbation", +static StatsCounter statsGenerated("Caustic perturbation", "Successful generation rate", EPercentage); CausticPerturbation::CausticPerturbation(const Scene *scene, Sampler *sampler, @@ -37,14 +37,14 @@ CausticPerturbation::CausticPerturbation(const Scene *scene, Sampler *sampler, Vector2i filmSize = camera->getFilm()->getSize(), cropSize = camera->getFilm()->getCropSize(); - /* Simple heuristic for choosing a jump size: assumes that each + /* Simple heuristic for choosing a jump size: assumes that each pixel on the camera subtends the same area on the sphere */ Float degPerPixel = std::min( - camera->getXFov() / filmSize.x, + camera->getXFov() / filmSize.x, camera->getYFov() / filmSize.y), radPerPixel = degPerPixel * M_PI / 180.0f; - Float r1 = minJump, + Float r1 = minJump, r2 = std::sqrt(coveredArea * cropSize.x*cropSize.y / M_PI); /* [Veach, p. 354] */ /* These represent the *desired* angle change range as seen from the camera */ @@ -58,7 +58,7 @@ CausticPerturbation::~CausticPerturbation() { } Mutator::EMutationType CausticPerturbation::getType() const { return ECausticPerturbation; } - + Float CausticPerturbation::suitability(const Path &path) const { int k = path.length(), m = k - 1, l = m - 1; @@ -86,7 +86,7 @@ bool CausticPerturbation::sampleMutation( if (l < 1) return false; - muRec = MutationRecord(ECausticPerturbation, l, m, m-l, + muRec = MutationRecord(ECausticPerturbation, l, m, m-l, source.getPrefixSuffixWeight(l, m)); statsAccepted.incrementBase(); statsGenerated.incrementBase(); @@ -94,13 +94,13 @@ bool CausticPerturbation::sampleMutation( /* Heuristic perturbation size computation (Veach, p.354) */ Float lengthE = source.edge(m-1)->length; Float lengthL = 0; - for (int i=l; ilength; Float factor = lengthE/lengthL, theta1 = m_theta1 * factor, theta2 = m_theta2 * factor; - Vector woSource = normalize(source.vertex(l+1)->getPosition() + Vector woSource = normalize(source.vertex(l+1)->getPosition() - source.vertex(l)->getPosition()); Float phi = m_sampler->next1D() * 2 * M_PI; Float theta = theta2 * math::fastexp(m_logRatio * m_sampler->next1D()); @@ -119,12 +119,12 @@ bool CausticPerturbation::sampleMutation( proposal.vertex(m) = proposal.vertex(m)->clone(m_pool); BDAssert(proposal.vertexCount() == source.vertexCount()); BDAssert(proposal.edgeCount() == source.edgeCount()); - - Float dist = source.edge(l)->length + + + Float dist = source.edge(l)->length + perturbMediumDistance(m_sampler, source.vertex(l+1)); /* Sample a perturbation and propagate it through specular interactions */ - if (!proposal.vertex(l)->perturbDirection(m_scene, + if (!proposal.vertex(l)->perturbDirection(m_scene, proposal.vertex(l-1), proposal.edge(l-1), proposal.edge(l), proposal.vertex(l+1), wo, dist, source.vertex(l+1)->getType(), EImportance)) { @@ -132,7 +132,7 @@ bool CausticPerturbation::sampleMutation( return false; } - Vector woProposal = normalize(proposal.vertex(l+1)->getPosition() + Vector woProposal = normalize(proposal.vertex(l+1)->getPosition() - source.vertex(l)->getPosition()); theta = unitAngle(woSource, woProposal); if (theta >= theta2 || theta <= theta1) { @@ -143,20 +143,20 @@ bool CausticPerturbation::sampleMutation( /* If necessary, propagate the perturbation through a sequence of ideally specular interactions */ for (int i=l+1; ilength + + Float dist = source.edge(i)->length + perturbMediumDistance(m_sampler, source.vertex(i+1)); - if (!proposal.vertex(i)->propagatePerturbation(m_scene, - proposal.vertex(i-1), proposal.edge(i-1), - proposal.edge(i), proposal.vertex(i+1), - source.vertex(i)->getComponentType(), dist, + if (!proposal.vertex(i)->propagatePerturbation(m_scene, + proposal.vertex(i-1), proposal.edge(i-1), + proposal.edge(i), proposal.vertex(i+1), + source.vertex(i)->getComponentType(), dist, source.vertex(i+1)->getType(), EImportance)) { proposal.release(l, m+1, m_pool); return false; } } - if (!PathVertex::connect(m_scene, + if (!PathVertex::connect(m_scene, proposal.vertex(m-2), proposal.edge(m-2), proposal.vertex(m-1), @@ -170,7 +170,7 @@ bool CausticPerturbation::sampleMutation( proposal.vertex(k-1)->updateSamplePosition( proposal.vertex(k-2)); - + ++statsGenerated; return true; } @@ -182,7 +182,7 @@ Float CausticPerturbation::Q(const Path &source, const Path &proposal, /* Heuristic perturbation size computation (Veach, p.354) */ Float lengthE = source.edge(m-1)->length; Float lengthL = 0; - for (int i=l; ilength; Float factor = lengthE/lengthL, theta1 = m_theta1 * factor, @@ -200,11 +200,11 @@ Float CausticPerturbation::Q(const Path &source, const Path &proposal, proposal.vertex(m-1), proposal.vertex(m), PathEdge::EEverything); for (int i=l; ievalCached(v0, v1, + weight *= edge->evalCached(v0, v1, PathEdge::ETransmittance | PathEdge::EValueCosineImp); if (v1->isMediumInteraction()) diff --git a/src/libbidir/mut_lens.cpp b/src/libbidir/mut_lens.cpp index 23ffd666..107702e8 100644 --- a/src/libbidir/mut_lens.cpp +++ b/src/libbidir/mut_lens.cpp @@ -21,9 +21,9 @@ MTS_NAMESPACE_BEGIN -static StatsCounter statsAccepted("Lens perturbation", +static StatsCounter statsAccepted("Lens perturbation", "Acceptance rate", EPercentage); -static StatsCounter statsGenerated("Lens perturbation", +static StatsCounter statsGenerated("Lens perturbation", "Successful generation rate", EPercentage); LensPerturbation::LensPerturbation(const Scene *scene, Sampler *sampler, @@ -57,7 +57,7 @@ LensPerturbation::~LensPerturbation() { } Mutator::EMutationType LensPerturbation::getType() const { return ELensPerturbation; } - + Float LensPerturbation::suitability(const Path &path) const { int k = path.length(), m = k - 1, l = m-1; @@ -65,7 +65,7 @@ Float LensPerturbation::suitability(const Path &path) const { --l; --l; - return (l >= 0 && path.vertex(l)->isConnectable() + return (l >= 0 && path.vertex(l)->isConnectable() && path.vertex(l+1)->isConnectable()) ? 1.0f : 0.0f; } @@ -76,7 +76,7 @@ bool LensPerturbation::sampleMutation( --l; --l; - muRec = MutationRecord(ELensPerturbation, l, m, m-l, + muRec = MutationRecord(ELensPerturbation, l, m, m-l, source.getPrefixSuffixWeight(l, m)); statsAccepted.incrementBase(); statsGenerated.incrementBase(); @@ -99,7 +99,7 @@ bool LensPerturbation::sampleMutation( if (sensor->sampleRay(ray, proposalSamplePosition, Point2(0.5f), 0.0f).isZero()) return false; - Float focusDistance = sensor->getFocusDistance() / + Float focusDistance = sensor->getFocusDistance() / absDot(sensor->getInverseViewTransform(0)(Vector(0,0,1)), ray.d); /* Correct direction based on the current aperture sample. @@ -129,9 +129,9 @@ bool LensPerturbation::sampleMutation( dist += perturbMediumDistance(m_sampler, source.vertex(m-1)); /* Sample a perturbation and propagate it through specular interactions */ - if (!proposal.vertex(m)->perturbDirection(m_scene, + if (!proposal.vertex(m)->perturbDirection(m_scene, proposal.vertex(k), proposal.edge(m), - proposal.edge(m-1), proposal.vertex(m-1), d, dist, + proposal.edge(m-1), proposal.vertex(m-1), d, dist, source.vertex(m-1)->getType(), ERadiance)) { proposal.release(l, m+1, m_pool); return false; @@ -143,17 +143,17 @@ bool LensPerturbation::sampleMutation( Float dist = source.edge(i-1)->length + perturbMediumDistance(m_sampler, source.vertex(i-1)); - if (!proposal.vertex(i)->propagatePerturbation(m_scene, - proposal.vertex(i+1), proposal.edge(i), - proposal.edge(i-1), proposal.vertex(i-1), - source.vertex(i)->getComponentType(), dist, + if (!proposal.vertex(i)->propagatePerturbation(m_scene, + proposal.vertex(i+1), proposal.edge(i), + proposal.edge(i-1), proposal.vertex(i-1), + source.vertex(i)->getComponentType(), dist, source.vertex(i-1)->getType(), ERadiance)) { proposal.release(l, m+1, m_pool); return false; } } - if (!PathVertex::connect(m_scene, + if (!PathVertex::connect(m_scene, l > 0 ? proposal.vertex(l-1) : NULL, l > 0 ? proposal.edge(l-1) : NULL, proposal.vertex(l), @@ -169,7 +169,7 @@ bool LensPerturbation::sampleMutation( proposal.vertex(k-2)); BDAssert(proposal.matchesConfiguration(source)); - + ++statsGenerated; return true; } @@ -183,11 +183,11 @@ Float LensPerturbation::Q(const Path &source, const Path &proposal, PathEdge::EEverything); for (int i=m; i>l+1; --i) { - const PathVertex *v0 = proposal.vertex(i-1), + const PathVertex *v0 = proposal.vertex(i-1), *v1 = proposal.vertex(i); const PathEdge *edge = proposal.edge(i-1); - weight *= edge->evalCached(v0, v1, + weight *= edge->evalCached(v0, v1, PathEdge::ETransmittance | (i != m ? PathEdge::EValueCosineRad : 0)); diff --git a/src/libbidir/mut_manifold.cpp b/src/libbidir/mut_manifold.cpp index 9fdc9493..52b9e313 100644 --- a/src/libbidir/mut_manifold.cpp +++ b/src/libbidir/mut_manifold.cpp @@ -25,22 +25,22 @@ MTS_NAMESPACE_BEGIN #define DIFF_SAMPLES 50000 -static StatsCounter statsAcceptedRad("Manifold perturbation", +static StatsCounter statsAcceptedRad("Manifold perturbation", "Acceptance rate (rad. transport)", EPercentage); -static StatsCounter statsGeneratedRad("Manifold perturbation", +static StatsCounter statsGeneratedRad("Manifold perturbation", "Successful generation rate (rad. transport)", EPercentage); -static StatsCounter statsAcceptedImp("Manifold perturbation", +static StatsCounter statsAcceptedImp("Manifold perturbation", "Acceptance rate (imp. transport)", EPercentage); -static StatsCounter statsGeneratedImp("Manifold perturbation", +static StatsCounter statsGeneratedImp("Manifold perturbation", "Successful generation rate (imp. transport)", EPercentage); -static StatsCounter statsUsedManifold("Manifold perturbation", +static StatsCounter statsUsedManifold("Manifold perturbation", "Perturbations involving manifold walks", EPercentage); -static StatsCounter statsNonReversible("Manifold perturbation", +static StatsCounter statsNonReversible("Manifold perturbation", "Non-reversible walks", EPercentage); -static StatsCounter statsRoughMediumSpecular("Manifold perturbation", +static StatsCounter statsRoughMediumSpecular("Manifold perturbation", "Medium treated as specular", EPercentage); -static StatsCounter statsRoughSurfaceSpecular("Manifold perturbation", +static StatsCounter statsRoughSurfaceSpecular("Manifold perturbation", "Rough material treated as specular", EPercentage); Float ManifoldPerturbation::m_thetaDiffSurface; @@ -50,11 +50,11 @@ int ManifoldPerturbation::m_thetaDiffMediumSamples; Mutex *ManifoldPerturbation::m_thetaDiffMutex = new Mutex(); ManifoldPerturbation::ManifoldPerturbation(const Scene *scene, Sampler *sampler, - MemoryPool &pool, Float probFactor, bool enableOffsetManifolds, - bool enableSpecularMedia, Float avgAngleChangeSurface, - Float avgAngleChangeMedium) : m_scene(scene), - m_sampler(sampler), m_pool(pool), - m_probFactor(probFactor), + MemoryPool &pool, Float probFactor, bool enableOffsetManifolds, + bool enableSpecularMedia, Float avgAngleChangeSurface, + Float avgAngleChangeMedium) : m_scene(scene), + m_sampler(sampler), m_pool(pool), + m_probFactor(probFactor), m_enableOffsetManifolds(enableOffsetManifolds), m_enableSpecularMedia(enableSpecularMedia) { m_manifold = new SpecularManifold(scene); @@ -88,7 +88,7 @@ ManifoldPerturbation::~ManifoldPerturbation() { Mutator::EMutationType ManifoldPerturbation::getType() const { return EManifoldPerturbation; } - + Float ManifoldPerturbation::suitability(const Path &path) const { return path.length() >= 4 ? 1.0f : 0.0f; } @@ -101,7 +101,7 @@ Float ManifoldPerturbation::nonspecularProbSurface(Float alpha) const { Float q = MTS_MANIFOLD_QUANTILE_SURFACE; Float theta_domain = std::atan(-math::fastlog(1-q) * alpha*alpha); - Float theta_diff = m_thetaDiffSurfaceSamples > 0 ? (m_thetaDiffSurface + Float theta_diff = m_thetaDiffSurfaceSamples > 0 ? (m_thetaDiffSurface / (Float) m_thetaDiffSurfaceSamples) : (Float) 0.0f; return (1-std::cos(theta_domain)) @@ -122,7 +122,7 @@ Float ManifoldPerturbation::nonspecularProbMedium(Float g_) const { Float theta_domain = math::safe_acos( (t0*t0 - 2*t0*t1*q + 2*g*t1*q*q) / (t2*t2)); - Float theta_diff = m_thetaDiffMediumSamples > 0 ? (m_thetaDiffMedium + Float theta_diff = m_thetaDiffMediumSamples > 0 ? (m_thetaDiffMedium / (Float) m_thetaDiffMediumSamples) : (Float) 0.0f; Float theta_newdomain = std::min(M_PI, theta_domain + theta_diff); @@ -195,7 +195,7 @@ bool ManifoldPerturbation::sampleMutationRecord( /* Extra optimization: slightly prefer perturbations from the sensor */ #define SENSOR_PROB (Float) 0.25f - if (sample < SENSOR_PROB) { + if (sample < SENSOR_PROB) { a = k-1; step = -1; } else { @@ -251,7 +251,7 @@ bool ManifoldPerturbation::sampleMutation( statsGeneratedRad.incrementBase(); } - muRec = MutationRecord(EManifoldPerturbation, l, m, m-l, + muRec = MutationRecord(EManifoldPerturbation, l, m, m-l, source.getPrefixSuffixWeight(l, m)); #if MTS_MANIFOLD_DEBUG == 1 @@ -276,14 +276,14 @@ bool ManifoldPerturbation::sampleMutation( proposal.append(source, m, k+1); proposal.vertex(a) = proposal.vertex(a)->clone(m_pool); proposal.vertex(c) = proposal.vertex(c)->clone(m_pool); - - const PathVertex + + const PathVertex *vb_old = source.vertex(b), *vb_new = proposal.vertex(b); if (a != 0 && a != k) { /* Sample the first vertex */ - const PathVertex + const PathVertex *pred_old = source.vertex(a-step), *vertex_old = source.vertex(a), *succ_old = source.vertex(a+step); @@ -293,7 +293,7 @@ bool ManifoldPerturbation::sampleMutation( *pred = proposal.vertex(a-step), *vertex = proposal.vertex(a), *succ = proposal.vertex(a+step); - PathEdge + PathEdge *predEdge = proposal.edge(mode == EImportance ? a-step : a-1-step), *succEdge = proposal.edge(mode == EImportance ? a : a-1); @@ -304,11 +304,11 @@ bool ManifoldPerturbation::sampleMutation( VonMisesFisherDistr::forPeakValue(prob_old * m_probFactor * m_probFactor)); Vector sampled = vMF.sample(m_sampler->next2D()); - Vector wo_old = normalize(succ_old->getPosition() + Vector wo_old = normalize(succ_old->getPosition() - vertex_old->getPosition()); Vector wo_new = Frame(wo_old).toWorld(sampled); - if (!vertex->perturbDirection(m_scene, + if (!vertex->perturbDirection(m_scene, pred, predEdge, succEdge, succ, wo_new, succEdge_old->length, succ_old->getType(), mode)) { goto fail; @@ -337,7 +337,7 @@ bool ManifoldPerturbation::sampleMutation( /* Generate subsequent vertices between a .. b deterministically */ for (int i = a + step; i != b; i += step) { - const PathVertex + const PathVertex *pred_old = source.vertex(i-step), *vertex_old = source.vertex(i), *succ_old = source.vertex(i+step); @@ -347,16 +347,16 @@ bool ManifoldPerturbation::sampleMutation( *pred = proposal.vertex(i-step), *vertex = proposal.vertex(i), *succ = proposal.vertex(i+step); - PathEdge + PathEdge *predEdge = proposal.edge(mode == EImportance ? i-step : i-1-step), *succEdge = proposal.edge(mode == EImportance ? i : i-1); if (vertex_old->isSurfaceInteraction()) { - const Intersection + const Intersection &its_old = vertex_old->getIntersection(), &its_new = vertex->getIntersection(); - Vector + Vector wi_old = its_old.toLocal(normalize(pred_old->getPosition() - its_old.p)), wo_old = its_old.toLocal(normalize(succ_old->getPosition() - its_old.p)); @@ -394,7 +394,7 @@ bool ManifoldPerturbation::sampleMutation( if (i+step == b && succ_old->isMediumInteraction()) dist += perturbMediumDistance(m_sampler, succ_old); - if (!vertex->perturbDirection(m_scene, + if (!vertex->perturbDirection(m_scene, pred, predEdge, succEdge, succ, wo_world, dist, succ_old->getType(), mode)) { goto fail; @@ -407,7 +407,7 @@ bool ManifoldPerturbation::sampleMutation( if (i+step == b && succ_old->isMediumInteraction()) dist += perturbMediumDistance(m_sampler, succ_old); - if (!vertex->propagatePerturbation(m_scene, + if (!vertex->propagatePerturbation(m_scene, pred, predEdge, succEdge, succ, component, dist, succ_old->getType(), mode)) { goto fail; @@ -421,7 +421,7 @@ bool ManifoldPerturbation::sampleMutation( n_old(normalize(p_old - pred_old->getPosition())), n_new(normalize(p_new - pred->getPosition())); - Vector + Vector dpdu_old = Vector(p_old) - dot(Vector(p_old), n_old) * n_old, dpdu_new = Vector(p_new) - dot(Vector(p_new), n_new) * n_new; @@ -454,7 +454,7 @@ bool ManifoldPerturbation::sampleMutation( if (i+step == b && succ_old->isMediumInteraction()) dist += perturbMediumDistance(m_sampler, succ_old); - if (!vertex->perturbDirection(m_scene, + if (!vertex->perturbDirection(m_scene, pred, predEdge, succEdge, succ, wo_new, dist, succ_old->getType(), mode)) goto fail; @@ -463,7 +463,7 @@ bool ManifoldPerturbation::sampleMutation( } } - if (!vb_new->isConnectable()) + if (!vb_new->isConnectable()) goto fail; statsUsedManifold.incrementBase(); @@ -472,7 +472,7 @@ bool ManifoldPerturbation::sampleMutation( /* Choose a local parameterization of the specular manifold using a plane with the following normal (which is computed in a reversible manner) */ - + Point p0; Normal n, n1, n2; ++statsUsedManifold; @@ -487,7 +487,7 @@ bool ManifoldPerturbation::sampleMutation( Vector rel = vb_new->getPosition() - vb_old->getPosition(); Float len = rel.length(); - if (len == 0) + if (len == 0) goto fail; rel /= len; @@ -496,7 +496,7 @@ bool ManifoldPerturbation::sampleMutation( n = n1 + n2; n = n - dot(rel, n)*rel; len = n.length(); - if (len == 0) + if (len == 0) goto fail; n /= len; @@ -511,7 +511,7 @@ bool ManifoldPerturbation::sampleMutation( ++statsNonReversible; goto fail; } - + Point p1 = m_manifold->getPosition(1); Float relerr = (p0-p1).length() / std::max(std::max(std::abs(p0.x), std::abs(p0.y)), std::abs(p0.z)); @@ -528,27 +528,27 @@ bool ManifoldPerturbation::sampleMutation( if ((vb_old->isSurfaceInteraction() && m_thetaDiffSurfaceSamples < DIFF_SAMPLES) || (vb_old->isMediumInteraction() && m_thetaDiffMediumSamples < DIFF_SAMPLES)) { /* Compute the half direction-vector change */ - const PathVertex + const PathVertex *pred_old = source.vertex(b-step), *vertex_old = source.vertex(b), *succ_old = source.vertex(b+step); - + const PathVertex *pred_new = proposal.vertex(b-step), *vertex_new = proposal.vertex(b), *succ_new = proposal.vertex(b+step); - + Vector wi_old = normalize(pred_old->getPosition() - vertex_old->getPosition()); Vector wo_old = normalize(succ_old->getPosition() - vertex_old->getPosition()); Vector wi_new = normalize(pred_new->getPosition() - vertex_new->getPosition()); Vector wo_new = normalize(succ_new->getPosition() - vertex_new->getPosition()); - + if (vb_old->isSurfaceInteraction()) { const BSDF *bsdf_old = vertex_old->getIntersection().getBSDF(); Vector n_old = vertex_old->getShadingNormal(); bool reflection = dot(wi_old, n_old) * dot(wo_old, n_old) > 0; Vector m_old(0.0f), m_new(0.0f); - + if (reflection) { m_old = wi_old + wo_old; m_new = wi_new + wo_new; @@ -557,17 +557,17 @@ bool ManifoldPerturbation::sampleMutation( if (eta != 1) { if (dot(wi_old, n_old) < 0) eta = 1/eta; - + m_old = wi_old + wo_old * eta; m_new = wi_new + wo_new * eta; } } - + if (!m_old.isZero()) { m_thetaDiffSurface += unitAngle(normalize(m_old), normalize(m_new)); m_thetaDiffSurfaceSamples++; } - + if (m_thetaDiffSurfaceSamples == DIFF_SAMPLES) Log(EDebug, "Average angle change (surface): %f, p(.2)=%f, p(.1)=%f, p(.01)=%f", radToDeg(m_thetaDiffSurface/m_thetaDiffSurfaceSamples), @@ -577,7 +577,7 @@ bool ManifoldPerturbation::sampleMutation( } else { m_thetaDiffMedium += std::abs(unitAngle(wi_old, wo_old) - unitAngle(wi_new, wo_new)); m_thetaDiffMediumSamples++; - + if (m_thetaDiffMediumSamples == DIFF_SAMPLES) Log(EDebug, "Average angle change (medium): %f, p(.9)=%f, p(.99)=%f", radToDeg(m_thetaDiffMedium/m_thetaDiffMediumSamples), @@ -586,18 +586,18 @@ bool ManifoldPerturbation::sampleMutation( } } } - if (!PathVertex::connect(m_scene, + if (!PathVertex::connect(m_scene, proposal.vertexOrNull(q-1), proposal.edgeOrNull(q-1), proposal.vertex(q), proposal.edge(q), proposal.vertex(q+1), proposal.edgeOrNull(q+1), - proposal.vertexOrNull(q+2), + proposal.vertexOrNull(q+2), source.vertex(q)->isConnectable() ? EArea : EDiscrete, source.vertex(q+1)->isConnectable() ? EArea : EDiscrete)) goto fail; - + if (m >= k-1) proposal.vertex(k-1)->updateSamplePosition( proposal.vertex(k-2)); @@ -621,7 +621,7 @@ Float ManifoldPerturbation::Q(const Path &source, const Path &proposal, c = muRec.extra[2], k = source.length(), step = muRec.extra[3]; - + const PathVertex *vb_old = source.vertex(b), *vb_new = proposal.vertex(b); @@ -632,7 +632,7 @@ Float ManifoldPerturbation::Q(const Path &source, const Path &proposal, if (a != 0 && a != k) { /* Compute the density of the first vertex */ - const PathVertex + const PathVertex *pred = source.vertex(a-step), *vertex = source.vertex(a), *succ_old = source.vertex(a+step), @@ -641,9 +641,9 @@ Float ManifoldPerturbation::Q(const Path &source, const Path &proposal, Float prob_old = std::max(INV_FOURPI, vertex->evalPdf( m_scene.get(), pred, succ_old, mode, ESolidAngle)); - Vector wo_old = normalize(succ_old->getPosition() + Vector wo_old = normalize(succ_old->getPosition() - vertex->getPosition()); - Vector wo_new = normalize(succ_new->getPosition() + Vector wo_new = normalize(succ_new->getPosition() - vertex->getPosition()); Float dp = dot(wo_old, wo_new); @@ -665,7 +665,7 @@ Float ManifoldPerturbation::Q(const Path &source, const Path &proposal, } else { Frame frame(source.vertex(a+step)->getGeometricNormal()); - Float stddev = 1.0f / std::sqrt(2*M_PI * + Float stddev = 1.0f / std::sqrt(2*M_PI * source.vertex(a)->pdf[mode] * m_probFactor * m_probFactor); Float pdf = source.vertex(a+step)->perturbPositionPdf(proposal.vertex(a+step), stddev); @@ -675,21 +675,21 @@ Float ManifoldPerturbation::Q(const Path &source, const Path &proposal, weight /= pdf; } - weight *= + weight *= m_manifold->multiG(proposal, a, c) * m_manifold->det(proposal, a, b, c); for (int i = a; i != b; i += step) { - int l = std::min(i, i+step), + int l = std::min(i, i+step), r = std::max(i, i+step); if (!proposal.vertex(i)->isConnectable()) - weight *= proposal.edge(l)->evalCached(proposal.vertex(l), - proposal.vertex(r), PathEdge::ETransmittance | ((mode == EImportance) + weight *= proposal.edge(l)->evalCached(proposal.vertex(l), + proposal.vertex(r), PathEdge::ETransmittance | ((mode == EImportance) ? PathEdge::EValueCosineImp : PathEdge::EValueCosineRad)); else - weight *= proposal.edge(l)->evalCached(proposal.vertex(l), - proposal.vertex(r), PathEdge::ETransmittance | ((mode == EImportance) + weight *= proposal.edge(l)->evalCached(proposal.vertex(l), + proposal.vertex(r), PathEdge::ETransmittance | ((mode == EImportance) ? PathEdge::EValueImp : PathEdge::EValueRad)); if (i != a) @@ -700,18 +700,18 @@ Float ManifoldPerturbation::Q(const Path &source, const Path &proposal, if (nonspec == 0) return 0.0f; weight /= nonspec; - + for (int i = c; i != b; i -= step) { - int l = std::min(i, i-step), + int l = std::min(i, i-step), r = std::max(i, i-step); if (!proposal.vertex(i)->isConnectable()) - weight *= proposal.edge(l)->evalCached(proposal.vertex(l), - proposal.vertex(r), PathEdge::ETransmittance | ((mode == EImportance) + weight *= proposal.edge(l)->evalCached(proposal.vertex(l), + proposal.vertex(r), PathEdge::ETransmittance | ((mode == EImportance) ? PathEdge::EValueCosineRad : PathEdge::EValueCosineImp)); else - weight *= proposal.edge(l)->evalCached(proposal.vertex(l), - proposal.vertex(r), PathEdge::ETransmittance | ((mode == EImportance) + weight *= proposal.edge(l)->evalCached(proposal.vertex(l), + proposal.vertex(r), PathEdge::ETransmittance | ((mode == EImportance) ? PathEdge::EValueRad : PathEdge::EValueImp)); if (i == c) @@ -729,10 +729,10 @@ Float ManifoldPerturbation::Q(const Path &source, const Path &proposal, if (vb_old->isMediumInteraction()) { int vbEdge = std::min(b, b-step); - weight /= pdfMediumPerturbation(vb_old, + weight /= pdfMediumPerturbation(vb_old, source.edge(vbEdge), proposal.edge(vbEdge)); } - + return 1.0f / weight.getLuminance(); } diff --git a/src/libbidir/mut_mchain.cpp b/src/libbidir/mut_mchain.cpp index 859ba6cc..4e08b2c4 100644 --- a/src/libbidir/mut_mchain.cpp +++ b/src/libbidir/mut_mchain.cpp @@ -21,9 +21,9 @@ MTS_NAMESPACE_BEGIN -static StatsCounter statsAccepted("Multi-chain perturbation", +static StatsCounter statsAccepted("Multi-chain perturbation", "Acceptance rate", EPercentage); -static StatsCounter statsGenerated("Multi-chain perturbation", +static StatsCounter statsGenerated("Multi-chain perturbation", "Successful generation rate", EPercentage); MultiChainPerturbation::MultiChainPerturbation(const Scene *scene, Sampler *sampler, @@ -51,11 +51,11 @@ MultiChainPerturbation::~MultiChainPerturbation() { } Mutator::EMutationType MultiChainPerturbation::getType() const { return EMultiChainPerturbation; } - + Float MultiChainPerturbation::suitability(const Path &path) const { int k = path.length(), m = k - 1, l = m-1, nChains = 1; - while (l-1 >= 0 && (!path.vertex(l)->isConnectable() + while (l-1 >= 0 && (!path.vertex(l)->isConnectable() || !path.vertex(l-1)->isConnectable())) { if (path.vertex(l)->isConnectable()) ++nChains; @@ -69,7 +69,7 @@ bool MultiChainPerturbation::sampleMutation( Path &source, Path &proposal, MutationRecord &muRec) { int k = source.length(), m = k - 1, l = m-1, nChains = 1; - while (l-1 >= 0 && (!source.vertex(l)->isConnectable() + while (l-1 >= 0 && (!source.vertex(l)->isConnectable() || !source.vertex(l-1)->isConnectable())) { if (source.vertex(l)->isConnectable()) ++nChains; @@ -79,7 +79,7 @@ bool MultiChainPerturbation::sampleMutation( if (l < 0 || nChains < 2) return false; - muRec = MutationRecord(EMultiChainPerturbation, l, m, m-l, + muRec = MutationRecord(EMultiChainPerturbation, l, m, m-l, source.getPrefixSuffixWeight(l, m)); statsAccepted.incrementBase(); statsGenerated.incrementBase(); @@ -101,7 +101,7 @@ bool MultiChainPerturbation::sampleMutation( Ray ray; if (sensor->sampleRay(ray, proposalSamplePosition, Point2(0.5f), 0.0f).isZero()) return false; - + Float focusDistance = sensor->getFocusDistance() / absDot(sensor->getInverseViewTransform(0)(Vector(0,0,1)), ray.d); @@ -129,11 +129,11 @@ bool MultiChainPerturbation::sampleMutation( Float dist = source.edge(m-1)->length + perturbMediumDistance(m_sampler, source.vertex(m-1)); - + /* Sample a perturbation and propagate it through specular interactions */ - if (!proposal.vertex(m)->perturbDirection(m_scene, + if (!proposal.vertex(m)->perturbDirection(m_scene, proposal.vertex(k), proposal.edge(m), - proposal.edge(m-1), proposal.vertex(m-1), d, dist, + proposal.edge(m-1), proposal.vertex(m-1), d, dist, source.vertex(m-1)->getType(), ERadiance)) { proposal.release(l, m+1, m_pool); return false; @@ -146,10 +146,10 @@ bool MultiChainPerturbation::sampleMutation( Float dist = source.edge(i-1)->length + perturbMediumDistance(m_sampler, source.vertex(i-1)); - if (!proposal.vertex(i)->propagatePerturbation(m_scene, - proposal.vertex(i+1), proposal.edge(i), - proposal.edge(i-1), proposal.vertex(i-1), - source.vertex(i)->getComponentType(), dist, + if (!proposal.vertex(i)->propagatePerturbation(m_scene, + proposal.vertex(i+1), proposal.edge(i), + proposal.edge(i-1), proposal.vertex(i-1), + source.vertex(i)->getComponentType(), dist, source.vertex(i-1)->getType(), ERadiance)) { proposal.release(l, m+1, m_pool); return false; @@ -163,12 +163,12 @@ bool MultiChainPerturbation::sampleMutation( Float theta = m_theta2 * math::fastexp(m_thetaLogRatio * m_sampler->next1D()); Float phi = 2 * M_PI * m_sampler->next1D(); Vector newD = Frame(oldD).toWorld(sphericalDirection(theta, phi)); - + dist += perturbMediumDistance(m_sampler, source.vertex(i-1)); - if (!proposal.vertex(i)->perturbDirection(m_scene, - proposal.vertex(i+1), proposal.edge(i), - proposal.edge(i-1), proposal.vertex(i-1), + if (!proposal.vertex(i)->perturbDirection(m_scene, + proposal.vertex(i+1), proposal.edge(i), + proposal.edge(i-1), proposal.vertex(i-1), newD, dist, source.vertex(i-1)->getType(), ERadiance)) { proposal.release(l, m+1, m_pool); @@ -177,7 +177,7 @@ bool MultiChainPerturbation::sampleMutation( } } - if (!PathVertex::connect(m_scene, + if (!PathVertex::connect(m_scene, l > 0 ? proposal.vertex(l-1) : NULL, l > 0 ? proposal.edge(l-1) : NULL, proposal.vertex(l), @@ -195,7 +195,7 @@ bool MultiChainPerturbation::sampleMutation( BDAssert(proposal.matchesConfiguration(source)); ++statsGenerated; - + return true; } @@ -208,11 +208,11 @@ Float MultiChainPerturbation::Q(const Path &source, const Path &proposal, PathEdge::EEverything); for (int i=m; i>l+1; --i) { - const PathVertex *v0 = proposal.vertex(i-1), + const PathVertex *v0 = proposal.vertex(i-1), *v1 = proposal.vertex(i); const PathEdge *edge = proposal.edge(i-1); - weight *= edge->evalCached(v0, v1, + weight *= edge->evalCached(v0, v1, PathEdge::ETransmittance | (i != m ? PathEdge::EValueCosineRad : 0)); if (v0->isMediumInteraction()) diff --git a/src/libbidir/path.cpp b/src/libbidir/path.cpp index 4374681b..454dfcdb 100644 --- a/src/libbidir/path.cpp +++ b/src/libbidir/path.cpp @@ -20,14 +20,14 @@ MTS_NAMESPACE_BEGIN -void Path::initialize(const Scene *scene, Float time, +void Path::initialize(const Scene *scene, Float time, ETransportMode mode, MemoryPool &pool) { release(pool); m_vertices.push_back(pool.allocVertex()); m_vertices[0]->makeEndpoint(scene, time, mode); } -int Path::randomWalk(const Scene *scene, Sampler *sampler, +int Path::randomWalk(const Scene *scene, Sampler *sampler, int nSteps, int rrStart, ETransportMode mode, MemoryPool &pool) { /* Determine the relevant edge and vertex to start the random walk */ @@ -59,7 +59,7 @@ int Path::randomWalk(const Scene *scene, Sampler *sampler, return nSteps; } -int Path::randomWalkFromPixel(const Scene *scene, Sampler *sampler, +int Path::randomWalkFromPixel(const Scene *scene, Sampler *sampler, int nSteps, const Point2i &pixelPosition, int rrStart, MemoryPool &pool) { PathVertex *v1 = pool.allocVertex(), *v2 = pool.allocVertex(); @@ -85,7 +85,7 @@ int Path::randomWalkFromPixel(const Scene *scene, Sampler *sampler, } append(e1, v2); - + PathVertex *predVertex = v1, *curVertex = v2; PathEdge *predEdge = e1; Spectrum throughput(1.0f); @@ -112,7 +112,7 @@ int Path::randomWalkFromPixel(const Scene *scene, Sampler *sampler, } -std::pair Path::alternatingRandomWalkFromPixel(const Scene *scene, Sampler *sampler, +std::pair Path::alternatingRandomWalkFromPixel(const Scene *scene, Sampler *sampler, Path &emitterPath, int nEmitterSteps, Path &sensorPath, int nSensorSteps, const Point2i &pixelPosition, int rrStart, MemoryPool &pool) { /* Determine the relevant edges and vertices to start the random walk */ @@ -156,7 +156,7 @@ std::pair Path::alternatingRandomWalkFromPixel(const Scene *scene, Sam PathEdge *succEdgeT = pool.allocEdge(); if (curVertexT->sampleNext(scene, sampler, predVertexT, - predEdgeT, succEdgeT, succVertexT, ERadiance, + predEdgeT, succEdgeT, succVertexT, ERadiance, rrStart != -1 && t >= rrStart, &throughputT)) { sensorPath.append(succEdgeT, succVertexT); predVertexT = curVertexT; @@ -176,8 +176,8 @@ std::pair Path::alternatingRandomWalkFromPixel(const Scene *scene, Sam PathVertex *succVertexS = pool.allocVertex(); PathEdge *succEdgeS = pool.allocEdge(); - if (curVertexS->sampleNext(scene, sampler, predVertexS, - predEdgeS, succEdgeS, succVertexS, EImportance, + if (curVertexS->sampleNext(scene, sampler, predVertexS, + predEdgeS, succEdgeS, succVertexS, EImportance, rrStart != -1 && s >= rrStart, &throughputS)) { emitterPath.append(succEdgeS, succVertexS); predVertexS = curVertexS; @@ -263,19 +263,19 @@ bool Path::operator==(const Path &path) const { return true; } -Float Path::miWeight(const Scene *scene, const Path &emitterSubpath, - const PathEdge *connectionEdge, const Path &sensorSubpath, +Float Path::miWeight(const Scene *scene, const Path &emitterSubpath, + const PathEdge *connectionEdge, const Path &sensorSubpath, int s, int t, bool sampleDirect, bool lightImage) { int k = s+t+1, n = k+1; - const PathVertex + const PathVertex *vsPred = emitterSubpath.vertexOrNull(s-1), *vtPred = sensorSubpath.vertexOrNull(t-1), *vs = emitterSubpath.vertex(s), *vt = sensorSubpath.vertex(t); - /* pdfImp[i] and pdfRad[i] store the area/volume density of vertex - 'i' when sampled from the adjacent vertex in the emitter + /* pdfImp[i] and pdfRad[i] store the area/volume density of vertex + 'i' when sampled from the adjacent vertex in the emitter and sensor direction, respectively. */ Float ratioEmitterDirect = 0.0f, ratioSensorDirect = 0.0f; @@ -306,7 +306,7 @@ Float Path::miWeight(const Scene *scene, const Path &emitterSubpath, EMeasure vsMeasure = EArea, vtMeasure = EArea; if (sampleDirect) { /* When direct sampling is enabled, we may be able to create certain - connections that otherwise would have failed (e.g. to an + connections that otherwise would have failed (e.g. to an orthographic camera or a directional light source) */ const AbstractEmitter *emitter = (s > 0 ? emitterSubpath.vertex(1) : vt)->getAbstractEmitter(); const AbstractEmitter *sensor = (t > 0 ? sensorSubpath.vertex(1) : vs)->getAbstractEmitter(); @@ -319,9 +319,9 @@ Float Path::miWeight(const Scene *scene, const Path &emitterSubpath, connectable[k-1] = sensorDirectMeasure != EInvalidMeasure; connectable[k] = sensorDirectMeasure != EDiscrete && sensorDirectMeasure != EInvalidMeasure; - /* The following is needed to handle orthographic cameras & + /* The following is needed to handle orthographic cameras & directional light sources together with direct sampling */ - if (t == 1) + if (t == 1) vtMeasure = sensor->needsDirectionSample() ? EArea : EDiscrete; else if (s == 1) vsMeasure = emitter->needsDirectionSample() ? EArea : EDiscrete; @@ -337,7 +337,7 @@ Float Path::miWeight(const Scene *scene, const Path &emitterSubpath, pdfImp[pos++] = vs->evalPdf(scene, vsPred, vt, EImportance, vsMeasure) * connectionEdge->pdf[EImportance]; - + if (t > 0) { pdfImp[pos++] = vt->evalPdf(scene, vs, vtPred, EImportance, vtMeasure) * sensorSubpath.edge(t-1)->pdf[EImportance]; @@ -350,7 +350,7 @@ Float Path::miWeight(const Scene *scene, const Path &emitterSubpath, /* Collect radiance transfer area/volume densities from vertices */ pos = 0; if (s > 0) { - for (int i=0; ipdf[ERadiance] * emitterSubpath.edge(i)->pdf[ERadiance]; @@ -372,7 +372,7 @@ Float Path::miWeight(const Scene *scene, const Path &emitterSubpath, to compute the correct MI weights even without going through all the trouble of computing the proper generalized geometric terms (described in the SIGGRAPH 2012 specular manifolds paper). The reason is that these - all cancel out. But to make sure that that's actually true, we need to + all cancel out. But to make sure that that's actually true, we need to convert some of the area densities in the 'pdfRad' and 'pdfImp' arrays into the projected solid angle measure */ for (int i=1; i <= k-3; ++i) { @@ -400,7 +400,7 @@ Float Path::miWeight(const Scene *scene, const Path &emitterSubpath, (succ->isOnSurface() ? dot(edge->d, succ->getGeometricNormal()) : 1) * (cur->isOnSurface() ? dot(edge->d, cur->getGeometricNormal()) : 1)); } - + int emitterRefIndirection = 2, sensorRefIndirection = k-2; /* One more array sweep before the actual useful work starts -- phew! :) @@ -427,7 +427,7 @@ Float Path::miWeight(const Scene *scene, const Path &emitterSubpath, Vector d = before->getPosition() - after->getPosition(); Float lengthSquared = d.lengthSquared(); d /= std::sqrt(lengthSquared); - + Float geoTerm = std::abs( (before->isOnSurface() ? dot(before->getGeometricNormal(), d) : 1) * (after->isOnSurface() ? dot(after->getGeometricNormal(), d) : 1)) / lengthSquared; @@ -449,27 +449,27 @@ Float Path::miWeight(const Scene *scene, const Path &emitterSubpath, double initial = 1.0f; - /* When direct sampling strategies are enabled, we must + /* When direct sampling strategies are enabled, we must account for them here as well */ if (sampleDirect) { /* Direct connection probability of the emitter */ const PathVertex *sample = s>0 ? emitterSubpath.vertex(1) : vt; - const PathVertex *ref = emitterRefIndirection <= s + const PathVertex *ref = emitterRefIndirection <= s ? emitterSubpath.vertex(emitterRefIndirection) : sensorSubpath.vertex(k-emitterRefIndirection); EMeasure measure = sample->getAbstractEmitter()->getDirectMeasure(); if (connectable[1] && connectable[emitterRefIndirection]) - ratioEmitterDirect = ref->evalPdfDirect(scene, sample, EImportance, + ratioEmitterDirect = ref->evalPdfDirect(scene, sample, EImportance, measure == ESolidAngle ? EArea : measure) / pdfImp[1]; /* Direct connection probability of the sensor */ sample = t>0 ? sensorSubpath.vertex(1) : vs; - ref = sensorRefIndirection <= s ? emitterSubpath.vertex(sensorRefIndirection) + ref = sensorRefIndirection <= s ? emitterSubpath.vertex(sensorRefIndirection) : sensorSubpath.vertex(k-sensorRefIndirection); measure = sample->getAbstractEmitter()->getDirectMeasure(); if (connectable[k-1] && connectable[sensorRefIndirection]) - ratioSensorDirect = ref->evalPdfDirect(scene, sample, ERadiance, + ratioSensorDirect = ref->evalPdfDirect(scene, sample, ERadiance, measure == ESolidAngle ? EArea : measure) / pdfRad[k-1]; if (s == 1) @@ -482,9 +482,9 @@ Float Path::miWeight(const Scene *scene, const Path &emitterSubpath, /* With all of the above information, the MI weight can now be computed. Since the goal is to evaluate the power heuristic, the absolute area - product density of each strategy is interestingly not required. Instead, - an incremental scheme can be used that only finds the densities relative - to the (s,t) strategy, which can be done using a linear sweep. For + product density of each strategy is interestingly not required. Instead, + an incremental scheme can be used that only finds the densities relative + to the (s,t) strategy, which can be done using a linear sweep. For details, refer to the Veach thesis, p.306. */ for (int i=s+1; i 1)) + if (connectable[i] && (connectable[i+1] || isNull[i+1]) && (lightImage || tPrime > 1)) weight += value*value; pdf = next; } - /* As above, but now compute pdf[i] with i=0; --i) { diff --git a/src/libbidir/pathsampler.cpp b/src/libbidir/pathsampler.cpp index a7fee312..2aef655c 100644 --- a/src/libbidir/pathsampler.cpp +++ b/src/libbidir/pathsampler.cpp @@ -25,11 +25,11 @@ MTS_NAMESPACE_BEGIN -PathSampler::PathSampler(ETechnique technique, const Scene *scene, Sampler *sensorSampler, - Sampler *emitterSampler, Sampler *directSampler, int maxDepth, int rrDepth, +PathSampler::PathSampler(ETechnique technique, const Scene *scene, Sampler *sensorSampler, + Sampler *emitterSampler, Sampler *directSampler, int maxDepth, int rrDepth, bool excludeDirectIllum, bool sampleDirect, bool lightImage) : m_technique(technique), m_scene(scene), m_emitterSampler(emitterSampler), - m_sensorSampler(sensorSampler), m_directSampler(directSampler), m_maxDepth(maxDepth), + m_sensorSampler(sensorSampler), m_directSampler(directSampler), m_maxDepth(maxDepth), m_rrDepth(rrDepth), m_excludeDirectIllum(excludeDirectIllum), m_sampleDirect(sampleDirect), m_lightImage(lightImage) { @@ -46,11 +46,11 @@ PathSampler::PathSampler(ETechnique technique, const Scene *scene, Sampler *sens m_emitterDepth = m_sensorDepth = maxDepth; /* Go one extra step if the sensor can be intersected */ - if (!m_scene->hasDegenerateSensor() && m_emitterDepth != -1) + if (!m_scene->hasDegenerateSensor() && m_emitterDepth != -1) ++m_emitterDepth; /* Go one extra step if there are emitters that can be intersected */ - if (!m_scene->hasDegenerateEmitters() && m_sensorDepth != -1) + if (!m_scene->hasDegenerateEmitters() && m_sensorDepth != -1) ++m_sensorDepth; } @@ -75,14 +75,14 @@ void PathSampler::sampleSplats(const Point2i &offset, SplatList &list) { m_sensorSubpath.initialize(m_scene, time, ERadiance, m_pool); /* Perform two random walks from the sensor and emitter side */ - m_emitterSubpath.randomWalk(m_scene, m_emitterSampler, m_emitterDepth, + m_emitterSubpath.randomWalk(m_scene, m_emitterSampler, m_emitterDepth, m_rrDepth, EImportance, m_pool); if (offset == Point2i(-1)) - m_sensorSubpath.randomWalk(m_scene, m_sensorSampler, + m_sensorSubpath.randomWalk(m_scene, m_sensorSampler, m_sensorDepth, m_rrDepth, ERadiance, m_pool); else - m_sensorSubpath.randomWalkFromPixel(m_scene, m_sensorSampler, + m_sensorSubpath.randomWalkFromPixel(m_scene, m_sensorSampler, m_sensorDepth, offset, m_rrDepth, m_pool); /* Compute the combined weights along the two subpaths */ @@ -90,7 +90,7 @@ void PathSampler::sampleSplats(const Point2i &offset, SplatList &list) { *radianceWeights = (Spectrum *) alloca(m_sensorSubpath.vertexCount() * sizeof(Spectrum)); importanceWeights[0] = radianceWeights[0] = Spectrum(1.0f); - for (size_t i=1; iweight[EImportance] * m_emitterSubpath.vertex(i-1)->rrWeight * @@ -115,18 +115,18 @@ void PathSampler::sampleSplats(const Point2i &offset, SplatList &list) { for (int s = (int) m_emitterSubpath.vertexCount()-1; s >= 0; --s) { /* Determine the range of sensor vertices to be traversed, while respecting the specified maximum path length */ - int minT = std::max(2-s, m_lightImage ? 0 : 2), + int minT = std::max(2-s, m_lightImage ? 0 : 2), maxT = (int) m_sensorSubpath.vertexCount() - 1; if (m_maxDepth != -1) maxT = std::min(maxT, m_maxDepth + 1 - s); for (int t = maxT; t >= minT; --t) { - PathVertex + PathVertex *vsPred = m_emitterSubpath.vertexOrNull(s-1), *vtPred = m_sensorSubpath.vertexOrNull(t-1), *vs = m_emitterSubpath.vertex(s), *vt = m_sensorSubpath.vertex(t); - PathEdge + PathEdge *vsEdge = m_emitterSubpath.edgeOrNull(s-1), *vtEdge = m_sensorSubpath.edgeOrNull(t-1); @@ -145,7 +145,7 @@ void PathSampler::sampleSplats(const Point2i &offset, SplatList &list) { /* Will receive the path weight of the (s, t)-connection */ Spectrum value; - /* Account for the terms of the measurement contribution + /* Account for the terms of the measurement contribution function that are coupled to the connection endpoints */ if (vs->isEmitterSupernode()) { /* If possible, convert 'vt' into an emitter sample */ @@ -174,7 +174,7 @@ void PathSampler::sampleSplats(const Point2i &offset, SplatList &list) { continue; /* Generate a position on an emitter using direct sampling */ - value = radianceWeights[t] * vt->sampleDirect(m_scene, m_directSampler, + value = radianceWeights[t] * vt->sampleDirect(m_scene, m_directSampler, &tempEndpoint, &tempEdge, &tempSample, EImportance); if (value.isZero()) @@ -186,7 +186,7 @@ void PathSampler::sampleSplats(const Point2i &offset, SplatList &list) { if (vs->isDegenerate()) continue; /* Generate a position on the sensor using direct sampling */ - value = importanceWeights[s] * vs->sampleDirect(m_scene, m_directSampler, + value = importanceWeights[s] * vs->sampleDirect(m_scene, m_directSampler, &tempEndpoint, &tempEdge, &tempSample, ERadiance); if (value.isZero()) continue; @@ -214,15 +214,15 @@ void PathSampler::sampleSplats(const Point2i &offset, SplatList &list) { the creation of additional vertices (index-matched boundaries etc.) */ int interactions = remaining; if (value.isZero() || !connectionEdge.pathConnectAndCollapse( - m_scene, vsEdge, vs, vt, vtEdge, interactions)) + m_scene, vsEdge, vs, vt, vtEdge, interactions)) continue; depth += interactions; - if (m_excludeDirectIllum && depth <= 2) + if (m_excludeDirectIllum && depth <= 2) continue; - /* Account for the terms of the measurement contribution + /* Account for the terms of the measurement contribution function that are coupled to the connection edge */ if (!sampleDirect) value *= connectionEdge.evalCached(vs, vt, PathEdge::EGeneralizedGeometricTerm); @@ -247,7 +247,7 @@ void PathSampler::sampleSplats(const Point2i &offset, SplatList &list) { if (sampleDirect) { /* Now undo the previous change */ if (t == 1) - m_sensorSubpath.swapEndpoints(vtPred, vtEdge, vt); + m_sensorSubpath.swapEndpoints(vtPred, vtEdge, vt); else m_emitterSubpath.swapEndpoints(vsPred, vsEdge, vs); } @@ -297,7 +297,7 @@ void PathSampler::sampleSplats(const Point2i &offset, SplatList &list) { RadianceQueryRecord rRec(m_scene, m_sensorSampler); rRec.newQuery( - m_excludeDirectIllum ? (RadianceQueryRecord::ERadiance + m_excludeDirectIllum ? (RadianceQueryRecord::ERadiance & ~(RadianceQueryRecord::EDirectSurfaceRadiance | RadianceQueryRecord::EEmittedRadiance)) : RadianceQueryRecord::ERadiance, sensor->getMedium()); @@ -325,14 +325,14 @@ void PathSampler::samplePaths(const Point2i &offset, PathCallback &callback) { m_sensorSubpath.initialize(m_scene, time, ERadiance, m_pool); /* Perform two random walks from the sensor and emitter side */ - m_emitterSubpath.randomWalk(m_scene, m_emitterSampler, m_emitterDepth, + m_emitterSubpath.randomWalk(m_scene, m_emitterSampler, m_emitterDepth, m_rrDepth, EImportance, m_pool); if (offset == Point2i(-1)) - m_sensorSubpath.randomWalk(m_scene, m_sensorSampler, + m_sensorSubpath.randomWalk(m_scene, m_sensorSampler, m_sensorDepth, m_rrDepth, ERadiance, m_pool); else - m_sensorSubpath.randomWalkFromPixel(m_scene, m_sensorSampler, + m_sensorSubpath.randomWalkFromPixel(m_scene, m_sensorSampler, m_sensorDepth, offset, m_rrDepth, m_pool); /* Compute the combined weights along the two subpaths */ @@ -340,7 +340,7 @@ void PathSampler::samplePaths(const Point2i &offset, PathCallback &callback) { *radianceWeights = (Spectrum *) alloca(m_sensorSubpath.vertexCount() * sizeof(Spectrum)); importanceWeights[0] = radianceWeights[0] = Spectrum(1.0f); - for (size_t i=1; iweight[EImportance] * m_emitterSubpath.vertex(i-1)->rrWeight * @@ -359,21 +359,21 @@ void PathSampler::samplePaths(const Point2i &offset, PathCallback &callback) { for (int s = (int) m_emitterSubpath.vertexCount()-1; s >= 0; --s) { /* Determine the range of sensor vertices to be traversed, while respecting the specified maximum path length */ - int minT = std::max(2-s, m_lightImage ? 0 : 2), + int minT = std::max(2-s, m_lightImage ? 0 : 2), maxT = (int) m_sensorSubpath.vertexCount() - 1; if (m_maxDepth != -1) maxT = std::min(maxT, m_maxDepth + 1 - s); for (int t = maxT; t >= minT; --t) { - PathVertex + PathVertex *vsPred = m_emitterSubpath.vertexOrNull(s-1), *vtPred = m_sensorSubpath.vertexOrNull(t-1), *vs = m_emitterSubpath.vertex(s), *vt = m_sensorSubpath.vertex(t); - PathEdge + PathEdge *vsEdge = m_emitterSubpath.edgeOrNull(s-1), *vtEdge = m_sensorSubpath.edgeOrNull(t-1); - + RestoreMeasureHelper rmh0(vs), rmh1(vt); /* Will be set to true if direct sampling was used */ @@ -392,7 +392,7 @@ void PathSampler::samplePaths(const Point2i &offset, PathCallback &callback) { /* Measure associated with the connection vertices */ EMeasure vsMeasure = EArea, vtMeasure = EArea; - /* Account for the terms of the measurement contribution + /* Account for the terms of the measurement contribution function that are coupled to the connection endpoints */ if (vs->isEmitterSupernode()) { /* If possible, convert 'vt' into an emitter sample */ @@ -421,7 +421,7 @@ void PathSampler::samplePaths(const Point2i &offset, PathCallback &callback) { continue; /* Generate a position on an emitter using direct sampling */ - value = radianceWeights[t] * vt->sampleDirect(m_scene, m_directSampler, + value = radianceWeights[t] * vt->sampleDirect(m_scene, m_directSampler, &tempEndpoint, &tempEdge, &tempSample, EImportance); if (value.isZero()) @@ -434,7 +434,7 @@ void PathSampler::samplePaths(const Point2i &offset, PathCallback &callback) { if (vs->isDegenerate()) continue; /* Generate a position on the sensor using direct sampling */ - value = importanceWeights[s] * vs->sampleDirect(m_scene, m_directSampler, + value = importanceWeights[s] * vs->sampleDirect(m_scene, m_directSampler, &tempEndpoint, &tempEdge, &tempSample, ERadiance); if (value.isZero()) continue; @@ -462,19 +462,19 @@ void PathSampler::samplePaths(const Point2i &offset, PathCallback &callback) { /* Attempt to connect the two endpoints, which could result in the creation of additional vertices (index-matched boundaries etc.) */ m_connectionSubpath.release(m_pool); - if (value.isZero() || !PathEdge::pathConnect(m_scene, vsEdge, - vs, m_connectionSubpath, vt, vtEdge, remaining, m_pool)) + if (value.isZero() || !PathEdge::pathConnect(m_scene, vsEdge, + vs, m_connectionSubpath, vt, vtEdge, remaining, m_pool)) continue; depth += (int) m_connectionSubpath.vertexCount(); - if (m_excludeDirectIllum && depth <= 2) + if (m_excludeDirectIllum && depth <= 2) continue; PathEdge connectionEdge; m_connectionSubpath.collapseTo(connectionEdge); - /* Account for the terms of the measurement contribution + /* Account for the terms of the measurement contribution function that are coupled to the connection edge */ if (!sampleDirect) value *= connectionEdge.evalCached(vs, vt, PathEdge::EGeneralizedGeometricTerm); @@ -505,13 +505,13 @@ void PathSampler::samplePaths(const Point2i &offset, PathCallback &callback) { m_fullPath.append(m_sensorSubpath, 0, t+1, true); m_fullPath.vertex(s) = &vsTemp; m_fullPath.vertex(s+k+1) = &vtTemp; - vsTemp = *m_emitterSubpath.vertex(s); - vtTemp = *m_sensorSubpath.vertex(t); + vsTemp = *m_emitterSubpath.vertex(s); + vtTemp = *m_sensorSubpath.vertex(t); if (vsTemp.update(m_scene, m_fullPath.vertexOrNull(s-1), m_fullPath.vertex(s+1), EImportance, vsMeasure) && vtTemp.update(m_scene, m_fullPath.vertexOrNull(s+k+2), m_fullPath.vertex(s+k), ERadiance, vtMeasure)) { - if (vtTemp.isSensorSample()) + if (vtTemp.isSensorSample()) vtTemp.updateSamplePosition(&vsTemp); callback(s, t, value.getLuminance(), m_fullPath); @@ -524,7 +524,7 @@ void PathSampler::samplePaths(const Point2i &offset, PathCallback &callback) { if (sampleDirect) { /* Now undo the previous change */ if (t == 1) - m_sensorSubpath.swapEndpoints(vtPred, vtEdge, vt); + m_sensorSubpath.swapEndpoints(vtPred, vtEdge, vt); else m_emitterSubpath.swapEndpoints(vsPred, vsEdge, vs); } @@ -548,7 +548,7 @@ struct PathSeedSortPredicate { }; Float PathSampler::computeAverageLuminance(size_t sampleCount) { - Log(EInfo, "Integrating luminance values over the image plane (" + Log(EInfo, "Integrating luminance values over the image plane (" SIZE_T_FMT " samples)..", sampleCount); ref timer = new Timer(); @@ -585,7 +585,7 @@ static void seedCallback(std::vector &output, int s, int t, Float weig Float PathSampler::generateSeeds(size_t sampleCount, size_t seedCount, bool fineGrained, std::vector &seeds) { - Log(EInfo, "Integrating luminance values over the image plane (" + Log(EInfo, "Integrating luminance values over the image plane (" SIZE_T_FMT " samples)..", sampleCount); BDAssert(m_sensorSampler == m_emitterSampler); @@ -596,7 +596,7 @@ Float PathSampler::generateSeeds(size_t sampleCount, size_t seedCount, tempSeeds.reserve(sampleCount); SplatList splatList; - PathCallback callback = boost::bind(&seedCallback, + PathCallback callback = boost::bind(&seedCallback, boost::ref(tempSeeds), _1, _2, _3, _4); Float mean = 0.0f, variance = 0.0f; @@ -608,7 +608,7 @@ Float PathSampler::generateSeeds(size_t sampleCount, size_t seedCount, if (fineGrained) { samplePaths(Point2i(-1), callback); - /* Fine seed granularity (e.g. for Veach-MLT). + /* Fine seed granularity (e.g. for Veach-MLT). Set the correct the sample index value */ for (size_t j = seedIndex; jnext1D()))); /* Sort the seeds to avoid unnecessary rewinds in the ReplayableSampler */ @@ -676,8 +676,8 @@ void PathSampler::reconstructPath(const PathSeed &seed, Path &result) { /* Generate the initial sample by replaying the seeding random number stream at the appropriate position. */ rplSampler->setSampleIndex(seed.sampleIndex); - - PathCallback callback = boost::bind(&reconstructCallback, + + PathCallback callback = boost::bind(&reconstructCallback, boost::cref(seed), boost::ref(result), boost::ref(m_pool), _1, _2, _3, _4); samplePaths(Point2i(-1), callback); @@ -721,7 +721,7 @@ std::string SplatList::toString() const { << " luminance = " << luminance << "," << endl << " splats = {" << endl; for (size_t i=0; i " << splats[i].second.toString(); if (i+1 < splats.size()) oss << ","; diff --git a/src/libbidir/rsampler.cpp b/src/libbidir/rsampler.cpp index 7928c69a..5319e2d8 100644 --- a/src/libbidir/rsampler.cpp +++ b/src/libbidir/rsampler.cpp @@ -28,7 +28,7 @@ ReplayableSampler::ReplayableSampler() : Sampler(Properties()) { m_sampleIndex = 0; } -ReplayableSampler::ReplayableSampler(Stream *stream, InstanceManager *manager) +ReplayableSampler::ReplayableSampler(Stream *stream, InstanceManager *manager) : Sampler(stream, manager) { m_initial = static_cast(manager->getInstance(stream)); m_random = new Random(); @@ -94,7 +94,7 @@ std::string ReplayableSampler::toString() const { std::ostringstream oss; oss << "ReplayableSampler[" << endl << " sampleCount = " << m_sampleCount << endl - << "]"; + << "]"; return oss.str(); } diff --git a/src/libbidir/util.cpp b/src/libbidir/util.cpp index 0301cc76..70f0bf5b 100644 --- a/src/libbidir/util.cpp +++ b/src/libbidir/util.cpp @@ -25,7 +25,7 @@ MTS_NAMESPACE_BEGIN -ref BidirectionalUtils::renderDirectComponent(Scene *scene, int sceneResID, +ref BidirectionalUtils::renderDirectComponent(Scene *scene, int sceneResID, int sensorResID, RenderQueue *queue, const RenderJob *job, size_t directSamples) { ref pluginMgr = PluginManager::getInstance(); ref scheduler = Scheduler::getInstance(); @@ -54,7 +54,7 @@ ref BidirectionalUtils::renderDirectComponent(Scene *scene, int sceneRes ref directIntegrator = static_cast (pluginMgr-> createObject(Integrator::m_theClass, integratorProps)); /* Create a low discrepancy sampler instance for every core */ - Properties samplerProps("ldsampler"); + Properties samplerProps("ldsampler"); samplerProps.setSize("sampleCount", pixelSamples); ref ldSampler = static_cast (pluginMgr-> createObject(Sampler::m_theClass, samplerProps)); @@ -73,7 +73,7 @@ ref BidirectionalUtils::renderDirectComponent(Scene *scene, int sceneRes integrator->incRef(); scene->setIntegrator(directIntegrator); - bool success = directIntegrator->render(scene, queue, job, + bool success = directIntegrator->render(scene, queue, job, sceneResID, sensorResID, ldSamplerResID); scene->setIntegrator(integrator); integrator->decRef(); @@ -91,7 +91,7 @@ ref BidirectionalUtils::renderDirectComponent(Scene *scene, int sceneRes } } -ref BidirectionalUtils::mltLuminancePass(Scene *scene, int sceneResID, +ref BidirectionalUtils::mltLuminancePass(Scene *scene, int sceneResID, RenderQueue *queue, int sizeFactor, ref &nestedJob) { ref pluginMgr = PluginManager::getInstance(); ref scheduler = Scheduler::getInstance(); @@ -101,14 +101,14 @@ ref BidirectionalUtils::mltLuminancePass(Scene *scene, int sceneResID, Vector2i origSize = scene->getFilm()->getSize(); Vector2i reducedSize = Vector2i( - std::max(1, origSize.x / sizeFactor), + std::max(1, origSize.x / sizeFactor), std::max(1, origSize.y / sizeFactor)); Vector2i reducedCropSize = Vector2i( - std::max(1, origCropSize.x / sizeFactor), + std::max(1, origCropSize.x / sizeFactor), std::max(1, origCropSize.y / sizeFactor)); - Point2i reducedCropOffset = + Point2i reducedCropOffset = scene->getFilm()->getCropOffset()/sizeFactor; size_t sampleCount = scene->getSampler()->getSampleCount(); @@ -143,7 +143,7 @@ ref BidirectionalUtils::mltLuminancePass(Scene *scene, int sceneResID, /* Configure the sensor */ Properties sensorProps = sensor->getProperties(); - ref nestedSensor = static_cast + ref nestedSensor = static_cast (pluginMgr->createObject(Sensor::m_theClass, sensorProps)); nestedSensor->addChild(nestedSampler); nestedSensor->addChild(nestedFilm); @@ -182,9 +182,9 @@ ref BidirectionalUtils::mltLuminancePass(Scene *scene, int sceneResID, rfilter->configure(); /* Develop the rendered image into a luminance bitmap */ - ref luminanceMap = new Bitmap(Bitmap::ELuminance, + ref luminanceMap = new Bitmap(Bitmap::ELuminance, Bitmap::EFloat, reducedCropSize); - nestedFilm->develop(Point2i(0, 0), reducedCropSize, + nestedFilm->develop(Point2i(0, 0), reducedCropSize, Point2i(0, 0), luminanceMap); /* Up-sample the low resolution luminance map */ @@ -192,7 +192,7 @@ ref BidirectionalUtils::mltLuminancePass(Scene *scene, int sceneResID, ReconstructionFilter::EClamp, ReconstructionFilter::EClamp, origCropSize, 0.0f, std::numeric_limits::infinity()); - + return luminanceMap; } diff --git a/src/libbidir/verification.cpp b/src/libbidir/verification.cpp index 7128769a..9355668a 100644 --- a/src/libbidir/verification.cpp +++ b/src/libbidir/verification.cpp @@ -91,8 +91,8 @@ bool PathVertex::verify(const Scene *scene, const PathVertex *pred, const PathVe } } - weightL = pdfL != 0 ? (weightL / pdfL) : Spectrum(0.0f); - weightE = pdfE != 0 ? (weightE / pdfE) : Spectrum(0.0f); + weightL = pdfL != 0 ? (weightL / pdfL) : Spectrum(0.0f); + weightE = pdfE != 0 ? (weightE / pdfE) : Spectrum(0.0f); valid &= validateValue("weight[ERadiance]", weightE, weight[ERadiance], os); valid &= validateValue("weight[EImportance]", weightL, weight[EImportance], os); @@ -135,7 +135,7 @@ bool PathVertex::verify(const Scene *scene, const PathVertex *pred, const PathVe return valid; } -bool PathEdge::verify(const Scene *scene, const PathVertex *pred, +bool PathEdge::verify(const Scene *scene, const PathVertex *pred, const PathVertex *succ, ETransportMode mode, std::ostream &os) const { if (mode == ERadiance) std::swap(pred, succ); @@ -145,8 +145,8 @@ bool PathEdge::verify(const Scene *scene, const PathVertex *pred, Float pdfL = evalPdf(pred, succ), pdfE = evalPdf(succ, pred); - weightL = pdfL != 0 ? (weightL / pdfL) : Spectrum(0.0f); - weightE = pdfE != 0 ? (weightE / pdfE) : Spectrum(0.0f); + weightL = pdfL != 0 ? (weightL / pdfL) : Spectrum(0.0f); + weightE = pdfE != 0 ? (weightE / pdfE) : Spectrum(0.0f); bool valid = true; diff --git a/src/libbidir/vertex.cpp b/src/libbidir/vertex.cpp index 9424985a..1729a1fe 100644 --- a/src/libbidir/vertex.cpp +++ b/src/libbidir/vertex.cpp @@ -28,19 +28,19 @@ void PathVertex::makeEndpoint(const Scene *scene, Float time, ETransportMode mod memset(this, 0, sizeof(PathVertex)); type = (mode == EImportance) ? EEmitterSupernode : ESensorSupernode; getEndpointRecord() = EndpointRecord(time); - degenerate = (mode == EImportance) + degenerate = (mode == EImportance) ? scene->hasDegenerateEmitters() : scene->hasDegenerateSensor(); } bool PathVertex::sampleNext(const Scene *scene, Sampler *sampler, const PathVertex *pred, const PathEdge *predEdge, - PathEdge *succEdge, PathVertex *succ, + PathEdge *succEdge, PathVertex *succ, ETransportMode mode, bool russianRoulette, Spectrum *throughput) { Ray ray; memset(succEdge, 0, sizeof(PathEdge)); memset(succ, 0, sizeof(PathVertex)); - + succEdge->medium = (predEdge == NULL) ? NULL : predEdge->medium; rrWeight = 1.0f; @@ -49,7 +49,7 @@ bool PathVertex::sampleNext(const Scene *scene, Sampler *sampler, BDAssert(mode == EImportance && pred == NULL && predEdge == NULL); PositionSamplingRecord &pRec = succ->getPositionSamplingRecord(); const EndpointRecord &eRec = getEndpointRecord(); - pRec = PositionSamplingRecord(eRec.time); + pRec = PositionSamplingRecord(eRec.time); Spectrum result = scene->sampleEmitterPosition(pRec, sampler->next2D()); if (result.isZero()) return false; @@ -83,7 +83,7 @@ bool PathVertex::sampleNext(const Scene *scene, Sampler *sampler, pdf[ERadiance] = pRec.pdf; measure = pRec.measure; succ->type = ESensorSample; - succ->degenerate = sensor->getType() + succ->degenerate = sensor->getType() & Sensor::EDeltaDirection; succEdge->weight[ERadiance] = Spectrum(1.0f); @@ -100,7 +100,7 @@ bool PathVertex::sampleNext(const Scene *scene, Sampler *sampler, const Emitter *emitter = static_cast(pRec.object); DirectionSamplingRecord dRec; - Spectrum result = emitter->sampleDirection(dRec, pRec, + Spectrum result = emitter->sampleDirection(dRec, pRec, emitter->needsDirectionSample() ? sampler->next2D() : Point2(0.5f)); if (result.isZero()) @@ -126,7 +126,7 @@ bool PathVertex::sampleNext(const Scene *scene, Sampler *sampler, const Sensor *sensor = static_cast(pRec.object); DirectionSamplingRecord dRec; - Spectrum result = sensor->sampleDirection(dRec, pRec, + Spectrum result = sensor->sampleDirection(dRec, pRec, sensor->needsDirectionSample() ? sampler->next2D() : Point2(0.5f)); if (result.isZero()) @@ -178,8 +178,8 @@ bool PathVertex::sampleNext(const Scene *scene, Sampler *sampler, #if defined(MTS_BD_TRACE) SLog(EWarn, "Detected an inconsistency: approached " "surface %s within medium %s, but the surface " - "states that the ray should have been in medium %s.", - its.toString().c_str(), predEdge->medium ? + "states that the ray should have been in medium %s.", + its.toString().c_str(), predEdge->medium ? predEdge->medium->toString().c_str() : "null", expected ? expected->toString().c_str() : "null"); #endif @@ -188,7 +188,7 @@ bool PathVertex::sampleNext(const Scene *scene, Sampler *sampler, } succEdge->medium = its.getTargetMedium(wo); } - + /* Compute the reverse quantities */ bRec.reverse(); pdf[1-mode] = bsdf->pdf(bRec, (EMeasure) measure); @@ -202,7 +202,7 @@ bool PathVertex::sampleNext(const Scene *scene, Sampler *sampler, everything (only the pdf and cosine factors changed) */ weight[1-mode] = weight[mode] * (pdf[mode] / pdf[1-mode]); if (measure == ESolidAngle) - weight[1-mode] *= + weight[1-mode] *= std::abs(Frame::cosTheta(bRec.wo) / Frame::cosTheta(bRec.wi)); } else { weight[1-mode] = bsdf->eval(bRec, (EMeasure) measure) / pdf[1-mode]; @@ -281,7 +281,7 @@ bool PathVertex::sampleNext(const Scene *scene, Sampler *sampler, } if (!succEdge->sampleNext(scene, sampler, this, ray, succ, mode)) { - /* Sampling a successor edge + vertex failed, hence the vertex + /* Sampling a successor edge + vertex failed, hence the vertex is not committed to a particular measure yet -- revert. */ measure = EInvalid; return false; @@ -307,9 +307,9 @@ bool PathVertex::sampleNext(const Scene *scene, Sampler *sampler, return true; } - -int PathVertex::sampleSensor(const Scene *scene, Sampler *sampler, - const Point2i &pixelPosition_, PathEdge *e0, PathVertex *v1, + +int PathVertex::sampleSensor(const Scene *scene, Sampler *sampler, + const Point2i &pixelPosition_, PathEdge *e0, PathVertex *v1, PathEdge *e1, PathVertex *v2) { BDAssert(type == ESensorSupernode); const EndpointRecord &eRec = getEndpointRecord(); @@ -324,8 +324,8 @@ int PathVertex::sampleSensor(const Scene *scene, Sampler *sampler, PositionSamplingRecord &pRec = v1->getPositionSamplingRecord(); pRec = PositionSamplingRecord(eRec.time); - Spectrum result = scene->sampleSensorPosition(pRec, - (sensor->getType() & Sensor::EPositionSampleMapsToPixels) ? pixelSample + Spectrum result = scene->sampleSensorPosition(pRec, + (sensor->getType() & Sensor::EPositionSampleMapsToPixels) ? pixelSample : apertureSample, &pixelPosition); if (result.isZero()) @@ -344,7 +344,7 @@ int PathVertex::sampleSensor(const Scene *scene, Sampler *sampler, DirectionSamplingRecord dRec; result = sensor->sampleDirection(dRec, pRec, - (sensor->getType() & Sensor::EPositionSampleMapsToPixels) ? apertureSample + (sensor->getType() & Sensor::EPositionSampleMapsToPixels) ? apertureSample : pixelSample, &pixelPosition); if (result.isZero()) return 1; @@ -391,19 +391,19 @@ bool PathVertex::perturbPosition(const Scene *scene, Sampler *sampler, Float std case ESurfaceInteraction: { const Intersection &its = getIntersection(); - ray = Ray(its.p + its.geoFrame.s * step.x + its.geoFrame.t * step.y - + its.geoFrame.n * Epsilon, -its.geoFrame.n, 0, + ray = Ray(its.p + its.geoFrame.s * step.x + its.geoFrame.t * step.y + + its.geoFrame.n * Epsilon, -its.geoFrame.n, 0, std::numeric_limits::infinity(), its.time); } break; - case ESensorSample: + case ESensorSample: case EEmitterSample: { const PositionSamplingRecord &pRec = getPositionSamplingRecord(); if (pRec.n.isZero()) return false; Frame frame(pRec.n); - ray = Ray(pRec.p + frame.s * step.x + frame.t * step.y - + frame.n * Epsilon, -frame.n, 0, + ray = Ray(pRec.p + frame.s * step.x + frame.t * step.y + + frame.n * Epsilon, -frame.n, 0, std::numeric_limits::infinity(), pRec.time); } break; @@ -461,7 +461,7 @@ Float PathVertex::perturbPositionPdf(const PathVertex *target, Float stddev) con const Intersection &itsNew = target->getIntersection(); Vector rel = itsOld.geoFrame.toLocal(itsOld.p - itsNew.p); Point2 rel2 = Point2(rel.x, rel.y) / stddev; - + return Warp::squareToStdNormalPdf(rel2) * absDot(itsOld.geoFrame.n, itsNew.geoFrame.n) / (stddev*stddev); } break; @@ -472,7 +472,7 @@ Float PathVertex::perturbPositionPdf(const PathVertex *target, Float stddev) con const PositionSamplingRecord &prNew = target->getPositionSamplingRecord(); Vector rel = Frame(prOld.n).toLocal(prOld.p - prNew.p); Point2 rel2 = Point2(rel.x, rel.y) / stddev; - + return Warp::squareToStdNormalPdf(rel2) * absDot(prOld.n, prNew.n) / (stddev*stddev); } break; @@ -484,8 +484,8 @@ Float PathVertex::perturbPositionPdf(const PathVertex *target, Float stddev) con } } -bool PathVertex::perturbDirection(const Scene *scene, const PathVertex *pred, - const PathEdge *predEdge, PathEdge *succEdge, PathVertex *succ, +bool PathVertex::perturbDirection(const Scene *scene, const PathVertex *pred, + const PathEdge *predEdge, PathEdge *succEdge, PathVertex *succ, const Vector &d, Float dist, EVertexType desiredType, ETransportMode mode) { Ray ray(getPosition(), d, pred->getTime()); @@ -552,7 +552,7 @@ bool PathVertex::perturbDirection(const Scene *scene, const PathVertex *pred, Vector wo(d); BSDFSamplingRecord bRec(its, its.toLocal(wi), its.toLocal(wo), mode); - + Spectrum value = bsdf->eval(bRec); Float prob = bsdf->pdf(bRec); @@ -562,7 +562,7 @@ bool PathVertex::perturbDirection(const Scene *scene, const PathVertex *pred, weight[mode] = value/prob; pdf[mode] = prob; - /* Prevent light leaks due to the use of shading normals */ + /* Prevent light leaks due to the use of shading normals */ Float wiDotGeoN = dot(its.geoFrame.n, wi), woDotGeoN = dot(its.geoFrame.n, wo); if (wiDotGeoN * Frame::cosTheta(bRec.wi) <= 0 || @@ -576,8 +576,8 @@ bool PathVertex::perturbDirection(const Scene *scene, const PathVertex *pred, #if defined(MTS_BD_TRACE) SLog(EWarn, "Detected an inconsistency: approached " "surface %s within medium %s, but the surface " - "states that the ray should be in medium %s.", - its.toString().c_str(), predEdge->medium ? + "states that the ray should be in medium %s.", + its.toString().c_str(), predEdge->medium ? predEdge->medium->toString().c_str() : "null", expected ? expected->toString().c_str() : "null"); #endif @@ -662,7 +662,7 @@ bool PathVertex::perturbDirection(const Scene *scene, const PathVertex *pred, /* Convert from solid angle to area measure */ if (measure == ESolidAngle) { measure = EArea; - + pdf[mode] /= succEdge->length * succEdge->length; if (succ->isOnSurface()) pdf[mode] *= absDot(ray.d, succ->getGeometricNormal()); @@ -677,8 +677,8 @@ bool PathVertex::perturbDirection(const Scene *scene, const PathVertex *pred, return true; } -bool PathVertex::propagatePerturbation(const Scene *scene, const PathVertex *pred, - const PathEdge *predEdge, PathEdge *succEdge, PathVertex *succ, +bool PathVertex::propagatePerturbation(const Scene *scene, const PathVertex *pred, + const PathEdge *predEdge, PathEdge *succEdge, PathVertex *succ, unsigned int componentType_, Float dist, EVertexType desiredType, ETransportMode mode) { BDAssert(isSurfaceInteraction()); @@ -705,7 +705,7 @@ bool PathVertex::propagatePerturbation(const Scene *scene, const PathVertex *pre Float wiDotGeoN = dot(its.geoFrame.n, wi), woDotGeoN = dot(its.geoFrame.n, wo); if (wiDotGeoN * Frame::cosTheta(bRec.wi) <= 0 || - woDotGeoN * Frame::cosTheta(bRec.wo) <= 0) + woDotGeoN * Frame::cosTheta(bRec.wo) <= 0) return false; bRec.typeMask = BSDF::EAll; @@ -725,8 +725,8 @@ bool PathVertex::propagatePerturbation(const Scene *scene, const PathVertex *pre #if defined(MTS_BD_TRACE) SLog(EWarn, "Detected an inconsistency: approached " "surface %s within medium %s, but the surface " - "states that the ray should be in medium %s.", - its.toString().c_str(), predEdge->medium ? + "states that the ray should be in medium %s.", + its.toString().c_str(), predEdge->medium ? predEdge->medium->toString().c_str() : "null", expected ? expected->toString().c_str() : "null"); #endif @@ -771,7 +771,7 @@ bool PathVertex::propagatePerturbation(const Scene *scene, const PathVertex *pre return true; } -Spectrum PathVertex::eval(const Scene *scene, const PathVertex *pred, +Spectrum PathVertex::eval(const Scene *scene, const PathVertex *pred, const PathVertex *succ, ETransportMode mode, EMeasure measure) const { Spectrum result(0.0f); Vector wo(0.0f); @@ -849,7 +849,7 @@ Spectrum PathVertex::eval(const Scene *scene, const PathVertex *pred, Vector wi = normalize(predP - its.p); wo = normalize(succP - its.p); - BSDFSamplingRecord bRec(its, its.toLocal(wi), + BSDFSamplingRecord bRec(its, its.toLocal(wi), its.toLocal(wo), mode); if (measure == EArea) @@ -862,7 +862,7 @@ Spectrum PathVertex::eval(const Scene *scene, const PathVertex *pred, woDotGeoN = dot(its.geoFrame.n, wo); if (wiDotGeoN * Frame::cosTheta(bRec.wi) <= 0 || - woDotGeoN * Frame::cosTheta(bRec.wo) <= 0) + woDotGeoN * Frame::cosTheta(bRec.wo) <= 0) return Spectrum(0.0f); if (mode == EImportance) { @@ -905,7 +905,7 @@ Spectrum PathVertex::eval(const Scene *scene, const PathVertex *pred, return result; } -Float PathVertex::evalPdf(const Scene *scene, const PathVertex *pred, +Float PathVertex::evalPdf(const Scene *scene, const PathVertex *pred, const PathVertex *succ, ETransportMode mode, EMeasure measure) const { Vector wo(0.0f); Float dist = 0.0f, result = 0.0f; @@ -976,7 +976,7 @@ Float PathVertex::evalPdf(const Scene *scene, const PathVertex *pred, woDotGeoN = dot(its.geoFrame.n, wo); if (wiDotGeoN * Frame::cosTheta(bRec.wi) <= 0 || - woDotGeoN * Frame::cosTheta(bRec.wo) <= 0) + woDotGeoN * Frame::cosTheta(bRec.wo) <= 0) return 0.0f; } break; @@ -1018,11 +1018,11 @@ Spectrum PathVertex::sampleDirect(const Scene *scene, Sampler *sampler, PathVertex *endpoint, PathEdge *edge, PathVertex *sample, ETransportMode mode) const { if (isDegenerate() || isAbsorbing()) return Spectrum(0.0f); - + memset(edge, 0, sizeof(PathEdge)); memset(endpoint, 0, sizeof(PathVertex)); memset(sample, 0, sizeof(PathVertex)); - + bool emitter = (mode == EImportance); DirectSamplingRecord dRec; if (isSurfaceInteraction()) @@ -1076,9 +1076,9 @@ Spectrum PathVertex::sampleDirect(const Scene *scene, Sampler *sampler, return value; } -Float PathVertex::evalPdfDirect(const Scene *scene, +Float PathVertex::evalPdfDirect(const Scene *scene, const PathVertex *sample, ETransportMode mode, EMeasure measure) const { - BDAssert((mode == EImportance && sample->type == EEmitterSample) || + BDAssert((mode == EImportance && sample->type == EEmitterSample) || (mode == ERadiance && sample->type == ESensorSample)); bool emitter = (mode == EImportance); @@ -1150,7 +1150,7 @@ bool PathVertex::cast(const Scene *scene, EVertexType desired) { } } -bool PathVertex::update(const Scene *scene, const PathVertex *pred, +bool PathVertex::update(const Scene *scene, const PathVertex *pred, const PathVertex *succ, ETransportMode mode, EMeasure measure) { pdf[mode] = evalPdf(scene, pred, succ, mode, measure); @@ -1241,7 +1241,7 @@ Normal PathVertex::getGeometricNormal() const { return Normal(0.0f); } } - + Float PathVertex::getTime() const { switch (type) { case ESurfaceInteraction: @@ -1261,7 +1261,7 @@ Float PathVertex::getTime() const { } } -const Medium *PathVertex::getTargetMedium(const PathEdge *predEdge, +const Medium *PathVertex::getTargetMedium(const PathEdge *predEdge, const PathVertex *succ) const { if (isSurfaceInteraction()) { const Intersection &its = getIntersection(); @@ -1271,7 +1271,7 @@ const Medium *PathVertex::getTargetMedium(const PathEdge *predEdge, return predEdge->medium; } -const Medium *PathVertex::getTargetMedium(const PathEdge *predEdge, +const Medium *PathVertex::getTargetMedium(const PathEdge *predEdge, const Vector &d) const { if (isSurfaceInteraction()) { const Intersection &its = getIntersection(); @@ -1301,9 +1301,9 @@ bool PathVertex::getSamplePosition(const PathVertex *v, Point2 &result) const { return sensor->getSamplePosition(pRec, dRec, result); } -bool PathVertex::connect(const Scene *scene, +bool PathVertex::connect(const Scene *scene, const PathVertex *pred, const PathEdge *predEdge, - PathVertex *vs, PathEdge *edge, PathVertex *vt, + PathVertex *vs, PathEdge *edge, PathVertex *vt, const PathEdge *succEdge, const PathVertex *succ) { if (vs->isEmitterSupernode()) { @@ -1314,12 +1314,12 @@ bool PathVertex::connect(const Scene *scene, if (!vs->cast(scene, PathVertex::ESensorSample)) return false; } else if (vs->getPosition() == vt->getPosition()) { - /* Check for this here to avoid dividing by zero + /* Check for this here to avoid dividing by zero when computing the direction vs->vt. */ return false; } - if (vs->isDegenerate() || vt->isDegenerate()) + if (vs->isDegenerate() || vt->isDegenerate()) return false; vs->update(scene, pred, vt, EImportance); @@ -1333,9 +1333,9 @@ bool PathVertex::connect(const Scene *scene, return edge->connect(scene, predEdge, vs, vt, succEdge); } -bool PathVertex::connect(const Scene *scene, +bool PathVertex::connect(const Scene *scene, const PathVertex *pred, const PathEdge *predEdge, - PathVertex *vs, PathEdge *edge, PathVertex *vt, + PathVertex *vs, PathEdge *edge, PathVertex *vt, const PathEdge *succEdge, const PathVertex *succ, EMeasure vsMeasure, EMeasure vtMeasure) { @@ -1412,7 +1412,7 @@ bool PathVertex::operator==(const PathVertex &other) const { other.weight[ERadiance] == weight[ERadiance] && other.pdf[EImportance] == pdf[EImportance] && other.pdf[ERadiance] == pdf[ERadiance] && - memcmp(other.data, data, EDataSize) == 0; + memcmp(other.data, data, EDataSize) == 0; } std::ostream &operator<<(std::ostream &os, PathVertex::EVertexType type) { diff --git a/src/libcore/appender.cpp b/src/libcore/appender.cpp index 621f5a10..f96f79da 100644 --- a/src/libcore/appender.cpp +++ b/src/libcore/appender.cpp @@ -70,7 +70,7 @@ void StreamAppender::append(ELogLevel level, const std::string &text) { (*m_stream) << text << endl; m_lastMessageWasProgress = false; } - + void StreamAppender::logProgress(Float progress, const std::string &name, const std::string &formatted, const std::string &eta, const void *ptr) { if (!m_isFile) { @@ -92,7 +92,7 @@ std::string StreamAppender::toString() const { } oss << "]"; - + return oss.str(); } @@ -103,7 +103,7 @@ StreamAppender::~StreamAppender() { } } -UnbufferedAppender::UnbufferedAppender(int fd) +UnbufferedAppender::UnbufferedAppender(int fd) : m_fd(fd) { m_lastMessageWasProgress = false; } diff --git a/src/libcore/bitmap.cpp b/src/libcore/bitmap.cpp index 0c73de6f..a13b2ca8 100644 --- a/src/libcore/bitmap.cpp +++ b/src/libcore/bitmap.cpp @@ -192,7 +192,7 @@ extern "C" { cinfo->src->next_input_byte = p->buffer; return TRUE; } - + METHODDEF(void) jpeg_skip_input_data (j_decompress_ptr cinfo, long num_bytes) { if (num_bytes > 0) { while (num_bytes > (long) cinfo->src->bytes_in_buffer) { @@ -209,7 +209,7 @@ extern "C" { delete[] p->buffer; } - METHODDEF(void) jpeg_init_destination(j_compress_ptr cinfo) { + METHODDEF(void) jpeg_init_destination(j_compress_ptr cinfo) { jbuf_out_t *p = (jbuf_out_t *)cinfo->dest; p->buffer = new JOCTET[jpeg_bufferSize]; @@ -217,7 +217,7 @@ extern "C" { p->mgr.free_in_buffer = jpeg_bufferSize; } - METHODDEF(boolean) jpeg_empty_output_buffer(j_compress_ptr cinfo) { + METHODDEF(boolean) jpeg_empty_output_buffer(j_compress_ptr cinfo) { jbuf_out_t *p = (jbuf_out_t *)cinfo->dest; p->stream->write(p->buffer, jpeg_bufferSize); p->mgr.next_output_byte = p->buffer; @@ -227,7 +227,7 @@ extern "C" { METHODDEF(void) jpeg_term_destination(j_compress_ptr cinfo) { jbuf_out_t *p = (jbuf_out_t *)cinfo->dest; - p->stream->write(p->buffer, + p->stream->write(p->buffer, jpeg_bufferSize-p->mgr.free_in_buffer); delete[] p->buffer; p->mgr.free_in_buffer = 0; @@ -245,8 +245,8 @@ extern "C" { * Bitmap class * * ========================== */ -Bitmap::Bitmap(EPixelFormat pFormat, EComponentFormat cFormat, - const Vector2i &size, int channelCount) : m_pixelFormat(pFormat), +Bitmap::Bitmap(EPixelFormat pFormat, EComponentFormat cFormat, + const Vector2i &size, int channelCount) : m_pixelFormat(pFormat), m_componentFormat(cFormat), m_size(size), m_channelCount(channelCount) { AssertEx(size.x > 0 && size.y > 0, "Invalid bitmap size"); @@ -312,12 +312,12 @@ Bitmap::Bitmap(EFileFormat format, Stream *stream, const std::string &prefix) : void Bitmap::write(EFileFormat format, Stream *stream, int compression, const std::vector *channelNames) const { switch (format) { - case EJPEG: + case EJPEG: if (compression == -1) compression = 100; writeJPEG(stream, compression); break; - case EPNG: + case EPNG: if (compression == -1) compression = 5; writePNG(stream, compression); @@ -377,7 +377,7 @@ int Bitmap::getBytesPerComponent() const { case EFloat16: return 2; break; case EFloat32: return 4; break; case EFloat64: return 8; break; - case EBitmask: + case EBitmask: Log(EError, "Bitmask images have less than 1 byte per component!"); return -1; default: @@ -390,9 +390,9 @@ int Bitmap::getBytesPerComponent() const { void Bitmap::setString(const std::string &key, const std::string &value) { m_metadata[key] = value; } - + std::string Bitmap::getString(const std::string &key) const { - std::map::const_iterator it = m_metadata.find(key); + std::map::const_iterator it = m_metadata.find(key); if (it != m_metadata.end()) return it->second; else @@ -453,7 +453,7 @@ void Bitmap::accumulate(const Bitmap *bitmap, const Point2i &offset) { const uint8_t *source = bitmap->getUInt8Data() + (offsetX - offset.x + (offsetY - offset.y) * bitmap->getSize().x) * pixelStride; - uint8_t *target = m_data + + uint8_t *target = m_data + (offsetX + offsetY * m_size.x) * pixelStride; for (int y = offsetY; y < endY; ++y) { @@ -724,10 +724,10 @@ void Bitmap::convert(void *target, EPixelFormat pixelFormat, (size_t) m_size.x * (size_t) m_size.y, multiplier, intent); } -template void tonemapReinhard(T *data, size_t pixels, Bitmap::EPixelFormat fmt, +template void tonemapReinhard(T *data, size_t pixels, Bitmap::EPixelFormat fmt, Float &logAvgLuminance, Float &maxLuminance, Float key, Float burn) { int channels = 0; - + switch (fmt) { case Bitmap::ERGB: case Bitmap::EXYZ: @@ -877,14 +877,14 @@ void Bitmap::tonemapReinhard(Float &logAvgLuminance, Float &maxLuminance, Float size_t pixels = (size_t) m_size.x * (size_t) m_size.y; switch (m_componentFormat) { - case EFloat16: - mitsuba::tonemapReinhard(getFloat16Data(), pixels, m_pixelFormat, logAvgLuminance, maxLuminance, key, burn); + case EFloat16: + mitsuba::tonemapReinhard(getFloat16Data(), pixels, m_pixelFormat, logAvgLuminance, maxLuminance, key, burn); break; - case EFloat32: - mitsuba::tonemapReinhard(getFloat32Data(), pixels, m_pixelFormat, logAvgLuminance, maxLuminance, key, burn); + case EFloat32: + mitsuba::tonemapReinhard(getFloat32Data(), pixels, m_pixelFormat, logAvgLuminance, maxLuminance, key, burn); break; case EFloat64: - mitsuba::tonemapReinhard(getFloat64Data(), pixels, m_pixelFormat, logAvgLuminance, maxLuminance, key, burn); + mitsuba::tonemapReinhard(getFloat64Data(), pixels, m_pixelFormat, logAvgLuminance, maxLuminance, key, burn); break; default: Log(EError, "Bitmap::tonemapReinhard(): Unsupported component format!"); @@ -944,7 +944,7 @@ ref Bitmap::join(EPixelFormat fmt, if (sourceBitmaps[i]->getComponentFormat() != ch0->getComponentFormat()) Log(EError, "Bitmap::join(): Detected a component format mismatch!"); - + if (sourceBitmaps[i]->getPixelFormat() != ELuminance) Log(EError, "Bitmap::join(): Detected a pixel format mismatch (expected ELuminance)!"); } @@ -959,24 +959,24 @@ ref Bitmap::join(EPixelFormat fmt, uint8_t *dest = result->getUInt8Data(); - for (size_t i = 0; i Bitmap::crop(const Point2i &offset, const Vector2i &size) const { Assert(offset.x >= 0 && offset.y >= 0 && offset.x + size.x <= m_size.x && offset.y + size.y <= m_size.y); - + size_t pixelStride = getBytesPerPixel(); size_t sourceStride = pixelStride * m_size.x; size_t targetStride = pixelStride * size.x; - ref result = new Bitmap(m_pixelFormat, m_componentFormat, + ref result = new Bitmap(m_pixelFormat, m_componentFormat, size, m_channelCount); result->setGamma(m_gamma); @@ -996,9 +996,9 @@ ref Bitmap::crop(const Point2i &offset, const Vector2i &size) const { } /// Bitmap resampling utility function -template static void resample(const ReconstructionFilter *rfilter, - ReconstructionFilter::EBoundaryCondition bch, - ReconstructionFilter::EBoundaryCondition bcv, +template static void resample(const ReconstructionFilter *rfilter, + ReconstructionFilter::EBoundaryCondition bch, + ReconstructionFilter::EBoundaryCondition bcv, const Bitmap *source, Bitmap *target, Float minValue, Float maxValue) { ref temp; // Pointer to a temporary bitmap @@ -1021,10 +1021,10 @@ template static void resample(const ReconstructionFilter *rfil for (int y=0; ygetHeight(); ++y) { const Scalar *srcPtr = (Scalar *) source->getUInt8Data() + y * source->getWidth() * channels; - Scalar *trgPtr = (Scalar *) temp->getUInt8Data() + Scalar *trgPtr = (Scalar *) temp->getUInt8Data() + y * target->getWidth() * channels; - r.resampleAndClamp(srcPtr, 1, trgPtr, 1, channels, + r.resampleAndClamp(srcPtr, 1, trgPtr, 1, channels, (Scalar) minValue, (Scalar) maxValue); } @@ -1043,13 +1043,13 @@ template static void resample(const ReconstructionFilter *rfil const Scalar *srcPtr = (Scalar *) source->getUInt8Data() + x * channels; Scalar *trgPtr = (Scalar *) target->getUInt8Data() + x * channels; - r.resampleAndClamp(srcPtr, source->getWidth(), trgPtr, target->getWidth(), + r.resampleAndClamp(srcPtr, source->getWidth(), trgPtr, target->getWidth(), channels, (Scalar) minValue, (Scalar) maxValue); } } } -void Bitmap::resample(const ReconstructionFilter *rfilter, +void Bitmap::resample(const ReconstructionFilter *rfilter, ReconstructionFilter::EBoundaryCondition bch, ReconstructionFilter::EBoundaryCondition bcv, Bitmap *target, Float minValue, Float maxValue) const { @@ -1073,8 +1073,8 @@ void Bitmap::resample(const ReconstructionFilter *rfilter, } } -ref Bitmap::resample(const ReconstructionFilter *rfilter, - ReconstructionFilter::EBoundaryCondition bch, +ref Bitmap::resample(const ReconstructionFilter *rfilter, + ReconstructionFilter::EBoundaryCondition bch, ReconstructionFilter::EBoundaryCondition bcv, const Vector2i &size, Float minValue, Float maxValue) const { ref result = new Bitmap(m_pixelFormat, m_componentFormat, size); @@ -1095,7 +1095,7 @@ bool Bitmap::operator==(const Bitmap &bitmap) const { std::string Bitmap::toString() const { std::ostringstream oss; - oss << "Bitmap[" << endl + oss << "Bitmap[" << endl << " type = " << m_pixelFormat << endl << " componentFormat = " << m_componentFormat << endl << " size = " << m_size.toString() << endl; @@ -1190,7 +1190,7 @@ void Bitmap::readPNG(Stream *stream) { png_textp text_ptr; png_get_text(png_ptr, info_ptr, &text_ptr, &textIdx); - for (int i=0; ikey] = text_ptr->text; int intent; double gamma; @@ -1228,8 +1228,8 @@ void Bitmap::writePNG(Stream *stream, int compression) const { int colorType, bitDepth; switch (m_pixelFormat) { - case ELuminance: colorType = PNG_COLOR_TYPE_GRAY; break; - case ELuminanceAlpha: colorType = PNG_COLOR_TYPE_GRAY_ALPHA; break; + case ELuminance: colorType = PNG_COLOR_TYPE_GRAY; break; + case ELuminanceAlpha: colorType = PNG_COLOR_TYPE_GRAY_ALPHA; break; case ERGB: colorType = PNG_COLOR_TYPE_RGB; break; case ERGBA: colorType = PNG_COLOR_TYPE_RGBA; break; default: @@ -1247,7 +1247,7 @@ void Bitmap::writePNG(Stream *stream, int compression) const { } png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, &png_error_func, NULL); - if (png_ptr == NULL) + if (png_ptr == NULL) Log(EError, "Error while creating PNG data structure"); info_ptr = png_create_info_struct(png_ptr); @@ -1266,7 +1266,7 @@ void Bitmap::writePNG(Stream *stream, int compression) const { png_set_compression_level(png_ptr, compression); png_text *text = NULL; - + std::map metadata = m_metadata; metadata["generated-by"] = "Mitsuba version " MTS_VERSION; @@ -1300,7 +1300,7 @@ void Bitmap::writePNG(Stream *stream, int compression) const { size_t rowBytes = png_get_rowbytes(png_ptr, info_ptr); Assert(rowBytes == getBufferSize() / m_size.y); - for (int i=0; i(allocAligned(getBufferSize())); boost::scoped_array scanlines(new uint8_t*[m_size.y]); - for (int i=0; i sourceChannels; - /* Now, try to categorize this image into some sort of + /* Now, try to categorize this image into some sort of generic class that we know how to deal with */ if (spectral) { m_pixelFormat = ESpectrum; @@ -1577,8 +1577,8 @@ void Bitmap::readOpenEXR(Stream *stream, const std::string &_prefix) { std::string name = it.name(), typeName = it.attribute().typeName(); const Imf::StringAttribute *sattr = NULL; - if (typeName == "string" && - (sattr = header.findTypedAttribute(name.c_str()))) + if (typeName == "string" && + (sattr = header.findTypedAttribute(name.c_str()))) m_metadata[name] = sattr->value(); } @@ -1639,7 +1639,7 @@ void Bitmap::readOpenEXR(Stream *stream, const std::string &_prefix) { if (sampling == Vector2i(1)) { /* This is a full resolution channel. Load the ordinary way */ - frameBuffer.insert(channelName, Imf::Slice(pxType, ptr, pixelStride, rowStride)); + frameBuffer.insert(channelName, Imf::Slice(pxType, ptr, pixelStride, rowStride)); ptr += compSize; } else { /* Uh oh, this is a sub-sampled channel. We will need to scale it up */ @@ -1648,12 +1648,12 @@ void Bitmap::readOpenEXR(Stream *stream, const std::string &_prefix) { uint8_t *resamplePtr = resampleBuffers[i]->getUInt8Data(); resamplePtr -= (dataWindow.min.x/sampling.x + dataWindow.min.y/sampling.x * channelSize.x) * compSize; frameBuffer.insert(channelName, Imf::Slice(pxType, (char *) resamplePtr, - compSize, compSize*channelSize.x, sampling.x, sampling.y)); + compSize, compSize*channelSize.x, sampling.x, sampling.y)); ptr += compSize; } } - Log(EDebug, "Loading a %ix%i OpenEXR file (%s format, %s encoding)", + Log(EDebug, "Loading a %ix%i OpenEXR file (%s format, %s encoding)", m_size.x, m_size.y, formatString.c_str(), encodingString.c_str()); file.setFrameBuffer(frameBuffer); @@ -1674,7 +1674,7 @@ void Bitmap::readOpenEXR(Stream *stream, const std::string &_prefix) { } Log(EDebug, "Upsampling layer \"%s\" from %ix%i to %ix%i pixels", - sourceChannels[i], resampleBuffers[i]->getWidth(), + sourceChannels[i], resampleBuffers[i]->getWidth(), resampleBuffers[i]->getHeight(), m_size.x, m_size.y); resampleBuffers[i] = resampleBuffers[i]->resample(rfilter, @@ -1693,7 +1693,7 @@ void Bitmap::readOpenEXR(Stream *stream, const std::string &_prefix) { resampleBuffers[i] = NULL; } - + if (luminanceChromaFormat) { Imath::V3f yw = Imf::RgbaYca::computeYw(fileChroma); @@ -1811,7 +1811,7 @@ void Bitmap::writeOpenEXR(Stream *stream, Imf::Header header(m_size.x, m_size.y); for (std::map::const_iterator it = metadata.begin(); - it != metadata.end(); ++it) + it != metadata.end(); ++it) header.insert(it->first.c_str(), Imf::StringAttribute(it->second.c_str())); if (pixelFormat == EXYZ || pixelFormat == EXYZA) { @@ -1861,7 +1861,7 @@ void Bitmap::writeOpenEXR(Stream *stream, channels.insert(name.c_str(), Imf::Channel(compType)); } } else if (pixelFormat == EMultiChannel) { - for (int i=0; iskip(8); uint32_t bmpOffset = stream->readUInt(); @@ -2040,7 +2040,7 @@ void Bitmap::readBMP(Stream *stream) { m_gamma = -1.0f; switch (bpp) { - case 1: + case 1: m_pixelFormat = ELuminance; m_componentFormat = EBitmask; break; @@ -2115,7 +2115,7 @@ namespace detail { static inline void RGBE_WriteBytes_RLE(Stream *stream, uint8_t *data, int numbytes) { int cur = 0; uint8_t buf[2]; - + while (cur < numbytes) { int beg_run = cur; /* find next run of length at least 4 if one exists */ @@ -2138,7 +2138,7 @@ namespace detail { /* write out bytes until we reach the start of the next run */ while (cur < beg_run) { int nonrun_count = beg_run - cur; - if (nonrun_count > 128) + if (nonrun_count > 128) nonrun_count = 128; buf[0] = nonrun_count; stream->write(buf, 1); @@ -2199,7 +2199,7 @@ void Bitmap::readRGBE(Stream *stream) { detail::RGBE_ReadPixels(stream, data, (size_t) m_size.x * (size_t) m_size.y); return; } - + uint8_t *buffer = new uint8_t[4*m_size.x]; try { @@ -2207,7 +2207,7 @@ void Bitmap::readRGBE(Stream *stream) { for (int y=0; yread(rgbe, 4); - + if (rgbe[0] != 2 || rgbe[1] != 2 || rgbe[2] & 0x80) { /* this file is not run length encoded */ detail::RGBE_ToFloat(rgbe, data); @@ -2215,11 +2215,11 @@ void Bitmap::readRGBE(Stream *stream) { return; } - if ((((int) rgbe[2]) << 8 | rgbe[3]) != m_size.x) + if ((((int) rgbe[2]) << 8 | rgbe[3]) != m_size.x) Log(EError, "readRGBE(): wrong scanline width!"); uint8_t *ptr = buffer; - + /* read each of the four channels for the scanline into the buffer */ for (int i=0;i<4;i++) { uint8_t *ptr_end = buffer + (i+1) * m_size.x; @@ -2242,7 +2242,7 @@ void Bitmap::readRGBE(Stream *stream) { if (count == 0 || count > ptr_end - ptr) Log(EError, "readRGBE(): bad scanline data!"); *ptr++ = buf[1]; - if (--count > 0) + if (--count > 0) stream->read(ptr, count); ptr += count; } @@ -2271,14 +2271,14 @@ void Bitmap::writeRGBE(Stream *stream) const { Log(EError, "writeRGBE(): component format must be EFloat32!"); if (m_pixelFormat != ERGB && m_pixelFormat != ERGBA) Log(EError, "writeRGBE(): pixel format must be ERGB or ERGBA!"); - + stream->writeLine("#?RGBE"); for (std::map::const_iterator it = m_metadata.begin(); it != m_metadata.end(); ++it) { stream->writeLine(formatString("# Metadata [%s]:", it->first.c_str())); std::istringstream iss(it->second); std::string buf; - while (std::getline(iss, buf)) + while (std::getline(iss, buf)) stream->writeLine(formatString("# %s", buf.c_str())); } stream->writeLine("FORMAT=32-bit_rle_rgbe\n"); diff --git a/src/libcore/brent.cpp b/src/libcore/brent.cpp index 1e079452..9cdae746 100644 --- a/src/libcore/brent.cpp +++ b/src/libcore/brent.cpp @@ -23,8 +23,8 @@ * \file brent.cpp * \brief Brent's method nonlinear zero finder * - * The implementation is transcribed from the Apache Commons - * Java implementation. + * The implementation is transcribed from the Apache Commons + * Java implementation. */ MTS_NAMESPACE_BEGIN @@ -61,7 +61,7 @@ BrentSolver::Result BrentSolver::solve(const boost::function &f, // return the initial guess if it is good enough Float yInitial = f(initial); - if (std::abs(yInitial) <= m_absAccuracy) + if (std::abs(yInitial) <= m_absAccuracy) return Result(true, 0, initial, yInitial); // return the first endpoint if it is good enough @@ -79,7 +79,7 @@ BrentSolver::Result BrentSolver::solve(const boost::function &f, return Result(true, 0, max, yMax); // reduce interval if initial and max bracket the root - if (yInitial * yMax < 0) + if (yInitial * yMax < 0) return solve(f, initial, yInitial, max, yMax, initial, yInitial); SLog(EWarn, "BrentSolver: Function values at the endpoints do not have different signs -- " @@ -116,7 +116,7 @@ BrentSolver::Result BrentSolver::solve(const boost::function &f, Float tolerance = std::max(m_relAccuracyPos * std::abs(x1), m_absAccuracyPos); - if (std::abs(dx) <= tolerance) + if (std::abs(dx) <= tolerance) return Result(true, i, x1, y1); if ((std::abs(oldDelta) < tolerance) || (std::abs(y0) <= std::abs(y1))) { diff --git a/src/libcore/chisquare.cpp b/src/libcore/chisquare.cpp index 15e5f419..98481051 100644 --- a/src/libcore/chisquare.cpp +++ b/src/libcore/chisquare.cpp @@ -25,7 +25,7 @@ #include MTS_NAMESPACE_BEGIN - + /* Simple ordering for storing vectors in a set */ struct VectorOrder { inline int compare(const Vector &v1, const Vector &v2) const { @@ -44,7 +44,7 @@ struct VectorOrder { }; ChiSquare::ChiSquare(int thetaBins, int phiBins, int numTests, - size_t sampleCount) : m_logLevel(EInfo), m_thetaBins(thetaBins), + size_t sampleCount) : m_logLevel(EInfo), m_thetaBins(thetaBins), m_phiBins(phiBins), m_numTests(numTests), m_sampleCount(sampleCount) { if (m_phiBins == 0) m_phiBins = 2*m_thetaBins; @@ -114,7 +114,7 @@ void ChiSquare::fill( } if (discreteDirections.size() > 0) { - Log(EDebug, "Incorporating the disrete density over " + Log(EDebug, "Incorporating the disrete density over " SIZE_T_FMT " direction(s) into the contingency table", discreteDirections.size()); for (std::set::const_iterator it = discreteDirections.begin(); it != discreteDirections.end(); ++it) { @@ -160,7 +160,7 @@ void ChiSquare::fill( } } - Log(m_logLevel, "Done, took %i ms (max error = %f, integral=%f).", + Log(m_logLevel, "Done, took %i ms (max error = %f, integral=%f).", timer->getMilliseconds(), maxError, integral); } @@ -208,7 +208,7 @@ ChiSquare::ETestResult ChiSquare::runTest(Float pvalThresh) { pooledRef += m_refTable[idx]; ++pooledCells; } else if (pooledRef > 0 && pooledRef < CHISQR_MIN_EXP_FREQUENCY) { - /* Pool more cells until the merged cell + /* Pool more cells until the merged cell has a sufficiently high frequency */ pooledCounts += m_table[idx]; pooledRef += m_refTable[idx]; @@ -236,7 +236,7 @@ ChiSquare::ETestResult ChiSquare::runTest(Float pvalThresh) { df -= 1; Log(m_logLevel, "Chi-square statistic = %e (df=%i)", chsq, df); - + if (df <= 0) { Log(m_logLevel, "The number of degrees of freedom (%i) is too low!", df); return ELowDoF; diff --git a/src/libcore/class.cpp b/src/libcore/class.cpp index 93d875c7..954b4f05 100644 --- a/src/libcore/class.cpp +++ b/src/libcore/class.cpp @@ -78,7 +78,7 @@ void Class::initializeOnce(Class *theClass) { } void Class::staticInitialization() { - std::for_each(__classes->begin(), __classes->end(), + std::for_each(__classes->begin(), __classes->end(), compose1(std::ptr_fun(initializeOnce), select2nd())); m_isInitialized = true; diff --git a/src/libcore/fmtconv.cpp b/src/libcore/fmtconv.cpp index af7c171f..ae831528 100644 --- a/src/libcore/fmtconv.cpp +++ b/src/libcore/fmtconv.cpp @@ -105,7 +105,7 @@ template struct FormatConverterImpl : public FormatConverter { } virtual void convert( - Bitmap::EPixelFormat sourceFormat, Float sourceGamma, const void *_source, + Bitmap::EPixelFormat sourceFormat, Float sourceGamma, const void *_source, Bitmap::EPixelFormat destFormat, Float destGamma, void *_dest, size_t count, Float multiplier, Spectrum::EConversionIntent intent) const { @@ -113,9 +113,9 @@ template struct FormatConverterImpl : public FormatConverter { std::ostringstream oss; oss << "FormatConverter::convert([" << sourceFormat << ", " << (Bitmap::EComponentFormat) detail::get_pixelformat::value - << "] -> [" << destFormat << ", " - << (Bitmap::EComponentFormat) detail::get_pixelformat::value - << "], gamma = " << sourceGamma << " -> " << destGamma + << "] -> [" << destFormat << ", " + << (Bitmap::EComponentFormat) detail::get_pixelformat::value + << "], gamma = " << sourceGamma << " -> " << destGamma << ", count = " << count << ")"; SLog(EInfo, "%s", oss.str().c_str()); #endif @@ -169,21 +169,21 @@ template struct FormatConverterImpl : public FormatConverter { *dest++ = convertScalar(*source++, sourceGamma, precomp, multiplier, invDestGamma); break; - case Bitmap::ELuminanceAlpha: + case Bitmap::ELuminanceAlpha: for (size_t i=0; i(*source++, sourceGamma, precomp, multiplier, invDestGamma); *dest++ = one; } break; - case Bitmap::ERGB: + case Bitmap::ERGB: for (size_t i=0; i(*source++, sourceGamma, precomp, multiplier, invDestGamma); *dest++ = value; *dest++ = value; *dest++ = value; } break; - case Bitmap::ERGBA: + case Bitmap::ERGBA: for (size_t i=0; i(*source++, sourceGamma, precomp, multiplier, invDestGamma); *dest++ = value; *dest++ = value; *dest++ = value; *dest++ = one; @@ -197,26 +197,26 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::EXYZA: + case Bitmap::EXYZA: for (size_t i=0; i(*source++, sourceGamma, precomp, multiplier, invDestGamma); *dest++ = zero; *dest++ = value; *dest++ = zero; *dest++ = one; } break; - case Bitmap::ESpectrum: + case Bitmap::ESpectrum: for (size_t i=0; i(*source++, sourceGamma, precomp, multiplier, invDestGamma); for (int j=0; j(*source++, sourceGamma, precomp, multiplier, invDestGamma); for (int j=0; j struct FormatConverterImpl : public FormatConverter { for (size_t i=0; i(*source++, sourceGamma, precomp, multiplier, invDestGamma); for (int j=0; j struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ELuminanceAlpha: { + case Bitmap::ELuminanceAlpha: { switch (destFormat) { case Bitmap::ELuminance: for (size_t i=0; i struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ERGB: + case Bitmap::ERGB: for (size_t i=0; i(*source++, sourceGamma, precomp, multiplier, invDestGamma); *dest++ = value; *dest++ = value; *dest++ = value; @@ -260,7 +260,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ERGBA: + case Bitmap::ERGBA: for (size_t i=0; i(*source++, sourceGamma, precomp, multiplier, invDestGamma); *dest++ = value; *dest++ = value; *dest++ = value; @@ -268,7 +268,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::EXYZ: + case Bitmap::EXYZ: for (size_t i=0; i(*source++, sourceGamma, precomp, multiplier, invDestGamma); *dest++ = zero; *dest++ = value; *dest++ = zero; @@ -284,20 +284,20 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ESpectrum: + case Bitmap::ESpectrum: for (size_t i=0; i(*source++, sourceGamma, precomp, multiplier, invDestGamma); for (int j=0; j(*source++, sourceGamma, precomp, multiplier, invDestGamma); for (int j=0; j(*source++); } break; @@ -306,7 +306,7 @@ template struct FormatConverterImpl : public FormatConverter { for (size_t i=0; i(*source++, sourceGamma, precomp, multiplier, invDestGamma); for (int j=0; j(*source++); *dest++ = one; } @@ -330,7 +330,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ELuminanceAlpha: + case Bitmap::ELuminanceAlpha: for (size_t i=0; i(*source++, sourceGamma); Float g = convertScalar(*source++, sourceGamma); @@ -341,7 +341,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ERGB: + case Bitmap::ERGB: for (size_t i=0; i(*source++, sourceGamma, precomp, multiplier, invDestGamma); *dest++ = convertScalar(*source++, sourceGamma, precomp, multiplier, invDestGamma); @@ -358,7 +358,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::EXYZ: + case Bitmap::EXYZ: for (size_t i=0; i(*source++, sourceGamma); Float g = convertScalar(*source++, sourceGamma); @@ -383,7 +383,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ESpectrum: + case Bitmap::ESpectrum: for (size_t i=0; i(*source++, sourceGamma); Float g = convertScalar(*source++, sourceGamma); @@ -448,7 +448,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ERGB: + case Bitmap::ERGB: for (size_t i=0; i(*source++, sourceGamma, precomp, multiplier, invDestGamma); *dest++ = convertScalar(*source++, sourceGamma, precomp, multiplier, invDestGamma); @@ -457,7 +457,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ERGBA: + case Bitmap::ERGBA: for (size_t i=0; i(*source++, sourceGamma, precomp, multiplier, invDestGamma); *dest++ = convertScalar(*source++, sourceGamma, precomp, multiplier, invDestGamma); @@ -466,7 +466,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::EXYZ: + case Bitmap::EXYZ: for (size_t i=0; i(*source++, sourceGamma); Float g = convertScalar(*source++, sourceGamma); @@ -479,7 +479,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::EXYZA: + case Bitmap::EXYZA: for (size_t i=0; i(*source++, sourceGamma); Float g = convertScalar(*source++, sourceGamma); @@ -492,7 +492,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ESpectrum: + case Bitmap::ESpectrum: for (size_t i=0; i(*source++, sourceGamma); Float g = convertScalar(*source++, sourceGamma); @@ -504,7 +504,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ESpectrumAlpha: + case Bitmap::ESpectrumAlpha: for (size_t i=0; i(*source++, sourceGamma); Float g = convertScalar(*source++, sourceGamma); @@ -516,7 +516,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ESpectrumAlphaWeight: + case Bitmap::ESpectrumAlphaWeight: for (size_t i=0; i(*source++, sourceGamma); Float g = convertScalar(*source++, sourceGamma); @@ -554,7 +554,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ERGB: + case Bitmap::ERGB: for (size_t i=0; i(*source++, sourceGamma); Float y = convertScalar(*source++, sourceGamma); @@ -566,7 +566,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ERGBA: + case Bitmap::ERGBA: for (size_t i=0; i(*source++, sourceGamma); Float y = convertScalar(*source++, sourceGamma); @@ -579,7 +579,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::EXYZ: + case Bitmap::EXYZ: for (size_t i=0; i(*source++, sourceGamma, precomp, multiplier, invDestGamma); *dest++ = convertScalar(*source++, sourceGamma, precomp, multiplier, invDestGamma); @@ -587,7 +587,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::EXYZA: + case Bitmap::EXYZA: for (size_t i=0; i(*source++, sourceGamma, precomp, multiplier, invDestGamma); *dest++ = convertScalar(*source++, sourceGamma, precomp, multiplier, invDestGamma); @@ -596,7 +596,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ESpectrum: + case Bitmap::ESpectrum: for (size_t i=0; i(*source++, sourceGamma); Float y = convertScalar(*source++, sourceGamma); @@ -607,7 +607,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ESpectrumAlpha: + case Bitmap::ESpectrumAlpha: for (size_t i=0; i(*source++, sourceGamma); Float y = convertScalar(*source++, sourceGamma); @@ -619,7 +619,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ESpectrumAlphaWeight: + case Bitmap::ESpectrumAlphaWeight: for (size_t i=0; i(*source++, sourceGamma); Float y = convertScalar(*source++, sourceGamma); @@ -647,7 +647,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ELuminanceAlpha: + case Bitmap::ELuminanceAlpha: for (size_t i=0; i(source[1], sourceGamma); *dest++ = convertScalar(luminance, 1.0f, NULL, multiplier, invDestGamma); @@ -656,7 +656,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ERGB: + case Bitmap::ERGB: for (size_t i=0; i(*source++, sourceGamma); Float y = convertScalar(*source++, sourceGamma); @@ -682,7 +682,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::EXYZ: + case Bitmap::EXYZ: for (size_t i=0; i(*source++, sourceGamma, precomp, multiplier, invDestGamma); *dest++ = convertScalar(*source++, sourceGamma, precomp, multiplier, invDestGamma); @@ -691,7 +691,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::EXYZA: + case Bitmap::EXYZA: for (size_t i=0; i(*source++, sourceGamma, precomp, multiplier, invDestGamma); *dest++ = convertScalar(*source++, sourceGamma, precomp, multiplier, invDestGamma); @@ -700,7 +700,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ESpectrum: + case Bitmap::ESpectrum: for (size_t i=0; i(*source++, sourceGamma); Float y = convertScalar(*source++, sourceGamma); @@ -712,7 +712,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ESpectrumAlpha: + case Bitmap::ESpectrumAlpha: for (size_t i=0; i(*source++, sourceGamma); Float y = convertScalar(*source++, sourceGamma); @@ -724,7 +724,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ESpectrumAlphaWeight: + case Bitmap::ESpectrumAlphaWeight: for (size_t i=0; i(*source++, sourceGamma); Float y = convertScalar(*source++, sourceGamma); @@ -763,7 +763,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ERGB: + case Bitmap::ERGB: for (size_t i=0; i(*source++, sourceGamma); @@ -775,7 +775,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ERGBA: + case Bitmap::ERGBA: for (size_t i=0; i(*source++, sourceGamma); @@ -788,7 +788,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::EXYZ: + case Bitmap::EXYZ: for (size_t i=0; i(*source++, sourceGamma); @@ -813,8 +813,8 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ESpectrum: - for (size_t i=0, n = count*SPECTRUM_SAMPLES; i(*source++, sourceGamma, precomp, multiplier, invDestGamma); break; @@ -860,7 +860,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ERGB: + case Bitmap::ERGB: for (size_t i=0; i(*source++, sourceGamma); @@ -873,7 +873,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ERGBA: + case Bitmap::ERGBA: for (size_t i=0; i(*source++, sourceGamma); @@ -886,7 +886,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::EXYZ: + case Bitmap::EXYZ: for (size_t i=0; i(*source++, sourceGamma); @@ -899,7 +899,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::EXYZA: + case Bitmap::EXYZA: for (size_t i=0; i(*source++, sourceGamma); @@ -912,7 +912,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ESpectrum: + case Bitmap::ESpectrum: for (size_t i=0; i(*source++, sourceGamma, precomp, multiplier, invDestGamma); @@ -920,7 +920,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ESpectrumAlpha: + case Bitmap::ESpectrumAlpha: for (size_t i=0; i(*source++, sourceGamma, precomp, multiplier, invDestGamma); @@ -966,7 +966,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ERGB: + case Bitmap::ERGB: for (size_t i=0; i(*source++, sourceGamma); @@ -980,7 +980,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ERGBA: + case Bitmap::ERGBA: for (size_t i=0; i(*source++, sourceGamma); @@ -995,7 +995,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::EXYZ: + case Bitmap::EXYZ: for (size_t i=0; i(*source++, sourceGamma); @@ -1009,7 +1009,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::EXYZA: + case Bitmap::EXYZA: for (size_t i=0; i(*source++, sourceGamma); @@ -1024,7 +1024,7 @@ template struct FormatConverterImpl : public FormatConverter { } break; - case Bitmap::ESpectrum: + case Bitmap::ESpectrum: for (size_t i=0; i(*source++, sourceGamma); @@ -1139,7 +1139,7 @@ private: } }; -/* ================================================ +/* ================================================ The following Boost MPL magic is responsible for generating code that efficiently converts from any image type to any other image type, @@ -1150,15 +1150,15 @@ private: typedef mpl::vector< uint8_t, uint16_t, uint32_t, half, float, double> SupportedTypes; -/* Meta-function that generates all type-pairs with T +/* Meta-function that generates all type-pairs with T as the first element */ template struct ConversionFn - : mpl::fold > > { }; /* Generate all possible type pairs */ typedef mpl::fold< - SupportedTypes, mpl::vector<>, + SupportedTypes, mpl::vector<>, mpl::lambda > >::type SupportedConversions; diff --git a/src/libcore/formatter.cpp b/src/libcore/formatter.cpp index e05b6f9d..56fbbc18 100644 --- a/src/libcore/formatter.cpp +++ b/src/libcore/formatter.cpp @@ -23,7 +23,7 @@ MTS_NAMESPACE_BEGIN -DefaultFormatter::DefaultFormatter() +DefaultFormatter::DefaultFormatter() : m_haveDate(true), m_haveLogLevel(true), m_haveThread(true), m_haveClass(true) { } diff --git a/src/libcore/fresolver.cpp b/src/libcore/fresolver.cpp index 81cd27da..bd94bd10 100644 --- a/src/libcore/fresolver.cpp +++ b/src/libcore/fresolver.cpp @@ -27,7 +27,7 @@ FileResolver::FileResolver() { #elif defined(__OSX__) MTS_AUTORELEASE_BEGIN() prependPath(__mts_bundlepath()); - MTS_AUTORELEASE_END() + MTS_AUTORELEASE_END() #elif defined(__WINDOWS__) std::vector lpFilename(MAX_PATH); diff --git a/src/libcore/fstream.cpp b/src/libcore/fstream.cpp index 072335b6..f31c91d4 100644 --- a/src/libcore/fstream.cpp +++ b/src/libcore/fstream.cpp @@ -107,19 +107,19 @@ void FileStream::open(const fs::path &path, EFileMode mode) { case EAppendReadWrite: dwDesiredAccess |= GENERIC_WRITE; break; - default: + default: Log(EError, "Unknown file mode"); break; } - d->file = CreateFileW(path.c_str(), dwDesiredAccess, - FILE_SHARE_WRITE | FILE_SHARE_READ, 0, + d->file = CreateFileW(path.c_str(), dwDesiredAccess, + FILE_SHARE_WRITE | FILE_SHARE_READ, 0, dwCreationDisposition, FILE_ATTRIBUTE_NORMAL, 0); if (d->file == INVALID_HANDLE_VALUE) - Log(EError, "Error while trying to open file \"%s\": %s", + Log(EError, "Error while trying to open file \"%s\": %s", d->path.string().c_str(), lastErrorText().c_str()); - + if (d->mode == EAppendWrite || d->mode == EAppendReadWrite) seek(getSize()); #else @@ -155,7 +155,7 @@ void FileStream::open(const fs::path &path, EFileMode mode) { d->file = fopen(d->path.string().c_str(), modeString); if (d->file == NULL) { - Log(EError, "Error while trying to open file \"%s\": %s", + Log(EError, "Error while trying to open file \"%s\": %s", d->path.string().c_str(), strerror(errno)); } #endif @@ -167,12 +167,12 @@ void FileStream::close() { #ifdef WIN32 if (!CloseHandle(d->file)) { - Log(EError, "Error while trying to close file \"%s\": %s", + Log(EError, "Error while trying to close file \"%s\": %s", d->path.string().c_str(), lastErrorText().c_str()); } #else if (fclose(d->file)) { - Log(EError, "Error while trying to close file \"%s\": %s", + Log(EError, "Error while trying to close file \"%s\": %s", d->path.string().c_str(), strerror(errno)); } #endif @@ -189,17 +189,17 @@ void FileStream::remove() { void FileStream::seek(size_t pos) { AssertEx(d->file != 0, "No file is currently open"); - + #ifdef WIN32 LARGE_INTEGER fpos; fpos.QuadPart = pos; if (SetFilePointerEx(d->file, fpos, 0, FILE_BEGIN) == INVALID_SET_FILE_POINTER) { - Log(EError, "Error while trying to seek to position %i in file \"%s\": %s", + Log(EError, "Error while trying to seek to position %i in file \"%s\": %s", pos, d->path.string().c_str(), lastErrorText().c_str()); } #else if (fseek(d->file, pos, SEEK_SET)) { - Log(EError, "Error while trying to seek to position %i in file \"%s\": %s", + Log(EError, "Error while trying to seek to position %i in file \"%s\": %s", pos, d->path.string().c_str(), strerror(errno)); } #endif @@ -218,7 +218,7 @@ size_t FileStream::getPos() const { long pos; pos = ftell(d->file); if (pos == -1) { - Log(EError, "Error while looking up the position in file \"%s\": %s", + Log(EError, "Error while looking up the position in file \"%s\": %s", d->path.string().c_str(), strerror(errno)); } return (size_t) pos; @@ -237,7 +237,7 @@ size_t FileStream::getSize() const { return (size_t) result.QuadPart; #else size_t size, tmp; - + tmp = getPos(); if (fseek(d->file, 0, SEEK_END)) { Log(EError, "Error while seeking within \"%s\": %s", @@ -257,7 +257,7 @@ void FileStream::truncate(size_t size) { AssertEx(d->write, "File is not open with write access"); size_t pos = getPos(); - if (pos > size) + if (pos > size) pos = size; #ifdef WIN32 @@ -297,7 +297,7 @@ void FileStream::flush() { void FileStream::read(void *pPtr, size_t size) { AssertEx(d->file != 0, "No file is currently open"); AssertEx(d->read, "File is not open with read access"); - + if (size == 0) return; #ifdef WIN32 @@ -306,7 +306,7 @@ void FileStream::read(void *pPtr, size_t size) { Log(EError, "Error while reading from file \"%s\": %s", d->path.string().c_str(), lastErrorText().c_str()); } - if (lpNumberOfBytesRead != (DWORD) size) + if (lpNumberOfBytesRead != (DWORD) size) throw EOFException(formatString("Read less data than expected (%i bytes required) " "from file \"%s\"", size, d->path.string().c_str()), (size_t) lpNumberOfBytesRead); #else @@ -335,7 +335,7 @@ void FileStream::write(const void *pPtr, size_t size) { Log(EError, "Error while writing to file \"%s\": %s", d->path.string().c_str(), lastErrorText().c_str()); } - if (lpNumberOfBytesWritten != (DWORD) size) + if (lpNumberOfBytesWritten != (DWORD) size) throw EOFException(formatString("Wrote less data than expected (%i bytes required) " "to file \"%s\"", size, d->path.string().c_str()), (size_t) lpNumberOfBytesWritten); #else @@ -369,10 +369,10 @@ void FileStream::staticInitialization() { /* On Linux + MacOS, strings are assumed to be in UTF-8. On Windows, they still are, but fs::path is UTF-16. So we need a codecvt_facet to take care of the necessary conversions */ - std::locale global_loc = std::locale(); + std::locale global_loc = std::locale(); __facet = new boost::filesystem::detail::utf8_codecvt_facet(); std::locale locale(global_loc, __facet); - boost::filesystem::path::imbue(locale); + boost::filesystem::path::imbue(locale); #endif } diff --git a/src/libcore/lock.cpp b/src/libcore/lock.cpp index 7b809943..84c1aeee 100644 --- a/src/libcore/lock.cpp +++ b/src/libcore/lock.cpp @@ -30,7 +30,7 @@ struct Mutex::MutexPrivate { Mutex::Mutex() : d(new MutexPrivate) { } - + Mutex::~Mutex() { } @@ -95,7 +95,7 @@ struct WaitFlag::WaitFlagPrivate { WaitFlagPrivate(bool f) : flag(f) {} }; -WaitFlag::WaitFlag(bool flag) +WaitFlag::WaitFlag(bool flag) : d(new WaitFlagPrivate(flag)) { } @@ -116,7 +116,7 @@ void WaitFlag::set(bool value) { void WaitFlag::wait() { boost::timed_mutex::scoped_lock lock(d->mutex); // Wait for a signal from the CV and release the mutex while waiting - while (!d->flag) + while (!d->flag) d->cond.wait(d->mutex); } diff --git a/src/libcore/logger.cpp b/src/libcore/logger.cpp index 511148da..cbab6b8c 100644 --- a/src/libcore/logger.cpp +++ b/src/libcore/logger.cpp @@ -53,7 +53,7 @@ void Logger::setErrorLevel(ELogLevel level) { m_errorLevel = level; } -void Logger::log(ELogLevel level, const Class *theClass, +void Logger::log(ELogLevel level, const Class *theClass, const char *file, int line, const char *fmt, ...) { if (level < m_logLevel) @@ -66,7 +66,7 @@ void Logger::log(ELogLevel level, const Class *theClass, va_start(iterator, fmt); size_t size = _vscprintf(fmt, iterator) + 1; - if (size >= sizeof(tmp)) + if (size >= sizeof(tmp)) msg = new char[size]; vsnprintf_s(msg, size, size-1, fmt, iterator); @@ -90,7 +90,7 @@ void Logger::log(ELogLevel level, const Class *theClass, exit(-1); } - std::string text = m_formatter->format(level, theClass, + std::string text = m_formatter->format(level, theClass, Thread::getThread(), msg, file, line); if (msg != tmp) @@ -105,7 +105,7 @@ void Logger::log(ELogLevel level, const Class *theClass, } else { #if defined(__LINUX__) /* A critical error occurred: trap if we're running in a debugger */ - + char exePath[PATH_MAX]; pid_t ppid = getppid(); memset(exePath, 0, PATH_MAX); @@ -130,7 +130,7 @@ void Logger::log(ELogLevel level, const Class *theClass, if (runningInDebugger) __asm__ ("int $3"); #elif defined(WIN32) - if (IsDebuggerPresent()) + if (IsDebuggerPresent()) __debugbreak(); #endif @@ -154,7 +154,7 @@ void Logger::addAppender(Appender *appender) { void Logger::removeAppender(Appender *appender) { LockGuard lock(m_mutex); - m_appenders.erase(std::remove(m_appenders.begin(), + m_appenders.erase(std::remove(m_appenders.begin(), m_appenders.end(), appender), m_appenders.end()); appender->decRef(); } @@ -165,7 +165,7 @@ bool Logger::readLog(std::string &target) { for (size_t i=0; igetClass()->derivesFrom(MTS_CLASS(StreamAppender))) { - StreamAppender *streamAppender = + StreamAppender *streamAppender = static_cast(appender); if (streamAppender->logsToFile()) { streamAppender->readLog(target); diff --git a/src/libcore/mmap.cpp b/src/libcore/mmap.cpp index 7f8f8edb..ede08cc3 100644 --- a/src/libcore/mmap.cpp +++ b/src/libcore/mmap.cpp @@ -23,9 +23,9 @@ struct MemoryMappedFile::MemoryMappedFilePrivate filename(f), size(s), data(NULL) {} }; -MemoryMappedFile::MemoryMappedFile(const fs::path &filename, size_t size) +MemoryMappedFile::MemoryMappedFile(const fs::path &filename, size_t size) : d(new MemoryMappedFilePrivate(filename, size)) { - Log(ETrace, "Creating memory-mapped file \"%s\" (%s)..", + Log(ETrace, "Creating memory-mapped file \"%s\" (%s)..", filename.filename().string().c_str(), memString(d->size).c_str()); #if defined(__LINUX__) || defined(__OSX__) int fd = open(filename.string().c_str(), O_RDWR | O_CREAT | O_TRUNC, 0664); @@ -43,8 +43,8 @@ MemoryMappedFile::MemoryMappedFile(const fs::path &filename, size_t size) if (close(fd) != 0) Log(EError, "close(): unable to close file!"); #elif defined(_WIN32) - d->file = CreateFile(filename.string().c_str(), GENERIC_WRITE | GENERIC_READ, - FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, + d->file = CreateFile(filename.string().c_str(), GENERIC_WRITE | GENERIC_READ, + FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (d->file == INVALID_HANDLE_VALUE) Log(EError, "Could not open \"%s\": %s", d->filename.string().c_str(), @@ -52,11 +52,11 @@ MemoryMappedFile::MemoryMappedFile(const fs::path &filename, size_t size) d->fileMapping = CreateFileMapping(d->file, NULL, PAGE_READWRITE, 0, static_cast(size), NULL); if (d->fileMapping == NULL) - Log(EError, "CreateFileMapping: Could not map \"%s\" to memory: %s", + Log(EError, "CreateFileMapping: Could not map \"%s\" to memory: %s", d->filename.string().c_str(), lastErrorText().c_str()); d->data = (void *) MapViewOfFile(d->fileMapping, FILE_MAP_WRITE, 0, 0, 0); if (d->data == NULL) - Log(EError, "MapViewOfFile: Could not map \"%s\" to memory: %s", + Log(EError, "MapViewOfFile: Could not map \"%s\" to memory: %s", d->filename.string().c_str(), lastErrorText().c_str()); #endif } @@ -67,7 +67,7 @@ MemoryMappedFile::MemoryMappedFile(const fs::path &filename) if (!fs::exists(filename)) Log(EError, "The file \"%s\" does not exist!", filename.string().c_str()); d->size = (size_t) fs::file_size(filename); - Log(ETrace, "Mapping \"%s\" into memory (%s)..", + Log(ETrace, "Mapping \"%s\" into memory (%s)..", filename.filename().string().c_str(), memString(d->size).c_str()); #if defined(__LINUX__) || defined(__OSX__) int fd = open(filename.string().c_str(), O_RDONLY); @@ -79,27 +79,27 @@ MemoryMappedFile::MemoryMappedFile(const fs::path &filename) if (close(fd) != 0) Log(EError, "close(): unable to close file!"); #elif defined(WIN32) - d->file = CreateFile(filename.string().c_str(), GENERIC_READ, - FILE_SHARE_READ, NULL, OPEN_EXISTING, + d->file = CreateFile(filename.string().c_str(), GENERIC_READ, + FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (d->file == INVALID_HANDLE_VALUE) Log(EError, "Could not open \"%s\": %s", d->filename.string().c_str(), lastErrorText().c_str()); d->fileMapping = CreateFileMapping(d->file, NULL, PAGE_READONLY, 0, 0, NULL); if (d->fileMapping == NULL) - Log(EError, "CreateFileMapping: Could not map \"%s\" to memory: %s", + Log(EError, "CreateFileMapping: Could not map \"%s\" to memory: %s", d->filename.string().c_str(), lastErrorText().c_str()); d->data = (void *) MapViewOfFile(d->fileMapping, FILE_MAP_READ, 0, 0, 0); if (d->data == NULL) - Log(EError, "MapViewOfFile: Could not map \"%s\" to memory: %s", + Log(EError, "MapViewOfFile: Could not map \"%s\" to memory: %s", d->filename.string().c_str(), lastErrorText().c_str()); #endif } MemoryMappedFile::~MemoryMappedFile() { if (d->data != NULL) { - Log(ETrace, "Unmapping \"%s\" from memory", - d->filename.string().c_str()); + Log(ETrace, "Unmapping \"%s\" from memory", + d->filename.string().c_str()); #if defined(__LINUX__) || defined(__OSX__) int retval = munmap(d->data, d->size); diff --git a/src/libcore/mstream.cpp b/src/libcore/mstream.cpp index 6677f55d..0375eb87 100644 --- a/src/libcore/mstream.cpp +++ b/src/libcore/mstream.cpp @@ -21,12 +21,12 @@ MTS_NAMESPACE_BEGIN MemoryStream::MemoryStream(size_t initialSize) - : Stream(), m_capacity(0), m_size(0), m_pos(0), + : Stream(), m_capacity(0), m_size(0), m_pos(0), m_ownsBuffer(true), m_data(NULL) { resize(initialSize); } -MemoryStream::MemoryStream(void *ptr, size_t size) +MemoryStream::MemoryStream(void *ptr, size_t size) : Stream(), m_capacity(size), m_size(size), m_pos(0), m_ownsBuffer(false), m_data((uint8_t *) ptr) { } @@ -101,7 +101,7 @@ void MemoryStream::read(void *ptr, size_t size) { void MemoryStream::write(const void *ptr, size_t size) { size_t endPos = m_pos + size; if (endPos > m_size) { - if (endPos > m_capacity) + if (endPos > m_capacity) resize(endPos); m_size = endPos; } diff --git a/src/libcore/object.cpp b/src/libcore/object.cpp index e83b61d1..cc582525 100644 --- a/src/libcore/object.cpp +++ b/src/libcore/object.cpp @@ -45,7 +45,7 @@ public: m_objects.insert(obj); } - inline void remove(const Object *obj) { + inline void remove(const Object *obj) { Lock lock(m_mutex); m_objects.erase(obj); } @@ -117,7 +117,7 @@ void Object::decRef() const { if (count == 0) { #if DEBUG_REFCOUNTS == 1 if (Class::rttiIsInitialized()) - cout << this << ": Deleting an instance of " << + cout << this << ": Deleting an instance of " << getClass()->getName() << endl; if (__ref_tracker) __ref_tracker->remove(this); @@ -139,7 +139,7 @@ std::string Object::toString() const { Object::~Object() { if (m_refCount > 0) { - Log(EWarn, "Deleting %s with reference count %i!", + Log(EWarn, "Deleting %s with reference count %i!", toString().c_str(), (int) m_refCount); } } diff --git a/src/libcore/platform_darwin.mm b/src/libcore/platform_darwin.mm index a9aeb17d..bcda249d 100644 --- a/src/libcore/platform_darwin.mm +++ b/src/libcore/platform_darwin.mm @@ -23,7 +23,7 @@ MTS_NAMESPACE_BEGIN static pthread_key_t __mts_autorelease_key; static bool __mts_cocoa_initialized = false; - + void __mts_autorelease_init() { pthread_key_create(&__mts_autorelease_key, NULL); } @@ -38,9 +38,9 @@ void __mts_autorelease_begin() { } void __mts_autorelease_end() { - NSAutoreleasePool *pool = + NSAutoreleasePool *pool = static_cast(pthread_getspecific(__mts_autorelease_key)); - [pool release]; + [pool release]; } void __mts_chdir_to_bundlepath() { diff --git a/src/libcore/platform_win32.cpp b/src/libcore/platform_win32.cpp index 07856377..2ea644f8 100644 --- a/src/libcore/platform_win32.cpp +++ b/src/libcore/platform_win32.cpp @@ -15,7 +15,7 @@ #include -/* Use strict IEEE 754 floating point computations +/* Use strict IEEE 754 floating point computations for the following code */ #pragma float_control(precise, on) @@ -128,7 +128,7 @@ double nextafter(double x, double y) { y = x*x; if (y==x) return y; - else + else return x; /* raise underflow flag */ } diff --git a/src/libcore/plugin.cpp b/src/libcore/plugin.cpp index e183409d..070179c3 100644 --- a/src/libcore/plugin.cpp +++ b/src/libcore/plugin.cpp @@ -59,12 +59,12 @@ struct Plugin::PluginPrivate { : shortName(sn), path(p) {} }; -Plugin::Plugin(const std::string &shortName, const fs::path &path) +Plugin::Plugin(const std::string &shortName, const fs::path &path) : d(new PluginPrivate(shortName, path)) { #if defined(_WIN32) d->handle = LoadLibraryW(path.c_str()); if (!d->handle) { - SLog(EError, "Error while loading plugin \"%s\": %s", + SLog(EError, "Error while loading plugin \"%s\": %s", d->path.string().c_str(), lastErrorText().c_str()); } #else @@ -146,7 +146,7 @@ std::string Plugin::getDescription() const { const fs::path& Plugin::getPath() const { return d->path; } - + const std::string& Plugin::getShortName() const { return d->shortName; } diff --git a/src/libcore/properties.cpp b/src/libcore/properties.cpp index da36c12a..da93cf3c 100644 --- a/src/libcore/properties.cpp +++ b/src/libcore/properties.cpp @@ -91,18 +91,18 @@ public: Properties::EPropertyType operator()(const Properties::Data &) const { return Properties::EData; } }; -Properties::Properties() +Properties::Properties() : m_id("unnamed") { m_elements = new std::map(); } Properties::Properties(const std::string &pluginName) -: m_pluginName(pluginName), m_id("unnamed") { +: m_pluginName(pluginName), m_id("unnamed") { m_elements = new std::map(); } Properties::Properties(const Properties &props) -: m_pluginName(props.m_pluginName), m_id(props.m_id) { +: m_pluginName(props.m_pluginName), m_id(props.m_id) { m_elements = new std::map(*props.m_elements); } @@ -144,7 +144,7 @@ Properties::EPropertyType Properties::getType(const std::string &name) const { std::map::const_iterator it = m_elements->find(name); if (it == m_elements->end()) SLog(EError, "Property \"%s\" has not been specified!", name.c_str()); - + type_visitor myVisitor; return boost::apply_visitor(myVisitor, it->second.data); } @@ -184,7 +184,7 @@ std::string Properties::toString() const { oss << "\"" << boost::get(data) << "\""; break; case EData: - oss << boost::get(data).ptr << " (size=" + oss << boost::get(data).ptr << " (size=" << boost::get(data).size << ")"; break; default: @@ -215,12 +215,12 @@ bool Properties::wasQueried(const std::string &name) const { void Properties::putPropertyNames(std::vector &results) const { for (std::map::const_iterator it = m_elements->begin(); - it != m_elements->end(); ++it) + it != m_elements->end(); ++it) results.push_back((*it).first); } -ConfigurableObject::ConfigurableObject(Stream *stream, InstanceManager *manager) +ConfigurableObject::ConfigurableObject(Stream *stream, InstanceManager *manager) : SerializableObject(stream, manager) { } @@ -237,14 +237,14 @@ void ConfigurableObject::serialize(Stream *stream, InstanceManager *manager) con } void ConfigurableObject::addChild(const std::string &name, ConfigurableObject *child) { - SLog(EError, "ConfigurableObject::addChild(\"%s\", %s) not implemented in \"%s\"", + SLog(EError, "ConfigurableObject::addChild(\"%s\", %s) not implemented in \"%s\"", name.c_str(), child->toString().c_str(), toString().c_str()); } void NetworkedObject::serialize(Stream *stream, InstanceManager *manager) const { ConfigurableObject::serialize(stream, manager); } - + void NetworkedObject::bindUsedResources(ParallelProcess *proc) const { } diff --git a/src/libcore/qmc.cpp b/src/libcore/qmc.cpp index 79d352af..fb4c1a84 100644 --- a/src/libcore/qmc.cpp +++ b/src/libcore/qmc.cpp @@ -21,63 +21,63 @@ MTS_NAMESPACE_BEGIN const int primeTable[primeTableSize] = { - 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, - 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, - 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, - 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, - 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, - 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, - 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, - 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, - 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, - 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, - 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, - 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, - 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, - 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, - 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, - 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, - 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, - 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, - 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, - 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, - 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, - 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, - 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, - 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, - 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, - 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, - 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, - 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, - 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, - 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, - 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, - 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, - 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, - 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, - 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, - 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, - 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, - 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, - 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, - 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, - 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, - 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, - 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, - 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, - 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, - 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, - 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, - 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, - 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, - 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, - 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, - 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, - 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, - 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, - 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, - 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, - 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, + 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, + 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, + 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, + 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, + 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, + 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, + 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, + 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, + 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, + 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, + 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, + 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, + 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, + 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, + 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, 1901, 1907, 1913, + 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, + 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, + 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, + 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, + 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, + 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, + 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, 2819, 2833, 2837, + 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, + 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, + 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, + 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, + 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, + 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, + 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, 3821, 3823, + 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, + 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, 4099, + 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, + 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, + 4409, 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, + 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, + 4691, 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, 4831, + 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, 4969, 4973, 4987, + 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, + 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, + 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, + 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, + 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, + 5717, 5737, 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, + 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, 6011, 6029, + 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, + 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, 6277, 6287, 6299, 6301, + 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, + 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, + 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, + 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, + 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, 7039, + 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, + 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, 7351, 7369, 7393, + 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, + 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, + 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, + 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, 8161 }; @@ -124,14 +124,14 @@ Float radicalInverseIncremental(int base, Float x) { x += hh + h - 1.0f; } - + return x; } -/* Radical inverse: explicitly instantiated versions that permit important +/* Radical inverse: explicitly instantiated versions that permit important additional compiler optimizations. */ -#if 1 +#if 1 /* Tuned version that keeps FP and integer separate in the loop (to avoid introducing unnecessary store-to-load dependencies on current processor architectures) */ @@ -199,1030 +199,1030 @@ Float radicalInverseFast(uint16_t baseIndex, uint64_t index) { Float inverse = 0.0f; switch (baseIndex) { - case 0: RINV(2); break; - case 1: RINV(3); break; - case 2: RINV(5); break; - case 3: RINV(7); break; - case 4: RINV(11); break; - case 5: RINV(13); break; - case 6: RINV(17); break; - case 7: RINV(19); break; - case 8: RINV(23); break; - case 9: RINV(29); break; - case 10: RINV(31); break; - case 11: RINV(37); break; - case 12: RINV(41); break; - case 13: RINV(43); break; - case 14: RINV(47); break; - case 15: RINV(53); break; - case 16: RINV(59); break; - case 17: RINV(61); break; - case 18: RINV(67); break; - case 19: RINV(71); break; - case 20: RINV(73); break; - case 21: RINV(79); break; - case 22: RINV(83); break; - case 23: RINV(89); break; - case 24: RINV(97); break; - case 25: RINV(101); break; - case 26: RINV(103); break; - case 27: RINV(107); break; - case 28: RINV(109); break; - case 29: RINV(113); break; - case 30: RINV(127); break; - case 31: RINV(131); break; - case 32: RINV(137); break; - case 33: RINV(139); break; - case 34: RINV(149); break; - case 35: RINV(151); break; - case 36: RINV(157); break; - case 37: RINV(163); break; - case 38: RINV(167); break; - case 39: RINV(173); break; - case 40: RINV(179); break; - case 41: RINV(181); break; - case 42: RINV(191); break; - case 43: RINV(193); break; - case 44: RINV(197); break; - case 45: RINV(199); break; - case 46: RINV(211); break; - case 47: RINV(223); break; - case 48: RINV(227); break; - case 49: RINV(229); break; - case 50: RINV(233); break; - case 51: RINV(239); break; - case 52: RINV(241); break; - case 53: RINV(251); break; - case 54: RINV(257); break; - case 55: RINV(263); break; - case 56: RINV(269); break; - case 57: RINV(271); break; - case 58: RINV(277); break; - case 59: RINV(281); break; - case 60: RINV(283); break; - case 61: RINV(293); break; - case 62: RINV(307); break; - case 63: RINV(311); break; - case 64: RINV(313); break; - case 65: RINV(317); break; - case 66: RINV(331); break; - case 67: RINV(337); break; - case 68: RINV(347); break; - case 69: RINV(349); break; - case 70: RINV(353); break; - case 71: RINV(359); break; - case 72: RINV(367); break; - case 73: RINV(373); break; - case 74: RINV(379); break; - case 75: RINV(383); break; - case 76: RINV(389); break; - case 77: RINV(397); break; - case 78: RINV(401); break; - case 79: RINV(409); break; - case 80: RINV(419); break; - case 81: RINV(421); break; - case 82: RINV(431); break; - case 83: RINV(433); break; - case 84: RINV(439); break; - case 85: RINV(443); break; - case 86: RINV(449); break; - case 87: RINV(457); break; - case 88: RINV(461); break; - case 89: RINV(463); break; - case 90: RINV(467); break; - case 91: RINV(479); break; - case 92: RINV(487); break; - case 93: RINV(491); break; - case 94: RINV(499); break; - case 95: RINV(503); break; - case 96: RINV(509); break; - case 97: RINV(521); break; - case 98: RINV(523); break; - case 99: RINV(541); break; - case 100: RINV(547); break; - case 101: RINV(557); break; - case 102: RINV(563); break; - case 103: RINV(569); break; - case 104: RINV(571); break; - case 105: RINV(577); break; - case 106: RINV(587); break; - case 107: RINV(593); break; - case 108: RINV(599); break; - case 109: RINV(601); break; - case 110: RINV(607); break; - case 111: RINV(613); break; - case 112: RINV(617); break; - case 113: RINV(619); break; - case 114: RINV(631); break; - case 115: RINV(641); break; - case 116: RINV(643); break; - case 117: RINV(647); break; - case 118: RINV(653); break; - case 119: RINV(659); break; - case 120: RINV(661); break; - case 121: RINV(673); break; - case 122: RINV(677); break; - case 123: RINV(683); break; - case 124: RINV(691); break; - case 125: RINV(701); break; - case 126: RINV(709); break; - case 127: RINV(719); break; - case 128: RINV(727); break; - case 129: RINV(733); break; - case 130: RINV(739); break; - case 131: RINV(743); break; - case 132: RINV(751); break; - case 133: RINV(757); break; - case 134: RINV(761); break; - case 135: RINV(769); break; - case 136: RINV(773); break; - case 137: RINV(787); break; - case 138: RINV(797); break; - case 139: RINV(809); break; - case 140: RINV(811); break; - case 141: RINV(821); break; - case 142: RINV(823); break; - case 143: RINV(827); break; - case 144: RINV(829); break; - case 145: RINV(839); break; - case 146: RINV(853); break; - case 147: RINV(857); break; - case 148: RINV(859); break; - case 149: RINV(863); break; - case 150: RINV(877); break; - case 151: RINV(881); break; - case 152: RINV(883); break; - case 153: RINV(887); break; - case 154: RINV(907); break; - case 155: RINV(911); break; - case 156: RINV(919); break; - case 157: RINV(929); break; - case 158: RINV(937); break; - case 159: RINV(941); break; - case 160: RINV(947); break; - case 161: RINV(953); break; - case 162: RINV(967); break; - case 163: RINV(971); break; - case 164: RINV(977); break; - case 165: RINV(983); break; - case 166: RINV(991); break; - case 167: RINV(997); break; - case 168: RINV(1009); break; - case 169: RINV(1013); break; - case 170: RINV(1019); break; - case 171: RINV(1021); break; - case 172: RINV(1031); break; - case 173: RINV(1033); break; - case 174: RINV(1039); break; - case 175: RINV(1049); break; - case 176: RINV(1051); break; - case 177: RINV(1061); break; - case 178: RINV(1063); break; - case 179: RINV(1069); break; - case 180: RINV(1087); break; - case 181: RINV(1091); break; - case 182: RINV(1093); break; - case 183: RINV(1097); break; - case 184: RINV(1103); break; - case 185: RINV(1109); break; - case 186: RINV(1117); break; - case 187: RINV(1123); break; - case 188: RINV(1129); break; - case 189: RINV(1151); break; - case 190: RINV(1153); break; - case 191: RINV(1163); break; - case 192: RINV(1171); break; - case 193: RINV(1181); break; - case 194: RINV(1187); break; - case 195: RINV(1193); break; - case 196: RINV(1201); break; - case 197: RINV(1213); break; - case 198: RINV(1217); break; - case 199: RINV(1223); break; - case 200: RINV(1229); break; - case 201: RINV(1231); break; - case 202: RINV(1237); break; - case 203: RINV(1249); break; - case 204: RINV(1259); break; - case 205: RINV(1277); break; - case 206: RINV(1279); break; - case 207: RINV(1283); break; - case 208: RINV(1289); break; - case 209: RINV(1291); break; - case 210: RINV(1297); break; - case 211: RINV(1301); break; - case 212: RINV(1303); break; - case 213: RINV(1307); break; - case 214: RINV(1319); break; - case 215: RINV(1321); break; - case 216: RINV(1327); break; - case 217: RINV(1361); break; - case 218: RINV(1367); break; - case 219: RINV(1373); break; - case 220: RINV(1381); break; - case 221: RINV(1399); break; - case 222: RINV(1409); break; - case 223: RINV(1423); break; - case 224: RINV(1427); break; - case 225: RINV(1429); break; - case 226: RINV(1433); break; - case 227: RINV(1439); break; - case 228: RINV(1447); break; - case 229: RINV(1451); break; - case 230: RINV(1453); break; - case 231: RINV(1459); break; - case 232: RINV(1471); break; - case 233: RINV(1481); break; - case 234: RINV(1483); break; - case 235: RINV(1487); break; - case 236: RINV(1489); break; - case 237: RINV(1493); break; - case 238: RINV(1499); break; - case 239: RINV(1511); break; - case 240: RINV(1523); break; - case 241: RINV(1531); break; - case 242: RINV(1543); break; - case 243: RINV(1549); break; - case 244: RINV(1553); break; - case 245: RINV(1559); break; - case 246: RINV(1567); break; - case 247: RINV(1571); break; - case 248: RINV(1579); break; - case 249: RINV(1583); break; - case 250: RINV(1597); break; - case 251: RINV(1601); break; - case 252: RINV(1607); break; - case 253: RINV(1609); break; - case 254: RINV(1613); break; - case 255: RINV(1619); break; - case 256: RINV(1621); break; - case 257: RINV(1627); break; - case 258: RINV(1637); break; - case 259: RINV(1657); break; - case 260: RINV(1663); break; - case 261: RINV(1667); break; - case 262: RINV(1669); break; - case 263: RINV(1693); break; - case 264: RINV(1697); break; - case 265: RINV(1699); break; - case 266: RINV(1709); break; - case 267: RINV(1721); break; - case 268: RINV(1723); break; - case 269: RINV(1733); break; - case 270: RINV(1741); break; - case 271: RINV(1747); break; - case 272: RINV(1753); break; - case 273: RINV(1759); break; - case 274: RINV(1777); break; - case 275: RINV(1783); break; - case 276: RINV(1787); break; - case 277: RINV(1789); break; - case 278: RINV(1801); break; - case 279: RINV(1811); break; - case 280: RINV(1823); break; - case 281: RINV(1831); break; - case 282: RINV(1847); break; - case 283: RINV(1861); break; - case 284: RINV(1867); break; - case 285: RINV(1871); break; - case 286: RINV(1873); break; - case 287: RINV(1877); break; - case 288: RINV(1879); break; - case 289: RINV(1889); break; - case 290: RINV(1901); break; - case 291: RINV(1907); break; - case 292: RINV(1913); break; - case 293: RINV(1931); break; - case 294: RINV(1933); break; - case 295: RINV(1949); break; - case 296: RINV(1951); break; - case 297: RINV(1973); break; - case 298: RINV(1979); break; - case 299: RINV(1987); break; - case 300: RINV(1993); break; - case 301: RINV(1997); break; - case 302: RINV(1999); break; - case 303: RINV(2003); break; - case 304: RINV(2011); break; - case 305: RINV(2017); break; - case 306: RINV(2027); break; - case 307: RINV(2029); break; - case 308: RINV(2039); break; - case 309: RINV(2053); break; - case 310: RINV(2063); break; - case 311: RINV(2069); break; - case 312: RINV(2081); break; - case 313: RINV(2083); break; - case 314: RINV(2087); break; - case 315: RINV(2089); break; - case 316: RINV(2099); break; - case 317: RINV(2111); break; - case 318: RINV(2113); break; - case 319: RINV(2129); break; - case 320: RINV(2131); break; - case 321: RINV(2137); break; - case 322: RINV(2141); break; - case 323: RINV(2143); break; - case 324: RINV(2153); break; - case 325: RINV(2161); break; - case 326: RINV(2179); break; - case 327: RINV(2203); break; - case 328: RINV(2207); break; - case 329: RINV(2213); break; - case 330: RINV(2221); break; - case 331: RINV(2237); break; - case 332: RINV(2239); break; - case 333: RINV(2243); break; - case 334: RINV(2251); break; - case 335: RINV(2267); break; - case 336: RINV(2269); break; - case 337: RINV(2273); break; - case 338: RINV(2281); break; - case 339: RINV(2287); break; - case 340: RINV(2293); break; - case 341: RINV(2297); break; - case 342: RINV(2309); break; - case 343: RINV(2311); break; - case 344: RINV(2333); break; - case 345: RINV(2339); break; - case 346: RINV(2341); break; - case 347: RINV(2347); break; - case 348: RINV(2351); break; - case 349: RINV(2357); break; - case 350: RINV(2371); break; - case 351: RINV(2377); break; - case 352: RINV(2381); break; - case 353: RINV(2383); break; - case 354: RINV(2389); break; - case 355: RINV(2393); break; - case 356: RINV(2399); break; - case 357: RINV(2411); break; - case 358: RINV(2417); break; - case 359: RINV(2423); break; - case 360: RINV(2437); break; - case 361: RINV(2441); break; - case 362: RINV(2447); break; - case 363: RINV(2459); break; - case 364: RINV(2467); break; - case 365: RINV(2473); break; - case 366: RINV(2477); break; - case 367: RINV(2503); break; - case 368: RINV(2521); break; - case 369: RINV(2531); break; - case 370: RINV(2539); break; - case 371: RINV(2543); break; - case 372: RINV(2549); break; - case 373: RINV(2551); break; - case 374: RINV(2557); break; - case 375: RINV(2579); break; - case 376: RINV(2591); break; - case 377: RINV(2593); break; - case 378: RINV(2609); break; - case 379: RINV(2617); break; - case 380: RINV(2621); break; - case 381: RINV(2633); break; - case 382: RINV(2647); break; - case 383: RINV(2657); break; - case 384: RINV(2659); break; - case 385: RINV(2663); break; - case 386: RINV(2671); break; - case 387: RINV(2677); break; - case 388: RINV(2683); break; - case 389: RINV(2687); break; - case 390: RINV(2689); break; - case 391: RINV(2693); break; - case 392: RINV(2699); break; - case 393: RINV(2707); break; - case 394: RINV(2711); break; - case 395: RINV(2713); break; - case 396: RINV(2719); break; - case 397: RINV(2729); break; - case 398: RINV(2731); break; - case 399: RINV(2741); break; - case 400: RINV(2749); break; - case 401: RINV(2753); break; - case 402: RINV(2767); break; - case 403: RINV(2777); break; - case 404: RINV(2789); break; - case 405: RINV(2791); break; - case 406: RINV(2797); break; - case 407: RINV(2801); break; - case 408: RINV(2803); break; - case 409: RINV(2819); break; - case 410: RINV(2833); break; - case 411: RINV(2837); break; - case 412: RINV(2843); break; - case 413: RINV(2851); break; - case 414: RINV(2857); break; - case 415: RINV(2861); break; - case 416: RINV(2879); break; - case 417: RINV(2887); break; - case 418: RINV(2897); break; - case 419: RINV(2903); break; - case 420: RINV(2909); break; - case 421: RINV(2917); break; - case 422: RINV(2927); break; - case 423: RINV(2939); break; - case 424: RINV(2953); break; - case 425: RINV(2957); break; - case 426: RINV(2963); break; - case 427: RINV(2969); break; - case 428: RINV(2971); break; - case 429: RINV(2999); break; - case 430: RINV(3001); break; - case 431: RINV(3011); break; - case 432: RINV(3019); break; - case 433: RINV(3023); break; - case 434: RINV(3037); break; - case 435: RINV(3041); break; - case 436: RINV(3049); break; - case 437: RINV(3061); break; - case 438: RINV(3067); break; - case 439: RINV(3079); break; - case 440: RINV(3083); break; - case 441: RINV(3089); break; - case 442: RINV(3109); break; - case 443: RINV(3119); break; - case 444: RINV(3121); break; - case 445: RINV(3137); break; - case 446: RINV(3163); break; - case 447: RINV(3167); break; - case 448: RINV(3169); break; - case 449: RINV(3181); break; - case 450: RINV(3187); break; - case 451: RINV(3191); break; - case 452: RINV(3203); break; - case 453: RINV(3209); break; - case 454: RINV(3217); break; - case 455: RINV(3221); break; - case 456: RINV(3229); break; - case 457: RINV(3251); break; - case 458: RINV(3253); break; - case 459: RINV(3257); break; - case 460: RINV(3259); break; - case 461: RINV(3271); break; - case 462: RINV(3299); break; - case 463: RINV(3301); break; - case 464: RINV(3307); break; - case 465: RINV(3313); break; - case 466: RINV(3319); break; - case 467: RINV(3323); break; - case 468: RINV(3329); break; - case 469: RINV(3331); break; - case 470: RINV(3343); break; - case 471: RINV(3347); break; - case 472: RINV(3359); break; - case 473: RINV(3361); break; - case 474: RINV(3371); break; - case 475: RINV(3373); break; - case 476: RINV(3389); break; - case 477: RINV(3391); break; - case 478: RINV(3407); break; - case 479: RINV(3413); break; - case 480: RINV(3433); break; - case 481: RINV(3449); break; - case 482: RINV(3457); break; - case 483: RINV(3461); break; - case 484: RINV(3463); break; - case 485: RINV(3467); break; - case 486: RINV(3469); break; - case 487: RINV(3491); break; - case 488: RINV(3499); break; - case 489: RINV(3511); break; - case 490: RINV(3517); break; - case 491: RINV(3527); break; - case 492: RINV(3529); break; - case 493: RINV(3533); break; - case 494: RINV(3539); break; - case 495: RINV(3541); break; - case 496: RINV(3547); break; - case 497: RINV(3557); break; - case 498: RINV(3559); break; - case 499: RINV(3571); break; - case 500: RINV(3581); break; - case 501: RINV(3583); break; - case 502: RINV(3593); break; - case 503: RINV(3607); break; - case 504: RINV(3613); break; - case 505: RINV(3617); break; - case 506: RINV(3623); break; - case 507: RINV(3631); break; - case 508: RINV(3637); break; - case 509: RINV(3643); break; - case 510: RINV(3659); break; - case 511: RINV(3671); break; - case 512: RINV(3673); break; - case 513: RINV(3677); break; - case 514: RINV(3691); break; - case 515: RINV(3697); break; - case 516: RINV(3701); break; - case 517: RINV(3709); break; - case 518: RINV(3719); break; - case 519: RINV(3727); break; - case 520: RINV(3733); break; - case 521: RINV(3739); break; - case 522: RINV(3761); break; - case 523: RINV(3767); break; - case 524: RINV(3769); break; - case 525: RINV(3779); break; - case 526: RINV(3793); break; - case 527: RINV(3797); break; - case 528: RINV(3803); break; - case 529: RINV(3821); break; - case 530: RINV(3823); break; - case 531: RINV(3833); break; - case 532: RINV(3847); break; - case 533: RINV(3851); break; - case 534: RINV(3853); break; - case 535: RINV(3863); break; - case 536: RINV(3877); break; - case 537: RINV(3881); break; - case 538: RINV(3889); break; - case 539: RINV(3907); break; - case 540: RINV(3911); break; - case 541: RINV(3917); break; - case 542: RINV(3919); break; - case 543: RINV(3923); break; - case 544: RINV(3929); break; - case 545: RINV(3931); break; - case 546: RINV(3943); break; - case 547: RINV(3947); break; - case 548: RINV(3967); break; - case 549: RINV(3989); break; - case 550: RINV(4001); break; - case 551: RINV(4003); break; - case 552: RINV(4007); break; - case 553: RINV(4013); break; - case 554: RINV(4019); break; - case 555: RINV(4021); break; - case 556: RINV(4027); break; - case 557: RINV(4049); break; - case 558: RINV(4051); break; - case 559: RINV(4057); break; - case 560: RINV(4073); break; - case 561: RINV(4079); break; - case 562: RINV(4091); break; - case 563: RINV(4093); break; - case 564: RINV(4099); break; - case 565: RINV(4111); break; - case 566: RINV(4127); break; - case 567: RINV(4129); break; - case 568: RINV(4133); break; - case 569: RINV(4139); break; - case 570: RINV(4153); break; - case 571: RINV(4157); break; - case 572: RINV(4159); break; - case 573: RINV(4177); break; - case 574: RINV(4201); break; - case 575: RINV(4211); break; - case 576: RINV(4217); break; - case 577: RINV(4219); break; - case 578: RINV(4229); break; - case 579: RINV(4231); break; - case 580: RINV(4241); break; - case 581: RINV(4243); break; - case 582: RINV(4253); break; - case 583: RINV(4259); break; - case 584: RINV(4261); break; - case 585: RINV(4271); break; - case 586: RINV(4273); break; - case 587: RINV(4283); break; - case 588: RINV(4289); break; - case 589: RINV(4297); break; - case 590: RINV(4327); break; - case 591: RINV(4337); break; - case 592: RINV(4339); break; - case 593: RINV(4349); break; - case 594: RINV(4357); break; - case 595: RINV(4363); break; - case 596: RINV(4373); break; - case 597: RINV(4391); break; - case 598: RINV(4397); break; - case 599: RINV(4409); break; - case 600: RINV(4421); break; - case 601: RINV(4423); break; - case 602: RINV(4441); break; - case 603: RINV(4447); break; - case 604: RINV(4451); break; - case 605: RINV(4457); break; - case 606: RINV(4463); break; - case 607: RINV(4481); break; - case 608: RINV(4483); break; - case 609: RINV(4493); break; - case 610: RINV(4507); break; - case 611: RINV(4513); break; - case 612: RINV(4517); break; - case 613: RINV(4519); break; - case 614: RINV(4523); break; - case 615: RINV(4547); break; - case 616: RINV(4549); break; - case 617: RINV(4561); break; - case 618: RINV(4567); break; - case 619: RINV(4583); break; - case 620: RINV(4591); break; - case 621: RINV(4597); break; - case 622: RINV(4603); break; - case 623: RINV(4621); break; - case 624: RINV(4637); break; - case 625: RINV(4639); break; - case 626: RINV(4643); break; - case 627: RINV(4649); break; - case 628: RINV(4651); break; - case 629: RINV(4657); break; - case 630: RINV(4663); break; - case 631: RINV(4673); break; - case 632: RINV(4679); break; - case 633: RINV(4691); break; - case 634: RINV(4703); break; - case 635: RINV(4721); break; - case 636: RINV(4723); break; - case 637: RINV(4729); break; - case 638: RINV(4733); break; - case 639: RINV(4751); break; - case 640: RINV(4759); break; - case 641: RINV(4783); break; - case 642: RINV(4787); break; - case 643: RINV(4789); break; - case 644: RINV(4793); break; - case 645: RINV(4799); break; - case 646: RINV(4801); break; - case 647: RINV(4813); break; - case 648: RINV(4817); break; - case 649: RINV(4831); break; - case 650: RINV(4861); break; - case 651: RINV(4871); break; - case 652: RINV(4877); break; - case 653: RINV(4889); break; - case 654: RINV(4903); break; - case 655: RINV(4909); break; - case 656: RINV(4919); break; - case 657: RINV(4931); break; - case 658: RINV(4933); break; - case 659: RINV(4937); break; - case 660: RINV(4943); break; - case 661: RINV(4951); break; - case 662: RINV(4957); break; - case 663: RINV(4967); break; - case 664: RINV(4969); break; - case 665: RINV(4973); break; - case 666: RINV(4987); break; - case 667: RINV(4993); break; - case 668: RINV(4999); break; - case 669: RINV(5003); break; - case 670: RINV(5009); break; - case 671: RINV(5011); break; - case 672: RINV(5021); break; - case 673: RINV(5023); break; - case 674: RINV(5039); break; - case 675: RINV(5051); break; - case 676: RINV(5059); break; - case 677: RINV(5077); break; - case 678: RINV(5081); break; - case 679: RINV(5087); break; - case 680: RINV(5099); break; - case 681: RINV(5101); break; - case 682: RINV(5107); break; - case 683: RINV(5113); break; - case 684: RINV(5119); break; - case 685: RINV(5147); break; - case 686: RINV(5153); break; - case 687: RINV(5167); break; - case 688: RINV(5171); break; - case 689: RINV(5179); break; - case 690: RINV(5189); break; - case 691: RINV(5197); break; - case 692: RINV(5209); break; - case 693: RINV(5227); break; - case 694: RINV(5231); break; - case 695: RINV(5233); break; - case 696: RINV(5237); break; - case 697: RINV(5261); break; - case 698: RINV(5273); break; - case 699: RINV(5279); break; - case 700: RINV(5281); break; - case 701: RINV(5297); break; - case 702: RINV(5303); break; - case 703: RINV(5309); break; - case 704: RINV(5323); break; - case 705: RINV(5333); break; - case 706: RINV(5347); break; - case 707: RINV(5351); break; - case 708: RINV(5381); break; - case 709: RINV(5387); break; - case 710: RINV(5393); break; - case 711: RINV(5399); break; - case 712: RINV(5407); break; - case 713: RINV(5413); break; - case 714: RINV(5417); break; - case 715: RINV(5419); break; - case 716: RINV(5431); break; - case 717: RINV(5437); break; - case 718: RINV(5441); break; - case 719: RINV(5443); break; - case 720: RINV(5449); break; - case 721: RINV(5471); break; - case 722: RINV(5477); break; - case 723: RINV(5479); break; - case 724: RINV(5483); break; - case 725: RINV(5501); break; - case 726: RINV(5503); break; - case 727: RINV(5507); break; - case 728: RINV(5519); break; - case 729: RINV(5521); break; - case 730: RINV(5527); break; - case 731: RINV(5531); break; - case 732: RINV(5557); break; - case 733: RINV(5563); break; - case 734: RINV(5569); break; - case 735: RINV(5573); break; - case 736: RINV(5581); break; - case 737: RINV(5591); break; - case 738: RINV(5623); break; - case 739: RINV(5639); break; - case 740: RINV(5641); break; - case 741: RINV(5647); break; - case 742: RINV(5651); break; - case 743: RINV(5653); break; - case 744: RINV(5657); break; - case 745: RINV(5659); break; - case 746: RINV(5669); break; - case 747: RINV(5683); break; - case 748: RINV(5689); break; - case 749: RINV(5693); break; - case 750: RINV(5701); break; - case 751: RINV(5711); break; - case 752: RINV(5717); break; - case 753: RINV(5737); break; - case 754: RINV(5741); break; - case 755: RINV(5743); break; - case 756: RINV(5749); break; - case 757: RINV(5779); break; - case 758: RINV(5783); break; - case 759: RINV(5791); break; - case 760: RINV(5801); break; - case 761: RINV(5807); break; - case 762: RINV(5813); break; - case 763: RINV(5821); break; - case 764: RINV(5827); break; - case 765: RINV(5839); break; - case 766: RINV(5843); break; - case 767: RINV(5849); break; - case 768: RINV(5851); break; - case 769: RINV(5857); break; - case 770: RINV(5861); break; - case 771: RINV(5867); break; - case 772: RINV(5869); break; - case 773: RINV(5879); break; - case 774: RINV(5881); break; - case 775: RINV(5897); break; - case 776: RINV(5903); break; - case 777: RINV(5923); break; - case 778: RINV(5927); break; - case 779: RINV(5939); break; - case 780: RINV(5953); break; - case 781: RINV(5981); break; - case 782: RINV(5987); break; - case 783: RINV(6007); break; - case 784: RINV(6011); break; - case 785: RINV(6029); break; - case 786: RINV(6037); break; - case 787: RINV(6043); break; - case 788: RINV(6047); break; - case 789: RINV(6053); break; - case 790: RINV(6067); break; - case 791: RINV(6073); break; - case 792: RINV(6079); break; - case 793: RINV(6089); break; - case 794: RINV(6091); break; - case 795: RINV(6101); break; - case 796: RINV(6113); break; - case 797: RINV(6121); break; - case 798: RINV(6131); break; - case 799: RINV(6133); break; - case 800: RINV(6143); break; - case 801: RINV(6151); break; - case 802: RINV(6163); break; - case 803: RINV(6173); break; - case 804: RINV(6197); break; - case 805: RINV(6199); break; - case 806: RINV(6203); break; - case 807: RINV(6211); break; - case 808: RINV(6217); break; - case 809: RINV(6221); break; - case 810: RINV(6229); break; - case 811: RINV(6247); break; - case 812: RINV(6257); break; - case 813: RINV(6263); break; - case 814: RINV(6269); break; - case 815: RINV(6271); break; - case 816: RINV(6277); break; - case 817: RINV(6287); break; - case 818: RINV(6299); break; - case 819: RINV(6301); break; - case 820: RINV(6311); break; - case 821: RINV(6317); break; - case 822: RINV(6323); break; - case 823: RINV(6329); break; - case 824: RINV(6337); break; - case 825: RINV(6343); break; - case 826: RINV(6353); break; - case 827: RINV(6359); break; - case 828: RINV(6361); break; - case 829: RINV(6367); break; - case 830: RINV(6373); break; - case 831: RINV(6379); break; - case 832: RINV(6389); break; - case 833: RINV(6397); break; - case 834: RINV(6421); break; - case 835: RINV(6427); break; - case 836: RINV(6449); break; - case 837: RINV(6451); break; - case 838: RINV(6469); break; - case 839: RINV(6473); break; - case 840: RINV(6481); break; - case 841: RINV(6491); break; - case 842: RINV(6521); break; - case 843: RINV(6529); break; - case 844: RINV(6547); break; - case 845: RINV(6551); break; - case 846: RINV(6553); break; - case 847: RINV(6563); break; - case 848: RINV(6569); break; - case 849: RINV(6571); break; - case 850: RINV(6577); break; - case 851: RINV(6581); break; - case 852: RINV(6599); break; - case 853: RINV(6607); break; - case 854: RINV(6619); break; - case 855: RINV(6637); break; - case 856: RINV(6653); break; - case 857: RINV(6659); break; - case 858: RINV(6661); break; - case 859: RINV(6673); break; - case 860: RINV(6679); break; - case 861: RINV(6689); break; - case 862: RINV(6691); break; - case 863: RINV(6701); break; - case 864: RINV(6703); break; - case 865: RINV(6709); break; - case 866: RINV(6719); break; - case 867: RINV(6733); break; - case 868: RINV(6737); break; - case 869: RINV(6761); break; - case 870: RINV(6763); break; - case 871: RINV(6779); break; - case 872: RINV(6781); break; - case 873: RINV(6791); break; - case 874: RINV(6793); break; - case 875: RINV(6803); break; - case 876: RINV(6823); break; - case 877: RINV(6827); break; - case 878: RINV(6829); break; - case 879: RINV(6833); break; - case 880: RINV(6841); break; - case 881: RINV(6857); break; - case 882: RINV(6863); break; - case 883: RINV(6869); break; - case 884: RINV(6871); break; - case 885: RINV(6883); break; - case 886: RINV(6899); break; - case 887: RINV(6907); break; - case 888: RINV(6911); break; - case 889: RINV(6917); break; - case 890: RINV(6947); break; - case 891: RINV(6949); break; - case 892: RINV(6959); break; - case 893: RINV(6961); break; - case 894: RINV(6967); break; - case 895: RINV(6971); break; - case 896: RINV(6977); break; - case 897: RINV(6983); break; - case 898: RINV(6991); break; - case 899: RINV(6997); break; - case 900: RINV(7001); break; - case 901: RINV(7013); break; - case 902: RINV(7019); break; - case 903: RINV(7027); break; - case 904: RINV(7039); break; - case 905: RINV(7043); break; - case 906: RINV(7057); break; - case 907: RINV(7069); break; - case 908: RINV(7079); break; - case 909: RINV(7103); break; - case 910: RINV(7109); break; - case 911: RINV(7121); break; - case 912: RINV(7127); break; - case 913: RINV(7129); break; - case 914: RINV(7151); break; - case 915: RINV(7159); break; - case 916: RINV(7177); break; - case 917: RINV(7187); break; - case 918: RINV(7193); break; - case 919: RINV(7207); break; - case 920: RINV(7211); break; - case 921: RINV(7213); break; - case 922: RINV(7219); break; - case 923: RINV(7229); break; - case 924: RINV(7237); break; - case 925: RINV(7243); break; - case 926: RINV(7247); break; - case 927: RINV(7253); break; - case 928: RINV(7283); break; - case 929: RINV(7297); break; - case 930: RINV(7307); break; - case 931: RINV(7309); break; - case 932: RINV(7321); break; - case 933: RINV(7331); break; - case 934: RINV(7333); break; - case 935: RINV(7349); break; - case 936: RINV(7351); break; - case 937: RINV(7369); break; - case 938: RINV(7393); break; - case 939: RINV(7411); break; - case 940: RINV(7417); break; - case 941: RINV(7433); break; - case 942: RINV(7451); break; - case 943: RINV(7457); break; - case 944: RINV(7459); break; - case 945: RINV(7477); break; - case 946: RINV(7481); break; - case 947: RINV(7487); break; - case 948: RINV(7489); break; - case 949: RINV(7499); break; - case 950: RINV(7507); break; - case 951: RINV(7517); break; - case 952: RINV(7523); break; - case 953: RINV(7529); break; - case 954: RINV(7537); break; - case 955: RINV(7541); break; - case 956: RINV(7547); break; - case 957: RINV(7549); break; - case 958: RINV(7559); break; - case 959: RINV(7561); break; - case 960: RINV(7573); break; - case 961: RINV(7577); break; - case 962: RINV(7583); break; - case 963: RINV(7589); break; - case 964: RINV(7591); break; - case 965: RINV(7603); break; - case 966: RINV(7607); break; - case 967: RINV(7621); break; - case 968: RINV(7639); break; - case 969: RINV(7643); break; - case 970: RINV(7649); break; - case 971: RINV(7669); break; - case 972: RINV(7673); break; - case 973: RINV(7681); break; - case 974: RINV(7687); break; - case 975: RINV(7691); break; - case 976: RINV(7699); break; - case 977: RINV(7703); break; - case 978: RINV(7717); break; - case 979: RINV(7723); break; - case 980: RINV(7727); break; - case 981: RINV(7741); break; - case 982: RINV(7753); break; - case 983: RINV(7757); break; - case 984: RINV(7759); break; - case 985: RINV(7789); break; - case 986: RINV(7793); break; - case 987: RINV(7817); break; - case 988: RINV(7823); break; - case 989: RINV(7829); break; - case 990: RINV(7841); break; - case 991: RINV(7853); break; - case 992: RINV(7867); break; - case 993: RINV(7873); break; - case 994: RINV(7877); break; - case 995: RINV(7879); break; - case 996: RINV(7883); break; - case 997: RINV(7901); break; - case 998: RINV(7907); break; - case 999: RINV(7919); break; - case 1000: RINV(7927); break; - case 1001: RINV(7933); break; - case 1002: RINV(7937); break; - case 1003: RINV(7949); break; - case 1004: RINV(7951); break; - case 1005: RINV(7963); break; - case 1006: RINV(7993); break; - case 1007: RINV(8009); break; - case 1008: RINV(8011); break; - case 1009: RINV(8017); break; - case 1010: RINV(8039); break; - case 1011: RINV(8053); break; - case 1012: RINV(8059); break; - case 1013: RINV(8069); break; - case 1014: RINV(8081); break; - case 1015: RINV(8087); break; - case 1016: RINV(8089); break; - case 1017: RINV(8093); break; - case 1018: RINV(8101); break; - case 1019: RINV(8111); break; - case 1020: RINV(8117); break; - case 1021: RINV(8123); break; - case 1022: RINV(8147); break; - case 1023: RINV(8161); break; + case 0: RINV(2); break; + case 1: RINV(3); break; + case 2: RINV(5); break; + case 3: RINV(7); break; + case 4: RINV(11); break; + case 5: RINV(13); break; + case 6: RINV(17); break; + case 7: RINV(19); break; + case 8: RINV(23); break; + case 9: RINV(29); break; + case 10: RINV(31); break; + case 11: RINV(37); break; + case 12: RINV(41); break; + case 13: RINV(43); break; + case 14: RINV(47); break; + case 15: RINV(53); break; + case 16: RINV(59); break; + case 17: RINV(61); break; + case 18: RINV(67); break; + case 19: RINV(71); break; + case 20: RINV(73); break; + case 21: RINV(79); break; + case 22: RINV(83); break; + case 23: RINV(89); break; + case 24: RINV(97); break; + case 25: RINV(101); break; + case 26: RINV(103); break; + case 27: RINV(107); break; + case 28: RINV(109); break; + case 29: RINV(113); break; + case 30: RINV(127); break; + case 31: RINV(131); break; + case 32: RINV(137); break; + case 33: RINV(139); break; + case 34: RINV(149); break; + case 35: RINV(151); break; + case 36: RINV(157); break; + case 37: RINV(163); break; + case 38: RINV(167); break; + case 39: RINV(173); break; + case 40: RINV(179); break; + case 41: RINV(181); break; + case 42: RINV(191); break; + case 43: RINV(193); break; + case 44: RINV(197); break; + case 45: RINV(199); break; + case 46: RINV(211); break; + case 47: RINV(223); break; + case 48: RINV(227); break; + case 49: RINV(229); break; + case 50: RINV(233); break; + case 51: RINV(239); break; + case 52: RINV(241); break; + case 53: RINV(251); break; + case 54: RINV(257); break; + case 55: RINV(263); break; + case 56: RINV(269); break; + case 57: RINV(271); break; + case 58: RINV(277); break; + case 59: RINV(281); break; + case 60: RINV(283); break; + case 61: RINV(293); break; + case 62: RINV(307); break; + case 63: RINV(311); break; + case 64: RINV(313); break; + case 65: RINV(317); break; + case 66: RINV(331); break; + case 67: RINV(337); break; + case 68: RINV(347); break; + case 69: RINV(349); break; + case 70: RINV(353); break; + case 71: RINV(359); break; + case 72: RINV(367); break; + case 73: RINV(373); break; + case 74: RINV(379); break; + case 75: RINV(383); break; + case 76: RINV(389); break; + case 77: RINV(397); break; + case 78: RINV(401); break; + case 79: RINV(409); break; + case 80: RINV(419); break; + case 81: RINV(421); break; + case 82: RINV(431); break; + case 83: RINV(433); break; + case 84: RINV(439); break; + case 85: RINV(443); break; + case 86: RINV(449); break; + case 87: RINV(457); break; + case 88: RINV(461); break; + case 89: RINV(463); break; + case 90: RINV(467); break; + case 91: RINV(479); break; + case 92: RINV(487); break; + case 93: RINV(491); break; + case 94: RINV(499); break; + case 95: RINV(503); break; + case 96: RINV(509); break; + case 97: RINV(521); break; + case 98: RINV(523); break; + case 99: RINV(541); break; + case 100: RINV(547); break; + case 101: RINV(557); break; + case 102: RINV(563); break; + case 103: RINV(569); break; + case 104: RINV(571); break; + case 105: RINV(577); break; + case 106: RINV(587); break; + case 107: RINV(593); break; + case 108: RINV(599); break; + case 109: RINV(601); break; + case 110: RINV(607); break; + case 111: RINV(613); break; + case 112: RINV(617); break; + case 113: RINV(619); break; + case 114: RINV(631); break; + case 115: RINV(641); break; + case 116: RINV(643); break; + case 117: RINV(647); break; + case 118: RINV(653); break; + case 119: RINV(659); break; + case 120: RINV(661); break; + case 121: RINV(673); break; + case 122: RINV(677); break; + case 123: RINV(683); break; + case 124: RINV(691); break; + case 125: RINV(701); break; + case 126: RINV(709); break; + case 127: RINV(719); break; + case 128: RINV(727); break; + case 129: RINV(733); break; + case 130: RINV(739); break; + case 131: RINV(743); break; + case 132: RINV(751); break; + case 133: RINV(757); break; + case 134: RINV(761); break; + case 135: RINV(769); break; + case 136: RINV(773); break; + case 137: RINV(787); break; + case 138: RINV(797); break; + case 139: RINV(809); break; + case 140: RINV(811); break; + case 141: RINV(821); break; + case 142: RINV(823); break; + case 143: RINV(827); break; + case 144: RINV(829); break; + case 145: RINV(839); break; + case 146: RINV(853); break; + case 147: RINV(857); break; + case 148: RINV(859); break; + case 149: RINV(863); break; + case 150: RINV(877); break; + case 151: RINV(881); break; + case 152: RINV(883); break; + case 153: RINV(887); break; + case 154: RINV(907); break; + case 155: RINV(911); break; + case 156: RINV(919); break; + case 157: RINV(929); break; + case 158: RINV(937); break; + case 159: RINV(941); break; + case 160: RINV(947); break; + case 161: RINV(953); break; + case 162: RINV(967); break; + case 163: RINV(971); break; + case 164: RINV(977); break; + case 165: RINV(983); break; + case 166: RINV(991); break; + case 167: RINV(997); break; + case 168: RINV(1009); break; + case 169: RINV(1013); break; + case 170: RINV(1019); break; + case 171: RINV(1021); break; + case 172: RINV(1031); break; + case 173: RINV(1033); break; + case 174: RINV(1039); break; + case 175: RINV(1049); break; + case 176: RINV(1051); break; + case 177: RINV(1061); break; + case 178: RINV(1063); break; + case 179: RINV(1069); break; + case 180: RINV(1087); break; + case 181: RINV(1091); break; + case 182: RINV(1093); break; + case 183: RINV(1097); break; + case 184: RINV(1103); break; + case 185: RINV(1109); break; + case 186: RINV(1117); break; + case 187: RINV(1123); break; + case 188: RINV(1129); break; + case 189: RINV(1151); break; + case 190: RINV(1153); break; + case 191: RINV(1163); break; + case 192: RINV(1171); break; + case 193: RINV(1181); break; + case 194: RINV(1187); break; + case 195: RINV(1193); break; + case 196: RINV(1201); break; + case 197: RINV(1213); break; + case 198: RINV(1217); break; + case 199: RINV(1223); break; + case 200: RINV(1229); break; + case 201: RINV(1231); break; + case 202: RINV(1237); break; + case 203: RINV(1249); break; + case 204: RINV(1259); break; + case 205: RINV(1277); break; + case 206: RINV(1279); break; + case 207: RINV(1283); break; + case 208: RINV(1289); break; + case 209: RINV(1291); break; + case 210: RINV(1297); break; + case 211: RINV(1301); break; + case 212: RINV(1303); break; + case 213: RINV(1307); break; + case 214: RINV(1319); break; + case 215: RINV(1321); break; + case 216: RINV(1327); break; + case 217: RINV(1361); break; + case 218: RINV(1367); break; + case 219: RINV(1373); break; + case 220: RINV(1381); break; + case 221: RINV(1399); break; + case 222: RINV(1409); break; + case 223: RINV(1423); break; + case 224: RINV(1427); break; + case 225: RINV(1429); break; + case 226: RINV(1433); break; + case 227: RINV(1439); break; + case 228: RINV(1447); break; + case 229: RINV(1451); break; + case 230: RINV(1453); break; + case 231: RINV(1459); break; + case 232: RINV(1471); break; + case 233: RINV(1481); break; + case 234: RINV(1483); break; + case 235: RINV(1487); break; + case 236: RINV(1489); break; + case 237: RINV(1493); break; + case 238: RINV(1499); break; + case 239: RINV(1511); break; + case 240: RINV(1523); break; + case 241: RINV(1531); break; + case 242: RINV(1543); break; + case 243: RINV(1549); break; + case 244: RINV(1553); break; + case 245: RINV(1559); break; + case 246: RINV(1567); break; + case 247: RINV(1571); break; + case 248: RINV(1579); break; + case 249: RINV(1583); break; + case 250: RINV(1597); break; + case 251: RINV(1601); break; + case 252: RINV(1607); break; + case 253: RINV(1609); break; + case 254: RINV(1613); break; + case 255: RINV(1619); break; + case 256: RINV(1621); break; + case 257: RINV(1627); break; + case 258: RINV(1637); break; + case 259: RINV(1657); break; + case 260: RINV(1663); break; + case 261: RINV(1667); break; + case 262: RINV(1669); break; + case 263: RINV(1693); break; + case 264: RINV(1697); break; + case 265: RINV(1699); break; + case 266: RINV(1709); break; + case 267: RINV(1721); break; + case 268: RINV(1723); break; + case 269: RINV(1733); break; + case 270: RINV(1741); break; + case 271: RINV(1747); break; + case 272: RINV(1753); break; + case 273: RINV(1759); break; + case 274: RINV(1777); break; + case 275: RINV(1783); break; + case 276: RINV(1787); break; + case 277: RINV(1789); break; + case 278: RINV(1801); break; + case 279: RINV(1811); break; + case 280: RINV(1823); break; + case 281: RINV(1831); break; + case 282: RINV(1847); break; + case 283: RINV(1861); break; + case 284: RINV(1867); break; + case 285: RINV(1871); break; + case 286: RINV(1873); break; + case 287: RINV(1877); break; + case 288: RINV(1879); break; + case 289: RINV(1889); break; + case 290: RINV(1901); break; + case 291: RINV(1907); break; + case 292: RINV(1913); break; + case 293: RINV(1931); break; + case 294: RINV(1933); break; + case 295: RINV(1949); break; + case 296: RINV(1951); break; + case 297: RINV(1973); break; + case 298: RINV(1979); break; + case 299: RINV(1987); break; + case 300: RINV(1993); break; + case 301: RINV(1997); break; + case 302: RINV(1999); break; + case 303: RINV(2003); break; + case 304: RINV(2011); break; + case 305: RINV(2017); break; + case 306: RINV(2027); break; + case 307: RINV(2029); break; + case 308: RINV(2039); break; + case 309: RINV(2053); break; + case 310: RINV(2063); break; + case 311: RINV(2069); break; + case 312: RINV(2081); break; + case 313: RINV(2083); break; + case 314: RINV(2087); break; + case 315: RINV(2089); break; + case 316: RINV(2099); break; + case 317: RINV(2111); break; + case 318: RINV(2113); break; + case 319: RINV(2129); break; + case 320: RINV(2131); break; + case 321: RINV(2137); break; + case 322: RINV(2141); break; + case 323: RINV(2143); break; + case 324: RINV(2153); break; + case 325: RINV(2161); break; + case 326: RINV(2179); break; + case 327: RINV(2203); break; + case 328: RINV(2207); break; + case 329: RINV(2213); break; + case 330: RINV(2221); break; + case 331: RINV(2237); break; + case 332: RINV(2239); break; + case 333: RINV(2243); break; + case 334: RINV(2251); break; + case 335: RINV(2267); break; + case 336: RINV(2269); break; + case 337: RINV(2273); break; + case 338: RINV(2281); break; + case 339: RINV(2287); break; + case 340: RINV(2293); break; + case 341: RINV(2297); break; + case 342: RINV(2309); break; + case 343: RINV(2311); break; + case 344: RINV(2333); break; + case 345: RINV(2339); break; + case 346: RINV(2341); break; + case 347: RINV(2347); break; + case 348: RINV(2351); break; + case 349: RINV(2357); break; + case 350: RINV(2371); break; + case 351: RINV(2377); break; + case 352: RINV(2381); break; + case 353: RINV(2383); break; + case 354: RINV(2389); break; + case 355: RINV(2393); break; + case 356: RINV(2399); break; + case 357: RINV(2411); break; + case 358: RINV(2417); break; + case 359: RINV(2423); break; + case 360: RINV(2437); break; + case 361: RINV(2441); break; + case 362: RINV(2447); break; + case 363: RINV(2459); break; + case 364: RINV(2467); break; + case 365: RINV(2473); break; + case 366: RINV(2477); break; + case 367: RINV(2503); break; + case 368: RINV(2521); break; + case 369: RINV(2531); break; + case 370: RINV(2539); break; + case 371: RINV(2543); break; + case 372: RINV(2549); break; + case 373: RINV(2551); break; + case 374: RINV(2557); break; + case 375: RINV(2579); break; + case 376: RINV(2591); break; + case 377: RINV(2593); break; + case 378: RINV(2609); break; + case 379: RINV(2617); break; + case 380: RINV(2621); break; + case 381: RINV(2633); break; + case 382: RINV(2647); break; + case 383: RINV(2657); break; + case 384: RINV(2659); break; + case 385: RINV(2663); break; + case 386: RINV(2671); break; + case 387: RINV(2677); break; + case 388: RINV(2683); break; + case 389: RINV(2687); break; + case 390: RINV(2689); break; + case 391: RINV(2693); break; + case 392: RINV(2699); break; + case 393: RINV(2707); break; + case 394: RINV(2711); break; + case 395: RINV(2713); break; + case 396: RINV(2719); break; + case 397: RINV(2729); break; + case 398: RINV(2731); break; + case 399: RINV(2741); break; + case 400: RINV(2749); break; + case 401: RINV(2753); break; + case 402: RINV(2767); break; + case 403: RINV(2777); break; + case 404: RINV(2789); break; + case 405: RINV(2791); break; + case 406: RINV(2797); break; + case 407: RINV(2801); break; + case 408: RINV(2803); break; + case 409: RINV(2819); break; + case 410: RINV(2833); break; + case 411: RINV(2837); break; + case 412: RINV(2843); break; + case 413: RINV(2851); break; + case 414: RINV(2857); break; + case 415: RINV(2861); break; + case 416: RINV(2879); break; + case 417: RINV(2887); break; + case 418: RINV(2897); break; + case 419: RINV(2903); break; + case 420: RINV(2909); break; + case 421: RINV(2917); break; + case 422: RINV(2927); break; + case 423: RINV(2939); break; + case 424: RINV(2953); break; + case 425: RINV(2957); break; + case 426: RINV(2963); break; + case 427: RINV(2969); break; + case 428: RINV(2971); break; + case 429: RINV(2999); break; + case 430: RINV(3001); break; + case 431: RINV(3011); break; + case 432: RINV(3019); break; + case 433: RINV(3023); break; + case 434: RINV(3037); break; + case 435: RINV(3041); break; + case 436: RINV(3049); break; + case 437: RINV(3061); break; + case 438: RINV(3067); break; + case 439: RINV(3079); break; + case 440: RINV(3083); break; + case 441: RINV(3089); break; + case 442: RINV(3109); break; + case 443: RINV(3119); break; + case 444: RINV(3121); break; + case 445: RINV(3137); break; + case 446: RINV(3163); break; + case 447: RINV(3167); break; + case 448: RINV(3169); break; + case 449: RINV(3181); break; + case 450: RINV(3187); break; + case 451: RINV(3191); break; + case 452: RINV(3203); break; + case 453: RINV(3209); break; + case 454: RINV(3217); break; + case 455: RINV(3221); break; + case 456: RINV(3229); break; + case 457: RINV(3251); break; + case 458: RINV(3253); break; + case 459: RINV(3257); break; + case 460: RINV(3259); break; + case 461: RINV(3271); break; + case 462: RINV(3299); break; + case 463: RINV(3301); break; + case 464: RINV(3307); break; + case 465: RINV(3313); break; + case 466: RINV(3319); break; + case 467: RINV(3323); break; + case 468: RINV(3329); break; + case 469: RINV(3331); break; + case 470: RINV(3343); break; + case 471: RINV(3347); break; + case 472: RINV(3359); break; + case 473: RINV(3361); break; + case 474: RINV(3371); break; + case 475: RINV(3373); break; + case 476: RINV(3389); break; + case 477: RINV(3391); break; + case 478: RINV(3407); break; + case 479: RINV(3413); break; + case 480: RINV(3433); break; + case 481: RINV(3449); break; + case 482: RINV(3457); break; + case 483: RINV(3461); break; + case 484: RINV(3463); break; + case 485: RINV(3467); break; + case 486: RINV(3469); break; + case 487: RINV(3491); break; + case 488: RINV(3499); break; + case 489: RINV(3511); break; + case 490: RINV(3517); break; + case 491: RINV(3527); break; + case 492: RINV(3529); break; + case 493: RINV(3533); break; + case 494: RINV(3539); break; + case 495: RINV(3541); break; + case 496: RINV(3547); break; + case 497: RINV(3557); break; + case 498: RINV(3559); break; + case 499: RINV(3571); break; + case 500: RINV(3581); break; + case 501: RINV(3583); break; + case 502: RINV(3593); break; + case 503: RINV(3607); break; + case 504: RINV(3613); break; + case 505: RINV(3617); break; + case 506: RINV(3623); break; + case 507: RINV(3631); break; + case 508: RINV(3637); break; + case 509: RINV(3643); break; + case 510: RINV(3659); break; + case 511: RINV(3671); break; + case 512: RINV(3673); break; + case 513: RINV(3677); break; + case 514: RINV(3691); break; + case 515: RINV(3697); break; + case 516: RINV(3701); break; + case 517: RINV(3709); break; + case 518: RINV(3719); break; + case 519: RINV(3727); break; + case 520: RINV(3733); break; + case 521: RINV(3739); break; + case 522: RINV(3761); break; + case 523: RINV(3767); break; + case 524: RINV(3769); break; + case 525: RINV(3779); break; + case 526: RINV(3793); break; + case 527: RINV(3797); break; + case 528: RINV(3803); break; + case 529: RINV(3821); break; + case 530: RINV(3823); break; + case 531: RINV(3833); break; + case 532: RINV(3847); break; + case 533: RINV(3851); break; + case 534: RINV(3853); break; + case 535: RINV(3863); break; + case 536: RINV(3877); break; + case 537: RINV(3881); break; + case 538: RINV(3889); break; + case 539: RINV(3907); break; + case 540: RINV(3911); break; + case 541: RINV(3917); break; + case 542: RINV(3919); break; + case 543: RINV(3923); break; + case 544: RINV(3929); break; + case 545: RINV(3931); break; + case 546: RINV(3943); break; + case 547: RINV(3947); break; + case 548: RINV(3967); break; + case 549: RINV(3989); break; + case 550: RINV(4001); break; + case 551: RINV(4003); break; + case 552: RINV(4007); break; + case 553: RINV(4013); break; + case 554: RINV(4019); break; + case 555: RINV(4021); break; + case 556: RINV(4027); break; + case 557: RINV(4049); break; + case 558: RINV(4051); break; + case 559: RINV(4057); break; + case 560: RINV(4073); break; + case 561: RINV(4079); break; + case 562: RINV(4091); break; + case 563: RINV(4093); break; + case 564: RINV(4099); break; + case 565: RINV(4111); break; + case 566: RINV(4127); break; + case 567: RINV(4129); break; + case 568: RINV(4133); break; + case 569: RINV(4139); break; + case 570: RINV(4153); break; + case 571: RINV(4157); break; + case 572: RINV(4159); break; + case 573: RINV(4177); break; + case 574: RINV(4201); break; + case 575: RINV(4211); break; + case 576: RINV(4217); break; + case 577: RINV(4219); break; + case 578: RINV(4229); break; + case 579: RINV(4231); break; + case 580: RINV(4241); break; + case 581: RINV(4243); break; + case 582: RINV(4253); break; + case 583: RINV(4259); break; + case 584: RINV(4261); break; + case 585: RINV(4271); break; + case 586: RINV(4273); break; + case 587: RINV(4283); break; + case 588: RINV(4289); break; + case 589: RINV(4297); break; + case 590: RINV(4327); break; + case 591: RINV(4337); break; + case 592: RINV(4339); break; + case 593: RINV(4349); break; + case 594: RINV(4357); break; + case 595: RINV(4363); break; + case 596: RINV(4373); break; + case 597: RINV(4391); break; + case 598: RINV(4397); break; + case 599: RINV(4409); break; + case 600: RINV(4421); break; + case 601: RINV(4423); break; + case 602: RINV(4441); break; + case 603: RINV(4447); break; + case 604: RINV(4451); break; + case 605: RINV(4457); break; + case 606: RINV(4463); break; + case 607: RINV(4481); break; + case 608: RINV(4483); break; + case 609: RINV(4493); break; + case 610: RINV(4507); break; + case 611: RINV(4513); break; + case 612: RINV(4517); break; + case 613: RINV(4519); break; + case 614: RINV(4523); break; + case 615: RINV(4547); break; + case 616: RINV(4549); break; + case 617: RINV(4561); break; + case 618: RINV(4567); break; + case 619: RINV(4583); break; + case 620: RINV(4591); break; + case 621: RINV(4597); break; + case 622: RINV(4603); break; + case 623: RINV(4621); break; + case 624: RINV(4637); break; + case 625: RINV(4639); break; + case 626: RINV(4643); break; + case 627: RINV(4649); break; + case 628: RINV(4651); break; + case 629: RINV(4657); break; + case 630: RINV(4663); break; + case 631: RINV(4673); break; + case 632: RINV(4679); break; + case 633: RINV(4691); break; + case 634: RINV(4703); break; + case 635: RINV(4721); break; + case 636: RINV(4723); break; + case 637: RINV(4729); break; + case 638: RINV(4733); break; + case 639: RINV(4751); break; + case 640: RINV(4759); break; + case 641: RINV(4783); break; + case 642: RINV(4787); break; + case 643: RINV(4789); break; + case 644: RINV(4793); break; + case 645: RINV(4799); break; + case 646: RINV(4801); break; + case 647: RINV(4813); break; + case 648: RINV(4817); break; + case 649: RINV(4831); break; + case 650: RINV(4861); break; + case 651: RINV(4871); break; + case 652: RINV(4877); break; + case 653: RINV(4889); break; + case 654: RINV(4903); break; + case 655: RINV(4909); break; + case 656: RINV(4919); break; + case 657: RINV(4931); break; + case 658: RINV(4933); break; + case 659: RINV(4937); break; + case 660: RINV(4943); break; + case 661: RINV(4951); break; + case 662: RINV(4957); break; + case 663: RINV(4967); break; + case 664: RINV(4969); break; + case 665: RINV(4973); break; + case 666: RINV(4987); break; + case 667: RINV(4993); break; + case 668: RINV(4999); break; + case 669: RINV(5003); break; + case 670: RINV(5009); break; + case 671: RINV(5011); break; + case 672: RINV(5021); break; + case 673: RINV(5023); break; + case 674: RINV(5039); break; + case 675: RINV(5051); break; + case 676: RINV(5059); break; + case 677: RINV(5077); break; + case 678: RINV(5081); break; + case 679: RINV(5087); break; + case 680: RINV(5099); break; + case 681: RINV(5101); break; + case 682: RINV(5107); break; + case 683: RINV(5113); break; + case 684: RINV(5119); break; + case 685: RINV(5147); break; + case 686: RINV(5153); break; + case 687: RINV(5167); break; + case 688: RINV(5171); break; + case 689: RINV(5179); break; + case 690: RINV(5189); break; + case 691: RINV(5197); break; + case 692: RINV(5209); break; + case 693: RINV(5227); break; + case 694: RINV(5231); break; + case 695: RINV(5233); break; + case 696: RINV(5237); break; + case 697: RINV(5261); break; + case 698: RINV(5273); break; + case 699: RINV(5279); break; + case 700: RINV(5281); break; + case 701: RINV(5297); break; + case 702: RINV(5303); break; + case 703: RINV(5309); break; + case 704: RINV(5323); break; + case 705: RINV(5333); break; + case 706: RINV(5347); break; + case 707: RINV(5351); break; + case 708: RINV(5381); break; + case 709: RINV(5387); break; + case 710: RINV(5393); break; + case 711: RINV(5399); break; + case 712: RINV(5407); break; + case 713: RINV(5413); break; + case 714: RINV(5417); break; + case 715: RINV(5419); break; + case 716: RINV(5431); break; + case 717: RINV(5437); break; + case 718: RINV(5441); break; + case 719: RINV(5443); break; + case 720: RINV(5449); break; + case 721: RINV(5471); break; + case 722: RINV(5477); break; + case 723: RINV(5479); break; + case 724: RINV(5483); break; + case 725: RINV(5501); break; + case 726: RINV(5503); break; + case 727: RINV(5507); break; + case 728: RINV(5519); break; + case 729: RINV(5521); break; + case 730: RINV(5527); break; + case 731: RINV(5531); break; + case 732: RINV(5557); break; + case 733: RINV(5563); break; + case 734: RINV(5569); break; + case 735: RINV(5573); break; + case 736: RINV(5581); break; + case 737: RINV(5591); break; + case 738: RINV(5623); break; + case 739: RINV(5639); break; + case 740: RINV(5641); break; + case 741: RINV(5647); break; + case 742: RINV(5651); break; + case 743: RINV(5653); break; + case 744: RINV(5657); break; + case 745: RINV(5659); break; + case 746: RINV(5669); break; + case 747: RINV(5683); break; + case 748: RINV(5689); break; + case 749: RINV(5693); break; + case 750: RINV(5701); break; + case 751: RINV(5711); break; + case 752: RINV(5717); break; + case 753: RINV(5737); break; + case 754: RINV(5741); break; + case 755: RINV(5743); break; + case 756: RINV(5749); break; + case 757: RINV(5779); break; + case 758: RINV(5783); break; + case 759: RINV(5791); break; + case 760: RINV(5801); break; + case 761: RINV(5807); break; + case 762: RINV(5813); break; + case 763: RINV(5821); break; + case 764: RINV(5827); break; + case 765: RINV(5839); break; + case 766: RINV(5843); break; + case 767: RINV(5849); break; + case 768: RINV(5851); break; + case 769: RINV(5857); break; + case 770: RINV(5861); break; + case 771: RINV(5867); break; + case 772: RINV(5869); break; + case 773: RINV(5879); break; + case 774: RINV(5881); break; + case 775: RINV(5897); break; + case 776: RINV(5903); break; + case 777: RINV(5923); break; + case 778: RINV(5927); break; + case 779: RINV(5939); break; + case 780: RINV(5953); break; + case 781: RINV(5981); break; + case 782: RINV(5987); break; + case 783: RINV(6007); break; + case 784: RINV(6011); break; + case 785: RINV(6029); break; + case 786: RINV(6037); break; + case 787: RINV(6043); break; + case 788: RINV(6047); break; + case 789: RINV(6053); break; + case 790: RINV(6067); break; + case 791: RINV(6073); break; + case 792: RINV(6079); break; + case 793: RINV(6089); break; + case 794: RINV(6091); break; + case 795: RINV(6101); break; + case 796: RINV(6113); break; + case 797: RINV(6121); break; + case 798: RINV(6131); break; + case 799: RINV(6133); break; + case 800: RINV(6143); break; + case 801: RINV(6151); break; + case 802: RINV(6163); break; + case 803: RINV(6173); break; + case 804: RINV(6197); break; + case 805: RINV(6199); break; + case 806: RINV(6203); break; + case 807: RINV(6211); break; + case 808: RINV(6217); break; + case 809: RINV(6221); break; + case 810: RINV(6229); break; + case 811: RINV(6247); break; + case 812: RINV(6257); break; + case 813: RINV(6263); break; + case 814: RINV(6269); break; + case 815: RINV(6271); break; + case 816: RINV(6277); break; + case 817: RINV(6287); break; + case 818: RINV(6299); break; + case 819: RINV(6301); break; + case 820: RINV(6311); break; + case 821: RINV(6317); break; + case 822: RINV(6323); break; + case 823: RINV(6329); break; + case 824: RINV(6337); break; + case 825: RINV(6343); break; + case 826: RINV(6353); break; + case 827: RINV(6359); break; + case 828: RINV(6361); break; + case 829: RINV(6367); break; + case 830: RINV(6373); break; + case 831: RINV(6379); break; + case 832: RINV(6389); break; + case 833: RINV(6397); break; + case 834: RINV(6421); break; + case 835: RINV(6427); break; + case 836: RINV(6449); break; + case 837: RINV(6451); break; + case 838: RINV(6469); break; + case 839: RINV(6473); break; + case 840: RINV(6481); break; + case 841: RINV(6491); break; + case 842: RINV(6521); break; + case 843: RINV(6529); break; + case 844: RINV(6547); break; + case 845: RINV(6551); break; + case 846: RINV(6553); break; + case 847: RINV(6563); break; + case 848: RINV(6569); break; + case 849: RINV(6571); break; + case 850: RINV(6577); break; + case 851: RINV(6581); break; + case 852: RINV(6599); break; + case 853: RINV(6607); break; + case 854: RINV(6619); break; + case 855: RINV(6637); break; + case 856: RINV(6653); break; + case 857: RINV(6659); break; + case 858: RINV(6661); break; + case 859: RINV(6673); break; + case 860: RINV(6679); break; + case 861: RINV(6689); break; + case 862: RINV(6691); break; + case 863: RINV(6701); break; + case 864: RINV(6703); break; + case 865: RINV(6709); break; + case 866: RINV(6719); break; + case 867: RINV(6733); break; + case 868: RINV(6737); break; + case 869: RINV(6761); break; + case 870: RINV(6763); break; + case 871: RINV(6779); break; + case 872: RINV(6781); break; + case 873: RINV(6791); break; + case 874: RINV(6793); break; + case 875: RINV(6803); break; + case 876: RINV(6823); break; + case 877: RINV(6827); break; + case 878: RINV(6829); break; + case 879: RINV(6833); break; + case 880: RINV(6841); break; + case 881: RINV(6857); break; + case 882: RINV(6863); break; + case 883: RINV(6869); break; + case 884: RINV(6871); break; + case 885: RINV(6883); break; + case 886: RINV(6899); break; + case 887: RINV(6907); break; + case 888: RINV(6911); break; + case 889: RINV(6917); break; + case 890: RINV(6947); break; + case 891: RINV(6949); break; + case 892: RINV(6959); break; + case 893: RINV(6961); break; + case 894: RINV(6967); break; + case 895: RINV(6971); break; + case 896: RINV(6977); break; + case 897: RINV(6983); break; + case 898: RINV(6991); break; + case 899: RINV(6997); break; + case 900: RINV(7001); break; + case 901: RINV(7013); break; + case 902: RINV(7019); break; + case 903: RINV(7027); break; + case 904: RINV(7039); break; + case 905: RINV(7043); break; + case 906: RINV(7057); break; + case 907: RINV(7069); break; + case 908: RINV(7079); break; + case 909: RINV(7103); break; + case 910: RINV(7109); break; + case 911: RINV(7121); break; + case 912: RINV(7127); break; + case 913: RINV(7129); break; + case 914: RINV(7151); break; + case 915: RINV(7159); break; + case 916: RINV(7177); break; + case 917: RINV(7187); break; + case 918: RINV(7193); break; + case 919: RINV(7207); break; + case 920: RINV(7211); break; + case 921: RINV(7213); break; + case 922: RINV(7219); break; + case 923: RINV(7229); break; + case 924: RINV(7237); break; + case 925: RINV(7243); break; + case 926: RINV(7247); break; + case 927: RINV(7253); break; + case 928: RINV(7283); break; + case 929: RINV(7297); break; + case 930: RINV(7307); break; + case 931: RINV(7309); break; + case 932: RINV(7321); break; + case 933: RINV(7331); break; + case 934: RINV(7333); break; + case 935: RINV(7349); break; + case 936: RINV(7351); break; + case 937: RINV(7369); break; + case 938: RINV(7393); break; + case 939: RINV(7411); break; + case 940: RINV(7417); break; + case 941: RINV(7433); break; + case 942: RINV(7451); break; + case 943: RINV(7457); break; + case 944: RINV(7459); break; + case 945: RINV(7477); break; + case 946: RINV(7481); break; + case 947: RINV(7487); break; + case 948: RINV(7489); break; + case 949: RINV(7499); break; + case 950: RINV(7507); break; + case 951: RINV(7517); break; + case 952: RINV(7523); break; + case 953: RINV(7529); break; + case 954: RINV(7537); break; + case 955: RINV(7541); break; + case 956: RINV(7547); break; + case 957: RINV(7549); break; + case 958: RINV(7559); break; + case 959: RINV(7561); break; + case 960: RINV(7573); break; + case 961: RINV(7577); break; + case 962: RINV(7583); break; + case 963: RINV(7589); break; + case 964: RINV(7591); break; + case 965: RINV(7603); break; + case 966: RINV(7607); break; + case 967: RINV(7621); break; + case 968: RINV(7639); break; + case 969: RINV(7643); break; + case 970: RINV(7649); break; + case 971: RINV(7669); break; + case 972: RINV(7673); break; + case 973: RINV(7681); break; + case 974: RINV(7687); break; + case 975: RINV(7691); break; + case 976: RINV(7699); break; + case 977: RINV(7703); break; + case 978: RINV(7717); break; + case 979: RINV(7723); break; + case 980: RINV(7727); break; + case 981: RINV(7741); break; + case 982: RINV(7753); break; + case 983: RINV(7757); break; + case 984: RINV(7759); break; + case 985: RINV(7789); break; + case 986: RINV(7793); break; + case 987: RINV(7817); break; + case 988: RINV(7823); break; + case 989: RINV(7829); break; + case 990: RINV(7841); break; + case 991: RINV(7853); break; + case 992: RINV(7867); break; + case 993: RINV(7873); break; + case 994: RINV(7877); break; + case 995: RINV(7879); break; + case 996: RINV(7883); break; + case 997: RINV(7901); break; + case 998: RINV(7907); break; + case 999: RINV(7919); break; + case 1000: RINV(7927); break; + case 1001: RINV(7933); break; + case 1002: RINV(7937); break; + case 1003: RINV(7949); break; + case 1004: RINV(7951); break; + case 1005: RINV(7963); break; + case 1006: RINV(7993); break; + case 1007: RINV(8009); break; + case 1008: RINV(8011); break; + case 1009: RINV(8017); break; + case 1010: RINV(8039); break; + case 1011: RINV(8053); break; + case 1012: RINV(8059); break; + case 1013: RINV(8069); break; + case 1014: RINV(8081); break; + case 1015: RINV(8087); break; + case 1016: RINV(8089); break; + case 1017: RINV(8093); break; + case 1018: RINV(8101); break; + case 1019: RINV(8111); break; + case 1020: RINV(8117); break; + case 1021: RINV(8123); break; + case 1022: RINV(8147); break; + case 1023: RINV(8161); break; } return std::min(inverse, ONE_MINUS_EPS); } @@ -1231,1030 +1231,1030 @@ Float scrambledRadicalInverseFast(uint16_t baseIndex, uint64_t index, uint16_t * Float inverse = 0.0f; switch (baseIndex) { - case 0: SCRAMBLED_RINV(2); break; - case 1: SCRAMBLED_RINV(3); break; - case 2: SCRAMBLED_RINV(5); break; - case 3: SCRAMBLED_RINV(7); break; - case 4: SCRAMBLED_RINV(11); break; - case 5: SCRAMBLED_RINV(13); break; - case 6: SCRAMBLED_RINV(17); break; - case 7: SCRAMBLED_RINV(19); break; - case 8: SCRAMBLED_RINV(23); break; - case 9: SCRAMBLED_RINV(29); break; - case 10: SCRAMBLED_RINV(31); break; - case 11: SCRAMBLED_RINV(37); break; - case 12: SCRAMBLED_RINV(41); break; - case 13: SCRAMBLED_RINV(43); break; - case 14: SCRAMBLED_RINV(47); break; - case 15: SCRAMBLED_RINV(53); break; - case 16: SCRAMBLED_RINV(59); break; - case 17: SCRAMBLED_RINV(61); break; - case 18: SCRAMBLED_RINV(67); break; - case 19: SCRAMBLED_RINV(71); break; - case 20: SCRAMBLED_RINV(73); break; - case 21: SCRAMBLED_RINV(79); break; - case 22: SCRAMBLED_RINV(83); break; - case 23: SCRAMBLED_RINV(89); break; - case 24: SCRAMBLED_RINV(97); break; - case 25: SCRAMBLED_RINV(101); break; - case 26: SCRAMBLED_RINV(103); break; - case 27: SCRAMBLED_RINV(107); break; - case 28: SCRAMBLED_RINV(109); break; - case 29: SCRAMBLED_RINV(113); break; - case 30: SCRAMBLED_RINV(127); break; - case 31: SCRAMBLED_RINV(131); break; - case 32: SCRAMBLED_RINV(137); break; - case 33: SCRAMBLED_RINV(139); break; - case 34: SCRAMBLED_RINV(149); break; - case 35: SCRAMBLED_RINV(151); break; - case 36: SCRAMBLED_RINV(157); break; - case 37: SCRAMBLED_RINV(163); break; - case 38: SCRAMBLED_RINV(167); break; - case 39: SCRAMBLED_RINV(173); break; - case 40: SCRAMBLED_RINV(179); break; - case 41: SCRAMBLED_RINV(181); break; - case 42: SCRAMBLED_RINV(191); break; - case 43: SCRAMBLED_RINV(193); break; - case 44: SCRAMBLED_RINV(197); break; - case 45: SCRAMBLED_RINV(199); break; - case 46: SCRAMBLED_RINV(211); break; - case 47: SCRAMBLED_RINV(223); break; - case 48: SCRAMBLED_RINV(227); break; - case 49: SCRAMBLED_RINV(229); break; - case 50: SCRAMBLED_RINV(233); break; - case 51: SCRAMBLED_RINV(239); break; - case 52: SCRAMBLED_RINV(241); break; - case 53: SCRAMBLED_RINV(251); break; - case 54: SCRAMBLED_RINV(257); break; - case 55: SCRAMBLED_RINV(263); break; - case 56: SCRAMBLED_RINV(269); break; - case 57: SCRAMBLED_RINV(271); break; - case 58: SCRAMBLED_RINV(277); break; - case 59: SCRAMBLED_RINV(281); break; - case 60: SCRAMBLED_RINV(283); break; - case 61: SCRAMBLED_RINV(293); break; - case 62: SCRAMBLED_RINV(307); break; - case 63: SCRAMBLED_RINV(311); break; - case 64: SCRAMBLED_RINV(313); break; - case 65: SCRAMBLED_RINV(317); break; - case 66: SCRAMBLED_RINV(331); break; - case 67: SCRAMBLED_RINV(337); break; - case 68: SCRAMBLED_RINV(347); break; - case 69: SCRAMBLED_RINV(349); break; - case 70: SCRAMBLED_RINV(353); break; - case 71: SCRAMBLED_RINV(359); break; - case 72: SCRAMBLED_RINV(367); break; - case 73: SCRAMBLED_RINV(373); break; - case 74: SCRAMBLED_RINV(379); break; - case 75: SCRAMBLED_RINV(383); break; - case 76: SCRAMBLED_RINV(389); break; - case 77: SCRAMBLED_RINV(397); break; - case 78: SCRAMBLED_RINV(401); break; - case 79: SCRAMBLED_RINV(409); break; - case 80: SCRAMBLED_RINV(419); break; - case 81: SCRAMBLED_RINV(421); break; - case 82: SCRAMBLED_RINV(431); break; - case 83: SCRAMBLED_RINV(433); break; - case 84: SCRAMBLED_RINV(439); break; - case 85: SCRAMBLED_RINV(443); break; - case 86: SCRAMBLED_RINV(449); break; - case 87: SCRAMBLED_RINV(457); break; - case 88: SCRAMBLED_RINV(461); break; - case 89: SCRAMBLED_RINV(463); break; - case 90: SCRAMBLED_RINV(467); break; - case 91: SCRAMBLED_RINV(479); break; - case 92: SCRAMBLED_RINV(487); break; - case 93: SCRAMBLED_RINV(491); break; - case 94: SCRAMBLED_RINV(499); break; - case 95: SCRAMBLED_RINV(503); break; - case 96: SCRAMBLED_RINV(509); break; - case 97: SCRAMBLED_RINV(521); break; - case 98: SCRAMBLED_RINV(523); break; - case 99: SCRAMBLED_RINV(541); break; - case 100: SCRAMBLED_RINV(547); break; - case 101: SCRAMBLED_RINV(557); break; - case 102: SCRAMBLED_RINV(563); break; - case 103: SCRAMBLED_RINV(569); break; - case 104: SCRAMBLED_RINV(571); break; - case 105: SCRAMBLED_RINV(577); break; - case 106: SCRAMBLED_RINV(587); break; - case 107: SCRAMBLED_RINV(593); break; - case 108: SCRAMBLED_RINV(599); break; - case 109: SCRAMBLED_RINV(601); break; - case 110: SCRAMBLED_RINV(607); break; - case 111: SCRAMBLED_RINV(613); break; - case 112: SCRAMBLED_RINV(617); break; - case 113: SCRAMBLED_RINV(619); break; - case 114: SCRAMBLED_RINV(631); break; - case 115: SCRAMBLED_RINV(641); break; - case 116: SCRAMBLED_RINV(643); break; - case 117: SCRAMBLED_RINV(647); break; - case 118: SCRAMBLED_RINV(653); break; - case 119: SCRAMBLED_RINV(659); break; - case 120: SCRAMBLED_RINV(661); break; - case 121: SCRAMBLED_RINV(673); break; - case 122: SCRAMBLED_RINV(677); break; - case 123: SCRAMBLED_RINV(683); break; - case 124: SCRAMBLED_RINV(691); break; - case 125: SCRAMBLED_RINV(701); break; - case 126: SCRAMBLED_RINV(709); break; - case 127: SCRAMBLED_RINV(719); break; - case 128: SCRAMBLED_RINV(727); break; - case 129: SCRAMBLED_RINV(733); break; - case 130: SCRAMBLED_RINV(739); break; - case 131: SCRAMBLED_RINV(743); break; - case 132: SCRAMBLED_RINV(751); break; - case 133: SCRAMBLED_RINV(757); break; - case 134: SCRAMBLED_RINV(761); break; - case 135: SCRAMBLED_RINV(769); break; - case 136: SCRAMBLED_RINV(773); break; - case 137: SCRAMBLED_RINV(787); break; - case 138: SCRAMBLED_RINV(797); break; - case 139: SCRAMBLED_RINV(809); break; - case 140: SCRAMBLED_RINV(811); break; - case 141: SCRAMBLED_RINV(821); break; - case 142: SCRAMBLED_RINV(823); break; - case 143: SCRAMBLED_RINV(827); break; - case 144: SCRAMBLED_RINV(829); break; - case 145: SCRAMBLED_RINV(839); break; - case 146: SCRAMBLED_RINV(853); break; - case 147: SCRAMBLED_RINV(857); break; - case 148: SCRAMBLED_RINV(859); break; - case 149: SCRAMBLED_RINV(863); break; - case 150: SCRAMBLED_RINV(877); break; - case 151: SCRAMBLED_RINV(881); break; - case 152: SCRAMBLED_RINV(883); break; - case 153: SCRAMBLED_RINV(887); break; - case 154: SCRAMBLED_RINV(907); break; - case 155: SCRAMBLED_RINV(911); break; - case 156: SCRAMBLED_RINV(919); break; - case 157: SCRAMBLED_RINV(929); break; - case 158: SCRAMBLED_RINV(937); break; - case 159: SCRAMBLED_RINV(941); break; - case 160: SCRAMBLED_RINV(947); break; - case 161: SCRAMBLED_RINV(953); break; - case 162: SCRAMBLED_RINV(967); break; - case 163: SCRAMBLED_RINV(971); break; - case 164: SCRAMBLED_RINV(977); break; - case 165: SCRAMBLED_RINV(983); break; - case 166: SCRAMBLED_RINV(991); break; - case 167: SCRAMBLED_RINV(997); break; - case 168: SCRAMBLED_RINV(1009); break; - case 169: SCRAMBLED_RINV(1013); break; - case 170: SCRAMBLED_RINV(1019); break; - case 171: SCRAMBLED_RINV(1021); break; - case 172: SCRAMBLED_RINV(1031); break; - case 173: SCRAMBLED_RINV(1033); break; - case 174: SCRAMBLED_RINV(1039); break; - case 175: SCRAMBLED_RINV(1049); break; - case 176: SCRAMBLED_RINV(1051); break; - case 177: SCRAMBLED_RINV(1061); break; - case 178: SCRAMBLED_RINV(1063); break; - case 179: SCRAMBLED_RINV(1069); break; - case 180: SCRAMBLED_RINV(1087); break; - case 181: SCRAMBLED_RINV(1091); break; - case 182: SCRAMBLED_RINV(1093); break; - case 183: SCRAMBLED_RINV(1097); break; - case 184: SCRAMBLED_RINV(1103); break; - case 185: SCRAMBLED_RINV(1109); break; - case 186: SCRAMBLED_RINV(1117); break; - case 187: SCRAMBLED_RINV(1123); break; - case 188: SCRAMBLED_RINV(1129); break; - case 189: SCRAMBLED_RINV(1151); break; - case 190: SCRAMBLED_RINV(1153); break; - case 191: SCRAMBLED_RINV(1163); break; - case 192: SCRAMBLED_RINV(1171); break; - case 193: SCRAMBLED_RINV(1181); break; - case 194: SCRAMBLED_RINV(1187); break; - case 195: SCRAMBLED_RINV(1193); break; - case 196: SCRAMBLED_RINV(1201); break; - case 197: SCRAMBLED_RINV(1213); break; - case 198: SCRAMBLED_RINV(1217); break; - case 199: SCRAMBLED_RINV(1223); break; - case 200: SCRAMBLED_RINV(1229); break; - case 201: SCRAMBLED_RINV(1231); break; - case 202: SCRAMBLED_RINV(1237); break; - case 203: SCRAMBLED_RINV(1249); break; - case 204: SCRAMBLED_RINV(1259); break; - case 205: SCRAMBLED_RINV(1277); break; - case 206: SCRAMBLED_RINV(1279); break; - case 207: SCRAMBLED_RINV(1283); break; - case 208: SCRAMBLED_RINV(1289); break; - case 209: SCRAMBLED_RINV(1291); break; - case 210: SCRAMBLED_RINV(1297); break; - case 211: SCRAMBLED_RINV(1301); break; - case 212: SCRAMBLED_RINV(1303); break; - case 213: SCRAMBLED_RINV(1307); break; - case 214: SCRAMBLED_RINV(1319); break; - case 215: SCRAMBLED_RINV(1321); break; - case 216: SCRAMBLED_RINV(1327); break; - case 217: SCRAMBLED_RINV(1361); break; - case 218: SCRAMBLED_RINV(1367); break; - case 219: SCRAMBLED_RINV(1373); break; - case 220: SCRAMBLED_RINV(1381); break; - case 221: SCRAMBLED_RINV(1399); break; - case 222: SCRAMBLED_RINV(1409); break; - case 223: SCRAMBLED_RINV(1423); break; - case 224: SCRAMBLED_RINV(1427); break; - case 225: SCRAMBLED_RINV(1429); break; - case 226: SCRAMBLED_RINV(1433); break; - case 227: SCRAMBLED_RINV(1439); break; - case 228: SCRAMBLED_RINV(1447); break; - case 229: SCRAMBLED_RINV(1451); break; - case 230: SCRAMBLED_RINV(1453); break; - case 231: SCRAMBLED_RINV(1459); break; - case 232: SCRAMBLED_RINV(1471); break; - case 233: SCRAMBLED_RINV(1481); break; - case 234: SCRAMBLED_RINV(1483); break; - case 235: SCRAMBLED_RINV(1487); break; - case 236: SCRAMBLED_RINV(1489); break; - case 237: SCRAMBLED_RINV(1493); break; - case 238: SCRAMBLED_RINV(1499); break; - case 239: SCRAMBLED_RINV(1511); break; - case 240: SCRAMBLED_RINV(1523); break; - case 241: SCRAMBLED_RINV(1531); break; - case 242: SCRAMBLED_RINV(1543); break; - case 243: SCRAMBLED_RINV(1549); break; - case 244: SCRAMBLED_RINV(1553); break; - case 245: SCRAMBLED_RINV(1559); break; - case 246: SCRAMBLED_RINV(1567); break; - case 247: SCRAMBLED_RINV(1571); break; - case 248: SCRAMBLED_RINV(1579); break; - case 249: SCRAMBLED_RINV(1583); break; - case 250: SCRAMBLED_RINV(1597); break; - case 251: SCRAMBLED_RINV(1601); break; - case 252: SCRAMBLED_RINV(1607); break; - case 253: SCRAMBLED_RINV(1609); break; - case 254: SCRAMBLED_RINV(1613); break; - case 255: SCRAMBLED_RINV(1619); break; - case 256: SCRAMBLED_RINV(1621); break; - case 257: SCRAMBLED_RINV(1627); break; - case 258: SCRAMBLED_RINV(1637); break; - case 259: SCRAMBLED_RINV(1657); break; - case 260: SCRAMBLED_RINV(1663); break; - case 261: SCRAMBLED_RINV(1667); break; - case 262: SCRAMBLED_RINV(1669); break; - case 263: SCRAMBLED_RINV(1693); break; - case 264: SCRAMBLED_RINV(1697); break; - case 265: SCRAMBLED_RINV(1699); break; - case 266: SCRAMBLED_RINV(1709); break; - case 267: SCRAMBLED_RINV(1721); break; - case 268: SCRAMBLED_RINV(1723); break; - case 269: SCRAMBLED_RINV(1733); break; - case 270: SCRAMBLED_RINV(1741); break; - case 271: SCRAMBLED_RINV(1747); break; - case 272: SCRAMBLED_RINV(1753); break; - case 273: SCRAMBLED_RINV(1759); break; - case 274: SCRAMBLED_RINV(1777); break; - case 275: SCRAMBLED_RINV(1783); break; - case 276: SCRAMBLED_RINV(1787); break; - case 277: SCRAMBLED_RINV(1789); break; - case 278: SCRAMBLED_RINV(1801); break; - case 279: SCRAMBLED_RINV(1811); break; - case 280: SCRAMBLED_RINV(1823); break; - case 281: SCRAMBLED_RINV(1831); break; - case 282: SCRAMBLED_RINV(1847); break; - case 283: SCRAMBLED_RINV(1861); break; - case 284: SCRAMBLED_RINV(1867); break; - case 285: SCRAMBLED_RINV(1871); break; - case 286: SCRAMBLED_RINV(1873); break; - case 287: SCRAMBLED_RINV(1877); break; - case 288: SCRAMBLED_RINV(1879); break; - case 289: SCRAMBLED_RINV(1889); break; - case 290: SCRAMBLED_RINV(1901); break; - case 291: SCRAMBLED_RINV(1907); break; - case 292: SCRAMBLED_RINV(1913); break; - case 293: SCRAMBLED_RINV(1931); break; - case 294: SCRAMBLED_RINV(1933); break; - case 295: SCRAMBLED_RINV(1949); break; - case 296: SCRAMBLED_RINV(1951); break; - case 297: SCRAMBLED_RINV(1973); break; - case 298: SCRAMBLED_RINV(1979); break; - case 299: SCRAMBLED_RINV(1987); break; - case 300: SCRAMBLED_RINV(1993); break; - case 301: SCRAMBLED_RINV(1997); break; - case 302: SCRAMBLED_RINV(1999); break; - case 303: SCRAMBLED_RINV(2003); break; - case 304: SCRAMBLED_RINV(2011); break; - case 305: SCRAMBLED_RINV(2017); break; - case 306: SCRAMBLED_RINV(2027); break; - case 307: SCRAMBLED_RINV(2029); break; - case 308: SCRAMBLED_RINV(2039); break; - case 309: SCRAMBLED_RINV(2053); break; - case 310: SCRAMBLED_RINV(2063); break; - case 311: SCRAMBLED_RINV(2069); break; - case 312: SCRAMBLED_RINV(2081); break; - case 313: SCRAMBLED_RINV(2083); break; - case 314: SCRAMBLED_RINV(2087); break; - case 315: SCRAMBLED_RINV(2089); break; - case 316: SCRAMBLED_RINV(2099); break; - case 317: SCRAMBLED_RINV(2111); break; - case 318: SCRAMBLED_RINV(2113); break; - case 319: SCRAMBLED_RINV(2129); break; - case 320: SCRAMBLED_RINV(2131); break; - case 321: SCRAMBLED_RINV(2137); break; - case 322: SCRAMBLED_RINV(2141); break; - case 323: SCRAMBLED_RINV(2143); break; - case 324: SCRAMBLED_RINV(2153); break; - case 325: SCRAMBLED_RINV(2161); break; - case 326: SCRAMBLED_RINV(2179); break; - case 327: SCRAMBLED_RINV(2203); break; - case 328: SCRAMBLED_RINV(2207); break; - case 329: SCRAMBLED_RINV(2213); break; - case 330: SCRAMBLED_RINV(2221); break; - case 331: SCRAMBLED_RINV(2237); break; - case 332: SCRAMBLED_RINV(2239); break; - case 333: SCRAMBLED_RINV(2243); break; - case 334: SCRAMBLED_RINV(2251); break; - case 335: SCRAMBLED_RINV(2267); break; - case 336: SCRAMBLED_RINV(2269); break; - case 337: SCRAMBLED_RINV(2273); break; - case 338: SCRAMBLED_RINV(2281); break; - case 339: SCRAMBLED_RINV(2287); break; - case 340: SCRAMBLED_RINV(2293); break; - case 341: SCRAMBLED_RINV(2297); break; - case 342: SCRAMBLED_RINV(2309); break; - case 343: SCRAMBLED_RINV(2311); break; - case 344: SCRAMBLED_RINV(2333); break; - case 345: SCRAMBLED_RINV(2339); break; - case 346: SCRAMBLED_RINV(2341); break; - case 347: SCRAMBLED_RINV(2347); break; - case 348: SCRAMBLED_RINV(2351); break; - case 349: SCRAMBLED_RINV(2357); break; - case 350: SCRAMBLED_RINV(2371); break; - case 351: SCRAMBLED_RINV(2377); break; - case 352: SCRAMBLED_RINV(2381); break; - case 353: SCRAMBLED_RINV(2383); break; - case 354: SCRAMBLED_RINV(2389); break; - case 355: SCRAMBLED_RINV(2393); break; - case 356: SCRAMBLED_RINV(2399); break; - case 357: SCRAMBLED_RINV(2411); break; - case 358: SCRAMBLED_RINV(2417); break; - case 359: SCRAMBLED_RINV(2423); break; - case 360: SCRAMBLED_RINV(2437); break; - case 361: SCRAMBLED_RINV(2441); break; - case 362: SCRAMBLED_RINV(2447); break; - case 363: SCRAMBLED_RINV(2459); break; - case 364: SCRAMBLED_RINV(2467); break; - case 365: SCRAMBLED_RINV(2473); break; - case 366: SCRAMBLED_RINV(2477); break; - case 367: SCRAMBLED_RINV(2503); break; - case 368: SCRAMBLED_RINV(2521); break; - case 369: SCRAMBLED_RINV(2531); break; - case 370: SCRAMBLED_RINV(2539); break; - case 371: SCRAMBLED_RINV(2543); break; - case 372: SCRAMBLED_RINV(2549); break; - case 373: SCRAMBLED_RINV(2551); break; - case 374: SCRAMBLED_RINV(2557); break; - case 375: SCRAMBLED_RINV(2579); break; - case 376: SCRAMBLED_RINV(2591); break; - case 377: SCRAMBLED_RINV(2593); break; - case 378: SCRAMBLED_RINV(2609); break; - case 379: SCRAMBLED_RINV(2617); break; - case 380: SCRAMBLED_RINV(2621); break; - case 381: SCRAMBLED_RINV(2633); break; - case 382: SCRAMBLED_RINV(2647); break; - case 383: SCRAMBLED_RINV(2657); break; - case 384: SCRAMBLED_RINV(2659); break; - case 385: SCRAMBLED_RINV(2663); break; - case 386: SCRAMBLED_RINV(2671); break; - case 387: SCRAMBLED_RINV(2677); break; - case 388: SCRAMBLED_RINV(2683); break; - case 389: SCRAMBLED_RINV(2687); break; - case 390: SCRAMBLED_RINV(2689); break; - case 391: SCRAMBLED_RINV(2693); break; - case 392: SCRAMBLED_RINV(2699); break; - case 393: SCRAMBLED_RINV(2707); break; - case 394: SCRAMBLED_RINV(2711); break; - case 395: SCRAMBLED_RINV(2713); break; - case 396: SCRAMBLED_RINV(2719); break; - case 397: SCRAMBLED_RINV(2729); break; - case 398: SCRAMBLED_RINV(2731); break; - case 399: SCRAMBLED_RINV(2741); break; - case 400: SCRAMBLED_RINV(2749); break; - case 401: SCRAMBLED_RINV(2753); break; - case 402: SCRAMBLED_RINV(2767); break; - case 403: SCRAMBLED_RINV(2777); break; - case 404: SCRAMBLED_RINV(2789); break; - case 405: SCRAMBLED_RINV(2791); break; - case 406: SCRAMBLED_RINV(2797); break; - case 407: SCRAMBLED_RINV(2801); break; - case 408: SCRAMBLED_RINV(2803); break; - case 409: SCRAMBLED_RINV(2819); break; - case 410: SCRAMBLED_RINV(2833); break; - case 411: SCRAMBLED_RINV(2837); break; - case 412: SCRAMBLED_RINV(2843); break; - case 413: SCRAMBLED_RINV(2851); break; - case 414: SCRAMBLED_RINV(2857); break; - case 415: SCRAMBLED_RINV(2861); break; - case 416: SCRAMBLED_RINV(2879); break; - case 417: SCRAMBLED_RINV(2887); break; - case 418: SCRAMBLED_RINV(2897); break; - case 419: SCRAMBLED_RINV(2903); break; - case 420: SCRAMBLED_RINV(2909); break; - case 421: SCRAMBLED_RINV(2917); break; - case 422: SCRAMBLED_RINV(2927); break; - case 423: SCRAMBLED_RINV(2939); break; - case 424: SCRAMBLED_RINV(2953); break; - case 425: SCRAMBLED_RINV(2957); break; - case 426: SCRAMBLED_RINV(2963); break; - case 427: SCRAMBLED_RINV(2969); break; - case 428: SCRAMBLED_RINV(2971); break; - case 429: SCRAMBLED_RINV(2999); break; - case 430: SCRAMBLED_RINV(3001); break; - case 431: SCRAMBLED_RINV(3011); break; - case 432: SCRAMBLED_RINV(3019); break; - case 433: SCRAMBLED_RINV(3023); break; - case 434: SCRAMBLED_RINV(3037); break; - case 435: SCRAMBLED_RINV(3041); break; - case 436: SCRAMBLED_RINV(3049); break; - case 437: SCRAMBLED_RINV(3061); break; - case 438: SCRAMBLED_RINV(3067); break; - case 439: SCRAMBLED_RINV(3079); break; - case 440: SCRAMBLED_RINV(3083); break; - case 441: SCRAMBLED_RINV(3089); break; - case 442: SCRAMBLED_RINV(3109); break; - case 443: SCRAMBLED_RINV(3119); break; - case 444: SCRAMBLED_RINV(3121); break; - case 445: SCRAMBLED_RINV(3137); break; - case 446: SCRAMBLED_RINV(3163); break; - case 447: SCRAMBLED_RINV(3167); break; - case 448: SCRAMBLED_RINV(3169); break; - case 449: SCRAMBLED_RINV(3181); break; - case 450: SCRAMBLED_RINV(3187); break; - case 451: SCRAMBLED_RINV(3191); break; - case 452: SCRAMBLED_RINV(3203); break; - case 453: SCRAMBLED_RINV(3209); break; - case 454: SCRAMBLED_RINV(3217); break; - case 455: SCRAMBLED_RINV(3221); break; - case 456: SCRAMBLED_RINV(3229); break; - case 457: SCRAMBLED_RINV(3251); break; - case 458: SCRAMBLED_RINV(3253); break; - case 459: SCRAMBLED_RINV(3257); break; - case 460: SCRAMBLED_RINV(3259); break; - case 461: SCRAMBLED_RINV(3271); break; - case 462: SCRAMBLED_RINV(3299); break; - case 463: SCRAMBLED_RINV(3301); break; - case 464: SCRAMBLED_RINV(3307); break; - case 465: SCRAMBLED_RINV(3313); break; - case 466: SCRAMBLED_RINV(3319); break; - case 467: SCRAMBLED_RINV(3323); break; - case 468: SCRAMBLED_RINV(3329); break; - case 469: SCRAMBLED_RINV(3331); break; - case 470: SCRAMBLED_RINV(3343); break; - case 471: SCRAMBLED_RINV(3347); break; - case 472: SCRAMBLED_RINV(3359); break; - case 473: SCRAMBLED_RINV(3361); break; - case 474: SCRAMBLED_RINV(3371); break; - case 475: SCRAMBLED_RINV(3373); break; - case 476: SCRAMBLED_RINV(3389); break; - case 477: SCRAMBLED_RINV(3391); break; - case 478: SCRAMBLED_RINV(3407); break; - case 479: SCRAMBLED_RINV(3413); break; - case 480: SCRAMBLED_RINV(3433); break; - case 481: SCRAMBLED_RINV(3449); break; - case 482: SCRAMBLED_RINV(3457); break; - case 483: SCRAMBLED_RINV(3461); break; - case 484: SCRAMBLED_RINV(3463); break; - case 485: SCRAMBLED_RINV(3467); break; - case 486: SCRAMBLED_RINV(3469); break; - case 487: SCRAMBLED_RINV(3491); break; - case 488: SCRAMBLED_RINV(3499); break; - case 489: SCRAMBLED_RINV(3511); break; - case 490: SCRAMBLED_RINV(3517); break; - case 491: SCRAMBLED_RINV(3527); break; - case 492: SCRAMBLED_RINV(3529); break; - case 493: SCRAMBLED_RINV(3533); break; - case 494: SCRAMBLED_RINV(3539); break; - case 495: SCRAMBLED_RINV(3541); break; - case 496: SCRAMBLED_RINV(3547); break; - case 497: SCRAMBLED_RINV(3557); break; - case 498: SCRAMBLED_RINV(3559); break; - case 499: SCRAMBLED_RINV(3571); break; - case 500: SCRAMBLED_RINV(3581); break; - case 501: SCRAMBLED_RINV(3583); break; - case 502: SCRAMBLED_RINV(3593); break; - case 503: SCRAMBLED_RINV(3607); break; - case 504: SCRAMBLED_RINV(3613); break; - case 505: SCRAMBLED_RINV(3617); break; - case 506: SCRAMBLED_RINV(3623); break; - case 507: SCRAMBLED_RINV(3631); break; - case 508: SCRAMBLED_RINV(3637); break; - case 509: SCRAMBLED_RINV(3643); break; - case 510: SCRAMBLED_RINV(3659); break; - case 511: SCRAMBLED_RINV(3671); break; - case 512: SCRAMBLED_RINV(3673); break; - case 513: SCRAMBLED_RINV(3677); break; - case 514: SCRAMBLED_RINV(3691); break; - case 515: SCRAMBLED_RINV(3697); break; - case 516: SCRAMBLED_RINV(3701); break; - case 517: SCRAMBLED_RINV(3709); break; - case 518: SCRAMBLED_RINV(3719); break; - case 519: SCRAMBLED_RINV(3727); break; - case 520: SCRAMBLED_RINV(3733); break; - case 521: SCRAMBLED_RINV(3739); break; - case 522: SCRAMBLED_RINV(3761); break; - case 523: SCRAMBLED_RINV(3767); break; - case 524: SCRAMBLED_RINV(3769); break; - case 525: SCRAMBLED_RINV(3779); break; - case 526: SCRAMBLED_RINV(3793); break; - case 527: SCRAMBLED_RINV(3797); break; - case 528: SCRAMBLED_RINV(3803); break; - case 529: SCRAMBLED_RINV(3821); break; - case 530: SCRAMBLED_RINV(3823); break; - case 531: SCRAMBLED_RINV(3833); break; - case 532: SCRAMBLED_RINV(3847); break; - case 533: SCRAMBLED_RINV(3851); break; - case 534: SCRAMBLED_RINV(3853); break; - case 535: SCRAMBLED_RINV(3863); break; - case 536: SCRAMBLED_RINV(3877); break; - case 537: SCRAMBLED_RINV(3881); break; - case 538: SCRAMBLED_RINV(3889); break; - case 539: SCRAMBLED_RINV(3907); break; - case 540: SCRAMBLED_RINV(3911); break; - case 541: SCRAMBLED_RINV(3917); break; - case 542: SCRAMBLED_RINV(3919); break; - case 543: SCRAMBLED_RINV(3923); break; - case 544: SCRAMBLED_RINV(3929); break; - case 545: SCRAMBLED_RINV(3931); break; - case 546: SCRAMBLED_RINV(3943); break; - case 547: SCRAMBLED_RINV(3947); break; - case 548: SCRAMBLED_RINV(3967); break; - case 549: SCRAMBLED_RINV(3989); break; - case 550: SCRAMBLED_RINV(4001); break; - case 551: SCRAMBLED_RINV(4003); break; - case 552: SCRAMBLED_RINV(4007); break; - case 553: SCRAMBLED_RINV(4013); break; - case 554: SCRAMBLED_RINV(4019); break; - case 555: SCRAMBLED_RINV(4021); break; - case 556: SCRAMBLED_RINV(4027); break; - case 557: SCRAMBLED_RINV(4049); break; - case 558: SCRAMBLED_RINV(4051); break; - case 559: SCRAMBLED_RINV(4057); break; - case 560: SCRAMBLED_RINV(4073); break; - case 561: SCRAMBLED_RINV(4079); break; - case 562: SCRAMBLED_RINV(4091); break; - case 563: SCRAMBLED_RINV(4093); break; - case 564: SCRAMBLED_RINV(4099); break; - case 565: SCRAMBLED_RINV(4111); break; - case 566: SCRAMBLED_RINV(4127); break; - case 567: SCRAMBLED_RINV(4129); break; - case 568: SCRAMBLED_RINV(4133); break; - case 569: SCRAMBLED_RINV(4139); break; - case 570: SCRAMBLED_RINV(4153); break; - case 571: SCRAMBLED_RINV(4157); break; - case 572: SCRAMBLED_RINV(4159); break; - case 573: SCRAMBLED_RINV(4177); break; - case 574: SCRAMBLED_RINV(4201); break; - case 575: SCRAMBLED_RINV(4211); break; - case 576: SCRAMBLED_RINV(4217); break; - case 577: SCRAMBLED_RINV(4219); break; - case 578: SCRAMBLED_RINV(4229); break; - case 579: SCRAMBLED_RINV(4231); break; - case 580: SCRAMBLED_RINV(4241); break; - case 581: SCRAMBLED_RINV(4243); break; - case 582: SCRAMBLED_RINV(4253); break; - case 583: SCRAMBLED_RINV(4259); break; - case 584: SCRAMBLED_RINV(4261); break; - case 585: SCRAMBLED_RINV(4271); break; - case 586: SCRAMBLED_RINV(4273); break; - case 587: SCRAMBLED_RINV(4283); break; - case 588: SCRAMBLED_RINV(4289); break; - case 589: SCRAMBLED_RINV(4297); break; - case 590: SCRAMBLED_RINV(4327); break; - case 591: SCRAMBLED_RINV(4337); break; - case 592: SCRAMBLED_RINV(4339); break; - case 593: SCRAMBLED_RINV(4349); break; - case 594: SCRAMBLED_RINV(4357); break; - case 595: SCRAMBLED_RINV(4363); break; - case 596: SCRAMBLED_RINV(4373); break; - case 597: SCRAMBLED_RINV(4391); break; - case 598: SCRAMBLED_RINV(4397); break; - case 599: SCRAMBLED_RINV(4409); break; - case 600: SCRAMBLED_RINV(4421); break; - case 601: SCRAMBLED_RINV(4423); break; - case 602: SCRAMBLED_RINV(4441); break; - case 603: SCRAMBLED_RINV(4447); break; - case 604: SCRAMBLED_RINV(4451); break; - case 605: SCRAMBLED_RINV(4457); break; - case 606: SCRAMBLED_RINV(4463); break; - case 607: SCRAMBLED_RINV(4481); break; - case 608: SCRAMBLED_RINV(4483); break; - case 609: SCRAMBLED_RINV(4493); break; - case 610: SCRAMBLED_RINV(4507); break; - case 611: SCRAMBLED_RINV(4513); break; - case 612: SCRAMBLED_RINV(4517); break; - case 613: SCRAMBLED_RINV(4519); break; - case 614: SCRAMBLED_RINV(4523); break; - case 615: SCRAMBLED_RINV(4547); break; - case 616: SCRAMBLED_RINV(4549); break; - case 617: SCRAMBLED_RINV(4561); break; - case 618: SCRAMBLED_RINV(4567); break; - case 619: SCRAMBLED_RINV(4583); break; - case 620: SCRAMBLED_RINV(4591); break; - case 621: SCRAMBLED_RINV(4597); break; - case 622: SCRAMBLED_RINV(4603); break; - case 623: SCRAMBLED_RINV(4621); break; - case 624: SCRAMBLED_RINV(4637); break; - case 625: SCRAMBLED_RINV(4639); break; - case 626: SCRAMBLED_RINV(4643); break; - case 627: SCRAMBLED_RINV(4649); break; - case 628: SCRAMBLED_RINV(4651); break; - case 629: SCRAMBLED_RINV(4657); break; - case 630: SCRAMBLED_RINV(4663); break; - case 631: SCRAMBLED_RINV(4673); break; - case 632: SCRAMBLED_RINV(4679); break; - case 633: SCRAMBLED_RINV(4691); break; - case 634: SCRAMBLED_RINV(4703); break; - case 635: SCRAMBLED_RINV(4721); break; - case 636: SCRAMBLED_RINV(4723); break; - case 637: SCRAMBLED_RINV(4729); break; - case 638: SCRAMBLED_RINV(4733); break; - case 639: SCRAMBLED_RINV(4751); break; - case 640: SCRAMBLED_RINV(4759); break; - case 641: SCRAMBLED_RINV(4783); break; - case 642: SCRAMBLED_RINV(4787); break; - case 643: SCRAMBLED_RINV(4789); break; - case 644: SCRAMBLED_RINV(4793); break; - case 645: SCRAMBLED_RINV(4799); break; - case 646: SCRAMBLED_RINV(4801); break; - case 647: SCRAMBLED_RINV(4813); break; - case 648: SCRAMBLED_RINV(4817); break; - case 649: SCRAMBLED_RINV(4831); break; - case 650: SCRAMBLED_RINV(4861); break; - case 651: SCRAMBLED_RINV(4871); break; - case 652: SCRAMBLED_RINV(4877); break; - case 653: SCRAMBLED_RINV(4889); break; - case 654: SCRAMBLED_RINV(4903); break; - case 655: SCRAMBLED_RINV(4909); break; - case 656: SCRAMBLED_RINV(4919); break; - case 657: SCRAMBLED_RINV(4931); break; - case 658: SCRAMBLED_RINV(4933); break; - case 659: SCRAMBLED_RINV(4937); break; - case 660: SCRAMBLED_RINV(4943); break; - case 661: SCRAMBLED_RINV(4951); break; - case 662: SCRAMBLED_RINV(4957); break; - case 663: SCRAMBLED_RINV(4967); break; - case 664: SCRAMBLED_RINV(4969); break; - case 665: SCRAMBLED_RINV(4973); break; - case 666: SCRAMBLED_RINV(4987); break; - case 667: SCRAMBLED_RINV(4993); break; - case 668: SCRAMBLED_RINV(4999); break; - case 669: SCRAMBLED_RINV(5003); break; - case 670: SCRAMBLED_RINV(5009); break; - case 671: SCRAMBLED_RINV(5011); break; - case 672: SCRAMBLED_RINV(5021); break; - case 673: SCRAMBLED_RINV(5023); break; - case 674: SCRAMBLED_RINV(5039); break; - case 675: SCRAMBLED_RINV(5051); break; - case 676: SCRAMBLED_RINV(5059); break; - case 677: SCRAMBLED_RINV(5077); break; - case 678: SCRAMBLED_RINV(5081); break; - case 679: SCRAMBLED_RINV(5087); break; - case 680: SCRAMBLED_RINV(5099); break; - case 681: SCRAMBLED_RINV(5101); break; - case 682: SCRAMBLED_RINV(5107); break; - case 683: SCRAMBLED_RINV(5113); break; - case 684: SCRAMBLED_RINV(5119); break; - case 685: SCRAMBLED_RINV(5147); break; - case 686: SCRAMBLED_RINV(5153); break; - case 687: SCRAMBLED_RINV(5167); break; - case 688: SCRAMBLED_RINV(5171); break; - case 689: SCRAMBLED_RINV(5179); break; - case 690: SCRAMBLED_RINV(5189); break; - case 691: SCRAMBLED_RINV(5197); break; - case 692: SCRAMBLED_RINV(5209); break; - case 693: SCRAMBLED_RINV(5227); break; - case 694: SCRAMBLED_RINV(5231); break; - case 695: SCRAMBLED_RINV(5233); break; - case 696: SCRAMBLED_RINV(5237); break; - case 697: SCRAMBLED_RINV(5261); break; - case 698: SCRAMBLED_RINV(5273); break; - case 699: SCRAMBLED_RINV(5279); break; - case 700: SCRAMBLED_RINV(5281); break; - case 701: SCRAMBLED_RINV(5297); break; - case 702: SCRAMBLED_RINV(5303); break; - case 703: SCRAMBLED_RINV(5309); break; - case 704: SCRAMBLED_RINV(5323); break; - case 705: SCRAMBLED_RINV(5333); break; - case 706: SCRAMBLED_RINV(5347); break; - case 707: SCRAMBLED_RINV(5351); break; - case 708: SCRAMBLED_RINV(5381); break; - case 709: SCRAMBLED_RINV(5387); break; - case 710: SCRAMBLED_RINV(5393); break; - case 711: SCRAMBLED_RINV(5399); break; - case 712: SCRAMBLED_RINV(5407); break; - case 713: SCRAMBLED_RINV(5413); break; - case 714: SCRAMBLED_RINV(5417); break; - case 715: SCRAMBLED_RINV(5419); break; - case 716: SCRAMBLED_RINV(5431); break; - case 717: SCRAMBLED_RINV(5437); break; - case 718: SCRAMBLED_RINV(5441); break; - case 719: SCRAMBLED_RINV(5443); break; - case 720: SCRAMBLED_RINV(5449); break; - case 721: SCRAMBLED_RINV(5471); break; - case 722: SCRAMBLED_RINV(5477); break; - case 723: SCRAMBLED_RINV(5479); break; - case 724: SCRAMBLED_RINV(5483); break; - case 725: SCRAMBLED_RINV(5501); break; - case 726: SCRAMBLED_RINV(5503); break; - case 727: SCRAMBLED_RINV(5507); break; - case 728: SCRAMBLED_RINV(5519); break; - case 729: SCRAMBLED_RINV(5521); break; - case 730: SCRAMBLED_RINV(5527); break; - case 731: SCRAMBLED_RINV(5531); break; - case 732: SCRAMBLED_RINV(5557); break; - case 733: SCRAMBLED_RINV(5563); break; - case 734: SCRAMBLED_RINV(5569); break; - case 735: SCRAMBLED_RINV(5573); break; - case 736: SCRAMBLED_RINV(5581); break; - case 737: SCRAMBLED_RINV(5591); break; - case 738: SCRAMBLED_RINV(5623); break; - case 739: SCRAMBLED_RINV(5639); break; - case 740: SCRAMBLED_RINV(5641); break; - case 741: SCRAMBLED_RINV(5647); break; - case 742: SCRAMBLED_RINV(5651); break; - case 743: SCRAMBLED_RINV(5653); break; - case 744: SCRAMBLED_RINV(5657); break; - case 745: SCRAMBLED_RINV(5659); break; - case 746: SCRAMBLED_RINV(5669); break; - case 747: SCRAMBLED_RINV(5683); break; - case 748: SCRAMBLED_RINV(5689); break; - case 749: SCRAMBLED_RINV(5693); break; - case 750: SCRAMBLED_RINV(5701); break; - case 751: SCRAMBLED_RINV(5711); break; - case 752: SCRAMBLED_RINV(5717); break; - case 753: SCRAMBLED_RINV(5737); break; - case 754: SCRAMBLED_RINV(5741); break; - case 755: SCRAMBLED_RINV(5743); break; - case 756: SCRAMBLED_RINV(5749); break; - case 757: SCRAMBLED_RINV(5779); break; - case 758: SCRAMBLED_RINV(5783); break; - case 759: SCRAMBLED_RINV(5791); break; - case 760: SCRAMBLED_RINV(5801); break; - case 761: SCRAMBLED_RINV(5807); break; - case 762: SCRAMBLED_RINV(5813); break; - case 763: SCRAMBLED_RINV(5821); break; - case 764: SCRAMBLED_RINV(5827); break; - case 765: SCRAMBLED_RINV(5839); break; - case 766: SCRAMBLED_RINV(5843); break; - case 767: SCRAMBLED_RINV(5849); break; - case 768: SCRAMBLED_RINV(5851); break; - case 769: SCRAMBLED_RINV(5857); break; - case 770: SCRAMBLED_RINV(5861); break; - case 771: SCRAMBLED_RINV(5867); break; - case 772: SCRAMBLED_RINV(5869); break; - case 773: SCRAMBLED_RINV(5879); break; - case 774: SCRAMBLED_RINV(5881); break; - case 775: SCRAMBLED_RINV(5897); break; - case 776: SCRAMBLED_RINV(5903); break; - case 777: SCRAMBLED_RINV(5923); break; - case 778: SCRAMBLED_RINV(5927); break; - case 779: SCRAMBLED_RINV(5939); break; - case 780: SCRAMBLED_RINV(5953); break; - case 781: SCRAMBLED_RINV(5981); break; - case 782: SCRAMBLED_RINV(5987); break; - case 783: SCRAMBLED_RINV(6007); break; - case 784: SCRAMBLED_RINV(6011); break; - case 785: SCRAMBLED_RINV(6029); break; - case 786: SCRAMBLED_RINV(6037); break; - case 787: SCRAMBLED_RINV(6043); break; - case 788: SCRAMBLED_RINV(6047); break; - case 789: SCRAMBLED_RINV(6053); break; - case 790: SCRAMBLED_RINV(6067); break; - case 791: SCRAMBLED_RINV(6073); break; - case 792: SCRAMBLED_RINV(6079); break; - case 793: SCRAMBLED_RINV(6089); break; - case 794: SCRAMBLED_RINV(6091); break; - case 795: SCRAMBLED_RINV(6101); break; - case 796: SCRAMBLED_RINV(6113); break; - case 797: SCRAMBLED_RINV(6121); break; - case 798: SCRAMBLED_RINV(6131); break; - case 799: SCRAMBLED_RINV(6133); break; - case 800: SCRAMBLED_RINV(6143); break; - case 801: SCRAMBLED_RINV(6151); break; - case 802: SCRAMBLED_RINV(6163); break; - case 803: SCRAMBLED_RINV(6173); break; - case 804: SCRAMBLED_RINV(6197); break; - case 805: SCRAMBLED_RINV(6199); break; - case 806: SCRAMBLED_RINV(6203); break; - case 807: SCRAMBLED_RINV(6211); break; - case 808: SCRAMBLED_RINV(6217); break; - case 809: SCRAMBLED_RINV(6221); break; - case 810: SCRAMBLED_RINV(6229); break; - case 811: SCRAMBLED_RINV(6247); break; - case 812: SCRAMBLED_RINV(6257); break; - case 813: SCRAMBLED_RINV(6263); break; - case 814: SCRAMBLED_RINV(6269); break; - case 815: SCRAMBLED_RINV(6271); break; - case 816: SCRAMBLED_RINV(6277); break; - case 817: SCRAMBLED_RINV(6287); break; - case 818: SCRAMBLED_RINV(6299); break; - case 819: SCRAMBLED_RINV(6301); break; - case 820: SCRAMBLED_RINV(6311); break; - case 821: SCRAMBLED_RINV(6317); break; - case 822: SCRAMBLED_RINV(6323); break; - case 823: SCRAMBLED_RINV(6329); break; - case 824: SCRAMBLED_RINV(6337); break; - case 825: SCRAMBLED_RINV(6343); break; - case 826: SCRAMBLED_RINV(6353); break; - case 827: SCRAMBLED_RINV(6359); break; - case 828: SCRAMBLED_RINV(6361); break; - case 829: SCRAMBLED_RINV(6367); break; - case 830: SCRAMBLED_RINV(6373); break; - case 831: SCRAMBLED_RINV(6379); break; - case 832: SCRAMBLED_RINV(6389); break; - case 833: SCRAMBLED_RINV(6397); break; - case 834: SCRAMBLED_RINV(6421); break; - case 835: SCRAMBLED_RINV(6427); break; - case 836: SCRAMBLED_RINV(6449); break; - case 837: SCRAMBLED_RINV(6451); break; - case 838: SCRAMBLED_RINV(6469); break; - case 839: SCRAMBLED_RINV(6473); break; - case 840: SCRAMBLED_RINV(6481); break; - case 841: SCRAMBLED_RINV(6491); break; - case 842: SCRAMBLED_RINV(6521); break; - case 843: SCRAMBLED_RINV(6529); break; - case 844: SCRAMBLED_RINV(6547); break; - case 845: SCRAMBLED_RINV(6551); break; - case 846: SCRAMBLED_RINV(6553); break; - case 847: SCRAMBLED_RINV(6563); break; - case 848: SCRAMBLED_RINV(6569); break; - case 849: SCRAMBLED_RINV(6571); break; - case 850: SCRAMBLED_RINV(6577); break; - case 851: SCRAMBLED_RINV(6581); break; - case 852: SCRAMBLED_RINV(6599); break; - case 853: SCRAMBLED_RINV(6607); break; - case 854: SCRAMBLED_RINV(6619); break; - case 855: SCRAMBLED_RINV(6637); break; - case 856: SCRAMBLED_RINV(6653); break; - case 857: SCRAMBLED_RINV(6659); break; - case 858: SCRAMBLED_RINV(6661); break; - case 859: SCRAMBLED_RINV(6673); break; - case 860: SCRAMBLED_RINV(6679); break; - case 861: SCRAMBLED_RINV(6689); break; - case 862: SCRAMBLED_RINV(6691); break; - case 863: SCRAMBLED_RINV(6701); break; - case 864: SCRAMBLED_RINV(6703); break; - case 865: SCRAMBLED_RINV(6709); break; - case 866: SCRAMBLED_RINV(6719); break; - case 867: SCRAMBLED_RINV(6733); break; - case 868: SCRAMBLED_RINV(6737); break; - case 869: SCRAMBLED_RINV(6761); break; - case 870: SCRAMBLED_RINV(6763); break; - case 871: SCRAMBLED_RINV(6779); break; - case 872: SCRAMBLED_RINV(6781); break; - case 873: SCRAMBLED_RINV(6791); break; - case 874: SCRAMBLED_RINV(6793); break; - case 875: SCRAMBLED_RINV(6803); break; - case 876: SCRAMBLED_RINV(6823); break; - case 877: SCRAMBLED_RINV(6827); break; - case 878: SCRAMBLED_RINV(6829); break; - case 879: SCRAMBLED_RINV(6833); break; - case 880: SCRAMBLED_RINV(6841); break; - case 881: SCRAMBLED_RINV(6857); break; - case 882: SCRAMBLED_RINV(6863); break; - case 883: SCRAMBLED_RINV(6869); break; - case 884: SCRAMBLED_RINV(6871); break; - case 885: SCRAMBLED_RINV(6883); break; - case 886: SCRAMBLED_RINV(6899); break; - case 887: SCRAMBLED_RINV(6907); break; - case 888: SCRAMBLED_RINV(6911); break; - case 889: SCRAMBLED_RINV(6917); break; - case 890: SCRAMBLED_RINV(6947); break; - case 891: SCRAMBLED_RINV(6949); break; - case 892: SCRAMBLED_RINV(6959); break; - case 893: SCRAMBLED_RINV(6961); break; - case 894: SCRAMBLED_RINV(6967); break; - case 895: SCRAMBLED_RINV(6971); break; - case 896: SCRAMBLED_RINV(6977); break; - case 897: SCRAMBLED_RINV(6983); break; - case 898: SCRAMBLED_RINV(6991); break; - case 899: SCRAMBLED_RINV(6997); break; - case 900: SCRAMBLED_RINV(7001); break; - case 901: SCRAMBLED_RINV(7013); break; - case 902: SCRAMBLED_RINV(7019); break; - case 903: SCRAMBLED_RINV(7027); break; - case 904: SCRAMBLED_RINV(7039); break; - case 905: SCRAMBLED_RINV(7043); break; - case 906: SCRAMBLED_RINV(7057); break; - case 907: SCRAMBLED_RINV(7069); break; - case 908: SCRAMBLED_RINV(7079); break; - case 909: SCRAMBLED_RINV(7103); break; - case 910: SCRAMBLED_RINV(7109); break; - case 911: SCRAMBLED_RINV(7121); break; - case 912: SCRAMBLED_RINV(7127); break; - case 913: SCRAMBLED_RINV(7129); break; - case 914: SCRAMBLED_RINV(7151); break; - case 915: SCRAMBLED_RINV(7159); break; - case 916: SCRAMBLED_RINV(7177); break; - case 917: SCRAMBLED_RINV(7187); break; - case 918: SCRAMBLED_RINV(7193); break; - case 919: SCRAMBLED_RINV(7207); break; - case 920: SCRAMBLED_RINV(7211); break; - case 921: SCRAMBLED_RINV(7213); break; - case 922: SCRAMBLED_RINV(7219); break; - case 923: SCRAMBLED_RINV(7229); break; - case 924: SCRAMBLED_RINV(7237); break; - case 925: SCRAMBLED_RINV(7243); break; - case 926: SCRAMBLED_RINV(7247); break; - case 927: SCRAMBLED_RINV(7253); break; - case 928: SCRAMBLED_RINV(7283); break; - case 929: SCRAMBLED_RINV(7297); break; - case 930: SCRAMBLED_RINV(7307); break; - case 931: SCRAMBLED_RINV(7309); break; - case 932: SCRAMBLED_RINV(7321); break; - case 933: SCRAMBLED_RINV(7331); break; - case 934: SCRAMBLED_RINV(7333); break; - case 935: SCRAMBLED_RINV(7349); break; - case 936: SCRAMBLED_RINV(7351); break; - case 937: SCRAMBLED_RINV(7369); break; - case 938: SCRAMBLED_RINV(7393); break; - case 939: SCRAMBLED_RINV(7411); break; - case 940: SCRAMBLED_RINV(7417); break; - case 941: SCRAMBLED_RINV(7433); break; - case 942: SCRAMBLED_RINV(7451); break; - case 943: SCRAMBLED_RINV(7457); break; - case 944: SCRAMBLED_RINV(7459); break; - case 945: SCRAMBLED_RINV(7477); break; - case 946: SCRAMBLED_RINV(7481); break; - case 947: SCRAMBLED_RINV(7487); break; - case 948: SCRAMBLED_RINV(7489); break; - case 949: SCRAMBLED_RINV(7499); break; - case 950: SCRAMBLED_RINV(7507); break; - case 951: SCRAMBLED_RINV(7517); break; - case 952: SCRAMBLED_RINV(7523); break; - case 953: SCRAMBLED_RINV(7529); break; - case 954: SCRAMBLED_RINV(7537); break; - case 955: SCRAMBLED_RINV(7541); break; - case 956: SCRAMBLED_RINV(7547); break; - case 957: SCRAMBLED_RINV(7549); break; - case 958: SCRAMBLED_RINV(7559); break; - case 959: SCRAMBLED_RINV(7561); break; - case 960: SCRAMBLED_RINV(7573); break; - case 961: SCRAMBLED_RINV(7577); break; - case 962: SCRAMBLED_RINV(7583); break; - case 963: SCRAMBLED_RINV(7589); break; - case 964: SCRAMBLED_RINV(7591); break; - case 965: SCRAMBLED_RINV(7603); break; - case 966: SCRAMBLED_RINV(7607); break; - case 967: SCRAMBLED_RINV(7621); break; - case 968: SCRAMBLED_RINV(7639); break; - case 969: SCRAMBLED_RINV(7643); break; - case 970: SCRAMBLED_RINV(7649); break; - case 971: SCRAMBLED_RINV(7669); break; - case 972: SCRAMBLED_RINV(7673); break; - case 973: SCRAMBLED_RINV(7681); break; - case 974: SCRAMBLED_RINV(7687); break; - case 975: SCRAMBLED_RINV(7691); break; - case 976: SCRAMBLED_RINV(7699); break; - case 977: SCRAMBLED_RINV(7703); break; - case 978: SCRAMBLED_RINV(7717); break; - case 979: SCRAMBLED_RINV(7723); break; - case 980: SCRAMBLED_RINV(7727); break; - case 981: SCRAMBLED_RINV(7741); break; - case 982: SCRAMBLED_RINV(7753); break; - case 983: SCRAMBLED_RINV(7757); break; - case 984: SCRAMBLED_RINV(7759); break; - case 985: SCRAMBLED_RINV(7789); break; - case 986: SCRAMBLED_RINV(7793); break; - case 987: SCRAMBLED_RINV(7817); break; - case 988: SCRAMBLED_RINV(7823); break; - case 989: SCRAMBLED_RINV(7829); break; - case 990: SCRAMBLED_RINV(7841); break; - case 991: SCRAMBLED_RINV(7853); break; - case 992: SCRAMBLED_RINV(7867); break; - case 993: SCRAMBLED_RINV(7873); break; - case 994: SCRAMBLED_RINV(7877); break; - case 995: SCRAMBLED_RINV(7879); break; - case 996: SCRAMBLED_RINV(7883); break; - case 997: SCRAMBLED_RINV(7901); break; - case 998: SCRAMBLED_RINV(7907); break; - case 999: SCRAMBLED_RINV(7919); break; - case 1000: SCRAMBLED_RINV(7927); break; - case 1001: SCRAMBLED_RINV(7933); break; - case 1002: SCRAMBLED_RINV(7937); break; - case 1003: SCRAMBLED_RINV(7949); break; - case 1004: SCRAMBLED_RINV(7951); break; - case 1005: SCRAMBLED_RINV(7963); break; - case 1006: SCRAMBLED_RINV(7993); break; - case 1007: SCRAMBLED_RINV(8009); break; - case 1008: SCRAMBLED_RINV(8011); break; - case 1009: SCRAMBLED_RINV(8017); break; - case 1010: SCRAMBLED_RINV(8039); break; - case 1011: SCRAMBLED_RINV(8053); break; - case 1012: SCRAMBLED_RINV(8059); break; - case 1013: SCRAMBLED_RINV(8069); break; - case 1014: SCRAMBLED_RINV(8081); break; - case 1015: SCRAMBLED_RINV(8087); break; - case 1016: SCRAMBLED_RINV(8089); break; - case 1017: SCRAMBLED_RINV(8093); break; - case 1018: SCRAMBLED_RINV(8101); break; - case 1019: SCRAMBLED_RINV(8111); break; - case 1020: SCRAMBLED_RINV(8117); break; - case 1021: SCRAMBLED_RINV(8123); break; - case 1022: SCRAMBLED_RINV(8147); break; - case 1023: SCRAMBLED_RINV(8161); break; + case 0: SCRAMBLED_RINV(2); break; + case 1: SCRAMBLED_RINV(3); break; + case 2: SCRAMBLED_RINV(5); break; + case 3: SCRAMBLED_RINV(7); break; + case 4: SCRAMBLED_RINV(11); break; + case 5: SCRAMBLED_RINV(13); break; + case 6: SCRAMBLED_RINV(17); break; + case 7: SCRAMBLED_RINV(19); break; + case 8: SCRAMBLED_RINV(23); break; + case 9: SCRAMBLED_RINV(29); break; + case 10: SCRAMBLED_RINV(31); break; + case 11: SCRAMBLED_RINV(37); break; + case 12: SCRAMBLED_RINV(41); break; + case 13: SCRAMBLED_RINV(43); break; + case 14: SCRAMBLED_RINV(47); break; + case 15: SCRAMBLED_RINV(53); break; + case 16: SCRAMBLED_RINV(59); break; + case 17: SCRAMBLED_RINV(61); break; + case 18: SCRAMBLED_RINV(67); break; + case 19: SCRAMBLED_RINV(71); break; + case 20: SCRAMBLED_RINV(73); break; + case 21: SCRAMBLED_RINV(79); break; + case 22: SCRAMBLED_RINV(83); break; + case 23: SCRAMBLED_RINV(89); break; + case 24: SCRAMBLED_RINV(97); break; + case 25: SCRAMBLED_RINV(101); break; + case 26: SCRAMBLED_RINV(103); break; + case 27: SCRAMBLED_RINV(107); break; + case 28: SCRAMBLED_RINV(109); break; + case 29: SCRAMBLED_RINV(113); break; + case 30: SCRAMBLED_RINV(127); break; + case 31: SCRAMBLED_RINV(131); break; + case 32: SCRAMBLED_RINV(137); break; + case 33: SCRAMBLED_RINV(139); break; + case 34: SCRAMBLED_RINV(149); break; + case 35: SCRAMBLED_RINV(151); break; + case 36: SCRAMBLED_RINV(157); break; + case 37: SCRAMBLED_RINV(163); break; + case 38: SCRAMBLED_RINV(167); break; + case 39: SCRAMBLED_RINV(173); break; + case 40: SCRAMBLED_RINV(179); break; + case 41: SCRAMBLED_RINV(181); break; + case 42: SCRAMBLED_RINV(191); break; + case 43: SCRAMBLED_RINV(193); break; + case 44: SCRAMBLED_RINV(197); break; + case 45: SCRAMBLED_RINV(199); break; + case 46: SCRAMBLED_RINV(211); break; + case 47: SCRAMBLED_RINV(223); break; + case 48: SCRAMBLED_RINV(227); break; + case 49: SCRAMBLED_RINV(229); break; + case 50: SCRAMBLED_RINV(233); break; + case 51: SCRAMBLED_RINV(239); break; + case 52: SCRAMBLED_RINV(241); break; + case 53: SCRAMBLED_RINV(251); break; + case 54: SCRAMBLED_RINV(257); break; + case 55: SCRAMBLED_RINV(263); break; + case 56: SCRAMBLED_RINV(269); break; + case 57: SCRAMBLED_RINV(271); break; + case 58: SCRAMBLED_RINV(277); break; + case 59: SCRAMBLED_RINV(281); break; + case 60: SCRAMBLED_RINV(283); break; + case 61: SCRAMBLED_RINV(293); break; + case 62: SCRAMBLED_RINV(307); break; + case 63: SCRAMBLED_RINV(311); break; + case 64: SCRAMBLED_RINV(313); break; + case 65: SCRAMBLED_RINV(317); break; + case 66: SCRAMBLED_RINV(331); break; + case 67: SCRAMBLED_RINV(337); break; + case 68: SCRAMBLED_RINV(347); break; + case 69: SCRAMBLED_RINV(349); break; + case 70: SCRAMBLED_RINV(353); break; + case 71: SCRAMBLED_RINV(359); break; + case 72: SCRAMBLED_RINV(367); break; + case 73: SCRAMBLED_RINV(373); break; + case 74: SCRAMBLED_RINV(379); break; + case 75: SCRAMBLED_RINV(383); break; + case 76: SCRAMBLED_RINV(389); break; + case 77: SCRAMBLED_RINV(397); break; + case 78: SCRAMBLED_RINV(401); break; + case 79: SCRAMBLED_RINV(409); break; + case 80: SCRAMBLED_RINV(419); break; + case 81: SCRAMBLED_RINV(421); break; + case 82: SCRAMBLED_RINV(431); break; + case 83: SCRAMBLED_RINV(433); break; + case 84: SCRAMBLED_RINV(439); break; + case 85: SCRAMBLED_RINV(443); break; + case 86: SCRAMBLED_RINV(449); break; + case 87: SCRAMBLED_RINV(457); break; + case 88: SCRAMBLED_RINV(461); break; + case 89: SCRAMBLED_RINV(463); break; + case 90: SCRAMBLED_RINV(467); break; + case 91: SCRAMBLED_RINV(479); break; + case 92: SCRAMBLED_RINV(487); break; + case 93: SCRAMBLED_RINV(491); break; + case 94: SCRAMBLED_RINV(499); break; + case 95: SCRAMBLED_RINV(503); break; + case 96: SCRAMBLED_RINV(509); break; + case 97: SCRAMBLED_RINV(521); break; + case 98: SCRAMBLED_RINV(523); break; + case 99: SCRAMBLED_RINV(541); break; + case 100: SCRAMBLED_RINV(547); break; + case 101: SCRAMBLED_RINV(557); break; + case 102: SCRAMBLED_RINV(563); break; + case 103: SCRAMBLED_RINV(569); break; + case 104: SCRAMBLED_RINV(571); break; + case 105: SCRAMBLED_RINV(577); break; + case 106: SCRAMBLED_RINV(587); break; + case 107: SCRAMBLED_RINV(593); break; + case 108: SCRAMBLED_RINV(599); break; + case 109: SCRAMBLED_RINV(601); break; + case 110: SCRAMBLED_RINV(607); break; + case 111: SCRAMBLED_RINV(613); break; + case 112: SCRAMBLED_RINV(617); break; + case 113: SCRAMBLED_RINV(619); break; + case 114: SCRAMBLED_RINV(631); break; + case 115: SCRAMBLED_RINV(641); break; + case 116: SCRAMBLED_RINV(643); break; + case 117: SCRAMBLED_RINV(647); break; + case 118: SCRAMBLED_RINV(653); break; + case 119: SCRAMBLED_RINV(659); break; + case 120: SCRAMBLED_RINV(661); break; + case 121: SCRAMBLED_RINV(673); break; + case 122: SCRAMBLED_RINV(677); break; + case 123: SCRAMBLED_RINV(683); break; + case 124: SCRAMBLED_RINV(691); break; + case 125: SCRAMBLED_RINV(701); break; + case 126: SCRAMBLED_RINV(709); break; + case 127: SCRAMBLED_RINV(719); break; + case 128: SCRAMBLED_RINV(727); break; + case 129: SCRAMBLED_RINV(733); break; + case 130: SCRAMBLED_RINV(739); break; + case 131: SCRAMBLED_RINV(743); break; + case 132: SCRAMBLED_RINV(751); break; + case 133: SCRAMBLED_RINV(757); break; + case 134: SCRAMBLED_RINV(761); break; + case 135: SCRAMBLED_RINV(769); break; + case 136: SCRAMBLED_RINV(773); break; + case 137: SCRAMBLED_RINV(787); break; + case 138: SCRAMBLED_RINV(797); break; + case 139: SCRAMBLED_RINV(809); break; + case 140: SCRAMBLED_RINV(811); break; + case 141: SCRAMBLED_RINV(821); break; + case 142: SCRAMBLED_RINV(823); break; + case 143: SCRAMBLED_RINV(827); break; + case 144: SCRAMBLED_RINV(829); break; + case 145: SCRAMBLED_RINV(839); break; + case 146: SCRAMBLED_RINV(853); break; + case 147: SCRAMBLED_RINV(857); break; + case 148: SCRAMBLED_RINV(859); break; + case 149: SCRAMBLED_RINV(863); break; + case 150: SCRAMBLED_RINV(877); break; + case 151: SCRAMBLED_RINV(881); break; + case 152: SCRAMBLED_RINV(883); break; + case 153: SCRAMBLED_RINV(887); break; + case 154: SCRAMBLED_RINV(907); break; + case 155: SCRAMBLED_RINV(911); break; + case 156: SCRAMBLED_RINV(919); break; + case 157: SCRAMBLED_RINV(929); break; + case 158: SCRAMBLED_RINV(937); break; + case 159: SCRAMBLED_RINV(941); break; + case 160: SCRAMBLED_RINV(947); break; + case 161: SCRAMBLED_RINV(953); break; + case 162: SCRAMBLED_RINV(967); break; + case 163: SCRAMBLED_RINV(971); break; + case 164: SCRAMBLED_RINV(977); break; + case 165: SCRAMBLED_RINV(983); break; + case 166: SCRAMBLED_RINV(991); break; + case 167: SCRAMBLED_RINV(997); break; + case 168: SCRAMBLED_RINV(1009); break; + case 169: SCRAMBLED_RINV(1013); break; + case 170: SCRAMBLED_RINV(1019); break; + case 171: SCRAMBLED_RINV(1021); break; + case 172: SCRAMBLED_RINV(1031); break; + case 173: SCRAMBLED_RINV(1033); break; + case 174: SCRAMBLED_RINV(1039); break; + case 175: SCRAMBLED_RINV(1049); break; + case 176: SCRAMBLED_RINV(1051); break; + case 177: SCRAMBLED_RINV(1061); break; + case 178: SCRAMBLED_RINV(1063); break; + case 179: SCRAMBLED_RINV(1069); break; + case 180: SCRAMBLED_RINV(1087); break; + case 181: SCRAMBLED_RINV(1091); break; + case 182: SCRAMBLED_RINV(1093); break; + case 183: SCRAMBLED_RINV(1097); break; + case 184: SCRAMBLED_RINV(1103); break; + case 185: SCRAMBLED_RINV(1109); break; + case 186: SCRAMBLED_RINV(1117); break; + case 187: SCRAMBLED_RINV(1123); break; + case 188: SCRAMBLED_RINV(1129); break; + case 189: SCRAMBLED_RINV(1151); break; + case 190: SCRAMBLED_RINV(1153); break; + case 191: SCRAMBLED_RINV(1163); break; + case 192: SCRAMBLED_RINV(1171); break; + case 193: SCRAMBLED_RINV(1181); break; + case 194: SCRAMBLED_RINV(1187); break; + case 195: SCRAMBLED_RINV(1193); break; + case 196: SCRAMBLED_RINV(1201); break; + case 197: SCRAMBLED_RINV(1213); break; + case 198: SCRAMBLED_RINV(1217); break; + case 199: SCRAMBLED_RINV(1223); break; + case 200: SCRAMBLED_RINV(1229); break; + case 201: SCRAMBLED_RINV(1231); break; + case 202: SCRAMBLED_RINV(1237); break; + case 203: SCRAMBLED_RINV(1249); break; + case 204: SCRAMBLED_RINV(1259); break; + case 205: SCRAMBLED_RINV(1277); break; + case 206: SCRAMBLED_RINV(1279); break; + case 207: SCRAMBLED_RINV(1283); break; + case 208: SCRAMBLED_RINV(1289); break; + case 209: SCRAMBLED_RINV(1291); break; + case 210: SCRAMBLED_RINV(1297); break; + case 211: SCRAMBLED_RINV(1301); break; + case 212: SCRAMBLED_RINV(1303); break; + case 213: SCRAMBLED_RINV(1307); break; + case 214: SCRAMBLED_RINV(1319); break; + case 215: SCRAMBLED_RINV(1321); break; + case 216: SCRAMBLED_RINV(1327); break; + case 217: SCRAMBLED_RINV(1361); break; + case 218: SCRAMBLED_RINV(1367); break; + case 219: SCRAMBLED_RINV(1373); break; + case 220: SCRAMBLED_RINV(1381); break; + case 221: SCRAMBLED_RINV(1399); break; + case 222: SCRAMBLED_RINV(1409); break; + case 223: SCRAMBLED_RINV(1423); break; + case 224: SCRAMBLED_RINV(1427); break; + case 225: SCRAMBLED_RINV(1429); break; + case 226: SCRAMBLED_RINV(1433); break; + case 227: SCRAMBLED_RINV(1439); break; + case 228: SCRAMBLED_RINV(1447); break; + case 229: SCRAMBLED_RINV(1451); break; + case 230: SCRAMBLED_RINV(1453); break; + case 231: SCRAMBLED_RINV(1459); break; + case 232: SCRAMBLED_RINV(1471); break; + case 233: SCRAMBLED_RINV(1481); break; + case 234: SCRAMBLED_RINV(1483); break; + case 235: SCRAMBLED_RINV(1487); break; + case 236: SCRAMBLED_RINV(1489); break; + case 237: SCRAMBLED_RINV(1493); break; + case 238: SCRAMBLED_RINV(1499); break; + case 239: SCRAMBLED_RINV(1511); break; + case 240: SCRAMBLED_RINV(1523); break; + case 241: SCRAMBLED_RINV(1531); break; + case 242: SCRAMBLED_RINV(1543); break; + case 243: SCRAMBLED_RINV(1549); break; + case 244: SCRAMBLED_RINV(1553); break; + case 245: SCRAMBLED_RINV(1559); break; + case 246: SCRAMBLED_RINV(1567); break; + case 247: SCRAMBLED_RINV(1571); break; + case 248: SCRAMBLED_RINV(1579); break; + case 249: SCRAMBLED_RINV(1583); break; + case 250: SCRAMBLED_RINV(1597); break; + case 251: SCRAMBLED_RINV(1601); break; + case 252: SCRAMBLED_RINV(1607); break; + case 253: SCRAMBLED_RINV(1609); break; + case 254: SCRAMBLED_RINV(1613); break; + case 255: SCRAMBLED_RINV(1619); break; + case 256: SCRAMBLED_RINV(1621); break; + case 257: SCRAMBLED_RINV(1627); break; + case 258: SCRAMBLED_RINV(1637); break; + case 259: SCRAMBLED_RINV(1657); break; + case 260: SCRAMBLED_RINV(1663); break; + case 261: SCRAMBLED_RINV(1667); break; + case 262: SCRAMBLED_RINV(1669); break; + case 263: SCRAMBLED_RINV(1693); break; + case 264: SCRAMBLED_RINV(1697); break; + case 265: SCRAMBLED_RINV(1699); break; + case 266: SCRAMBLED_RINV(1709); break; + case 267: SCRAMBLED_RINV(1721); break; + case 268: SCRAMBLED_RINV(1723); break; + case 269: SCRAMBLED_RINV(1733); break; + case 270: SCRAMBLED_RINV(1741); break; + case 271: SCRAMBLED_RINV(1747); break; + case 272: SCRAMBLED_RINV(1753); break; + case 273: SCRAMBLED_RINV(1759); break; + case 274: SCRAMBLED_RINV(1777); break; + case 275: SCRAMBLED_RINV(1783); break; + case 276: SCRAMBLED_RINV(1787); break; + case 277: SCRAMBLED_RINV(1789); break; + case 278: SCRAMBLED_RINV(1801); break; + case 279: SCRAMBLED_RINV(1811); break; + case 280: SCRAMBLED_RINV(1823); break; + case 281: SCRAMBLED_RINV(1831); break; + case 282: SCRAMBLED_RINV(1847); break; + case 283: SCRAMBLED_RINV(1861); break; + case 284: SCRAMBLED_RINV(1867); break; + case 285: SCRAMBLED_RINV(1871); break; + case 286: SCRAMBLED_RINV(1873); break; + case 287: SCRAMBLED_RINV(1877); break; + case 288: SCRAMBLED_RINV(1879); break; + case 289: SCRAMBLED_RINV(1889); break; + case 290: SCRAMBLED_RINV(1901); break; + case 291: SCRAMBLED_RINV(1907); break; + case 292: SCRAMBLED_RINV(1913); break; + case 293: SCRAMBLED_RINV(1931); break; + case 294: SCRAMBLED_RINV(1933); break; + case 295: SCRAMBLED_RINV(1949); break; + case 296: SCRAMBLED_RINV(1951); break; + case 297: SCRAMBLED_RINV(1973); break; + case 298: SCRAMBLED_RINV(1979); break; + case 299: SCRAMBLED_RINV(1987); break; + case 300: SCRAMBLED_RINV(1993); break; + case 301: SCRAMBLED_RINV(1997); break; + case 302: SCRAMBLED_RINV(1999); break; + case 303: SCRAMBLED_RINV(2003); break; + case 304: SCRAMBLED_RINV(2011); break; + case 305: SCRAMBLED_RINV(2017); break; + case 306: SCRAMBLED_RINV(2027); break; + case 307: SCRAMBLED_RINV(2029); break; + case 308: SCRAMBLED_RINV(2039); break; + case 309: SCRAMBLED_RINV(2053); break; + case 310: SCRAMBLED_RINV(2063); break; + case 311: SCRAMBLED_RINV(2069); break; + case 312: SCRAMBLED_RINV(2081); break; + case 313: SCRAMBLED_RINV(2083); break; + case 314: SCRAMBLED_RINV(2087); break; + case 315: SCRAMBLED_RINV(2089); break; + case 316: SCRAMBLED_RINV(2099); break; + case 317: SCRAMBLED_RINV(2111); break; + case 318: SCRAMBLED_RINV(2113); break; + case 319: SCRAMBLED_RINV(2129); break; + case 320: SCRAMBLED_RINV(2131); break; + case 321: SCRAMBLED_RINV(2137); break; + case 322: SCRAMBLED_RINV(2141); break; + case 323: SCRAMBLED_RINV(2143); break; + case 324: SCRAMBLED_RINV(2153); break; + case 325: SCRAMBLED_RINV(2161); break; + case 326: SCRAMBLED_RINV(2179); break; + case 327: SCRAMBLED_RINV(2203); break; + case 328: SCRAMBLED_RINV(2207); break; + case 329: SCRAMBLED_RINV(2213); break; + case 330: SCRAMBLED_RINV(2221); break; + case 331: SCRAMBLED_RINV(2237); break; + case 332: SCRAMBLED_RINV(2239); break; + case 333: SCRAMBLED_RINV(2243); break; + case 334: SCRAMBLED_RINV(2251); break; + case 335: SCRAMBLED_RINV(2267); break; + case 336: SCRAMBLED_RINV(2269); break; + case 337: SCRAMBLED_RINV(2273); break; + case 338: SCRAMBLED_RINV(2281); break; + case 339: SCRAMBLED_RINV(2287); break; + case 340: SCRAMBLED_RINV(2293); break; + case 341: SCRAMBLED_RINV(2297); break; + case 342: SCRAMBLED_RINV(2309); break; + case 343: SCRAMBLED_RINV(2311); break; + case 344: SCRAMBLED_RINV(2333); break; + case 345: SCRAMBLED_RINV(2339); break; + case 346: SCRAMBLED_RINV(2341); break; + case 347: SCRAMBLED_RINV(2347); break; + case 348: SCRAMBLED_RINV(2351); break; + case 349: SCRAMBLED_RINV(2357); break; + case 350: SCRAMBLED_RINV(2371); break; + case 351: SCRAMBLED_RINV(2377); break; + case 352: SCRAMBLED_RINV(2381); break; + case 353: SCRAMBLED_RINV(2383); break; + case 354: SCRAMBLED_RINV(2389); break; + case 355: SCRAMBLED_RINV(2393); break; + case 356: SCRAMBLED_RINV(2399); break; + case 357: SCRAMBLED_RINV(2411); break; + case 358: SCRAMBLED_RINV(2417); break; + case 359: SCRAMBLED_RINV(2423); break; + case 360: SCRAMBLED_RINV(2437); break; + case 361: SCRAMBLED_RINV(2441); break; + case 362: SCRAMBLED_RINV(2447); break; + case 363: SCRAMBLED_RINV(2459); break; + case 364: SCRAMBLED_RINV(2467); break; + case 365: SCRAMBLED_RINV(2473); break; + case 366: SCRAMBLED_RINV(2477); break; + case 367: SCRAMBLED_RINV(2503); break; + case 368: SCRAMBLED_RINV(2521); break; + case 369: SCRAMBLED_RINV(2531); break; + case 370: SCRAMBLED_RINV(2539); break; + case 371: SCRAMBLED_RINV(2543); break; + case 372: SCRAMBLED_RINV(2549); break; + case 373: SCRAMBLED_RINV(2551); break; + case 374: SCRAMBLED_RINV(2557); break; + case 375: SCRAMBLED_RINV(2579); break; + case 376: SCRAMBLED_RINV(2591); break; + case 377: SCRAMBLED_RINV(2593); break; + case 378: SCRAMBLED_RINV(2609); break; + case 379: SCRAMBLED_RINV(2617); break; + case 380: SCRAMBLED_RINV(2621); break; + case 381: SCRAMBLED_RINV(2633); break; + case 382: SCRAMBLED_RINV(2647); break; + case 383: SCRAMBLED_RINV(2657); break; + case 384: SCRAMBLED_RINV(2659); break; + case 385: SCRAMBLED_RINV(2663); break; + case 386: SCRAMBLED_RINV(2671); break; + case 387: SCRAMBLED_RINV(2677); break; + case 388: SCRAMBLED_RINV(2683); break; + case 389: SCRAMBLED_RINV(2687); break; + case 390: SCRAMBLED_RINV(2689); break; + case 391: SCRAMBLED_RINV(2693); break; + case 392: SCRAMBLED_RINV(2699); break; + case 393: SCRAMBLED_RINV(2707); break; + case 394: SCRAMBLED_RINV(2711); break; + case 395: SCRAMBLED_RINV(2713); break; + case 396: SCRAMBLED_RINV(2719); break; + case 397: SCRAMBLED_RINV(2729); break; + case 398: SCRAMBLED_RINV(2731); break; + case 399: SCRAMBLED_RINV(2741); break; + case 400: SCRAMBLED_RINV(2749); break; + case 401: SCRAMBLED_RINV(2753); break; + case 402: SCRAMBLED_RINV(2767); break; + case 403: SCRAMBLED_RINV(2777); break; + case 404: SCRAMBLED_RINV(2789); break; + case 405: SCRAMBLED_RINV(2791); break; + case 406: SCRAMBLED_RINV(2797); break; + case 407: SCRAMBLED_RINV(2801); break; + case 408: SCRAMBLED_RINV(2803); break; + case 409: SCRAMBLED_RINV(2819); break; + case 410: SCRAMBLED_RINV(2833); break; + case 411: SCRAMBLED_RINV(2837); break; + case 412: SCRAMBLED_RINV(2843); break; + case 413: SCRAMBLED_RINV(2851); break; + case 414: SCRAMBLED_RINV(2857); break; + case 415: SCRAMBLED_RINV(2861); break; + case 416: SCRAMBLED_RINV(2879); break; + case 417: SCRAMBLED_RINV(2887); break; + case 418: SCRAMBLED_RINV(2897); break; + case 419: SCRAMBLED_RINV(2903); break; + case 420: SCRAMBLED_RINV(2909); break; + case 421: SCRAMBLED_RINV(2917); break; + case 422: SCRAMBLED_RINV(2927); break; + case 423: SCRAMBLED_RINV(2939); break; + case 424: SCRAMBLED_RINV(2953); break; + case 425: SCRAMBLED_RINV(2957); break; + case 426: SCRAMBLED_RINV(2963); break; + case 427: SCRAMBLED_RINV(2969); break; + case 428: SCRAMBLED_RINV(2971); break; + case 429: SCRAMBLED_RINV(2999); break; + case 430: SCRAMBLED_RINV(3001); break; + case 431: SCRAMBLED_RINV(3011); break; + case 432: SCRAMBLED_RINV(3019); break; + case 433: SCRAMBLED_RINV(3023); break; + case 434: SCRAMBLED_RINV(3037); break; + case 435: SCRAMBLED_RINV(3041); break; + case 436: SCRAMBLED_RINV(3049); break; + case 437: SCRAMBLED_RINV(3061); break; + case 438: SCRAMBLED_RINV(3067); break; + case 439: SCRAMBLED_RINV(3079); break; + case 440: SCRAMBLED_RINV(3083); break; + case 441: SCRAMBLED_RINV(3089); break; + case 442: SCRAMBLED_RINV(3109); break; + case 443: SCRAMBLED_RINV(3119); break; + case 444: SCRAMBLED_RINV(3121); break; + case 445: SCRAMBLED_RINV(3137); break; + case 446: SCRAMBLED_RINV(3163); break; + case 447: SCRAMBLED_RINV(3167); break; + case 448: SCRAMBLED_RINV(3169); break; + case 449: SCRAMBLED_RINV(3181); break; + case 450: SCRAMBLED_RINV(3187); break; + case 451: SCRAMBLED_RINV(3191); break; + case 452: SCRAMBLED_RINV(3203); break; + case 453: SCRAMBLED_RINV(3209); break; + case 454: SCRAMBLED_RINV(3217); break; + case 455: SCRAMBLED_RINV(3221); break; + case 456: SCRAMBLED_RINV(3229); break; + case 457: SCRAMBLED_RINV(3251); break; + case 458: SCRAMBLED_RINV(3253); break; + case 459: SCRAMBLED_RINV(3257); break; + case 460: SCRAMBLED_RINV(3259); break; + case 461: SCRAMBLED_RINV(3271); break; + case 462: SCRAMBLED_RINV(3299); break; + case 463: SCRAMBLED_RINV(3301); break; + case 464: SCRAMBLED_RINV(3307); break; + case 465: SCRAMBLED_RINV(3313); break; + case 466: SCRAMBLED_RINV(3319); break; + case 467: SCRAMBLED_RINV(3323); break; + case 468: SCRAMBLED_RINV(3329); break; + case 469: SCRAMBLED_RINV(3331); break; + case 470: SCRAMBLED_RINV(3343); break; + case 471: SCRAMBLED_RINV(3347); break; + case 472: SCRAMBLED_RINV(3359); break; + case 473: SCRAMBLED_RINV(3361); break; + case 474: SCRAMBLED_RINV(3371); break; + case 475: SCRAMBLED_RINV(3373); break; + case 476: SCRAMBLED_RINV(3389); break; + case 477: SCRAMBLED_RINV(3391); break; + case 478: SCRAMBLED_RINV(3407); break; + case 479: SCRAMBLED_RINV(3413); break; + case 480: SCRAMBLED_RINV(3433); break; + case 481: SCRAMBLED_RINV(3449); break; + case 482: SCRAMBLED_RINV(3457); break; + case 483: SCRAMBLED_RINV(3461); break; + case 484: SCRAMBLED_RINV(3463); break; + case 485: SCRAMBLED_RINV(3467); break; + case 486: SCRAMBLED_RINV(3469); break; + case 487: SCRAMBLED_RINV(3491); break; + case 488: SCRAMBLED_RINV(3499); break; + case 489: SCRAMBLED_RINV(3511); break; + case 490: SCRAMBLED_RINV(3517); break; + case 491: SCRAMBLED_RINV(3527); break; + case 492: SCRAMBLED_RINV(3529); break; + case 493: SCRAMBLED_RINV(3533); break; + case 494: SCRAMBLED_RINV(3539); break; + case 495: SCRAMBLED_RINV(3541); break; + case 496: SCRAMBLED_RINV(3547); break; + case 497: SCRAMBLED_RINV(3557); break; + case 498: SCRAMBLED_RINV(3559); break; + case 499: SCRAMBLED_RINV(3571); break; + case 500: SCRAMBLED_RINV(3581); break; + case 501: SCRAMBLED_RINV(3583); break; + case 502: SCRAMBLED_RINV(3593); break; + case 503: SCRAMBLED_RINV(3607); break; + case 504: SCRAMBLED_RINV(3613); break; + case 505: SCRAMBLED_RINV(3617); break; + case 506: SCRAMBLED_RINV(3623); break; + case 507: SCRAMBLED_RINV(3631); break; + case 508: SCRAMBLED_RINV(3637); break; + case 509: SCRAMBLED_RINV(3643); break; + case 510: SCRAMBLED_RINV(3659); break; + case 511: SCRAMBLED_RINV(3671); break; + case 512: SCRAMBLED_RINV(3673); break; + case 513: SCRAMBLED_RINV(3677); break; + case 514: SCRAMBLED_RINV(3691); break; + case 515: SCRAMBLED_RINV(3697); break; + case 516: SCRAMBLED_RINV(3701); break; + case 517: SCRAMBLED_RINV(3709); break; + case 518: SCRAMBLED_RINV(3719); break; + case 519: SCRAMBLED_RINV(3727); break; + case 520: SCRAMBLED_RINV(3733); break; + case 521: SCRAMBLED_RINV(3739); break; + case 522: SCRAMBLED_RINV(3761); break; + case 523: SCRAMBLED_RINV(3767); break; + case 524: SCRAMBLED_RINV(3769); break; + case 525: SCRAMBLED_RINV(3779); break; + case 526: SCRAMBLED_RINV(3793); break; + case 527: SCRAMBLED_RINV(3797); break; + case 528: SCRAMBLED_RINV(3803); break; + case 529: SCRAMBLED_RINV(3821); break; + case 530: SCRAMBLED_RINV(3823); break; + case 531: SCRAMBLED_RINV(3833); break; + case 532: SCRAMBLED_RINV(3847); break; + case 533: SCRAMBLED_RINV(3851); break; + case 534: SCRAMBLED_RINV(3853); break; + case 535: SCRAMBLED_RINV(3863); break; + case 536: SCRAMBLED_RINV(3877); break; + case 537: SCRAMBLED_RINV(3881); break; + case 538: SCRAMBLED_RINV(3889); break; + case 539: SCRAMBLED_RINV(3907); break; + case 540: SCRAMBLED_RINV(3911); break; + case 541: SCRAMBLED_RINV(3917); break; + case 542: SCRAMBLED_RINV(3919); break; + case 543: SCRAMBLED_RINV(3923); break; + case 544: SCRAMBLED_RINV(3929); break; + case 545: SCRAMBLED_RINV(3931); break; + case 546: SCRAMBLED_RINV(3943); break; + case 547: SCRAMBLED_RINV(3947); break; + case 548: SCRAMBLED_RINV(3967); break; + case 549: SCRAMBLED_RINV(3989); break; + case 550: SCRAMBLED_RINV(4001); break; + case 551: SCRAMBLED_RINV(4003); break; + case 552: SCRAMBLED_RINV(4007); break; + case 553: SCRAMBLED_RINV(4013); break; + case 554: SCRAMBLED_RINV(4019); break; + case 555: SCRAMBLED_RINV(4021); break; + case 556: SCRAMBLED_RINV(4027); break; + case 557: SCRAMBLED_RINV(4049); break; + case 558: SCRAMBLED_RINV(4051); break; + case 559: SCRAMBLED_RINV(4057); break; + case 560: SCRAMBLED_RINV(4073); break; + case 561: SCRAMBLED_RINV(4079); break; + case 562: SCRAMBLED_RINV(4091); break; + case 563: SCRAMBLED_RINV(4093); break; + case 564: SCRAMBLED_RINV(4099); break; + case 565: SCRAMBLED_RINV(4111); break; + case 566: SCRAMBLED_RINV(4127); break; + case 567: SCRAMBLED_RINV(4129); break; + case 568: SCRAMBLED_RINV(4133); break; + case 569: SCRAMBLED_RINV(4139); break; + case 570: SCRAMBLED_RINV(4153); break; + case 571: SCRAMBLED_RINV(4157); break; + case 572: SCRAMBLED_RINV(4159); break; + case 573: SCRAMBLED_RINV(4177); break; + case 574: SCRAMBLED_RINV(4201); break; + case 575: SCRAMBLED_RINV(4211); break; + case 576: SCRAMBLED_RINV(4217); break; + case 577: SCRAMBLED_RINV(4219); break; + case 578: SCRAMBLED_RINV(4229); break; + case 579: SCRAMBLED_RINV(4231); break; + case 580: SCRAMBLED_RINV(4241); break; + case 581: SCRAMBLED_RINV(4243); break; + case 582: SCRAMBLED_RINV(4253); break; + case 583: SCRAMBLED_RINV(4259); break; + case 584: SCRAMBLED_RINV(4261); break; + case 585: SCRAMBLED_RINV(4271); break; + case 586: SCRAMBLED_RINV(4273); break; + case 587: SCRAMBLED_RINV(4283); break; + case 588: SCRAMBLED_RINV(4289); break; + case 589: SCRAMBLED_RINV(4297); break; + case 590: SCRAMBLED_RINV(4327); break; + case 591: SCRAMBLED_RINV(4337); break; + case 592: SCRAMBLED_RINV(4339); break; + case 593: SCRAMBLED_RINV(4349); break; + case 594: SCRAMBLED_RINV(4357); break; + case 595: SCRAMBLED_RINV(4363); break; + case 596: SCRAMBLED_RINV(4373); break; + case 597: SCRAMBLED_RINV(4391); break; + case 598: SCRAMBLED_RINV(4397); break; + case 599: SCRAMBLED_RINV(4409); break; + case 600: SCRAMBLED_RINV(4421); break; + case 601: SCRAMBLED_RINV(4423); break; + case 602: SCRAMBLED_RINV(4441); break; + case 603: SCRAMBLED_RINV(4447); break; + case 604: SCRAMBLED_RINV(4451); break; + case 605: SCRAMBLED_RINV(4457); break; + case 606: SCRAMBLED_RINV(4463); break; + case 607: SCRAMBLED_RINV(4481); break; + case 608: SCRAMBLED_RINV(4483); break; + case 609: SCRAMBLED_RINV(4493); break; + case 610: SCRAMBLED_RINV(4507); break; + case 611: SCRAMBLED_RINV(4513); break; + case 612: SCRAMBLED_RINV(4517); break; + case 613: SCRAMBLED_RINV(4519); break; + case 614: SCRAMBLED_RINV(4523); break; + case 615: SCRAMBLED_RINV(4547); break; + case 616: SCRAMBLED_RINV(4549); break; + case 617: SCRAMBLED_RINV(4561); break; + case 618: SCRAMBLED_RINV(4567); break; + case 619: SCRAMBLED_RINV(4583); break; + case 620: SCRAMBLED_RINV(4591); break; + case 621: SCRAMBLED_RINV(4597); break; + case 622: SCRAMBLED_RINV(4603); break; + case 623: SCRAMBLED_RINV(4621); break; + case 624: SCRAMBLED_RINV(4637); break; + case 625: SCRAMBLED_RINV(4639); break; + case 626: SCRAMBLED_RINV(4643); break; + case 627: SCRAMBLED_RINV(4649); break; + case 628: SCRAMBLED_RINV(4651); break; + case 629: SCRAMBLED_RINV(4657); break; + case 630: SCRAMBLED_RINV(4663); break; + case 631: SCRAMBLED_RINV(4673); break; + case 632: SCRAMBLED_RINV(4679); break; + case 633: SCRAMBLED_RINV(4691); break; + case 634: SCRAMBLED_RINV(4703); break; + case 635: SCRAMBLED_RINV(4721); break; + case 636: SCRAMBLED_RINV(4723); break; + case 637: SCRAMBLED_RINV(4729); break; + case 638: SCRAMBLED_RINV(4733); break; + case 639: SCRAMBLED_RINV(4751); break; + case 640: SCRAMBLED_RINV(4759); break; + case 641: SCRAMBLED_RINV(4783); break; + case 642: SCRAMBLED_RINV(4787); break; + case 643: SCRAMBLED_RINV(4789); break; + case 644: SCRAMBLED_RINV(4793); break; + case 645: SCRAMBLED_RINV(4799); break; + case 646: SCRAMBLED_RINV(4801); break; + case 647: SCRAMBLED_RINV(4813); break; + case 648: SCRAMBLED_RINV(4817); break; + case 649: SCRAMBLED_RINV(4831); break; + case 650: SCRAMBLED_RINV(4861); break; + case 651: SCRAMBLED_RINV(4871); break; + case 652: SCRAMBLED_RINV(4877); break; + case 653: SCRAMBLED_RINV(4889); break; + case 654: SCRAMBLED_RINV(4903); break; + case 655: SCRAMBLED_RINV(4909); break; + case 656: SCRAMBLED_RINV(4919); break; + case 657: SCRAMBLED_RINV(4931); break; + case 658: SCRAMBLED_RINV(4933); break; + case 659: SCRAMBLED_RINV(4937); break; + case 660: SCRAMBLED_RINV(4943); break; + case 661: SCRAMBLED_RINV(4951); break; + case 662: SCRAMBLED_RINV(4957); break; + case 663: SCRAMBLED_RINV(4967); break; + case 664: SCRAMBLED_RINV(4969); break; + case 665: SCRAMBLED_RINV(4973); break; + case 666: SCRAMBLED_RINV(4987); break; + case 667: SCRAMBLED_RINV(4993); break; + case 668: SCRAMBLED_RINV(4999); break; + case 669: SCRAMBLED_RINV(5003); break; + case 670: SCRAMBLED_RINV(5009); break; + case 671: SCRAMBLED_RINV(5011); break; + case 672: SCRAMBLED_RINV(5021); break; + case 673: SCRAMBLED_RINV(5023); break; + case 674: SCRAMBLED_RINV(5039); break; + case 675: SCRAMBLED_RINV(5051); break; + case 676: SCRAMBLED_RINV(5059); break; + case 677: SCRAMBLED_RINV(5077); break; + case 678: SCRAMBLED_RINV(5081); break; + case 679: SCRAMBLED_RINV(5087); break; + case 680: SCRAMBLED_RINV(5099); break; + case 681: SCRAMBLED_RINV(5101); break; + case 682: SCRAMBLED_RINV(5107); break; + case 683: SCRAMBLED_RINV(5113); break; + case 684: SCRAMBLED_RINV(5119); break; + case 685: SCRAMBLED_RINV(5147); break; + case 686: SCRAMBLED_RINV(5153); break; + case 687: SCRAMBLED_RINV(5167); break; + case 688: SCRAMBLED_RINV(5171); break; + case 689: SCRAMBLED_RINV(5179); break; + case 690: SCRAMBLED_RINV(5189); break; + case 691: SCRAMBLED_RINV(5197); break; + case 692: SCRAMBLED_RINV(5209); break; + case 693: SCRAMBLED_RINV(5227); break; + case 694: SCRAMBLED_RINV(5231); break; + case 695: SCRAMBLED_RINV(5233); break; + case 696: SCRAMBLED_RINV(5237); break; + case 697: SCRAMBLED_RINV(5261); break; + case 698: SCRAMBLED_RINV(5273); break; + case 699: SCRAMBLED_RINV(5279); break; + case 700: SCRAMBLED_RINV(5281); break; + case 701: SCRAMBLED_RINV(5297); break; + case 702: SCRAMBLED_RINV(5303); break; + case 703: SCRAMBLED_RINV(5309); break; + case 704: SCRAMBLED_RINV(5323); break; + case 705: SCRAMBLED_RINV(5333); break; + case 706: SCRAMBLED_RINV(5347); break; + case 707: SCRAMBLED_RINV(5351); break; + case 708: SCRAMBLED_RINV(5381); break; + case 709: SCRAMBLED_RINV(5387); break; + case 710: SCRAMBLED_RINV(5393); break; + case 711: SCRAMBLED_RINV(5399); break; + case 712: SCRAMBLED_RINV(5407); break; + case 713: SCRAMBLED_RINV(5413); break; + case 714: SCRAMBLED_RINV(5417); break; + case 715: SCRAMBLED_RINV(5419); break; + case 716: SCRAMBLED_RINV(5431); break; + case 717: SCRAMBLED_RINV(5437); break; + case 718: SCRAMBLED_RINV(5441); break; + case 719: SCRAMBLED_RINV(5443); break; + case 720: SCRAMBLED_RINV(5449); break; + case 721: SCRAMBLED_RINV(5471); break; + case 722: SCRAMBLED_RINV(5477); break; + case 723: SCRAMBLED_RINV(5479); break; + case 724: SCRAMBLED_RINV(5483); break; + case 725: SCRAMBLED_RINV(5501); break; + case 726: SCRAMBLED_RINV(5503); break; + case 727: SCRAMBLED_RINV(5507); break; + case 728: SCRAMBLED_RINV(5519); break; + case 729: SCRAMBLED_RINV(5521); break; + case 730: SCRAMBLED_RINV(5527); break; + case 731: SCRAMBLED_RINV(5531); break; + case 732: SCRAMBLED_RINV(5557); break; + case 733: SCRAMBLED_RINV(5563); break; + case 734: SCRAMBLED_RINV(5569); break; + case 735: SCRAMBLED_RINV(5573); break; + case 736: SCRAMBLED_RINV(5581); break; + case 737: SCRAMBLED_RINV(5591); break; + case 738: SCRAMBLED_RINV(5623); break; + case 739: SCRAMBLED_RINV(5639); break; + case 740: SCRAMBLED_RINV(5641); break; + case 741: SCRAMBLED_RINV(5647); break; + case 742: SCRAMBLED_RINV(5651); break; + case 743: SCRAMBLED_RINV(5653); break; + case 744: SCRAMBLED_RINV(5657); break; + case 745: SCRAMBLED_RINV(5659); break; + case 746: SCRAMBLED_RINV(5669); break; + case 747: SCRAMBLED_RINV(5683); break; + case 748: SCRAMBLED_RINV(5689); break; + case 749: SCRAMBLED_RINV(5693); break; + case 750: SCRAMBLED_RINV(5701); break; + case 751: SCRAMBLED_RINV(5711); break; + case 752: SCRAMBLED_RINV(5717); break; + case 753: SCRAMBLED_RINV(5737); break; + case 754: SCRAMBLED_RINV(5741); break; + case 755: SCRAMBLED_RINV(5743); break; + case 756: SCRAMBLED_RINV(5749); break; + case 757: SCRAMBLED_RINV(5779); break; + case 758: SCRAMBLED_RINV(5783); break; + case 759: SCRAMBLED_RINV(5791); break; + case 760: SCRAMBLED_RINV(5801); break; + case 761: SCRAMBLED_RINV(5807); break; + case 762: SCRAMBLED_RINV(5813); break; + case 763: SCRAMBLED_RINV(5821); break; + case 764: SCRAMBLED_RINV(5827); break; + case 765: SCRAMBLED_RINV(5839); break; + case 766: SCRAMBLED_RINV(5843); break; + case 767: SCRAMBLED_RINV(5849); break; + case 768: SCRAMBLED_RINV(5851); break; + case 769: SCRAMBLED_RINV(5857); break; + case 770: SCRAMBLED_RINV(5861); break; + case 771: SCRAMBLED_RINV(5867); break; + case 772: SCRAMBLED_RINV(5869); break; + case 773: SCRAMBLED_RINV(5879); break; + case 774: SCRAMBLED_RINV(5881); break; + case 775: SCRAMBLED_RINV(5897); break; + case 776: SCRAMBLED_RINV(5903); break; + case 777: SCRAMBLED_RINV(5923); break; + case 778: SCRAMBLED_RINV(5927); break; + case 779: SCRAMBLED_RINV(5939); break; + case 780: SCRAMBLED_RINV(5953); break; + case 781: SCRAMBLED_RINV(5981); break; + case 782: SCRAMBLED_RINV(5987); break; + case 783: SCRAMBLED_RINV(6007); break; + case 784: SCRAMBLED_RINV(6011); break; + case 785: SCRAMBLED_RINV(6029); break; + case 786: SCRAMBLED_RINV(6037); break; + case 787: SCRAMBLED_RINV(6043); break; + case 788: SCRAMBLED_RINV(6047); break; + case 789: SCRAMBLED_RINV(6053); break; + case 790: SCRAMBLED_RINV(6067); break; + case 791: SCRAMBLED_RINV(6073); break; + case 792: SCRAMBLED_RINV(6079); break; + case 793: SCRAMBLED_RINV(6089); break; + case 794: SCRAMBLED_RINV(6091); break; + case 795: SCRAMBLED_RINV(6101); break; + case 796: SCRAMBLED_RINV(6113); break; + case 797: SCRAMBLED_RINV(6121); break; + case 798: SCRAMBLED_RINV(6131); break; + case 799: SCRAMBLED_RINV(6133); break; + case 800: SCRAMBLED_RINV(6143); break; + case 801: SCRAMBLED_RINV(6151); break; + case 802: SCRAMBLED_RINV(6163); break; + case 803: SCRAMBLED_RINV(6173); break; + case 804: SCRAMBLED_RINV(6197); break; + case 805: SCRAMBLED_RINV(6199); break; + case 806: SCRAMBLED_RINV(6203); break; + case 807: SCRAMBLED_RINV(6211); break; + case 808: SCRAMBLED_RINV(6217); break; + case 809: SCRAMBLED_RINV(6221); break; + case 810: SCRAMBLED_RINV(6229); break; + case 811: SCRAMBLED_RINV(6247); break; + case 812: SCRAMBLED_RINV(6257); break; + case 813: SCRAMBLED_RINV(6263); break; + case 814: SCRAMBLED_RINV(6269); break; + case 815: SCRAMBLED_RINV(6271); break; + case 816: SCRAMBLED_RINV(6277); break; + case 817: SCRAMBLED_RINV(6287); break; + case 818: SCRAMBLED_RINV(6299); break; + case 819: SCRAMBLED_RINV(6301); break; + case 820: SCRAMBLED_RINV(6311); break; + case 821: SCRAMBLED_RINV(6317); break; + case 822: SCRAMBLED_RINV(6323); break; + case 823: SCRAMBLED_RINV(6329); break; + case 824: SCRAMBLED_RINV(6337); break; + case 825: SCRAMBLED_RINV(6343); break; + case 826: SCRAMBLED_RINV(6353); break; + case 827: SCRAMBLED_RINV(6359); break; + case 828: SCRAMBLED_RINV(6361); break; + case 829: SCRAMBLED_RINV(6367); break; + case 830: SCRAMBLED_RINV(6373); break; + case 831: SCRAMBLED_RINV(6379); break; + case 832: SCRAMBLED_RINV(6389); break; + case 833: SCRAMBLED_RINV(6397); break; + case 834: SCRAMBLED_RINV(6421); break; + case 835: SCRAMBLED_RINV(6427); break; + case 836: SCRAMBLED_RINV(6449); break; + case 837: SCRAMBLED_RINV(6451); break; + case 838: SCRAMBLED_RINV(6469); break; + case 839: SCRAMBLED_RINV(6473); break; + case 840: SCRAMBLED_RINV(6481); break; + case 841: SCRAMBLED_RINV(6491); break; + case 842: SCRAMBLED_RINV(6521); break; + case 843: SCRAMBLED_RINV(6529); break; + case 844: SCRAMBLED_RINV(6547); break; + case 845: SCRAMBLED_RINV(6551); break; + case 846: SCRAMBLED_RINV(6553); break; + case 847: SCRAMBLED_RINV(6563); break; + case 848: SCRAMBLED_RINV(6569); break; + case 849: SCRAMBLED_RINV(6571); break; + case 850: SCRAMBLED_RINV(6577); break; + case 851: SCRAMBLED_RINV(6581); break; + case 852: SCRAMBLED_RINV(6599); break; + case 853: SCRAMBLED_RINV(6607); break; + case 854: SCRAMBLED_RINV(6619); break; + case 855: SCRAMBLED_RINV(6637); break; + case 856: SCRAMBLED_RINV(6653); break; + case 857: SCRAMBLED_RINV(6659); break; + case 858: SCRAMBLED_RINV(6661); break; + case 859: SCRAMBLED_RINV(6673); break; + case 860: SCRAMBLED_RINV(6679); break; + case 861: SCRAMBLED_RINV(6689); break; + case 862: SCRAMBLED_RINV(6691); break; + case 863: SCRAMBLED_RINV(6701); break; + case 864: SCRAMBLED_RINV(6703); break; + case 865: SCRAMBLED_RINV(6709); break; + case 866: SCRAMBLED_RINV(6719); break; + case 867: SCRAMBLED_RINV(6733); break; + case 868: SCRAMBLED_RINV(6737); break; + case 869: SCRAMBLED_RINV(6761); break; + case 870: SCRAMBLED_RINV(6763); break; + case 871: SCRAMBLED_RINV(6779); break; + case 872: SCRAMBLED_RINV(6781); break; + case 873: SCRAMBLED_RINV(6791); break; + case 874: SCRAMBLED_RINV(6793); break; + case 875: SCRAMBLED_RINV(6803); break; + case 876: SCRAMBLED_RINV(6823); break; + case 877: SCRAMBLED_RINV(6827); break; + case 878: SCRAMBLED_RINV(6829); break; + case 879: SCRAMBLED_RINV(6833); break; + case 880: SCRAMBLED_RINV(6841); break; + case 881: SCRAMBLED_RINV(6857); break; + case 882: SCRAMBLED_RINV(6863); break; + case 883: SCRAMBLED_RINV(6869); break; + case 884: SCRAMBLED_RINV(6871); break; + case 885: SCRAMBLED_RINV(6883); break; + case 886: SCRAMBLED_RINV(6899); break; + case 887: SCRAMBLED_RINV(6907); break; + case 888: SCRAMBLED_RINV(6911); break; + case 889: SCRAMBLED_RINV(6917); break; + case 890: SCRAMBLED_RINV(6947); break; + case 891: SCRAMBLED_RINV(6949); break; + case 892: SCRAMBLED_RINV(6959); break; + case 893: SCRAMBLED_RINV(6961); break; + case 894: SCRAMBLED_RINV(6967); break; + case 895: SCRAMBLED_RINV(6971); break; + case 896: SCRAMBLED_RINV(6977); break; + case 897: SCRAMBLED_RINV(6983); break; + case 898: SCRAMBLED_RINV(6991); break; + case 899: SCRAMBLED_RINV(6997); break; + case 900: SCRAMBLED_RINV(7001); break; + case 901: SCRAMBLED_RINV(7013); break; + case 902: SCRAMBLED_RINV(7019); break; + case 903: SCRAMBLED_RINV(7027); break; + case 904: SCRAMBLED_RINV(7039); break; + case 905: SCRAMBLED_RINV(7043); break; + case 906: SCRAMBLED_RINV(7057); break; + case 907: SCRAMBLED_RINV(7069); break; + case 908: SCRAMBLED_RINV(7079); break; + case 909: SCRAMBLED_RINV(7103); break; + case 910: SCRAMBLED_RINV(7109); break; + case 911: SCRAMBLED_RINV(7121); break; + case 912: SCRAMBLED_RINV(7127); break; + case 913: SCRAMBLED_RINV(7129); break; + case 914: SCRAMBLED_RINV(7151); break; + case 915: SCRAMBLED_RINV(7159); break; + case 916: SCRAMBLED_RINV(7177); break; + case 917: SCRAMBLED_RINV(7187); break; + case 918: SCRAMBLED_RINV(7193); break; + case 919: SCRAMBLED_RINV(7207); break; + case 920: SCRAMBLED_RINV(7211); break; + case 921: SCRAMBLED_RINV(7213); break; + case 922: SCRAMBLED_RINV(7219); break; + case 923: SCRAMBLED_RINV(7229); break; + case 924: SCRAMBLED_RINV(7237); break; + case 925: SCRAMBLED_RINV(7243); break; + case 926: SCRAMBLED_RINV(7247); break; + case 927: SCRAMBLED_RINV(7253); break; + case 928: SCRAMBLED_RINV(7283); break; + case 929: SCRAMBLED_RINV(7297); break; + case 930: SCRAMBLED_RINV(7307); break; + case 931: SCRAMBLED_RINV(7309); break; + case 932: SCRAMBLED_RINV(7321); break; + case 933: SCRAMBLED_RINV(7331); break; + case 934: SCRAMBLED_RINV(7333); break; + case 935: SCRAMBLED_RINV(7349); break; + case 936: SCRAMBLED_RINV(7351); break; + case 937: SCRAMBLED_RINV(7369); break; + case 938: SCRAMBLED_RINV(7393); break; + case 939: SCRAMBLED_RINV(7411); break; + case 940: SCRAMBLED_RINV(7417); break; + case 941: SCRAMBLED_RINV(7433); break; + case 942: SCRAMBLED_RINV(7451); break; + case 943: SCRAMBLED_RINV(7457); break; + case 944: SCRAMBLED_RINV(7459); break; + case 945: SCRAMBLED_RINV(7477); break; + case 946: SCRAMBLED_RINV(7481); break; + case 947: SCRAMBLED_RINV(7487); break; + case 948: SCRAMBLED_RINV(7489); break; + case 949: SCRAMBLED_RINV(7499); break; + case 950: SCRAMBLED_RINV(7507); break; + case 951: SCRAMBLED_RINV(7517); break; + case 952: SCRAMBLED_RINV(7523); break; + case 953: SCRAMBLED_RINV(7529); break; + case 954: SCRAMBLED_RINV(7537); break; + case 955: SCRAMBLED_RINV(7541); break; + case 956: SCRAMBLED_RINV(7547); break; + case 957: SCRAMBLED_RINV(7549); break; + case 958: SCRAMBLED_RINV(7559); break; + case 959: SCRAMBLED_RINV(7561); break; + case 960: SCRAMBLED_RINV(7573); break; + case 961: SCRAMBLED_RINV(7577); break; + case 962: SCRAMBLED_RINV(7583); break; + case 963: SCRAMBLED_RINV(7589); break; + case 964: SCRAMBLED_RINV(7591); break; + case 965: SCRAMBLED_RINV(7603); break; + case 966: SCRAMBLED_RINV(7607); break; + case 967: SCRAMBLED_RINV(7621); break; + case 968: SCRAMBLED_RINV(7639); break; + case 969: SCRAMBLED_RINV(7643); break; + case 970: SCRAMBLED_RINV(7649); break; + case 971: SCRAMBLED_RINV(7669); break; + case 972: SCRAMBLED_RINV(7673); break; + case 973: SCRAMBLED_RINV(7681); break; + case 974: SCRAMBLED_RINV(7687); break; + case 975: SCRAMBLED_RINV(7691); break; + case 976: SCRAMBLED_RINV(7699); break; + case 977: SCRAMBLED_RINV(7703); break; + case 978: SCRAMBLED_RINV(7717); break; + case 979: SCRAMBLED_RINV(7723); break; + case 980: SCRAMBLED_RINV(7727); break; + case 981: SCRAMBLED_RINV(7741); break; + case 982: SCRAMBLED_RINV(7753); break; + case 983: SCRAMBLED_RINV(7757); break; + case 984: SCRAMBLED_RINV(7759); break; + case 985: SCRAMBLED_RINV(7789); break; + case 986: SCRAMBLED_RINV(7793); break; + case 987: SCRAMBLED_RINV(7817); break; + case 988: SCRAMBLED_RINV(7823); break; + case 989: SCRAMBLED_RINV(7829); break; + case 990: SCRAMBLED_RINV(7841); break; + case 991: SCRAMBLED_RINV(7853); break; + case 992: SCRAMBLED_RINV(7867); break; + case 993: SCRAMBLED_RINV(7873); break; + case 994: SCRAMBLED_RINV(7877); break; + case 995: SCRAMBLED_RINV(7879); break; + case 996: SCRAMBLED_RINV(7883); break; + case 997: SCRAMBLED_RINV(7901); break; + case 998: SCRAMBLED_RINV(7907); break; + case 999: SCRAMBLED_RINV(7919); break; + case 1000: SCRAMBLED_RINV(7927); break; + case 1001: SCRAMBLED_RINV(7933); break; + case 1002: SCRAMBLED_RINV(7937); break; + case 1003: SCRAMBLED_RINV(7949); break; + case 1004: SCRAMBLED_RINV(7951); break; + case 1005: SCRAMBLED_RINV(7963); break; + case 1006: SCRAMBLED_RINV(7993); break; + case 1007: SCRAMBLED_RINV(8009); break; + case 1008: SCRAMBLED_RINV(8011); break; + case 1009: SCRAMBLED_RINV(8017); break; + case 1010: SCRAMBLED_RINV(8039); break; + case 1011: SCRAMBLED_RINV(8053); break; + case 1012: SCRAMBLED_RINV(8059); break; + case 1013: SCRAMBLED_RINV(8069); break; + case 1014: SCRAMBLED_RINV(8081); break; + case 1015: SCRAMBLED_RINV(8087); break; + case 1016: SCRAMBLED_RINV(8089); break; + case 1017: SCRAMBLED_RINV(8093); break; + case 1018: SCRAMBLED_RINV(8101); break; + case 1019: SCRAMBLED_RINV(8111); break; + case 1020: SCRAMBLED_RINV(8117); break; + case 1021: SCRAMBLED_RINV(8123); break; + case 1022: SCRAMBLED_RINV(8147); break; + case 1023: SCRAMBLED_RINV(8161); break; } return std::min(inverse, ONE_MINUS_EPS); } diff --git a/src/libcore/quad.cpp b/src/libcore/quad.cpp index b0bdd8a5..ab78a584 100644 --- a/src/libcore/quad.cpp +++ b/src/libcore/quad.cpp @@ -136,7 +136,7 @@ void gaussLegendre(int n, Float *nodes, Float *weights) { while (true) { if (++it > 20) SLog(EError, "gaussLegendre(): did not converge after 20 iterations!"); - + /* Search for the interior roots of P_{n+1}(x) using Newton's method. */ std::pair L = legendrePD(n+1, x); double step = L.first / L.second; @@ -179,8 +179,8 @@ void gaussLobatto(int n, Float *nodes, Float *weights) { while (true) { if (++it > 20) SLog(EError, "gaussLobatto(): did not converge after 20 iterations!"); - - /* Search for the interior roots of P_n'(x) using Newton's method. The same + + /* Search for the interior roots of P_n'(x) using Newton's method. The same roots are also shared by P_{n+1}-P_{n-1}, which is nicer to evaluate. */ std::pair Q = legendreQ(n, x); @@ -225,15 +225,15 @@ void gaussLobatto(int n, Float *nodes, Float *weights) { FOR A PARTICULAR PURPOSE. See the license for more details. */ -const Float GaussLobattoIntegrator::m_alpha = (Float) std::sqrt(2.0/3.0); +const Float GaussLobattoIntegrator::m_alpha = (Float) std::sqrt(2.0/3.0); const Float GaussLobattoIntegrator::m_beta = (Float) (1.0/std::sqrt(5.0)); -const Float GaussLobattoIntegrator::m_x1 = (Float) 0.94288241569547971906; +const Float GaussLobattoIntegrator::m_x1 = (Float) 0.94288241569547971906; const Float GaussLobattoIntegrator::m_x2 = (Float) 0.64185334234578130578; const Float GaussLobattoIntegrator::m_x3 = (Float) 0.23638319966214988028; GaussLobattoIntegrator::GaussLobattoIntegrator(size_t maxEvals, Float absError, Float relError, bool useConvergenceEstimate, bool warn) - : m_absError(absError), + : m_absError(absError), m_relError(relError), m_maxEvals(maxEvals), m_useConvergenceEstimate(useConvergenceEstimate), @@ -265,7 +265,7 @@ Float GaussLobattoIntegrator::integrate( Float GaussLobattoIntegrator::calculateAbsTolerance( const boost::function& f, Float a, Float b, size_t &evals) const { - const Float m = (a+b)/2; + const Float m = (a+b)/2; const Float h = (b-a)/2; const Float y1 = f(a); const Float y3 = f(m-m_alpha*h); @@ -279,9 +279,9 @@ Float GaussLobattoIntegrator::calculateAbsTolerance( + (Float) 0.0942738402188500455*(f(m-m_x1*h)+f(m+m_x1*h)) + (Float) 0.1550719873365853963*(y3+y11) + (Float) 0.1888215739601824544*(f(m-m_x2*h)+ f(m+m_x2*h)) - + (Float) 0.1997734052268585268*(y5+y9) + + (Float) 0.1997734052268585268*(y5+y9) + (Float) 0.2249264653333395270*(f(m-m_x3*h)+f(m+m_x3*h)) - + (Float) 0.2426110719014077338*y7); + + (Float) 0.2426110719014077338*y7); evals += 13; Float r = 1.0; @@ -290,7 +290,7 @@ Float GaussLobattoIntegrator::calculateAbsTolerance( const Float integral1 = (h/1470)* (77*(y1+y13) + 432*(y3+y11) + 625*(y5+y9) + 672*y7); - if (std::abs(integral2-acc) != 0.0) + if (std::abs(integral2-acc) != 0.0) r = std::abs(integral1-acc)/std::abs(integral2-acc); if (r == 0.0 || r > 1.0) r = 1.0; @@ -303,7 +303,7 @@ Float GaussLobattoIntegrator::calculateAbsTolerance( / (r*std::numeric_limits::epsilon()); if (m_absError != 0) - result = std::min(result, m_absError + result = std::min(result, m_absError / (r*std::numeric_limits::epsilon())); return result; @@ -313,14 +313,14 @@ Float GaussLobattoIntegrator::adaptiveGaussLobattoStep( const boost::function& f, Float a, Float b, Float fa, Float fb, Float acc, size_t &evals) const { - const Float h=(b-a)/2; + const Float h=(b-a)/2; const Float m=(a+b)/2; - - const Float mll=m-m_alpha*h; - const Float ml =m-m_beta*h; - const Float mr =m+m_beta*h; + + const Float mll=m-m_alpha*h; + const Float ml =m-m_beta*h; + const Float mr =m+m_beta*h; const Float mrr=m+m_alpha*h; - + const Float fmll= f(mll); const Float fml = f(ml); const Float fm = f(m); @@ -333,14 +333,14 @@ Float GaussLobattoIntegrator::adaptiveGaussLobattoStep( evals += 5; - if (evals >= m_maxEvals) + if (evals >= m_maxEvals) return integral1; Float dist = acc + (integral1-integral2); if (dist==acc || mll<=a || b<=mrr) { return integral1; } else { - return adaptiveGaussLobattoStep(f,a,mll,fa,fmll,acc,evals) + return adaptiveGaussLobattoStep(f,a,mll,fa,fmll,acc,evals) + adaptiveGaussLobattoStep(f,mll,ml,fmll,fml,acc,evals) + adaptiveGaussLobattoStep(f,ml,m,fml,fm,acc,evals) + adaptiveGaussLobattoStep(f,m,mr,fm,fmr,acc,evals) @@ -396,7 +396,7 @@ Float GaussLobattoIntegrator::adaptiveGaussLobattoStep( 3) Goto (1). The basic algorithm is based on the adaptive cubature described in - + A. C. Genz and A. A. Malik, "An adaptive algorithm for numeric integration over an N-dimensional rectangular region," J. Comput. Appl. Math. 6 (4), 295-302 (1980). @@ -534,7 +534,7 @@ static bool cut_region(region *R, region *R2) { struct rule_s; /* forward declaration */ typedef NDIntegrator::EResult (*evalError_func)(struct rule_s *r, - unsigned int fdim, const VectorizedIntegrand &f, + unsigned int fdim, const VectorizedIntegrand &f, unsigned int nR, region *R); typedef void (*destroy_func)(struct rule_s *r); @@ -565,7 +565,7 @@ static NDIntegrator::EResult alloc_rule_pts(rule *r, unsigned int num_regions) { /* allocate extra so that repeatedly calling alloc_rule_pts with growing num_regions only needs a logarithmic number of allocations */ num_regions *= 2; - r->pts = (Float *) malloc(sizeof(Float) * + r->pts = (Float *) malloc(sizeof(Float) * (num_regions * r->num_points * (r->dim + r->fdim))); if (r->fdim + r->dim > 0 && !r->pts) return NDIntegrator::EFailure; @@ -595,7 +595,7 @@ static rule *make_rule(size_t sz, /* >= sizeof(rule) */ } /* note: all regions must have same fdim */ -static int eval_regions(unsigned int nR, region *R, +static int eval_regions(unsigned int nR, region *R, const VectorizedIntegrand & f, rule *r) { unsigned int iR; @@ -773,10 +773,10 @@ static NDIntegrator::EResult rule75genzmalik_evalError(rule *r_, unsigned int fd for (unsigned int iR = 0; iR < nR; ++iR) { const Float *center = R[iR].h.data; const Float *halfwidth = R[iR].h.data + dim; - + for (i = 0; i < dim; ++i) r->p[i] = center[i]; - + for (i = 0; i < dim; ++i) r->widthLambda2[i] = halfwidth[i] * lambda2; for (i = 0; i < dim; ++i) @@ -784,7 +784,7 @@ static NDIntegrator::EResult rule75genzmalik_evalError(rule *r_, unsigned int fd /* Evaluate points in the center, in (lambda2,0,...,0) and (lambda3=lambda4, 0,...,0). */ - evalR0_0fs4d(pts + npts*dim, dim, r->p, center, + evalR0_0fs4d(pts + npts*dim, dim, r->p, center, r->widthLambda2, r->widthLambda); npts += num0_0(dim) + 2 * numR0_0fs(dim); @@ -802,8 +802,8 @@ static NDIntegrator::EResult rule75genzmalik_evalError(rule *r_, unsigned int fd /* Evaluate the const Integrand & function(s) at all the points */ f((size_t) npts, pts, vals); - /* we are done with the points, and so we can re-use the pts - array to store the maximum difference diff[i] in each dimension + /* we are done with the points, and so we can re-use the pts + array to store the maximum difference diff[i] in each dimension for each hypercube */ diff = pts; for (i = 0; i < dim * nR; ++i) @@ -814,7 +814,7 @@ static NDIntegrator::EResult rule75genzmalik_evalError(rule *r_, unsigned int fd Float result, res5th; Float val0, sum2=0, sum3=0, sum4=0, sum5=0; unsigned int k, k0 = 0; - + /* accumulate j-th function values into j-th integrals NOTE: this relies on the ordering of the eval functions above, as well as on the internal structure of @@ -828,11 +828,11 @@ static NDIntegrator::EResult rule75genzmalik_evalError(rule *r_, unsigned int fd Float v1 = vals[(k0 + 4*k) + 1]; Float v2 = vals[(k0 + 4*k) + 2]; Float v3 = vals[(k0 + 4*k) + 3]; - + sum2 += v0 + v1; sum3 += v2 + v3; - - diff[iR * dim + k] += + + diff[iR * dim + k] += std::abs(v0 + v1 - 2*val0 - ratio * (v2 + v3 - 2*val0)); } k0 += 4*k; @@ -840,10 +840,10 @@ static NDIntegrator::EResult rule75genzmalik_evalError(rule *r_, unsigned int fd for (k = 0; k < numRR0_0fs(dim); ++k) sum4 += vals[k0 + k]; k0 += k; - + for (k = 0; k < numR_Rfs(dim); ++k) sum5 += vals[k0 + k]; - + /* Calculate fifth and seventh order results */ result = R[iR].h.vol * (r->weight1 * val0 + weight2 * sum2 + r->weight3 * sum3 + weight4 * sum4 + r->weight5 * sum5); res5th = R[iR].h.vol * (r->weightE1 * val0 + weightE2 * sum2 + r->weightE3 * sum3 + weightE4 * sum4); @@ -900,7 +900,7 @@ static rule *make_rule75genzmalik(unsigned int dim, unsigned int fdim) { r->p = (Float *) malloc(sizeof(Float) * dim * 3); if (!r->p) { destroy_rule((rule *) r); - return NULL; + return NULL; } r->widthLambda = r->p + dim; r->widthLambda2 = r->p + 2 * dim; @@ -927,7 +927,7 @@ static NDIntegrator::EResult rule15gauss_evalError(rule *r, (Float) 0.405845151377397166906606412076961, (Float) 0.207784955007898467600689403773245, (Float) 0.000000000000000000000000000000000 - /* xgk[1], xgk[3], ... abscissae of the 7-point gauss rule. + /* xgk[1], xgk[3], ... abscissae of the 7-point gauss rule. xgk[0], xgk[2], ... to optimally extend the 7-point gauss rule */ }; static const Float wg[4] = { /* weights of the 7-point gauss rule */ @@ -957,7 +957,7 @@ static NDIntegrator::EResult rule15gauss_evalError(rule *r, for (unsigned int iR = 0; iR < nR; ++iR) { const Float center = R[iR].h.data[0]; const Float halfwidth = R[iR].h.data[1]; - + pts[npts++] = center; for (j = 0; j < (n - 1) / 2; ++j) { @@ -977,7 +977,7 @@ static NDIntegrator::EResult rule15gauss_evalError(rule *r, } f((size_t) npts, pts, vals); - + for (unsigned int k = 0; k < fdim; ++k) { for (unsigned int iR = 0; iR < nR; ++iR) { const Float halfwidth = R[iR].h.data[1]; @@ -1085,7 +1085,7 @@ static heap heap_alloc(unsigned int nalloc, unsigned int fdim) { h.fdim = fdim; h.ee = (esterr *) malloc(sizeof(esterr) * fdim); if (h.ee) { - for (i = 0; i < fdim; ++i) + for (i = 0; i < fdim; ++i) h.ee[i].val = h.ee[i].err = 0; heap_resize(&h, nalloc); } @@ -1184,7 +1184,7 @@ static NDIntegrator::EResult ruleadapt_integrate(rule *r, unsigned int fdim, ee = (esterr *) malloc(sizeof(esterr) * fdim); if (!ee) goto bad; - + nR_alloc = 2; R = (region *) malloc(sizeof(region) * nR_alloc); if (!R) @@ -1193,7 +1193,7 @@ static NDIntegrator::EResult ruleadapt_integrate(rule *r, unsigned int fdim, if (!R[0].ee || eval_regions(1, R, f, r) || heap_push(®ions, R[0])) goto bad; numEval += r->num_points; - + while (numEval < maxEval || !maxEval) { for (j = 0; j < fdim && (regions.ee[j].err <= reqAbsError || relError(regions.ee[j]) <= reqRelError); ++j) @@ -1207,8 +1207,8 @@ static NDIntegrator::EResult ruleadapt_integrate(rule *r, unsigned int fdim, adapted from I. Gladwell, "Vectorization of one dimensional quadrature codes," pp. 230--238 in _Numerical Integration. Recent Developments, Software and Applications_, G. Fairweather and - P. M. Keast, eds., NATO ASI Series C203, Dordrecht (1987), as - described in J. M. Bull and T. L. Freeman, "Parallel Globally + P. M. Keast, eds., NATO ASI Series C203, Dordrecht (1987), as + described in J. M. Bull and T. L. Freeman, "Parallel Globally Adaptive Algorithms for Multi-dimensional Integration," http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.42.6638 @@ -1264,9 +1264,9 @@ static NDIntegrator::EResult ruleadapt_integrate(rule *r, unsigned int fdim, /* re-sum integral and errors */ for (j = 0; j < fdim; ++j) - val[j] = err[j] = 0; + val[j] = err[j] = 0; for (i = 0; i < regions.n; ++i) { - for (j = 0; j < fdim; ++j) { + for (j = 0; j < fdim; ++j) { val[j] += regions.items[i].ee[j].val; err[j] += regions.items[i].ee[j].err; } @@ -1286,9 +1286,9 @@ bad: return NDIntegrator::EFailure; } -static NDIntegrator::EResult integrate(unsigned fdim, const VectorizedIntegrand & f, - unsigned dim, const Float *xmin, const Float *xmax, - size_t maxEval, Float reqAbsError, Float reqRelError, +static NDIntegrator::EResult integrate(unsigned fdim, const VectorizedIntegrand & f, + unsigned dim, const Float *xmin, const Float *xmax, + size_t maxEval, Float reqAbsError, Float reqRelError, Float *val, Float *err, size_t &numEval, int parallel) { NDIntegrator::EResult status; @@ -1303,10 +1303,10 @@ static NDIntegrator::EResult integrate(unsigned fdim, const VectorizedIntegrand } rule *r = dim == 1 ? make_rule15gauss(dim, fdim) : make_rule75genzmalik(dim, fdim); - if (!r) { + if (!r) { for (unsigned int i = 0; i < fdim; ++i) { val[i] = 0; - err[i] = std::numeric_limits::infinity(); + err[i] = std::numeric_limits::infinity(); } return NDIntegrator::EFailure; } @@ -1345,11 +1345,11 @@ private: }; NDIntegrator::NDIntegrator(size_t fDim, size_t dim, - size_t maxEvals, Float absError, Float relError) + size_t maxEvals, Float absError, Float relError) : m_fdim(fDim), m_dim(dim), m_maxEvals(maxEvals), m_absError(absError), m_relError(relError) { } -NDIntegrator::EResult NDIntegrator::integrate(const Integrand &f, const Float *min, +NDIntegrator::EResult NDIntegrator::integrate(const Integrand &f, const Float *min, const Float *max, Float *result, Float *error, size_t *_evals) const { VectorizationAdapter adapter(f, m_fdim, m_dim); size_t evals = 0; @@ -1361,7 +1361,7 @@ NDIntegrator::EResult NDIntegrator::integrate(const Integrand &f, const Float *m return retval; } -NDIntegrator::EResult NDIntegrator::integrateVectorized(const VectorizedIntegrand &f, const Float *min, +NDIntegrator::EResult NDIntegrator::integrateVectorized(const VectorizedIntegrand &f, const Float *min, const Float *max, Float *result, Float *error, size_t *_evals) const { size_t evals = 0; EResult retval = mitsuba::integrate((unsigned int) m_fdim, f, (unsigned int) m_dim, diff --git a/src/libcore/random.cpp b/src/libcore/random.cpp index faa358b7..a91f5849 100644 --- a/src/libcore/random.cpp +++ b/src/libcore/random.cpp @@ -1,4 +1,4 @@ -/* +/* SIMD oriented Fast Mersenne Twister (SFMT) pseudorandom number generator http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/ @@ -40,12 +40,12 @@ Springer (2008) 607--622. DOI: 10.1007/978-3-540-74496-2_36 T. Nishimura, ``Tables of 64-bit Mersenne Twisters'' - ACM Transactions on Modeling and + ACM Transactions on Modeling and Computer Simulation 10. (2000) 348--357. M. Matsumoto and T. Nishimura, ``Mersenne Twister: a 623-dimensionally equidistributed uniform pseudorandom number generator'' - ACM Transactions on Modeling and + ACM Transactions on Modeling and Computer Simulation 8. (Jan. 1998) 3--30. */ @@ -67,7 +67,7 @@ /************************ SFMT-19937 Parameters *******************************/ -/* Mersenne Exponent. The period of the sequence +/* Mersenne Exponent. The period of the sequence * is a multiple of 2^MEXP-1. */ #define MEXP 19937 /* SFMT generator has an internal state array of 128-bit integers, @@ -109,7 +109,7 @@ inline uint32_t sfmtHash() { const uint32_t data[] = {MEXP, POS1, SL1, SL2, SR1, SR2, MSK1, MSK2, MSK3, MSK4}; uint32_t hash = 17; - for (int i = 0; i < 10; ++i) + for (int i = 0; i < 10; ++i) hash ^= data[i] + 0x9e3779b9U + (hash<<6) + (hash>>2); return hash; } @@ -208,13 +208,13 @@ inline static void do_recursion(w128_t &r, const w128_t &a, const w128_t &b, lshift128(x, a, SL2); rshift128(y, c, SR2); - r.u[0] = a.u[0] ^ x.u[0] ^ ((b.u[0] >> SR1) & MSK1) ^ y.u[0] + r.u[0] = a.u[0] ^ x.u[0] ^ ((b.u[0] >> SR1) & MSK1) ^ y.u[0] ^ (d.u[0] << SL1); - r.u[1] = a.u[1] ^ x.u[1] ^ ((b.u[1] >> SR1) & MSK2) ^ y.u[1] + r.u[1] = a.u[1] ^ x.u[1] ^ ((b.u[1] >> SR1) & MSK2) ^ y.u[1] ^ (d.u[1] << SL1); - r.u[2] = a.u[2] ^ x.u[2] ^ ((b.u[2] >> SR1) & MSK3) ^ y.u[2] + r.u[2] = a.u[2] ^ x.u[2] ^ ((b.u[2] >> SR1) & MSK3) ^ y.u[2] ^ (d.u[2] << SL1); - r.u[3] = a.u[3] ^ x.u[3] ^ ((b.u[3] >> SR1) & MSK4) ^ y.u[3] + r.u[3] = a.u[3] ^ x.u[3] ^ ((b.u[3] >> SR1) & MSK4) ^ y.u[3] ^ (d.u[3] << SL1); } #endif // MTS_SFMT_SSE @@ -282,7 +282,7 @@ struct Random::State { * This function generates and returns 64-bit pseudorandom number. * init_gen_rand or init_by_array must be called before this function. * The function gen_rand64 should not be called after gen_rand32, - * unless an initialization is again executed. + * unless an initialization is again executed. * \return 64-bit pseudorandom number */ FINLINE uint64_t gen_rand64() { @@ -397,7 +397,7 @@ const uint32_t Random::State::s_magic = sfmtHash(); void Random::State::init_gen_rand(const uint64_t seed) { psfmt64[0] = seed; for (int i = 1; i < N64; ++i) { - psfmt64[i] = (6364136223846793005ULL * (psfmt64[i-1] + psfmt64[i] = (6364136223846793005ULL * (psfmt64[i-1] ^ (psfmt64[i-1] >> 62)) + i); } idx = N32; @@ -438,7 +438,7 @@ void Random::State::init_by_array(const uint32_t *init_key, int key_length) { count--; for (i = 1, j = 0; (j < count) && (j < key_length); j++) { - r = func1(psfmt32[i] ^ psfmt32[(i + mid) % N32] + r = func1(psfmt32[i] ^ psfmt32[(i + mid) % N32] ^ psfmt32[(i + N32 - 1) % N32]); psfmt32[(i + mid) % N32] += r; r += init_key[j] + i; @@ -447,7 +447,7 @@ void Random::State::init_by_array(const uint32_t *init_key, int key_length) { i = (i + 1) % N32; } for (; j < count; j++) { - r = func1(psfmt32[i] ^ psfmt32[(i + mid) % N32] + r = func1(psfmt32[i] ^ psfmt32[(i + mid) % N32] ^ psfmt32[(i + N32 - 1) % N32]); psfmt32[(i + mid) % N32] += r; r += i; @@ -456,7 +456,7 @@ void Random::State::init_by_array(const uint32_t *init_key, int key_length) { i = (i + 1) % N32; } for (j = 0; j < N32; j++) { - r = func2(psfmt32[i] + psfmt32[(i + mid) % N32] + r = func2(psfmt32[i] + psfmt32[(i + mid) % N32] + psfmt32[(i + N32 - 1) % N32]); psfmt32[(i + mid) % N32] ^= r; r -= i; @@ -505,7 +505,7 @@ Random::~Random() { freeAligned(mt); } -Random::Random(Stream *stream, InstanceManager *manager) +Random::Random(Stream *stream, InstanceManager *manager) : SerializableObject(stream, manager), mt(NULL) { // Check the magic number first uint32_t magic = stream->readUInt(); @@ -556,7 +556,7 @@ uint64_t Random::nextULong() { namespace { // Helper function to create bitmasks according to the size template T makeBitmask(T n); - + template <> inline uint32_t makeBitmask(uint32_t n) { uint32_t bitmask = n; bitmask |= bitmask >> 1; @@ -566,7 +566,7 @@ namespace { bitmask |= bitmask >> 16; return bitmask; } - + template <> inline uint64_t makeBitmask(uint64_t n) { uint64_t bitmask = n; bitmask |= bitmask >> 1; @@ -577,7 +577,7 @@ namespace { bitmask |= bitmask >> 32; return bitmask; } - + #if defined(MTS_AMBIGUOUS_SIZE_T) inline size_t makeBitmask(size_t n) { if (sizeof(size_t) == 8) @@ -615,7 +615,7 @@ size_t Random::nextSize(size_t n) { #if defined(DOUBLE_PRECISION) Float Random::nextFloat() { - /* Trick from MTGP: generate an uniformly distributed + /* Trick from MTGP: generate an uniformly distributed single precision number in [1,2) and subtract 1. */ union { uint64_t u; @@ -628,7 +628,7 @@ Float Random::nextFloat() { #else Float Random::nextFloat() { - /* Trick from MTGP: generate an uniformly distributed + /* Trick from MTGP: generate an uniformly distributed single precision number in [1,2) and subtract 1. */ union { uint32_t u; diff --git a/src/libcore/rfilter.cpp b/src/libcore/rfilter.cpp index 1afa66c4..062d872a 100644 --- a/src/libcore/rfilter.cpp +++ b/src/libcore/rfilter.cpp @@ -25,7 +25,7 @@ ReconstructionFilter::ReconstructionFilter(const Properties &props) ReconstructionFilter::~ReconstructionFilter() { } -ReconstructionFilter::ReconstructionFilter(Stream *stream, InstanceManager *manager) +ReconstructionFilter::ReconstructionFilter(Stream *stream, InstanceManager *manager) : ConfigurableObject(stream, manager) { m_radius = stream->readFloat(); } diff --git a/src/libcore/sched.cpp b/src/libcore/sched.cpp index 4ac8c9c6..a2765adb 100644 --- a/src/libcore/sched.cpp +++ b/src/libcore/sched.cpp @@ -25,20 +25,19 @@ MTS_NAMESPACE_BEGIN SerializableObject *WorkProcessor::getResource(const std::string &name) { - if (m_resources.find(name) == m_resources.end()) + if (m_resources.find(name) == m_resources.end()) Log(EError, "Could not find a resource named \"%s\"!", name.c_str()); return m_resources[name]; } - + void ParallelProcess::bindResource(const std::string &name, int id) { m_bindings[name] = id; } - std::vector ParallelProcess::getRequiredPlugins() { return PluginManager::getInstance()->getLoadedPlugins(); } - + void ParallelProcess::handleCancellation() { } @@ -73,7 +72,7 @@ void Scheduler::registerWorker(Worker *worker) { void Scheduler::unregisterWorker(Worker *worker) { LockGuard lock(m_mutex); - m_workers.erase(std::remove(m_workers.begin(), m_workers.end(), worker), + m_workers.erase(std::remove(m_workers.begin(), m_workers.end(), worker), m_workers.end()); worker->decRef(); } @@ -270,7 +269,7 @@ bool Scheduler::schedule(ParallelProcess *process) { return false; } - /* First, check that all resources are available and increase + /* First, check that all resources are available and increase their reference count */ const ParallelProcess::ResourceBindings &bindings = process->getResourceBindings(); for (ParallelProcess::ResourceBindings::const_iterator it = bindings.begin(); @@ -281,7 +280,7 @@ bool Scheduler::schedule(ParallelProcess *process) { } m_resources[(*it).second]->refCount++; } - ProcessRecord *rec = new ProcessRecord(m_processCounter++, + ProcessRecord *rec = new ProcessRecord(m_processCounter++, process->getLogLevel(), m_mutex); m_processes[process] = rec; #if defined(DEBUG_SCHED) @@ -296,7 +295,7 @@ bool Scheduler::schedule(ParallelProcess *process) { m_workAvailable->broadcast(); return true; } - + bool Scheduler::hasRemoteWorkers() const { bool hasRemoteWorkers = false; LockGuard lock(m_mutex); @@ -316,7 +315,7 @@ bool Scheduler::hasLocalWorkers() const { bool Scheduler::wait(const ParallelProcess *process) { UniqueLock lock(m_mutex); - std::map::iterator it = + std::map::iterator it = m_processes.find(process); if (it == m_processes.end()) { /* The process is not known */ @@ -325,7 +324,7 @@ bool Scheduler::wait(const ParallelProcess *process) { ProcessRecord *rec = (*it).second; /* Increase the WaitFlag reference count as otherwise, - it might be deleted before having a chance to verify + it might be deleted before having a chance to verify that the flag has really changed */ #if defined(DEBUG_SCHED) @@ -345,7 +344,7 @@ bool Scheduler::wait(const ParallelProcess *process) { bool Scheduler::cancel(ParallelProcess *process, bool reduceInflight) { UniqueLock lock(m_mutex); - std::map::iterator it = + std::map::iterator it = m_processes.find(process); if (it == m_processes.end()) { #if defined(DEBUG_SCHED) @@ -378,9 +377,9 @@ bool Scheduler::cancel(ParallelProcess *process, bool reduceInflight) { m_workers[i]->signalProcessCancellation(rec->id); /* Ensure that this process won't be scheduled again */ - m_localQueue.erase(std::remove(m_localQueue.begin(), m_localQueue.end(), rec->id), + m_localQueue.erase(std::remove(m_localQueue.begin(), m_localQueue.end(), rec->id), m_localQueue.end()); - m_remoteQueue.erase(std::remove(m_remoteQueue.begin(), m_remoteQueue.end(), rec->id), + m_remoteQueue.erase(std::remove(m_remoteQueue.begin(), m_remoteQueue.end(), rec->id), m_remoteQueue.end()); /* Ensure that the process won't be considered 'done' when the @@ -390,7 +389,7 @@ bool Scheduler::cancel(ParallelProcess *process, bool reduceInflight) { /* Now wait until no more work from this process circulates and release the lock while waiting. */ - while (rec->inflight != 0) + while (rec->inflight != 0) rec->cond->wait(); /* Decrease the reference count of all bound resources */ @@ -423,7 +422,7 @@ bool Scheduler::cancel(ParallelProcess *process, bool reduceInflight) { return true; } -Scheduler::EStatus Scheduler::acquireWork(Item &item, +Scheduler::EStatus Scheduler::acquireWork(Item &item, bool local, bool onlyTry, bool keepLock) { UniqueLock lock(m_mutex); std::deque &queue = local ? m_localQueue : m_remoteQueue; @@ -432,9 +431,9 @@ Scheduler::EStatus Scheduler::acquireWork(Item &item, return ENone; } - /* Wait until work is available and return false + /* Wait until work is available and return false if stop() is called */ - while (queue.size() == 0 && m_running) + while (queue.size() == 0 && m_running) m_workAvailable->wait(); if (!m_running) { @@ -448,7 +447,7 @@ Scheduler::EStatus Scheduler::acquireWork(Item &item, int id = queue.front(); if (item.id != id) { /* First work unit from this parallel process - establish - connections to referenced resources and prepare the + connections to referenced resources and prepare the work processor */ setProcessByID(item, id); } @@ -493,7 +492,7 @@ Scheduler::EStatus Scheduler::acquireWork(Item &item, boost::this_thread::yield(); return EOK; } - + void Scheduler::signalProcessTermination(ParallelProcess *proc, ProcessRecord *rec) { #if defined(DEBUG_SCHED) Log(rec->logLevel, "Process %i is complete.", rec->id); @@ -509,9 +508,9 @@ void Scheduler::signalProcessTermination(ParallelProcess *proc, ProcessRecord *r } rec->done->set(true); m_processes.erase(proc); - m_localQueue.erase(std::remove(m_localQueue.begin(), m_localQueue.end(), rec->id), + m_localQueue.erase(std::remove(m_localQueue.begin(), m_localQueue.end(), rec->id), m_localQueue.end()); - m_remoteQueue.erase(std::remove(m_remoteQueue.begin(), m_remoteQueue.end(), rec->id), + m_remoteQueue.erase(std::remove(m_remoteQueue.begin(), m_remoteQueue.end(), rec->id), m_remoteQueue.end()); proc->m_returnStatus = ParallelProcess::ESuccess; m_idToProcess.erase(rec->id); @@ -573,7 +572,7 @@ void Scheduler::stop() { for (std::map::iterator it = m_resources.begin(); it != m_resources.end(); ++it) { ResourceRecord *rec = (*it).second; - for (size_t i=0; iresources.size(); ++i) + for (size_t i=0; iresources.size(); ++i) rec->resources[i]->decRef(); delete rec; } @@ -616,7 +615,7 @@ void Scheduler::staticShutdown() { Worker::Worker(const std::string &name) : Thread(name), m_coreCount(0), m_isRemote(false) { } -void Worker::clear() { +void Worker::clear() { m_schedItem.wp = NULL; m_schedItem.workUnit = NULL; m_schedItem.workResult = NULL; @@ -630,11 +629,11 @@ void Worker::start(Scheduler *scheduler, int workerIndex, int coreOffset) { Thread::start(); } -LocalWorker::LocalWorker(const std::string &name, +LocalWorker::LocalWorker(const std::string &name, Thread::EThreadPriority priority) : Worker(name) { m_coreCount = 1; #if !defined(__LINUX__) - /* Don't set thead priority on Linux, since it uses + /* Don't set thead priority on Linux, since it uses dynamic priorities */ setPriority(priority); #endif @@ -670,7 +669,7 @@ void LocalWorker::signalProcessTermination(int id) { } void LocalWorker::signalProcessCancellation(int id) { - if (m_schedItem.id == id) + if (m_schedItem.id == id) m_schedItem.stop = true; } diff --git a/src/libcore/sched_remote.cpp b/src/libcore/sched_remote.cpp index fffe0665..d11e763a 100644 --- a/src/libcore/sched_remote.cpp +++ b/src/libcore/sched_remote.cpp @@ -67,7 +67,7 @@ RemoteWorker::RemoteWorker(const std::string &name, Stream *stream) : Worker(nam m_reader->start(); m_inFlight = 0; m_isRemote = true; - Log(EDebug, "Connection to \"%s\" established (%i cores).", + Log(EDebug, "Connection to \"%s\" established (%i cores).", m_nodeName.c_str(), m_coreCount); } @@ -83,7 +83,7 @@ RemoteWorker::~RemoteWorker() { } m_reader->join(); } - + void RemoteWorker::start(Scheduler *scheduler, int workerIndex, int coreOffset) { Worker::start(scheduler, workerIndex, coreOffset); m_reader->m_schedItem.coreOffset = coreOffset; @@ -110,8 +110,8 @@ void RemoteWorker::run() { const int id = m_schedItem.rec->id; if (m_processes.find(id) == m_processes.end()) { - /* The backend has not yet seen this process - submit - all information required to receive and execute work + /* The backend has not yet seen this process - submit + all information required to receive and execute work units on the other side */ std::vector > resources; std::vector > multiResources; @@ -125,11 +125,11 @@ void RemoteWorker::run() { if (m_resources.find(resID) == m_resources.end()) { if (!m_scheduler->isMultiResource(resID)) { - resources.push_back(std::pair(resID, + resources.push_back(std::pair(resID, m_scheduler->getResourceStream(resID))); } else { for (size_t i=0; i(resID, + multiResources.push_back(std::pair(resID, m_scheduler->getResource(resID, (int) (m_schedItem.coreOffset + i)))); } } @@ -168,13 +168,13 @@ void RemoteWorker::run() { m_memStream->writeUInt((unsigned int) resStream->getPos()); m_memStream->write(resStream->getData(), resStream->getPos()); } - + for (size_t i=0; i resStream = new MemoryStream(); ref manager = new InstanceManager(); resStream->setByteOrder(Stream::ENetworkByteOrder); - for (size_t j=0; jserialize(resStream, multiResources[i+j].second); Log(EDebug, "Sending multi resource %i to \"%s\" (%i KB)", resID, m_nodeName.c_str(), resStream->getPos() / 1024); @@ -204,7 +204,7 @@ void RemoteWorker::run() { /* There are now too many packets in transit. Wait until this clears up a bit before attempting to send more work */ - while (m_inFlight > MTS_CONTINUE_FACTOR * m_coreCount) + while (m_inFlight > MTS_CONTINUE_FACTOR * m_coreCount) m_finishCond->wait(); } } @@ -254,8 +254,8 @@ void RemoteWorker::clear() { } -RemoteWorkerReader::RemoteWorkerReader(RemoteWorker *worker) - : Thread(formatString("%s_r", worker->getName().c_str())), +RemoteWorkerReader::RemoteWorkerReader(RemoteWorker *worker) + : Thread(formatString("%s_r", worker->getName().c_str())), m_parent(worker), m_shutdown(false), m_currentID(-1) { m_stream = m_parent->m_stream; setCritical(true); @@ -268,7 +268,7 @@ void RemoteWorkerReader::run() { try { msg = m_stream->readShort(); id = m_stream->readInt(); - + if (id != m_currentID) { m_parent->setProcessByID(m_schedItem, id); m_currentID = id; @@ -318,7 +318,7 @@ void RemoteWorkerReader::run() { /* ==================================================================== */ StreamBackend::StreamBackend(const std::string &thrName, Scheduler *scheduler, - const std::string &nodeName, Stream *stream, bool detach) : Thread(thrName), + const std::string &nodeName, Stream *stream, bool detach) : Thread(thrName), m_scheduler(scheduler), m_nodeName(nodeName), m_stream(stream), m_detach(detach) { m_sendMutex = new Mutex(); m_memStream = new MemoryStream(); @@ -350,7 +350,7 @@ void StreamBackend::run() { } const size_t dataLength = strlen(MTS_VERSION)+3; - char *data = (char *) alloca(dataLength), + char *data = (char *) alloca(dataLength), *refData = (char *) alloca(dataLength); strncpy(refData, MTS_VERSION, strlen(MTS_VERSION)+1); refData[dataLength-2] = SPECTRUM_SAMPLES; @@ -377,7 +377,7 @@ void StreamBackend::run() { m_memStream->copyTo(m_stream); m_stream->flush(); bool running = true; - + try { while (running) { msg = m_stream->readShort(); @@ -535,7 +535,7 @@ void StreamBackend::sendWorkResult(int id, const WorkResult *result, bool cancel /* Remote process */ /* ==================================================================== */ -RemoteProcess::RemoteProcess(int id, ELogLevel logLevel, +RemoteProcess::RemoteProcess(int id, ELogLevel logLevel, StreamBackend *backend, WorkProcessor *wp) : m_id(id), m_backend(backend), m_wp(wp) { m_mutex = new Mutex(); @@ -578,7 +578,7 @@ ref RemoteProcess::createWorkProcessor() const { /* Executed while the main scheduler lock is held. */ void RemoteProcess::handleCancellation() { - /* Also acquire the local queue mutex, purge all queued + /* Also acquire the local queue mutex, purge all queued work units and inform the remote side how many were lost */ LockGuard lock(m_mutex); m_backend->sendCancellation(m_id, (int) m_full.size()); diff --git a/src/libcore/serialization.cpp b/src/libcore/serialization.cpp index a3b35c06..bde67d1a 100644 --- a/src/libcore/serialization.cpp +++ b/src/libcore/serialization.cpp @@ -32,7 +32,7 @@ InstanceManager::~InstanceManager() { #ifdef DEBUG_SERIALIZATION Log(EDebug, "Destroying an instance manager"); #endif - for (std::vector::iterator it = m_fullyAllocated.begin(); + for (std::vector::iterator it = m_fullyAllocated.begin(); it!= m_fullyAllocated.end(); ++it) { (*it)->decRef(); } @@ -86,7 +86,7 @@ void InstanceManager::serialize(Stream *stream, const SerializableObject *inst) } } -SerializableObject::SerializableObject(Stream *stream, InstanceManager *manager) { +SerializableObject::SerializableObject(Stream *stream, InstanceManager *manager) { manager->registerInstance(this); } diff --git a/src/libcore/shvector.cpp b/src/libcore/shvector.cpp index 729672b8..d08a1778 100644 --- a/src/libcore/shvector.cpp +++ b/src/libcore/shvector.cpp @@ -117,14 +117,14 @@ Float SHVector::eval(const Vector &v) const { Float SHVector::evalAzimuthallyInvariant(Float theta, Float phi) const { Float result = 0, cosTheta = std::cos(theta); - for (int l=0; l SHVector::mu2() const { SAssert(m_bands > 0); result.clear(); - result(0, 0) = result(1, 1) = + result(0, 0) = result(1, 1) = result(2, 2) = sqrt5o3*operator()(0,0); if (m_bands >= 3) { @@ -201,7 +201,7 @@ ublas::matrix SHVector::mu2() const { return result * (2*std::sqrt((Float) M_PI / 15)); } - + std::string SHVector::toString() const { std::ostringstream oss; oss << "SHVector[bands=" << m_bands << ", {"; @@ -246,8 +246,8 @@ struct RotationBlockHelper { int prevLevel, level; inline RotationBlockHelper( - const ublas::matrix &M1, - const ublas::matrix &Mp, + const ublas::matrix &M1, + const ublas::matrix &Mp, ublas::matrix &Mn) : M1(M1), Mp(Mp), Mn(Mn), prevLevel((int) Mp.size1()/2), level((int) Mp.size1()/2+1) { } @@ -293,7 +293,7 @@ struct RotationBlockHelper { int denom = (std::abs(n) == l) ? (2*l*(2*l-1)) : ((l+n)*(l-n)), absM = std::abs(m); return .5f * (1-2*delta(m, 0)) * std::sqrt( (Float) ((1+delta(m, 0)) * (l+absM-1)*(l+absM)) / (Float) denom - ); + ); } inline Float w(int l, int m, int n) const { @@ -330,7 +330,7 @@ struct RotationBlockHelper { for (int m=-level; m<=level; ++m) { for (int n=-level; n<=level; ++n) { Float uVal = u(level, m, n), vVal = v(level, m, n), wVal = w(level, m, n); - Mn(m+level, n+level) = + Mn(m+level, n+level) = (uVal != 0 ? (uVal * U(level, m, n)) : (Float) 0) + (vVal != 0 ? (vVal * V(level, m, n)) : (Float) 0) + (wVal != 0 ? (wVal * W(level, m, n)) : (Float) 0); @@ -389,7 +389,7 @@ SHSampler::SHSampler(int bands, int depth) : m_bands(bands), m_depth(depth) { m_normalization = new Float[m_bands*(m_bands+1)/2]; m_dataSize = m_bands*(m_bands+1)/2; Assert(depth >= 1); - + for (int i=0; i<=depth; ++i) { int res = 1 << i; Float zStep = -2 / (Float) res; @@ -417,7 +417,7 @@ SHSampler::SHSampler(int bands, int depth) : m_bands(bands), m_depth(depth) { std::string SHSampler::toString() const { std::ostringstream oss; - oss << "SHSampler[bands=" << m_bands << ", depth=" << m_depth + oss << "SHSampler[bands=" << m_bands << ", depth=" << m_depth << ", size=" << (m_dataSize*sizeof(double))/1024 << " KiB]"; return oss.str(); } @@ -492,13 +492,13 @@ SHSampler::~SHSampler() { delete[] m_legendreMap; delete[] m_normalization; } - + Float SHSampler::integrate(int depth, int zBlock, int phiBlock, const SHVector &f) const { Float result = 0; for (int l=0; l= SPECTRUM_SAMPLES) @@ -238,7 +238,7 @@ void Spectrum::toXYZ(Float &x, Float &y, Float &z) const { Float Spectrum::getLuminance() const { Float luminance = 0.0f; - for (size_t i=0; i "; oss.precision(3); oss << s[i]; @@ -462,7 +462,7 @@ std::string ProductSpectrum::toString() const { RayleighSpectrum::RayleighSpectrum(EMode mode, Float eta, Float height) { /* See ``Display of the Earth Taking into Account Atmospheric Scattering'', - * by Nishita et al., SIGGRAPH 1993 */ + * by Nishita et al., SIGGRAPH 1993 */ Float tmp = eta * eta - 1; Float rho = math::fastexp(-height/7794.0f); //Float Ns = ; @@ -499,14 +499,14 @@ Float ContinuousSpectrum::average(Float lambdaMin, Float lambdaMax) const { Float integral = 0; /// Integrate over 50nm-sized regions - size_t nSteps = std::max((size_t) 1, + size_t nSteps = std::max((size_t) 1, (size_t) std::ceil((lambdaMax - lambdaMin) / 50)); Float stepSize = (lambdaMax - lambdaMin) / nSteps, pos = lambdaMin; for (size_t i=0; i::const_iterator iterator; if (m_wavelengths.size() < 2 || lambda < m_wavelengths[0] || - lambda > m_wavelengths[m_wavelengths.size()-1]) + lambda > m_wavelengths[m_wavelengths.size()-1]) return 0.0f; /* Find the associated table entries using binary search */ - std::pair result = + std::pair result = std::equal_range(m_wavelengths.begin(), m_wavelengths.end(), lambda); size_t idx1 = result.first - m_wavelengths.begin(); @@ -681,7 +681,7 @@ std::string InterpolatedSpectrum::toString() const { /// ========================================================================== /// CIE XYZ color matching functions from -/// http://www.cvrl.org/database/data/cmfs/ciexyz31_1.txt +/// http://www.cvrl.org/database/data/cmfs/ciexyz31_1.txt /// ========================================================================== #ifdef _MSC_VER diff --git a/src/libcore/ssemath.cpp b/src/libcore/ssemath.cpp index 1ff1ef47..83a11a2b 100644 --- a/src/libcore/ssemath.cpp +++ b/src/libcore/ssemath.cpp @@ -68,16 +68,16 @@ namespace constants { static const MM_ALIGN16 SSEVector min_norm_pos( 0x00800000); static const MM_ALIGN16 SSEVector mant_mask( 0x7f800000); static const MM_ALIGN16 SSEVector inv_mant_mask(~0x7f800000); - + static const MM_ALIGN16 SSEVector sign_mask( 0x80000000); static const MM_ALIGN16 SSEVector inv_sign_mask(~0x80000000); - + static const MM_ALIGN16 SSEVector pi32_1(1); static const MM_ALIGN16 SSEVector pi32_inv1(~1); static const MM_ALIGN16 SSEVector pi32_2(2); static const MM_ALIGN16 SSEVector pi32_4(4); static const MM_ALIGN16 SSEVector pi32_0x7f(0x7f); - + static const MM_ALIGN16 SSEVector cephes_SQRTHF( 0.707106781186547524f); static const MM_ALIGN16 SSEVector cephes_log_p0( 7.0376836292E-2f); static const MM_ALIGN16 SSEVector cephes_log_p1(- 1.1514610310E-1f); @@ -90,21 +90,21 @@ namespace constants { static const MM_ALIGN16 SSEVector cephes_log_p8(+ 3.3333331174E-1f); static const MM_ALIGN16 SSEVector cephes_log_q1(- 2.12194440e-4f); static const MM_ALIGN16 SSEVector cephes_log_q2( 0.693359375f); - + static const MM_ALIGN16 SSEVector exp_hi( 88.3762626647949f); static const MM_ALIGN16 SSEVector exp_lo(-88.3762626647949f); - + static const MM_ALIGN16 SSEVector cephes_LOG2EF( 1.44269504088896341f); static const MM_ALIGN16 SSEVector cephes_exp_C1( 0.693359375f); static const MM_ALIGN16 SSEVector cephes_exp_C2(-2.12194440e-4f); - + static const MM_ALIGN16 SSEVector cephes_exp_p0(1.9875691500E-4f); static const MM_ALIGN16 SSEVector cephes_exp_p1(1.3981999507E-3f); static const MM_ALIGN16 SSEVector cephes_exp_p2(8.3334519073E-3f); static const MM_ALIGN16 SSEVector cephes_exp_p3(4.1665795894E-2f); static const MM_ALIGN16 SSEVector cephes_exp_p4(1.6666665459E-1f); static const MM_ALIGN16 SSEVector cephes_exp_p5(5.0000001201E-1f); - + static const MM_ALIGN16 SSEVector minus_cephes_DP1(-0.78515625f); static const MM_ALIGN16 SSEVector minus_cephes_DP2(-2.4187564849853515625e-4f); static const MM_ALIGN16 SSEVector minus_cephes_DP3(-3.77489497744594108e-8f); @@ -134,7 +134,7 @@ namespace constants { static const MM_ALIGN16 SSEVector am_exp2_q1(4.36821166879210612817e3f); }; -/* natural logarithm computed for 4 simultaneous float +/* natural logarithm computed for 4 simultaneous float return NaN for x <= 0 */ __m128 log_ps(__m128 x) { @@ -158,7 +158,7 @@ __m128 log_ps(__m128 x) { e = _mm_add_ps(e, one); - /* part2: + /* part2: if( x < SQRTHF ) { e -= 1; x = x + x - 1.0; @@ -225,7 +225,7 @@ __m128 exp_ps(__m128 x) { emm0 = _mm_cvttps_epi32(fx); tmp = _mm_cvtepi32_ps(emm0); /* if greater, substract 1 */ - v4sf mask = _mm_cmpgt_ps(tmp, fx); + v4sf mask = _mm_cmpgt_ps(tmp, fx); mask = _mm_and_ps(mask, one); fx = _mm_sub_ps(tmp, mask); @@ -311,7 +311,7 @@ __m128 sin_ps(__m128 x) { // any x /* get the swap sign flag */ emm0 = _mm_and_si128(emm2, constants::pi32_4.pi); emm0 = _mm_slli_epi32(emm0, 29); - /* get the polynom selection mask + /* get the polynom selection mask there is one polynom for 0 <= x <= Pi/4 and another one for Pi/4hostName; } - + const std::string& SSHStream::getUserName() const { return d->userName; } - + size_t SSHStream::getReceivedBytes() const { return d->received; } - + size_t SSHStream::getSentBytes() const { return d->sent; } std::string SSHStream::toString() const { std::ostringstream oss; - oss << "SSHStream[userName='"<< d->userName << "', hostName='" + oss << "SSHStream[userName='"<< d->userName << "', hostName='" << d->hostName << "', sent=" << (d->sent / 1024) << " KB, " "received=" << (d->received/1024) << " KB]" << endl; return oss.str(); diff --git a/src/libcore/sstream.cpp b/src/libcore/sstream.cpp index 01e6bf7d..d63932ad 100644 --- a/src/libcore/sstream.cpp +++ b/src/libcore/sstream.cpp @@ -49,7 +49,7 @@ const char *inet_ntop(int af, const void *src, char *dst, socklen_t len) { memset(&in, 0, sizeof(in)); in.sin_family = AF_INET; memcpy(&in.sin_addr, src, sizeof(struct in_addr)); - if (getnameinfo((struct sockaddr *)&in, + if (getnameinfo((struct sockaddr *)&in, sizeof(struct sockaddr_in), dst, len, NULL, 0, NI_NUMERICHOST) != 0) return NULL; return dst; @@ -58,7 +58,7 @@ const char *inet_ntop(int af, const void *src, char *dst, socklen_t len) { memset(&in, 0, sizeof(in)); in.sin6_family = AF_INET6; memcpy(&in.sin6_addr, src, sizeof(struct in_addr6)); - if (getnameinfo((struct sockaddr *)&in, + if (getnameinfo((struct sockaddr *)&in, sizeof(struct sockaddr_in6), dst, len, NULL, 0, NI_NUMERICHOST) != 0) return NULL; return dst; @@ -69,7 +69,7 @@ const char *inet_ntop(int af, const void *src, char *dst, socklen_t len) { void *get_in_addr(struct sockaddr_storage *sa) { - if (sa->ss_family == AF_INET) + if (sa->ss_family == AF_INET) return &(((struct sockaddr_in*)sa)->sin_addr); return &(((struct sockaddr_in6*)sa)->sin6_addr); } @@ -83,10 +83,10 @@ SocketStream::SocketStream(socket_t socket) socklen_t addrlen = sizeof(sockaddr); char s[INET6_ADDRSTRLEN]; - if (getpeername(m_socket, (struct sockaddr *) &sockaddr, &addrlen) == SOCKET_ERROR) + if (getpeername(m_socket, (struct sockaddr *) &sockaddr, &addrlen) == SOCKET_ERROR) handleError("getpeername"); - if (inet_ntop(sockaddr.ss_family, get_in_addr(&sockaddr), s, sizeof(s)) == NULL) + if (inet_ntop(sockaddr.ss_family, get_in_addr(&sockaddr), s, sizeof(s)) == NULL) handleError("inet_ntop"); m_peer = s; @@ -101,10 +101,10 @@ SocketStream::SocketStream(const std::string &host, int port) memset(&hints, 0, sizeof(addrinfo)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; - snprintf(portName, sizeof(portName), "%i", port); + snprintf(portName, sizeof(portName), "%i", port); Log(EInfo, "Connecting to \"%s:%i\"", host.c_str(), port); - if ((rv = getaddrinfo(host.c_str(), portName, &hints, &servinfo)) != 0) + if ((rv = getaddrinfo(host.c_str(), portName, &hints, &servinfo)) != 0) Log(EError, "Error in getaddrinfo(): %s", gai_strerror(rv)); if (servinfo == NULL) @@ -112,26 +112,26 @@ SocketStream::SocketStream(const std::string &host, int port) m_socket = socket(servinfo->ai_family, servinfo->ai_socktype, servinfo->ai_protocol); if (m_socket == INVALID_SOCKET) { - freeaddrinfo(servinfo); + freeaddrinfo(servinfo); handleError("socket"); } if (connect(m_socket, servinfo->ai_addr, (socklen_t) servinfo->ai_addrlen) == SOCKET_ERROR) { - freeaddrinfo(servinfo); + freeaddrinfo(servinfo); handleError("connect"); } - freeaddrinfo(servinfo); - + freeaddrinfo(servinfo); + setByteOrder(ENetworkByteOrder); struct sockaddr_storage sockaddr; socklen_t addrlen = sizeof(sockaddr); char s[INET6_ADDRSTRLEN]; - if (getpeername(m_socket, (struct sockaddr *) &sockaddr, &addrlen) == SOCKET_ERROR) + if (getpeername(m_socket, (struct sockaddr *) &sockaddr, &addrlen) == SOCKET_ERROR) handleError("getpeername"); - if (inet_ntop(sockaddr.ss_family, get_in_addr(&sockaddr), s, sizeof(s)) == NULL) + if (inet_ntop(sockaddr.ss_family, get_in_addr(&sockaddr), s, sizeof(s)) == NULL) handleError("inet_ntop"); #if defined(__OSX__) @@ -240,7 +240,7 @@ void SocketStream::truncate(size_t size) { void SocketStream::flush() { /* Ignore */ } - + void SocketStream::handleError(const std::string &cmd, ELogLevel level) { #ifndef WIN32 if (cmd.find("(") == std::string::npos) diff --git a/src/libcore/statistics.cpp b/src/libcore/statistics.cpp index ddbf0220..f8b1fb82 100644 --- a/src/libcore/statistics.cpp +++ b/src/libcore/statistics.cpp @@ -66,7 +66,7 @@ void ProgressReporter::update(long long value) { curMs - m_lastMs > 1000)) { m_percentage = (int) perc; int fillEnd = (int) ((value * m_fillSize) / m_total); - + Float time = curMs / 1000.0f; Float remaining = (time*m_total) / value - time; @@ -76,7 +76,7 @@ void ProgressReporter::update(long long value) { std::ostringstream oss; std::string eta = timeString(remaining); oss << '\r' << m_title << ": [" << m_string << "] ("; - oss << timeString(time) << ", ETA: " + oss << timeString(time) << ", ETA: " << eta << ") \b\b"; Thread::getThread()->getLogger()->logProgress( perc, m_title, oss.str(), eta, m_ptr); @@ -112,7 +112,7 @@ bool StatsCounter::operator<(const StatsCounter &v) const { } ref Statistics::m_instance = new Statistics(); - + void Statistics::staticInitialization() { SAssert(sizeof(CacheLineCounter) == 128); } @@ -148,7 +148,7 @@ std::string Statistics::getStats() { oss << " none." << endl; } else { std::sort(m_plugins.begin(), m_plugins.end()); - for (unsigned int i=0; igetName().c_str(), baseValue == 0 ? (Float) 0 : value/baseValue * 100, + snprintf(temp, sizeof(temp), " - %s : %.2f %% (%.2f%s of %.2f%s)", + counter->getName().c_str(), baseValue == 0 ? (Float) 0 : value/baseValue * 100, value2, suffixesNumber[suffixIndex].c_str(), value3, suffixesNumber[suffixIndex2].c_str()); break; @@ -236,7 +236,7 @@ std::string Statistics::getStats() { value3 /= 1000.0f; suffixIndex2++; } - snprintf(temp, sizeof(temp), " - %s : %.2f (%.2f%s / %.2f%s)", + snprintf(temp, sizeof(temp), " - %s : %.2f (%.2f%s / %.2f%s)", counter->getName().c_str(), avg, value2, suffixesNumber[suffixIndex].c_str(), value3, suffixesNumber[suffixIndex2].c_str()); diff --git a/src/libcore/stream.cpp b/src/libcore/stream.cpp index 8b4e15fd..07c19412 100644 --- a/src/libcore/stream.cpp +++ b/src/libcore/stream.cpp @@ -165,7 +165,7 @@ void Stream::writeUChar(unsigned char value) { void Stream::writeHalf(half halfValue) { short value = halfValue.bits(); - if (m_byteOrder != m_hostByteOrder) + if (m_byteOrder != m_hostByteOrder) value = endianness_swap(value); write(&value, sizeof(short)); } @@ -174,7 +174,7 @@ void Stream::writeHalfArray(const half *data, size_t size) { BOOST_STATIC_ASSERT(sizeof(half) == 2); if (m_byteOrder != m_hostByteOrder) { short *temp = new short[size]; - for (size_t i=0; iwrite(data, blockSize); diff --git a/src/libcore/thread.cpp b/src/libcore/thread.cpp index d96885e7..2811463b 100644 --- a/src/libcore/thread.cpp +++ b/src/libcore/thread.cpp @@ -122,7 +122,7 @@ protected: ThreadLocal *Thread::ThreadPrivate::self = NULL; -Thread::Thread(const std::string &name) +Thread::Thread(const std::string &name) : d(new ThreadPrivate(name)) { } Thread::EThreadPriority Thread::getPriority() const { @@ -312,13 +312,13 @@ void Thread::dispatch(Thread *thread) { // pthread_setname_np(pthread_self(), threadName.c_str()); prctl(PR_SET_NAME, threadName.c_str()); -#elif defined(__OSX__) +#elif defined(__OSX__) pthread_setname_np(threadName.c_str()); #elif defined(__WINDOWS__) SetThreadName(threadName.c_str()); #endif } - + try { thread->run(); } catch (std::exception &e) { @@ -434,7 +434,7 @@ Thread *Thread::registerUnmanagedThread(const std::string &name) { thread->d->joined = false; thread->incRef(); ThreadPrivate::self->set(thread); - + boost::lock_guard guard(__unmanagedMutex); __unmanagedThreads.push_back((UnmanagedThread *) thread); } diff --git a/src/libcore/timer.cpp b/src/libcore/timer.cpp index 45d8e7d2..0b9e2e3e 100644 --- a/src/libcore/timer.cpp +++ b/src/libcore/timer.cpp @@ -64,7 +64,7 @@ namespace { static double timerResolution() { #if defined(__WINDOWS__) LARGE_INTEGER freq; - if (!QueryPerformanceFrequency(&freq)) + if (!QueryPerformanceFrequency(&freq)) SLog(EError, "Could not query the high performance counter: %s", lastErrorText().c_str()); return 1.0 / static_cast(freq.QuadPart) * 1e9; diff --git a/src/libcore/tls.cpp b/src/libcore/tls.cpp index 615e7f8f..7237ec54 100644 --- a/src/libcore/tls.cpp +++ b/src/libcore/tls.cpp @@ -28,12 +28,12 @@ MTS_NAMESPACE_BEGIN /* The native TLS classes on Linux/MacOS/Windows only support a limited number - of dynamically allocated entries (usually 1024 or 1088). Furthermore, they - do not provide appropriate cleanup semantics when the TLS object or one of - the assocated threads dies. The custom TLS code provided in Mitsuba has no + of dynamically allocated entries (usually 1024 or 1088). Furthermore, they + do not provide appropriate cleanup semantics when the TLS object or one of + the assocated threads dies. The custom TLS code provided in Mitsuba has no such limits (caching in various subsystems of Mitsuba may create a huge amount, - so this is a big deal) as well as nice cleanup semantics. The implementation - is designed to make the \c get() operation as fast as as possible at the cost + so this is a big deal) as well as nice cleanup semantics. The implementation + is designed to make the \c get() operation as fast as as possible at the cost of more involved locking when creating or destroying threads and TLS objects */ namespace detail { @@ -70,15 +70,15 @@ struct ThreadLocalBase::ThreadLocalPrivate { ConstructFunctor constructFunctor; DestructFunctor destructFunctor; - ThreadLocalPrivate(const ConstructFunctor &constructFunctor, + ThreadLocalPrivate(const ConstructFunctor &constructFunctor, const DestructFunctor &destructFunctor) : constructFunctor(constructFunctor), destructFunctor(destructFunctor) { } ~ThreadLocalPrivate() { - /* The TLS object was destroyed. Walk through all threads + /* The TLS object was destroyed. Walk through all threads and clean up where necessary */ boost::lock_guard guard(ptdGlobalLock); - + for (std::set::iterator it = ptdGlobal.begin(); it != ptdGlobal.end(); ++it) { PerThreadData *ptd = *it; @@ -94,7 +94,7 @@ struct ThreadLocalBase::ThreadLocalPrivate { lock.unlock(); - if (entry.data) + if (entry.data) destructFunctor(entry.data); } } @@ -125,7 +125,7 @@ struct ThreadLocalBase::ThreadLocalPrivate { }; ThreadLocalBase::ThreadLocalBase( - const ConstructFunctor &constructFunctor, const DestructFunctor &destructFunctor) + const ConstructFunctor &constructFunctor, const DestructFunctor &destructFunctor) : d(new ThreadLocalPrivate(constructFunctor, destructFunctor)) { } ThreadLocalBase::~ThreadLocalBase() { } @@ -193,7 +193,7 @@ void destroyLocalTLS() { boost::unique_lock lock(ptd->mutex); - for (PerThreadData::Map::iterator it = ptd->map.begin(); + for (PerThreadData::Map::iterator it = ptd->map.begin(); it != ptd->map.end(); ++it) { TLSEntry &entry = it->second; entry.destructFunctor(entry.data); diff --git a/src/libcore/transform.cpp b/src/libcore/transform.cpp index 720be787..71004bec 100644 --- a/src/libcore/transform.cpp +++ b/src/libcore/transform.cpp @@ -68,7 +68,7 @@ Transform Transform::rotate(const Vector &axis, Float angle) { /* Make sure that the axis is normalized */ Vector naxis = normalize(axis); math::sincos(degToRad(angle), &sinTheta, &cosTheta); - + Matrix4x4 result; result(0, 0) = naxis.x * naxis.x + (1.0f - naxis.x * naxis.x) * cosTheta; result(0, 1) = naxis.x * naxis.y * (1.0f - cosTheta) - naxis.z * sinTheta; @@ -102,7 +102,7 @@ Transform Transform::perspective(Float fov, Float clipNear, Float clipFar) { * xProj = x / z * yProj = y / z * zProj = (far * (z - near)) / (z * (far-near)) - * + * * Camera-space depths are not mapped linearly! */ Float recip = 1.0f / (clipFar - clipNear); @@ -216,7 +216,7 @@ Transform Transform::lookAt(const Point &p, const Point &t, const Vector &up) { Transform Transform::fromFrame(const Frame &frame) { Matrix4x4 result( frame.s.x, frame.t.x, frame.n.x, 0, - frame.s.y, frame.t.y, frame.n.y, 0, + frame.s.y, frame.t.y, frame.n.y, 0, frame.s.z, frame.t.z, frame.n.z, 0, 0, 0, 0, 1 ); @@ -231,7 +231,7 @@ std::string Transform::toString() const { } /** - * \brief Tridiagonalizes a 3x3 matrix using a single + * \brief Tridiagonalizes a 3x3 matrix using a single * Householder transformation and returns the result. * * Based on "Geometric Tools" by David Eberly. @@ -275,7 +275,7 @@ static inline void tred3(Matrix3x3 &m, Float *diag, Float *subd) { * matrix using the QL algorithm with implicit shifts * * Based on "Geometric Tools" by David Eberly and Numerical Recipes by - * Teukolsky, et al. Originally, this code goes back to the Handbook + * Teukolsky, et al. Originally, this code goes back to the Handbook * for Automatic Computation by Wilkionson and Reinsch, as well as * the corresponding EISPACK routine. */ @@ -289,7 +289,7 @@ static inline bool ql3(Matrix3x3 &m, Float *diag, Float *subd) { int j; for (j = i; j < 2; ++j) { Float tmp = std::abs(diag[j]) + std::abs(diag[j+1]); - if (std::abs(subd[j]) + tmp == tmp) + if (std::abs(subd[j]) + tmp == tmp) break; } if (j == i) @@ -297,7 +297,7 @@ static inline bool ql3(Matrix3x3 &m, Float *diag, Float *subd) { Float value0 = (diag[i + 1] - diag[i])/(2*subd[i]); Float value1 = std::sqrt(value0*value0 + 1); - value0 = diag[j] - diag[i] + subd[i] / + value0 = diag[j] - diag[i] + subd[i] / ((value0 < 0) ? (value0 - value1) : (value0 + value1)); Float sn = 1, cs = 1, value2 = 0; @@ -367,11 +367,11 @@ bool eig3(Matrix3x3 &m, Float lambda[3]) { std::swap(lambda[i], lambda[largest]); // Swap the eigenvectors - for (int j=0; j<3; ++j) + for (int j=0; j<3; ++j) std::swap(m(j, i), m(j, largest)); } } - + return true; } @@ -404,7 +404,7 @@ static void eig3_evals(const Matrix3x3 &A, double root[3]) { // and in solving the equation for the roots in closed form. double c2Div3 = c2*msInv3; double aDiv3 = (c1 - c2*c2Div3)*msInv3; - if (aDiv3 > 0.0) + if (aDiv3 > 0.0) aDiv3 = 0.0; double halfMB = 0.5*(c0 + c2Div3*(2.0*c2Div3*c2Div3 - c1)); @@ -493,7 +493,7 @@ static void eig3_evecs(Matrix3x3& A, const Float lambda[3], const Vector& U2, in absValue = std::abs(p01), invLength; - if (absValue > maxValue) + if (absValue > maxValue) maxValue = absValue; int row = 0; @@ -516,7 +516,7 @@ static void eig3_evecs(Matrix3x3& A, const Float lambda[3], const Vector& U2, in evecs[i2] = p11*U0 + p01*U1; } } else { - if (row == 0) + if (row == 0) evecs[i2] = U1; else evecs[i2] = U0; @@ -534,7 +534,7 @@ static void eig3_evecs(Matrix3x3& A, const Float lambda[3], const Vector& U2, in maxValue = std::abs(p00); row = 0; absValue = std::abs(p01); - if (absValue > maxValue) + if (absValue > maxValue) maxValue = absValue; absValue = std::abs(p11); if (absValue > maxValue) { @@ -571,7 +571,7 @@ static void eig3_evecs(Matrix3x3& A, const Float lambda[3], const Vector& U2, in /** * \brief Fast non-iterative 3x3 eigenvalue decomposition - * + * * Based on "Geometric Tools" by David Eberly. */ void eig3_noniter(Matrix3x3 &A, Float lambda[3]) { diff --git a/src/libcore/triangle.cpp b/src/libcore/triangle.cpp index d1e9170f..fb761445 100644 --- a/src/libcore/triangle.cpp +++ b/src/libcore/triangle.cpp @@ -29,7 +29,7 @@ Point Triangle::sample(const Point *positions, const Normal *normals, Point2 bary = Warp::squareToUniformTriangle(sample); Vector sideA = p1 - p0, sideB = p2 - p0; - Point p = p0 + (sideA * bary.x) + (sideB * bary.y); + Point p = p0 + (sideA * bary.x) + (sideB * bary.y); if (normals) { const Normal &n0 = normals[idx[0]]; @@ -57,7 +57,7 @@ Float Triangle::surfaceArea(const Point *positions) const { #define MAX_VERTS 10 -static int sutherlandHodgman(Point3d *input, int inCount, Point3d *output, int axis, +static int sutherlandHodgman(Point3d *input, int inCount, Point3d *output, int axis, double splitPos, bool isMinimum) { if (inCount < 3) return 0; @@ -114,7 +114,7 @@ AABB Triangle::getClippedAABB(const Point *positions, const AABB &aabb) const { errors in such cases, otherwise the resulting tree will incorrectly remove triangles from the associated nodes. Hence, do the following computation in double precision! */ - for (int i=0; i<3; ++i) + for (int i=0; i<3; ++i) vertices1[i] = Point3d(positions[idx[i]]); for (int axis=0; axis<3; ++axis) { @@ -133,12 +133,12 @@ AABB Triangle::getClippedAABB(const Point *positions, const AABB &aabb) const { if (pos_f < pos_d) { /* Float value is too small */ pos_roundedDown = pos_f; - pos_roundedUp = nextafterf(pos_f, + pos_roundedUp = nextafterf(pos_f, std::numeric_limits::infinity()); } else if (pos_f > pos_d) { /* Float value is too large */ pos_roundedUp = pos_f; - pos_roundedDown = nextafterf(pos_f, + pos_roundedDown = nextafterf(pos_f, -std::numeric_limits::infinity()); } else { /* Double value is exactly representable */ diff --git a/src/libcore/util.cpp b/src/libcore/util.cpp index 4847b41c..3f2bf951 100644 --- a/src/libcore/util.cpp +++ b/src/libcore/util.cpp @@ -59,7 +59,7 @@ inline void enable_fpexcept_sse() { ~(_MM_MASK_INVALID | _MM_MASK_DIV_ZERO)); } inline unsigned int query_fpexcept_sse() { - return (~_MM_GET_EXCEPTION_MASK() & + return (~_MM_GET_EXCEPTION_MASK() & (_MM_MASK_INVALID | _MM_MASK_DIV_ZERO)); } inline void disable_fpexcept_sse() { @@ -91,11 +91,11 @@ std::vector tokenize(const std::string &string, const std::string & } std::string trim(const std::string& str) { - std::string::size_type + std::string::size_type start = str.find_first_not_of(" \t\r\n"), end = str.find_last_not_of(" \t\r\n"); - return str.substr(start == std::string::npos ? 0 : start, + return str.substr(start == std::string::npos ? 0 : start, end == std::string::npos ? str.length() - 1 : end - start + 1); } @@ -173,7 +173,7 @@ int getCoreCount() { std::string lastErrorText() { DWORD errCode = GetLastError(); char *errorText = NULL; - if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER + if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, @@ -201,7 +201,7 @@ bool enableFPExceptions() { #elif defined(__OSX__) exceptionsWereEnabled = query_fpexcept_sse() != 0; #else - exceptionsWereEnabled = + exceptionsWereEnabled = fegetexcept() & (FE_INVALID|FE_DIVBYZERO|FE_OVERFLOW); feenableexcept(FE_INVALID|FE_DIVBYZERO|FE_OVERFLOW); #endif @@ -220,7 +220,7 @@ bool disableFPExceptions() { #elif defined(__OSX__) exceptionsWereEnabled = query_fpexcept_sse() != 0; #else - exceptionsWereEnabled = + exceptionsWereEnabled = fegetexcept() & (FE_INVALID|FE_DIVBYZERO|FE_OVERFLOW); fedisableexcept(FE_INVALID|FE_DIVBYZERO|FE_OVERFLOW); #endif @@ -276,7 +276,7 @@ std::string getFQDN() { } char fqdn[NI_MAXHOST]; - retVal = getnameinfo(addrInfo->ai_addr, sizeof(struct sockaddr_in), + retVal = getnameinfo(addrInfo->ai_addr, sizeof(struct sockaddr_in), fqdn, NI_MAXHOST, NULL, 0, 0); if (retVal != 0) { freeaddrinfo(addrInfo); @@ -289,7 +289,7 @@ std::string getFQDN() { #endif return getHostName(); } - + freeaddrinfo(addrInfo); return fqdn; @@ -477,11 +477,11 @@ Float interpCubic1D(Float x, const Float *data, Float min, Float max, size_t siz /* Transform 'x' so that knots lie at integer positions */ Float t = ((x - min) * (size - 1)) / (max - min); - /* Find the index of the left knot in the queried subinterval, be + /* Find the index of the left knot in the queried subinterval, be robust to cases where 't' lies exactly on the right endpoint */ size_t k = std::max((size_t) 0, std::min((size_t) t, size - 2)); - Float f0 = data[k], + Float f0 = data[k], f1 = data[k+1], d0, d1; @@ -501,7 +501,7 @@ Float interpCubic1D(Float x, const Float *data, Float min, Float max, size_t siz Float t2 = t*t, t3 = t2*t; - return + return ( 2*t3 - 3*t2 + 1) * f0 + (-2*t3 + 3*t2) * f1 + ( t3 - 2*t2 + t) * d0 + @@ -516,7 +516,7 @@ Float interpCubic1DIrregular(Float x, const Float *nodes, const Float *data, siz size_t k = (size_t) std::max((ptrdiff_t) 0, std::min((ptrdiff_t) size - 2, std::lower_bound(nodes, nodes + size, x) - nodes - 1)); - Float f0 = data[k], + Float f0 = data[k], f1 = data[k+1], width = nodes[k+1] - nodes[k], invWidth = 1.0f / width, @@ -536,7 +536,7 @@ Float interpCubic1DIrregular(Float x, const Float *nodes, const Float *data, siz Float t = (x - nodes[k]) * invWidth; Float t2 = t*t, t3 = t2*t; - return + return ( 2*t3 - 3*t2 + 1) * f0 + (-2*t3 + 3*t2) * f1 + (( t3 - 2*t2 + t) * d0 + @@ -544,7 +544,7 @@ Float interpCubic1DIrregular(Float x, const Float *nodes, const Float *data, siz } -Float interpCubic2D(const Point2 &p, const Float *data, +Float interpCubic2D(const Point2 &p, const Float *data, const Point2 &min, const Point2 &max, const Size2 &size) { Float knotWeights[2][4]; Size2 knot; @@ -560,7 +560,7 @@ Float interpCubic2D(const Point2 &p, const Float *data, Float t = ((p[dim] - min[dim]) * (size[dim] - 1)) / (max[dim]-min[dim]); - /* Find the index of the left knot in the queried subinterval, be + /* Find the index of the left knot in the queried subinterval, be robust to cases where 't' lies exactly on the right endpoint */ knot[dim] = std::min((size_t) t, size[dim] - 2); @@ -614,7 +614,7 @@ Float interpCubic2D(const Point2 &p, const Float *data, return result; } -Float interpCubic2DIrregular(const Point2 &p, const Float **nodes_, +Float interpCubic2DIrregular(const Point2 &p, const Float **nodes_, const Float *data, const Size2 &size) { Float knotWeights[2][4]; Size2 knot; @@ -628,12 +628,12 @@ Float interpCubic2DIrregular(const Point2 &p, const Float **nodes_, if (!(p[dim] >= nodes[0] && p[dim] <= nodes[size[dim]-1])) return 0.0f; - /* Find the index of the left knot in the queried subinterval, be + /* Find the index of the left knot in the queried subinterval, be robust to cases where 't' lies exactly on the right endpoint */ size_t k = (size_t) std::max((ptrdiff_t) 0, std::min((ptrdiff_t) size[dim] - 2, std::lower_bound(nodes, nodes + size[dim], p[dim]) - nodes - 1)); knot[dim] = k; - + Float width = nodes[k+1] - nodes[k], invWidth = 1 / width; /* Compute the relative position within the interval */ @@ -688,7 +688,7 @@ Float interpCubic2DIrregular(const Point2 &p, const Float **nodes_, return result; } -Float interpCubic3D(const Point3 &p, const Float *data, +Float interpCubic3D(const Point3 &p, const Float *data, const Point3 &min, const Point3 &max, const Size3 &size) { Float knotWeights[3][4]; Size3 knot; @@ -704,7 +704,7 @@ Float interpCubic3D(const Point3 &p, const Float *data, Float t = ((p[dim] - min[dim]) * (size[dim] - 1)) / (max[dim]-min[dim]); - /* Find the index of the left knot in the queried subinterval, be + /* Find the index of the left knot in the queried subinterval, be robust to cases where 't' lies exactly on the right endpoint */ knot[dim] = std::min((size_t) t, size[dim] - 2); @@ -762,7 +762,7 @@ Float interpCubic3D(const Point3 &p, const Float *data, return result; } -Float interpCubic3DIrregular(const Point3 &p, const Float **nodes_, +Float interpCubic3DIrregular(const Point3 &p, const Float **nodes_, const Float *data, const Size3 &size) { Float knotWeights[3][4]; Size3 knot; @@ -776,12 +776,12 @@ Float interpCubic3DIrregular(const Point3 &p, const Float **nodes_, if (!(p[dim] >= nodes[0] && p[dim] <= nodes[size[dim]-1])) return 0.0f; - /* Find the index of the left knot in the queried subinterval, be + /* Find the index of the left knot in the queried subinterval, be robust to cases where 't' lies exactly on the right endpoint */ size_t k = (size_t) std::max((ptrdiff_t) 0, std::min((ptrdiff_t) size[dim] - 2, std::lower_bound(nodes, nodes + size[dim], p[dim]) - nodes - 1)); knot[dim] = k; - + Float width = nodes[k+1] - nodes[k], invWidth = 1 / width; /* Compute the relative position within the interval */ @@ -997,7 +997,7 @@ Vector refract(const Vector &wi, const Normal &n, Float eta) { /* Check for total internal reflection */ if (cosThetaTSqr <= 0.0f) return Vector(0.0f); - + return n * (cosThetaI * eta - math::signum(cosThetaI) * std::sqrt(cosThetaTSqr)) - wi * eta; } @@ -1025,7 +1025,7 @@ namespace { Float fresnelDiffuseReflectance(Float eta, bool fast) { if (fast) { /* Fast mode: the following code approximates the - * diffuse Frensel reflectance for the eta<1 and + * diffuse Frensel reflectance for the eta<1 and * eta>1 cases. An evalution of the accuracy led * to the following scheme, which cherry-picks * fits from two papers where they are best. @@ -1033,19 +1033,19 @@ Float fresnelDiffuseReflectance(Float eta, bool fast) { if (eta < 1) { /* Fit by Egan and Hilgeman (1973). Works reasonably well for "normal" IOR values (<2). - + Max rel. error in 1.0 - 1.5 : 0.1% Max rel. error in 1.5 - 2 : 0.6% Max rel. error in 2.0 - 5 : 9.5% */ - return -1.4399f * (eta * eta) - + 0.7099f * eta - + 0.6681f + return -1.4399f * (eta * eta) + + 0.7099f * eta + + 0.6681f + 0.0636f / eta; } else { /* Fit by d'Eon and Irving (2011) * - * Maintains a good accuracy even for + * Maintains a good accuracy even for * unrealistic IOR values. * * Max rel. error in 1.0 - 2.0 : 0.1% @@ -1057,10 +1057,10 @@ Float fresnelDiffuseReflectance(Float eta, bool fast) { invEta4 = invEta3*invEta, invEta5 = invEta4*invEta; - return 0.919317f - 3.4793f * invEta + return 0.919317f - 3.4793f * invEta + 6.75335f * invEta2 - - 7.80989f * invEta3 - + 4.98554f * invEta4 + - 7.80989f * invEta3 + + 4.98554f * invEta4 - 1.36881f * invEta5; } } else { diff --git a/src/libcore/vmf.cpp b/src/libcore/vmf.cpp index 8f1830df..7380b1d4 100644 --- a/src/libcore/vmf.cpp +++ b/src/libcore/vmf.cpp @@ -59,7 +59,7 @@ Vector VonMisesFisherDistr::sample(const Point2 &sample) const { math::sincos(2*M_PI * sample.y, &sinPhi, &cosPhi); - return Vector(cosPhi * sinTheta, + return Vector(cosPhi * sinTheta, sinPhi * sinTheta, cosTheta); } @@ -80,7 +80,7 @@ static Float A3(Float kappa) { } static Float dA3(Float kappa) { - Float csch = 2.0f / + Float csch = 2.0f / (math::fastexp(kappa)-math::fastexp(-kappa)); return 1/(kappa*kappa) - csch*csch; } diff --git a/src/libcore/warp.cpp b/src/libcore/warp.cpp index ba879207..349c776b 100644 --- a/src/libcore/warp.cpp +++ b/src/libcore/warp.cpp @@ -92,7 +92,7 @@ Point2 Warp::squareToUniformDiskConcentric(const Point2 &sample) { } else { /* Regions 3/4 */ if (r1readFloat(); } @@ -41,7 +41,7 @@ void ConstantFloatTexture::serialize(Stream *stream, InstanceManager *manager) c stream->writeFloat(m_value); } -SpectrumProductTexture::SpectrumProductTexture(Stream *stream, InstanceManager *manager) +SpectrumProductTexture::SpectrumProductTexture(Stream *stream, InstanceManager *manager) : Texture(stream, manager) { m_a = static_cast(manager->getInstance(stream)); m_b = static_cast(manager->getInstance(stream)); @@ -53,7 +53,7 @@ void SpectrumProductTexture::serialize(Stream *stream, InstanceManager *manager) manager->serialize(stream, m_b.get()); } -SpectrumAdditionTexture::SpectrumAdditionTexture(Stream *stream, InstanceManager *manager) +SpectrumAdditionTexture::SpectrumAdditionTexture(Stream *stream, InstanceManager *manager) : Texture(stream, manager) { m_a = static_cast(manager->getInstance(stream)); m_b = static_cast(manager->getInstance(stream)); @@ -65,7 +65,7 @@ void SpectrumAdditionTexture::serialize(Stream *stream, InstanceManager *manager manager->serialize(stream, m_b.get()); } -SpectrumSubtractionTexture::SpectrumSubtractionTexture(Stream *stream, InstanceManager *manager) +SpectrumSubtractionTexture::SpectrumSubtractionTexture(Stream *stream, InstanceManager *manager) : Texture(stream, manager) { m_a = static_cast(manager->getInstance(stream)); m_b = static_cast(manager->getInstance(stream)); @@ -79,7 +79,7 @@ void SpectrumSubtractionTexture::serialize(Stream *stream, InstanceManager *mana class ConstantSpectrumTextureShader : public Shader { public: - ConstantSpectrumTextureShader(Renderer *renderer, const Spectrum &value) + ConstantSpectrumTextureShader(Renderer *renderer, const Spectrum &value) : Shader(renderer, ETextureShader), m_value(value) { } @@ -108,7 +108,7 @@ private: class ConstantFloatTextureShader : public Shader { public: - ConstantFloatTextureShader(Renderer *renderer, const Float &value) + ConstantFloatTextureShader(Renderer *renderer, const Float &value) : Shader(renderer, ETextureShader), m_value(value) { } @@ -137,7 +137,7 @@ private: class SpectrumProductTextureShader : public Shader { public: - SpectrumProductTextureShader(Renderer *renderer, const Texture *a, const Texture *b) + SpectrumProductTextureShader(Renderer *renderer, const Texture *a, const Texture *b) : Shader(renderer, ETextureShader), m_a(a), m_b(b) { m_aShader = renderer->registerShaderForResource(m_a.get()); m_bShader = renderer->registerShaderForResource(m_b.get()); @@ -173,7 +173,7 @@ private: class SpectrumAdditionTextureShader : public Shader { public: - SpectrumAdditionTextureShader(Renderer *renderer, const Texture *a, const Texture *b) + SpectrumAdditionTextureShader(Renderer *renderer, const Texture *a, const Texture *b) : Shader(renderer, ETextureShader), m_a(a), m_b(b) { m_aShader = renderer->registerShaderForResource(m_a.get()); m_bShader = renderer->registerShaderForResource(m_b.get()); @@ -209,7 +209,7 @@ private: class SpectrumSubtractionTextureShader : public Shader { public: - SpectrumSubtractionTextureShader(Renderer *renderer, const Texture *a, const Texture *b) + SpectrumSubtractionTextureShader(Renderer *renderer, const Texture *a, const Texture *b) : Shader(renderer, ETextureShader), m_a(a), m_b(b) { m_aShader = renderer->registerShaderForResource(m_a.get()); m_bShader = renderer->registerShaderForResource(m_b.get()); @@ -243,23 +243,23 @@ private: ref m_aShader, m_bShader; }; -Shader *ConstantSpectrumTexture::createShader(Renderer *renderer) const { +Shader *ConstantSpectrumTexture::createShader(Renderer *renderer) const { return new ConstantSpectrumTextureShader(renderer, m_value); } -Shader *ConstantFloatTexture::createShader(Renderer *renderer) const { +Shader *ConstantFloatTexture::createShader(Renderer *renderer) const { return new ConstantFloatTextureShader(renderer, m_value); } -Shader *SpectrumProductTexture::createShader(Renderer *renderer) const { +Shader *SpectrumProductTexture::createShader(Renderer *renderer) const { return new SpectrumProductTextureShader(renderer, m_a.get(), m_b.get()); } -Shader *SpectrumAdditionTexture::createShader(Renderer *renderer) const { +Shader *SpectrumAdditionTexture::createShader(Renderer *renderer) const { return new SpectrumAdditionTextureShader(renderer, m_a.get(), m_b.get()); } -Shader *SpectrumSubtractionTexture::createShader(Renderer *renderer) const { +Shader *SpectrumSubtractionTexture::createShader(Renderer *renderer) const { return new SpectrumSubtractionTextureShader(renderer, m_a.get(), m_b.get()); } diff --git a/src/libhw/data/shaders.h b/src/libhw/data/shaders.h index 94041ad7..6a9a93ab 100644 --- a/src/libhw/data/shaders.h +++ b/src/libhw/data/shaders.h @@ -22,12 +22,12 @@ #define MAYBE_UNUSED #endif -static const char *sh_paraboloid_vert MAYBE_UNUSED = +static const char *sh_paraboloid_vert MAYBE_UNUSED = "void main() {\n" " gl_Position = gl_ModelViewMatrix * gl_Vertex;\n" "}\n"; -static const char *sh_paraboloid_geom MAYBE_UNUSED = +static const char *sh_paraboloid_geom MAYBE_UNUSED = "#extension GL_EXT_geometry_shader4 : enable\n" "\n" "/* -> Fragment shader (triangle data, projected position) */\n" @@ -145,7 +145,7 @@ static const char *sh_paraboloid_geom MAYBE_UNUSED = " EndPrimitive();\n" "}\n"; -static const char *sh_paraboloid_frag MAYBE_UNUSED = +static const char *sh_paraboloid_frag MAYBE_UNUSED = "/* Triangle data (from geometry shader) */\n" "varying vec3 p0, edge1, edge2;\n" "\n" @@ -192,19 +192,19 @@ static const char *sh_paraboloid_frag MAYBE_UNUSED = " gl_FragDepth = depth + sqrt(dx*dx+dy*dy);\n" "}\n"; -static const char *sh_directional_vert MAYBE_UNUSED = +static const char *sh_directional_vert MAYBE_UNUSED = "void main() {\n" " gl_Position = ftransform();\n" "}\n"; -static const char *sh_directional_frag MAYBE_UNUSED = +static const char *sh_directional_frag MAYBE_UNUSED = "void main() {\n" " float depth = gl_FragCoord.z,\n" " dx = dFdx(depth), dy = dFdy(depth);\n" " gl_FragDepth = depth + sqrt(dx*dx+dy*dy);\n" "}\n"; -static const char *sh_cube_6pass_vert MAYBE_UNUSED = +static const char *sh_cube_6pass_vert MAYBE_UNUSED = "/* Transformation matrix for the current cube map face */\n" "uniform mat4 transform;\n" "\n" @@ -220,7 +220,7 @@ static const char *sh_cube_6pass_vert MAYBE_UNUSED = " depth = dot(projDir, pos);\n" "}\n"; -static const char *sh_cube_6pass_frag MAYBE_UNUSED = +static const char *sh_cube_6pass_frag MAYBE_UNUSED = "/* Linear depth from the vertex shader */\n" "varying float depth;\n" "\n" @@ -234,12 +234,12 @@ static const char *sh_cube_6pass_frag MAYBE_UNUSED = " #endif\n" "}\n"; -static const char *sh_cube_1pass_vert MAYBE_UNUSED = +static const char *sh_cube_1pass_vert MAYBE_UNUSED = "void main() {\n" " gl_Position = gl_ModelViewMatrix * gl_Vertex;\n" "}\n"; -static const char *sh_cube_1pass_geom MAYBE_UNUSED = +static const char *sh_cube_1pass_geom MAYBE_UNUSED = "#extension GL_EXT_geometry_shader4 : enable\n" "\n" "/* Transformation matrix for each cube map face */\n" @@ -266,7 +266,7 @@ static const char *sh_cube_1pass_geom MAYBE_UNUSED = " }\n" "}\n"; -static const char *sh_cube_1pass_frag MAYBE_UNUSED = +static const char *sh_cube_1pass_frag MAYBE_UNUSED = "/* Linear depth from the vertex shader */\n" "varying float depth;\n" "\n" @@ -275,12 +275,12 @@ static const char *sh_cube_1pass_frag MAYBE_UNUSED = " gl_FragDepth = depth + sqrt(dx*dx+dy*dy);\n" "}\n"; -static const char *sh_hemicube_1pass_vert MAYBE_UNUSED = +static const char *sh_hemicube_1pass_vert MAYBE_UNUSED = "void main() {\n" " gl_Position = gl_ModelViewMatrix * gl_Vertex;\n" "}\n"; -static const char *sh_hemicube_1pass_geom MAYBE_UNUSED = +static const char *sh_hemicube_1pass_geom MAYBE_UNUSED = "#extension GL_EXT_geometry_shader4 : enable\n" "\n" "/* Transformation matrix for each cube map face */\n" @@ -307,7 +307,7 @@ static const char *sh_hemicube_1pass_geom MAYBE_UNUSED = " }\n" "}\n"; -static const char *sh_hemicube_1pass_frag MAYBE_UNUSED = +static const char *sh_hemicube_1pass_frag MAYBE_UNUSED = "/* Linear depth from the vertex shader */\n" "varying float depth;\n" "\n" @@ -316,7 +316,7 @@ static const char *sh_hemicube_1pass_frag MAYBE_UNUSED = " gl_FragDepth = depth + sqrt(dx*dx+dy*dy);\n" "}\n"; -static const char *sh_background_vert MAYBE_UNUSED = +static const char *sh_background_vert MAYBE_UNUSED = "uniform mat4 clipToWorld;\n" "varying vec3 position;\n" "\n" @@ -329,7 +329,7 @@ static const char *sh_background_vert MAYBE_UNUSED = "}\n" "\n"; -static const char *sh_background_frag MAYBE_UNUSED = +static const char *sh_background_frag MAYBE_UNUSED = "#extension GL_EXT_gpu_shader4 : enable\n" "\n" "varying vec3 position;\n" @@ -356,7 +356,7 @@ static const char *sh_background_frag MAYBE_UNUSED = " gl_FragColor = vec4(result * emitterScale, 1.0);\n" "}\n"; -static const char *sh_unsupported_vert MAYBE_UNUSED = +static const char *sh_unsupported_vert MAYBE_UNUSED = "/* Uniform parameters */\n" "uniform mat4 instanceTransform;\n" "\n" @@ -365,12 +365,12 @@ static const char *sh_unsupported_vert MAYBE_UNUSED = " gl_Position = gl_ModelViewProjectionMatrix * pos;\n" "}\n"; -static const char *sh_unsupported_frag MAYBE_UNUSED = +static const char *sh_unsupported_frag MAYBE_UNUSED = "void main() {\n" " gl_FragColor = vec4(0.0);\n" "}\n"; -static const char *sh_render_vert MAYBE_UNUSED = +static const char *sh_render_vert MAYBE_UNUSED = "/* Uniform parameters */\n" "uniform mat4 vplTransform;\n" "uniform mat4 instanceTransform;\n" @@ -430,7 +430,7 @@ static const char *sh_render_vert MAYBE_UNUSED = " #endif\n" "}\n"; -static const char *sh_render_geom MAYBE_UNUSED = +static const char *sh_render_geom MAYBE_UNUSED = "#extension GL_EXT_geometry_shader4 : enable\n" "\n" "/* From vertex program */\n" @@ -469,7 +469,7 @@ static const char *sh_render_geom MAYBE_UNUSED = " EndPrimitive();\n" "}\n"; -static const char *sh_render_frag MAYBE_UNUSED = +static const char *sh_render_frag MAYBE_UNUSED = "#extension GL_EXT_gpu_shader4 : enable\n" "\n" "#define EPSILON 0.001\n" diff --git a/src/libhw/data/vera14_dsc.h b/src/libhw/data/vera14_dsc.h index d4081d25..381e9438 100644 --- a/src/libhw/data/vera14_dsc.h +++ b/src/libhw/data/vera14_dsc.h @@ -1,190 +1,190 @@ /* Autogenerated by bin2c */ uint8_t vera14_dsc[] = { - 0x1f, 0x8b, 0x08, 0x08, 0xa5, 0x63, 0x4e, 0x50, 0x00, 0x03, 0x76, 0x65, - 0x72, 0x61, 0x31, 0x34, 0x2e, 0x64, 0x73, 0x63, 0x00, 0xed, 0x9c, 0x3d, - 0x53, 0x22, 0x4b, 0x14, 0x86, 0x5b, 0x01, 0x11, 0x01, 0xaf, 0xe1, 0x9a, - 0x6d, 0x99, 0x9a, 0x92, 0xad, 0x0c, 0x46, 0xa6, 0xa6, 0x84, 0x5a, 0x65, - 0x64, 0x4a, 0x6a, 0x60, 0x62, 0x4e, 0x68, 0x48, 0x6d, 0x7a, 0x13, 0x03, - 0x7f, 0x00, 0x91, 0xb1, 0x21, 0xa1, 0x81, 0x91, 0xd1, 0xfd, 0x01, 0x96, - 0x73, 0xe9, 0xd3, 0xdd, 0x67, 0x7a, 0x60, 0x66, 0xfa, 0xa0, 0x80, 0x1f, - 0xf3, 0x3e, 0x55, 0xb3, 0xb0, 0xe3, 0xcb, 0xf9, 0xe8, 0xee, 0xd3, 0xd3, - 0xd3, 0x7c, 0x28, 0x65, 0x38, 0x3a, 0x9b, 0x1e, 0x63, 0x7a, 0x5a, 0x9f, - 0x1e, 0xad, 0xe9, 0xb1, 0x31, 0x3d, 0x76, 0xa6, 0xc7, 0x76, 0x77, 0x4f, - 0xa0, 0x19, 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6d, 0x38, 0x3b, 0x27, 0xd8, 0xbd, 0x02, - 0x33, 0x27, 0xbc, 0x64, 0x6b, 0x94, 0x3f, 0x6f, 0xbc, 0x5a, 0x5f, 0x8a, - 0x35, 0xd5, 0x59, 0x3b, 0x54, 0xef, 0xce, 0xce, 0x1d, 0xdb, 0xf1, 0xf7, - 0xd0, 0x2a, 0xbd, 0xbd, 0x70, 0x5e, 0x54, 0xef, 0x81, 0xbc, 0xa8, 0xde, - 0x43, 0x76, 0x0e, 0x05, 0x9a, 0x8e, 0x40, 0xd3, 0x15, 0xc4, 0x73, 0x22, - 0xd0, 0x9c, 0x5a, 0xcd, 0x48, 0xb9, 0xf7, 0xa4, 0xdc, 0x9a, 0xd9, 0x8d, - 0x9f, 0x56, 0xcf, 0x8d, 0xc3, 0xec, 0xbd, 0xe5, 0x64, 0x3d, 0x1f, 0x8a, - 0xf9, 0x52, 0xa0, 0x19, 0x84, 0x35, 0xfa, 0x64, 0xf4, 0x6f, 0x71, 0x5e, - 0x54, 0xef, 0xff, 0xda, 0x98, 0xff, 0xe3, 0x38, 0xff, 0xf1, 0xc6, 0x46, - 0x9d, 0xea, 0xdd, 0xd9, 0x79, 0x62, 0x3b, 0xbb, 0x29, 0x3b, 0x13, 0xcf, - 0xce, 0x13, 0xdb, 0xf1, 0xf7, 0x3c, 0xed, 0x27, 0x3c, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x71, 0xea, 0x49, 0x9c, - 0x2f, 0x5c, 0x07, 0x0b, 0xba, 0xff, 0x60, 0xb4, 0x71, 0xea, 0x59, 0xac, - 0xe2, 0x58, 0xbd, 0xe5, 0x99, 0x27, 0x45, 0xbc, 0xe2, 0xf6, 0x89, 0xdf, - 0xc2, 0x1a, 0x9f, 0xb7, 0xf8, 0x93, 0xfb, 0x0b, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x80, 0xef, 0x43, 0x3c, 0xf3, 0xbf, 0x38, 0x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x06, 0x05, 0x00, - 0x94, 0x83, 0xb2, 0x7f, 0xfe, 0x09, 0xf9, 0xa7, 0xff, 0x87, 0xfc, 0x91, - 0xff, 0xc7, 0x2c, 0x7e, 0x14, 0xe4, 0xbf, 0x4a, 0xf9, 0x1a, 0x8d, 0x7d, - 0x43, 0xd0, 0xff, 0xc8, 0x1f, 0xf9, 0x2f, 0xd3, 0xe2, 0x7b, 0x62, 0x58, - 0xa5, 0x1c, 0x00, 0x00, 0x40, 0x16, 0x65, 0xff, 0xfc, 0x1b, 0xf2, 0x47, - 0xfe, 0xc8, 0x7f, 0x99, 0x16, 0x17, 0x72, 0xee, 0x3f, 0x2c, 0xf8, 0xaa, - 0x65, 0x85, 0x50, 0xee, 0xf5, 0x2f, 0xf2, 0x47, 0xfe, 0x65, 0xce, 0x1f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x0d, 0x1b, 0xc9, - 0x53, 0xdc, 0xc9, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x05, 0xe0, 0xf3, 0x7f, 0x2b, 0xb1, - 0xb8, 0x4a, 0xf7, 0x78, 0xd7, 0x08, 0x7c, 0x80, 0xb2, 0xff, 0xfe, 0x55, - 0xd9, 0xf3, 0x07, 0x00, 0x80, 0x12, 0xe2, 0xcd, 0x9c, 0x6f, 0xde, 0x89, - 0xec, 0x09, 0x75, 0xee, 0x37, 0x7a, 0xf3, 0x64, 0x9a, 0x45, 0x03, 0xf9, - 0x9c, 0xdf, 0xff, 0x9d, 0xcb, 0xff, 0xbd, 0xaf, 0xfe, 0x70, 0x20, 0xf8, - 0xfd, 0x63, 0x00, 0xc0, 0x7a, 0x49, 0x16, 0xfb, 0x3f, 0xff, 0xf7, 0xdf, - 0xb3, 0xcc, 0xc4, 0xc5, 0x7f, 0x7e, 0x87, 0xc5, 0x77, 0xa0, 0x73, 0xcf, - 0xcb, 0x3f, 0xc6, 0xfc, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x64, 0xbc, - 0xf5, 0x15, 0x2d, 0xc2, 0x62, 0xfd, 0x10, 0xa7, 0x15, 0xe9, 0xe7, 0xe9, - 0xbf, 0x2f, 0x6b, 0x75, 0xe6, 0x9b, 0xcc, 0xb4, 0x99, 0xbf, 0xa9, 0xb2, - 0xf8, 0x76, 0x0b, 0xf0, 0xc0, 0xfb, 0x1f, 0xe5, 0x06, 0xfd, 0x0f, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7e, 0x2e, 0x78, 0x33, 0x09, 0x00, 0x00, 0x7e, 0x18, 0xf8, - 0xfc, 0x7b, 0x96, 0x79, 0xfe, 0xe7, 0xc7, 0x7f, 0xff, 0x01, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xc0, 0xdd, 0x66, 0xb9, 0xdb, - 0xa0, 0xcc, 0xb9, 0x3b, 0xca, 0xdc, 0x06, 0x65, 0xce, 0xfd, 0x47, 0xf1, + 0x1f, 0x8b, 0x08, 0x08, 0xa5, 0x63, 0x4e, 0x50, 0x00, 0x03, 0x76, 0x65, + 0x72, 0x61, 0x31, 0x34, 0x2e, 0x64, 0x73, 0x63, 0x00, 0xed, 0x9c, 0x3d, + 0x53, 0x22, 0x4b, 0x14, 0x86, 0x5b, 0x01, 0x11, 0x01, 0xaf, 0xe1, 0x9a, + 0x6d, 0x99, 0x9a, 0x92, 0xad, 0x0c, 0x46, 0xa6, 0xa6, 0x84, 0x5a, 0x65, + 0x64, 0x4a, 0x6a, 0x60, 0x62, 0x4e, 0x68, 0x48, 0x6d, 0x7a, 0x13, 0x03, + 0x7f, 0x00, 0x91, 0xb1, 0x21, 0xa1, 0x81, 0x91, 0xd1, 0xfd, 0x01, 0x96, + 0x73, 0xe9, 0xd3, 0xdd, 0x67,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 0x7b, 0xfe, 0x65, 0x07, 0xf7, 0xff, 0x5f, 0x89, 0xf5, 0xa7, 0xf6, 0xb5, + 0x1a, 0xf3, 0x6b, 0x45, 0xf3, 0xe3, 0x48, 0xbe, 0xec, 0xc7, 0x6f, 0xc0, + 0x2f, 0xd0, 0xe2, 0x4b, 0xec, 0x9c, 0xfc, 0xaf, 0xb0, 0xe3, 0xfd, 0x7f, + 0x00, 0x00, 0x58, 0x15, 0xf8, 0xfe, 0x37, 0x48, 0x83, 0x06, 0x05, 0x00, + 0x94, 0x83, 0xb2, 0x7f, 0xfe, 0x09, 0xf9, 0xa7, 0xff, 0x87, 0xfc, 0x91, + 0xff, 0xc7, 0x2c, 0x7e, 0x14, 0xe4, 0xbf, 0x4a, 0xf9, 0x1a, 0x8d, 0x7d, + 0x43, 0xd0, 0xff, 0xc8, 0x1f, 0xf9, 0x2f, 0xd3, 0xe2, 0x7b, 0x62, 0x58, + 0xa5, 0x1c, 0x00, 0x00, 0x40, 0x16, 0x65, 0xff, 0xfc, 0x1b, 0xf2, 0x47, + 0xfe, 0xc8, 0x7f, 0x99, 0x16, 0x17, 0x72, 0xee, 0x3f, 0x2c, 0xf8, 0xaa, + 0x65, 0x85, 0x50, 0xee, 0xf5, 0x2f, 0xf2, 0x47, 0xfe, 0x65, 0xce, 0x1f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x0d, 0x1b, 0xc9, + 0x53, 0xdc, 0xc9, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x05, 0xe0, 0xf3, 0x7f, 0x2b, 0xb1, + 0xb8, 0x4a, 0xf7, 0x78, 0xd7, 0x08, 0x7c, 0x80, 0xb2, 0xff, 0xfe, 0x55, + 0xd9, 0xf3, 0x07, 0x00, 0x80, 0x12, 0xe2, 0xcd, 0x9c, 0x6f, 0xde, 0x89, + 0xec, 0x09, 0x75, 0xee, 0x37, 0x7a, 0xf3, 0x64, 0x9a, 0x45, 0x03, 0xf9, + 0x9c, 0xdf, 0xff, 0x9d, 0xcb, 0xff, 0xbd, 0xaf, 0xfe, 0x70, 0x20, 0xf8, + 0xfd, 0x63, 0x00, 0xc0, 0x7a, 0x49, 0x16, 0xfb, 0x3f, 0xff, 0xf7, 0xdf, + 0xb3, 0xcc, 0xc4, 0xc5, 0x7f, 0x7e, 0x87, 0xc5, 0x77, 0xa0, 0x73, 0xcf, + 0xcb, 0x3f, 0xc6, 0xfc, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x64, 0xbc, + 0xf5, 0x15, 0x2d, 0xc2, 0x62, 0xfd, 0x10, 0xa7, 0x15, 0xe9, 0xe7, 0xe9, + 0xbf, 0x2f, 0x6b, 0x75, 0xe6, 0x9b, 0xcc, 0xb4, 0x99, 0xbf, 0xa9, 0xb2, + 0xf8, 0x76, 0x0b, 0xf0, 0xc0, 0xfb, 0x1f, 0xe5, 0x06, 0xfd, 0x0f, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7e, 0x2e, 0x78, 0x33, 0x09, 0x00, 0x00, 0x7e, 0x18, 0xf8, + 0xfc, 0x7b, 0x96, 0x79, 0xfe, 0xe7, 0xc7, 0x7f, 0xff, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xc0, 0xdd, 0x66, 0xb9, 0xdb, + 0xa0, 0xcc, 0xb9, 0x3b, 0xca, 0xdc, 0x06, 0x65, 0xce, 0xfd, 0x47, 0xf1, 0x3f, 0xdf, 0x37, 0xf4, 0x4c, 0x00, 0x24, 0x01, 0x00 }; diff --git a/src/libhw/data/vera14_png.h b/src/libhw/data/vera14_png.h index de6df048..f74dce36 100644 --- a/src/libhw/data/vera14_png.h +++ b/src/libhw/data/vera14_png.h @@ -1,751 +1,751 @@ /* Autogenerated by bin2c */ uint8_t vera14_png[] = { - 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, - 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, - 0x08, 0x00, 0x00, 0x00, 0x00, 0xd1, 0x13, 0x8b, 0x26, 0x00, 0x00, 0x00, - 0x04, 0x67, 0x41, 0x4d, 0x41, 0x00, 0x00, 0xb1, 0x8f, 0x0b, 0xfc, 0x61, - 0x05, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x03, 0x37, 0xc7, - 0x4d, 0x53, 0x00, 0x00, 0x00, 0x20, 0x63, 0x48, 0x52, 0x4d, 0x00, 0x00, - 0x7a, 0x26, 0x00, 0x00, 0x80, 0x84, 0x00, 0x00, 0xfa, 0x00, 0x00, 0x00, - 0x80, 0xe8, 0x00, 0x00, 0x75, 0x30, 0x00, 0x00, 0xea, 0x60, 0x00, 0x00, - 0x3a, 0x98, 0x00, 0x00, 0x17, 0x70, 0x9c, 0xba, 0x51, 0x3c, 0x00, 0x00, - 0x00, 0x22, 0x74, 0x45, 0x58, 0x74, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x65, 0x64, 0x2d, 0x62, 0x79, 0x00, 0x4d, 0x69, 0x74, 0x73, 0x75, - 0x62, 0x61, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x30, - 0x2e, 0x34, 0x2e, 0x30, 0xd0, 0x43, 0xaf, 0x65, 0x00, 0x00, 0x20, 0x00, - 0x49, 0x44, 0x41, 0x54, 0x78, 0x5e, 0xed, 0xdd, 0x77, 0x60, 0x15, 0x55, - 0xa2, 0x06, 0xf0, 0x2f, 0x21, 0x8d, 0x14, 0x48, 0xa8, 0x42, 0x50, 0x94, - 0x05, 0xc5, 0x08, 0x2a, 0x60, 0xa1, 0xa8, 0x84, 0x22, 0x0a, 0x02, 0x06, - 0x44, 0x14, 0x5c, 0x01, 0xc5, 0x05, 0x7c, 0xb2, 0x02, 0xea, 0xfa, 0x9e, - 0xae, 0xb8, 0xba, 0x2a, 0xb8, 0xb2, 0xa2, 0x2e, 0xeb, 0x22, 0x2e, 0x4d, - 0x05, 0x6c, 0x08, 0x28, 0x45, 0x8a, 0x14, 0x81, 0x80, 0xd2, 0x7b, 0x0d, - 0x81, 0x10, 0x82, 0x21, 0x21, 0x01, 0x49, 0x20, 0x85, 0x72, 0xde, 0x1f, - 0x97, 0x9b, 0x39, 0xed, 0x26, 0xc3, 0x25, 0x01, 0x0d, 0xdf, 0xef, 0x0f, - 0xf4, 0x7e, 0xf7, 0x4c, 0xb9, 0xf7, 0x9c, 0xcc, 0xcc, 0x9d, 0x39, 0x73, - 0x26, 0x40, 0x00, 0x00, 0x10, 0x80, 0x22, 0x4c, 0xae, 0x84, 0x44, 0x7b, - 0x4b, 0x30, 0xb9, 0xc2, 0x12, 0xaf, 0x40, 0x4b, 0x46, 0x57, 0x10, 0x36, - 0x80, 0x2b, 0x1c, 0x1b, 0xc0, 0x15, 0x8e, 0x0d, 0xe0, 0x0a, 0xc7, 0x06, - 0x70, 0x85, 0x63, 0x03, 0xb8, 0xc2, 0xb1, 0x01, 0x5c, 0xe1, 0xd8, 0x00, - 0xae, 0x70, 0x6c, 0x00, 0x57, 0xb8, 0x20, 0xcb, 0xe9, 0x21, 0x26, 0x57, - 0x42, 0x42, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x57, 0x24, 0xe1, 0x71, - 0xd1, 0x89, 0xc9, 0xf6, 0x63, 0xd4, 0x32, 0x45, 0x68, 0x5e, 0x43, 0xac, - 0x7c, 0x4a, 0x2d, 0xa6, 0xa8, 0xb3, 0x38, 0xe7, 0x87, 0xda, 0x00, 0x7e, - 0x78, 0xbe, 0x28, 0xaa, 0xfb, 0x7d, 0xce, 0xde, 0x3f, 0x16, 0x33, 0x09, - 0x00, 0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x6e, - 0x5a, 0x24, 0xcf, 0x30, 0xf4, 0xf5, 0xa4, 0xfc, 0x5d, 0x7f, 0x94, 0x7b, - 0xcf, 0x58, 0x3e, 0xb2, 0x19, 0x35, 0x1e, 0x9d, 0xbe, 0xfc, 0x89, 0x12, - 0x77, 0x01, 0x4f, 0xae, 0x48, 0x7f, 0x57, 0xd9, 0x05, 0x1c, 0x8d, 0x55, - 0x4b, 0xe4, 0x56, 0xc6, 0xd1, 0x1a, 0x40, 0x4d, 0x81, 0xf0, 0xfc, 0xf3, - 0x51, 0xc2, 0x5b, 0x00, 0xa6, 0x25, 0x38, 0x65, 0x04, 0x80, 0x90, 0xb8, - 0xd9, 0x9f, 0x38, 0x89, 0xef, 0x06, 0xe0, 0xec, 0x27, 0xdc, 0x6c, 0x01, - 0xf2, 0x2a, 0x02, 0x80, 0x5c, 0xdf, 0x7e, 0x6e, 0x01, 0x6e, 0x4f, 0x57, - 0x2e, 0xfd, 0xda, 0x97, 0x1e, 0xb8, 0xe9, 0xba, 0xeb, 0x36, 0x49, 0x5d, - 0x3c, 0x05, 0xd0, 0x72, 0x7d, 0x85, 0x12, 0x1a, 0x80, 0x10, 0x05, 0x49, - 0x23, 0xe5, 0xee, 0x4e, 0xde, 0x32, 0xce, 0x5f, 0xbc, 0x10, 0x42, 0x88, - 0xf4, 0x1a, 0x52, 0x19, 0x54, 0xed, 0x33, 0x66, 0x43, 0xb2, 0xda, 0x1b, - 0xe1, 0xbc, 0xe3, 0xb1, 0x00, 0x62, 0x8f, 0xeb, 0x71, 0x7b, 0xf9, 0xa8, - 0xcb, 0x5c, 0x79, 0x6b, 0x6f, 0xf9, 0xa0, 0x07, 0x67, 0x66, 0x4f, 0x8e, - 0xb7, 0xbc, 0xe1, 0x15, 0x3f, 0xf9, 0xd8, 0xcc, 0xae, 0x25, 0xfc, 0x65, - 0xe4, 0x46, 0xe2, 0x68, 0x75, 0xa0, 0x86, 0x40, 0x6b, 0xef, 0x86, 0x62, - 0x96, 0x10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 0x65, 0x47, 0x58, 0xf1, 0x6f, 0x3b, 0x0b, 0x4e, 0x2c, - 0x7c, 0xc0, 0x09, 0x84, 0x10, 0x79, 0x29, 0xdf, 0xf6, 0x2a, 0xfe, 0x44, - 0x10, 0x0c, 0xc1, 0xc3, 0xd6, 0x9d, 0x2c, 0x4c, 0x99, 0xe4, 0xdc, 0x85, - 0xe4, 0xaa, 0x01, 0x04, 0x9c, 0xd3, 0x02, 0x01, 0x00, 0x75, 0x76, 0xbf, - 0x2c, 0x25, 0xc6, 0x01, 0xa7, 0x8f, 0x06, 0x10, 0xb8, 0x46, 0x2e, 0x15, - 0xfd, 0x5e, 0xea, 0xe9, 0x83, 0xa3, 0xe5, 0x93, 0x3c, 0x30, 0x54, 0x1a, - 0x95, 0x72, 0x46, 0xec, 0x90, 0x3a, 0x51, 0x79, 0xca, 0x74, 0x58, 0xef, - 0x24, 0x6d, 0x67, 0x64, 0x9f, 0xda, 0x33, 0xc2, 0x7a, 0x67, 0xd0, 0x6f, - 0x4e, 0xdd, 0xcd, 0x73, 0xee, 0xad, 0x1c, 0x12, 0xf7, 0x8e, 0xf5, 0xf6, - 0xa6, 0xdf, 0xa8, 0x6a, 0xf2, 0xcf, 0xb2, 0xcb, 0xa2, 0xce, 0x2f, 0xbe, - 0x7f, 0xe8, 0xfd, 0xde, 0x84, 0x0e, 0x4e, 0xfc, 0xb5, 0x70, 0xff, 0x04, - 0xeb, 0x21, 0xeb, 0x6f, 0x53, 0xe8, 0x70, 0xb3, 0x07, 0xea, 0xa5, 0xd6, - 0x31, 0xa5, 0x6a, 0x49, 0x45, 0xa8, 0xac, 0x14, 0xfe, 0x74, 0x43, 0x49, - 0x45, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x7e, 0x2b, 0xbc, 0x97, 0x3b, - 0x8b, 0x3b, 0xf9, 0xb9, 0xde, 0xd3, 0x39, 0xa7, 0x83, 0x73, 0x19, 0x37, - 0xe9, 0x26, 0x00, 0x0f, 0x89, 0x87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 0x8b, 0x6e, 0x03, - 0x50, 0x47, 0x19, 0x01, 0xe4, 0xac, 0xde, 0x16, 0x97, 0x77, 0x06, 0xd0, - 0xa5, 0xf8, 0x06, 0xe0, 0x86, 0xab, 0x06, 0xd0, 0x10, 0x88, 0x11, 0x0d, - 0x81, 0x18, 0xef, 0xf5, 0x71, 0xd1, 0x04, 0x40, 0x0d, 0x79, 0x58, 0x89, - 0xc4, 0x04, 0x00, 0xdd, 0x7c, 0x8e, 0x78, 0x57, 0x52, 0x03, 0xc0, 0xc7, - 0xcf, 0x03, 0x18, 0x2a, 0xf5, 0x32, 0x0c, 0x3f, 0x1e, 0x8e, 0xe8, 0xac, - 0xe0, 0x63, 0xd5, 0x10, 0x98, 0xe6, 0xbd, 0xc4, 0xd0, 0x66, 0xf7, 0xb5, - 0x7b, 0x9c, 0xde, 0xb4, 0x00, 0x30, 0xf7, 0x25, 0xbc, 0xa2, 0x57, 0x43, - 0xab, 0xc5, 0x72, 0x8f, 0x56, 0xcb, 0xd7, 0xb2, 0x5b, 0x1f, 0x5a, 0xc1, - 0x2c, 0x35, 0x62, 0x47, 0x1d, 0x00, 0x57, 0xef, 0x18, 0x61, 0x94, 0x2c, - 0x4e, 0xdd, 0x6f, 0x32, 0x84, 0x38, 0x23, 0x27, 0x62, 0xe0, 0xde, 0xc2, - 0x7d, 0xfd, 0xe4, 0xe4, 0x94, 0x3e, 0xfe, 0x1c, 0xf0, 0xc4, 0x3e, 0x6d, - 0x63, 0x9e, 0x79, 0xe6, 0xcc, 0xd9, 0x73, 0xe2, 0xac, 0x94, 0xe8, 0x97, - 0x79, 0x80, 0xec, 0x68, 0x00, 0x31, 0x4a, 0x03, 0x30, 0x36, 0xcb, 0x6e, - 0xb7, 0x00, 0xcd, 0x0f, 0xcb, 0xa3, 0xfb, 0x58, 0x1a, 0x40, 0x40, 0xd1, - 0x3f, 0xde, 0xc4, 0xe8, 0x5c, 0x9c, 0x1d, 0x03, 0x5f, 0x97, 0x83, 0xf5, - 0xa2, 0xd6, 0x06, 0xd0, 0x6c, 0x07, 0x80, 0xad, 0x72, 0xcd, 0x2c, 0xec, - 0x88, 0x2e, 0xdf, 0x61, 0xce, 0x43, 0x68, 0xea, 0x8c, 0xe5, 0xf0, 0xce, - 0x21, 0x6d, 0xf3, 0x5d, 0x27, 0xbd, 0x53, 0x7a, 0x1d, 0x28, 0x6e, 0x48, - 0x54, 0x76, 0x4d, 0x96, 0x2f, 0xc1, 0x18, 0x5c, 0xc5, 0xdf, 0xbf, 0x1e, - 0xdd, 0xd2, 0x91, 0xb1, 0x41, 0x61, 0xca, 0xac, 0xc4, 0x81, 0xd6, 0x91, - 0xf1, 0x29, 0x52, 0xef, 0x63, 0x64, 0x19, 0x0d, 0xe0, 0xbe, 0xfd, 0xad, - 0x23, 0xe3, 0x53, 0xe4, 0xc9, 0xf2, 0xe4, 0x0e, 0xeb, 0x1e, 0xc6, 0x0a, - 0x5a, 0x1a, 0x80, 0xb1, 0x59, 0x76, 0xd9, 0x00, 0x12, 0x52, 0x95, 0xbe, - 0x17, 0x3e, 0xb6, 0x09, 0xce, 0x3f, 0x45, 0xff, 0x2d, 0xcd, 0x06, 0x80, - 0xf5, 0xad, 0x70, 0xa7, 0xdc, 0x93, 0x0f, 0xcf, 0x7d, 0x80, 0x51, 0xc3, - 0xf0, 0xc2, 0x18, 0xbc, 0x30, 0xcc, 0x1b, 0x45, 0x2c, 0x8a, 0xdb, 0xa4, - 0x5d, 0x70, 0x1c, 0x70, 0x4e, 0x3b, 0xf0, 0xa8, 0x99, 0x78, 0xad, 0xf2, - 0xda, 0xf2, 0x25, 0x18, 0xc3, 0x2b, 0x95, 0x56, 0x03, 0xc8, 0x8d, 0x04, - 0xee, 0x51, 0x1b, 0x40, 0x17, 0x00, 0x09, 0xcb, 0xa4, 0x64, 0xe9, 0x43, - 0xd0, 0xfc, 0xd8, 0x05, 0x40, 0x82, 0x3c, 0xd9, 0xca, 0x41, 0x7a, 0x19, - 0x73, 0x05, 0x97, 0x77, 0x06, 0xd0, 0x59, 0x69, 0x00, 0xc6, 0x66, 0xd9, - 0x5d, 0x03, 0x78, 0x66, 0x8b, 0xda, 0xd5, 0xd2, 0xbf, 0x06, 0x90, 0xf8, - 0x20, 0x80, 0x04, 0x97, 0xbb, 0x80, 0x9c, 0xca, 0x00, 0x10, 0xad, 0xf4, - 0x0a, 0x1d, 0x38, 0x19, 0xff, 0x75, 0x0e, 0x01, 0x01, 0xc4, 0xed, 0xc6, - 0x9a, 0x26, 0xb8, 0x6d, 0x2b, 0xe6, 0xdd, 0xe8, 0x8d, 0xc6, 0x75, 0xc1, - 0x0b, 0x72, 0xc7, 0x12, 0x00, 0x01, 0xda, 0xea, 0x46, 0x2c, 0xd6, 0xee, - 0x02, 0xb1, 0x7d, 0x09, 0xfa, 0x00, 0x6b, 0xa5, 0xd5, 0x00, 0x36, 0x0c, - 0x0b, 0x6f, 0xb6, 0x43, 0x99, 0x95, 0x88, 0x06, 0x10, 0x23, 0x0f, 0xcd, - 0x19, 0x7f, 0xa8, 0x93, 0x76, 0x10, 0x98, 0x65, 0xfc, 0x2d, 0xb7, 0xcb, - 0xea, 0x5b, 0x35, 0xa2, 0x9d, 0x32, 0xfc, 0x84, 0xb1, 0x82, 0x9d, 0x93, - 0xef, 0x8e, 0xb8, 0x3b, 0x59, 0x69, 0x00, 0xc6, 0x66, 0xd9, 0x55, 0x03, - 0x78, 0x2d, 0x51, 0xeb, 0xd7, 0xe3, 0x5f, 0x03, 0xe8, 0x96, 0x12, 0x1f, - 0x19, 0x9f, 0xe2, 0xf2, 0x20, 0x70, 0xed, 0xbd, 0x00, 0x70, 0x9f, 0xd3, - 0x0d, 0x0d, 0x40, 0x54, 0x7a, 0xed, 0x34, 0xb5, 0xc3, 0x67, 0x4a, 0xa3, - 0x8c, 0x40, 0x54, 0x38, 0x56, 0xab, 0xa8, 0x27, 0x5a, 0xc7, 0xef, 0x80, - 0x0a, 0xeb, 0xee, 0x53, 0x0a, 0x69, 0x73, 0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, 0xdb, 0x72, 0xff, 0xbc, 0x2a, 0x37, - 0xf7, 0x39, 0x23, 0x05, 0xe0, 0x6e, 0xe5, 0x99, 0x5c, 0x7c, 0x62, 0x32, - 0x06, 0x42, 0xc1, 0x4f, 0xf7, 0x43, 0x7f, 0xf8, 0x90, 0x65, 0x1e, 0xd9, - 0xb5, 0x81, 0xda, 0xd2, 0x80, 0x5f, 0x42, 0x88, 0x3d, 0xda, 0x11, 0x88, - 0x31, 0x4d, 0x46, 0x95, 0x98, 0xd7, 0x4e, 0xbe, 0x65, 0xc4, 0x80, 0xbb, - 0x95, 0x67, 0x72, 0xf1, 0x89, 0xe9, 0x57, 0x23, 0x39, 0x5e, 0xc9, 0x68, - 0x00, 0x96, 0x63, 0xc9, 0x63, 0xb1, 0x40, 0xac, 0x32, 0xb0, 0x51, 0xcb, - 0x73, 0x25, 0x3d, 0x5f, 0x27, 0xab, 0x07, 0x70, 0x97, 0xfc, 0x2c, 0x59, - 0x87, 0x9b, 0x95, 0x67, 0x72, 0xf1, 0x89, 0xc9, 0x7c, 0xf7, 0x78, 0x25, - 0x18, 0x57, 0x34, 0xcd, 0x52, 0x33, 0xe6, 0xc4, 0xd6, 0x9e, 0xf3, 0x85, - 0x54, 0xc2, 0xc5, 0x2f, 0x8e, 0xc1, 0x67, 0xa7, 0x36, 0x8e, 0xdd, 0x6f, - 0x7d, 0xcb, 0xcd, 0xca, 0x33, 0xb9, 0xf8, 0xc4, 0x64, 0xbe, 0xfb, 0xf3, - 0x7d, 0x30, 0xba, 0x2c, 0x18, 0xa5, 0x1e, 0xc9, 0x99, 0x71, 0x2c, 0xeb, - 0xf3, 0x1c, 0xa5, 0xe7, 0xbc, 0x56, 0xc8, 0xb2, 0xdc, 0x07, 0x77, 0x89, - 0x54, 0xad, 0xb3, 0xfd, 0x79, 0x6e, 0x56, 0x9e, 0xc9, 0xc5, 0x27, 0x26, - 0xf3, 0xdd, 0xc7, 0xf6, 0x36, 0x3f, 0x73, 0x83, 0x3a, 0xca, 0x96, 0x59, - 0x6a, 0x52, 0x0f, 0x00, 0xe8, 0x31, 0xa6, 0x98, 0x42, 0xd6, 0xe5, 0x36, - 0x1c, 0xbf, 0xc4, 0x16, 0xbb, 0x5a, 0x79, 0x26, 0x17, 0x9f, 0x98, 0x2c, - 0xef, 0x3e, 0xbd, 0x57, 0xec, 0xeb, 0xad, 0x94, 0x71, 0xb1, 0x79, 0x87, - 0x31, 0x2b, 0x6b, 0xf9, 0x88, 0x47, 0x0e, 0xda, 0x62, 0x57, 0x2b, 0xcf, - 0xe4, 0xe2, 0x13, 0x97, 0xfc, 0x98, 0xc4, 0x64, 0xce, 0x44, 0x08, 0x91, - 0x3d, 0xdf, 0x79, 0x1c, 0xaa, 0x24, 0xc8, 0x56, 0x9a, 0x49, 0x19, 0x24, - 0x97, 0x95, 0xab, 0x5e, 0x75, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x74, - 0x05, 0x10, 0x96, 0x9f, 0xac, 0x5d, 0x97, 0xe5, 0xe4, 0x2c, 0xed, 0x2c, - 0x17, 0x3a, 0x97, 0x2c, 0x0f, 0x23, 0x05, 0x20, 0x60, 0x14, 0x02, 0x46, - 0xc9, 0x81, 0x10, 0xfa, 0x59, 0x2b, 0xdb, 0x29, 0x2c, 0x7d, 0xce, 0x66, - 0x99, 0x8e, 0x87, 0x0e, 0x5a, 0x06, 0xf0, 0x57, 0x0b, 0x09, 0x71, 0xf8, - 0x29, 0xed, 0x7d, 0x91, 0xa1, 0x8c, 0x20, 0x00, 0x60, 0x94, 0x74, 0xbd, - 0xc4, 0x53, 0x46, 0xfa, 0xd7, 0xa3, 0xf2, 0xd8, 0xc3, 0xda, 0xf2, 0x2d, - 0x3f, 0xdf, 0xdf, 0xd0, 0xaf, 0xa3, 0x9b, 0x9f, 0xaa, 0xce, 0xe2, 0x9c, - 0x25, 0xea, 0xed, 0xab, 0xef, 0x00, 0xda, 0x03, 0xb4, 0xce, 0x4f, 0xf5, - 0xbc, 0xf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0xae, 0x38, 0x67, 0xae, 0xf6, 0x88, 0x30, 0x8f, - 0xe2, 0x1a, 0xc0, 0x83, 0x7b, 0xaa, 0x08, 0x91, 0xf5, 0x9a, 0x34, 0x67, - 0xd3, 0x2f, 0xcd, 0x5b, 0x1e, 0x32, 0x53, 0x7d, 0xae, 0x09, 0xfa, 0xe3, - 0x08, 0xc5, 0x39, 0xed, 0xc6, 0xbf, 0xb9, 0xc6, 0x1d, 0xc5, 0x66, 0x03, - 0x38, 0x66, 0x34, 0x00, 0x53, 0x46, 0x9e, 0xf4, 0xa0, 0x53, 0x0f, 0x63, - 0x8a, 0x63, 0x31, 0xfa, 0x23, 0xd9, 0xc2, 0xe7, 0xcd, 0xae, 0x38, 0x7b, - 0x36, 0x64, 0x02, 0x00, 0x26, 0xfe, 0xa3, 0xf8, 0xe4, 0xdc, 0x13, 0x5a, - 0x72, 0x39, 0x2c, 0xef, 0xf6, 0xf1, 0xf4, 0xab, 0x01, 0x24, 0x2c, 0xf5, - 0x26, 0x29, 0x5d, 0x2b, 0x46, 0xa9, 0x9f, 0xda, 0xbf, 0x06, 0xb0, 0xbc, - 0x1b, 0x04, 0x6e, 0xcb, 0x91, 0xe6, 0x6c, 0xea, 0xf6, 0xcb, 0x21, 0x79, - 0xc4, 0x30, 0xc0, 0xb2, 0x73, 0x41, 0x87, 0x83, 0x7a, 0x4f, 0xb9, 0xc0, - 0xf6, 0xca, 0x33, 0x41, 0x6d, 0xcc, 0x06, 0xb0, 0xdf, 0x45, 0x03, 0xb0, - 0x30, 0x1b, 0x40, 0x34, 0xa2, 0xb5, 0x06, 0x30, 0xd7, 0xda, 0x00, 0x6e, - 0x4f, 0x93, 0x9f, 0x01, 0x66, 0x26, 0x81, 0xed, 0x53, 0xb5, 0xc4, 0xb6, - 0x7a, 0x43, 0xf3, 0x86, 0x96, 0x4a, 0xe2, 0x4b, 0x6e, 0x54, 0x46, 0x4d, - 0x00, 0x88, 0x2a, 0xea, 0x41, 0x92, 0xd5, 0x26, 0x72, 0xb4, 0xba, 0x22, - 0x41, 0x9f, 0x24, 0x06, 0x7d, 0x62, 0xdd, 0x05, 0x14, 0x27, 0x37, 0x0a, - 0x42, 0x9c, 0x7a, 0x42, 0x9a, 0xb3, 0x5b, 0xea, 0xd2, 0xfb, 0xef, 0x32, - 0x7a, 0xc0, 0x04, 0x76, 0x3c, 0xa2, 0x47, 0x3a, 0x01, 0x68, 0x0f, 0xb2, - 0xeb, 0x7b, 0xb6, 0x74, 0x1a, 0xc0, 0xac, 0x11, 0x51, 0x23, 0x66, 0x2a, - 0xc9, 0xaa, 0xc9, 0x41, 0xab, 0x26, 0x1b, 0xbb, 0x80, 0x80, 0x9f, 0xfa, - 0x00, 0x7d, 0x84, 0x9e, 0x38, 0x02, 0x3b, 0x1e, 0xd1, 0xca, 0xc4, 0x66, - 0xc0, 0xb0, 0xb1, 0xdf, 0xa6, 0x52, 0x49, 0x7c, 0x29, 0x6a, 0x00, 0xb9, - 0xde, 0xa4, 0x6f, 0xc6, 0xd1, 0x3f, 0x69, 0x9f, 0xda, 0x38, 0x08, 0x74, - 0x23, 0x37, 0x0a, 0x22, 0x66, 0xd3, 0x7d, 0xd2, 0x9c, 0xdd, 0x52, 0x97, - 0x6e, 0x1e, 0x3a, 0x8a, 0xb3, 0xc9, 0x4a, 0xb7, 0x48, 0x1b, 0x51, 0x15, - 0xc0, 0x1f, 0x94, 0x09, 0x6f, 0x19, 0xee, 0x47, 0x03, 0x30, 0x8f, 0x6d, - 0xaf, 0x59, 0x9a, 0xbb, 0x54, 0xdd, 0x24, 0x8d, 0x0a, 0xc0, 0x28, 0xf5, - 0x02, 0x8c, 0x10, 0x02, 0x7d, 0x57, 0x07, 0x20, 0xbe, 0xe8, 0x69, 0x82, - 0xde, 0xc4, 0x39, 0xa4, 0x15, 0x67, 0x93, 0xbb, 0xa9, 0x65, 0x2a, 0xad, - 0x35, 0x9e, 0xa1, 0x87, 0x5b, 0x57, 0x60, 0xa3, 0xfa, 0x68, 0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xd4, 0x84, 0xda, 0xcb, 0xf7, 0x7a, 0xcf, 0xbe, 0x56, 0x3a, 0xa4, 0xd5, - 0xcb, 0x6c, 0x1b, 0x14, 0x76, 0xb3, 0x7a, 0x2c, 0x89, 0x84, 0xb7, 0x00, - 0x4c, 0x93, 0x1f, 0xeb, 0xe8, 0x5f, 0x52, 0x9c, 0x84, 0x15, 0xb9, 0xb9, - 0xcb, 0x1f, 0x2c, 0xa9, 0x94, 0x3f, 0xca, 0x6e, 0xce, 0x25, 0xbb, 0xdc, - 0x0d, 0x60, 0xee, 0xf9, 0x33, 0x4a, 0xce, 0x02, 0x3d, 0x89, 0x7c, 0x48, - 0xab, 0x97, 0x69, 0xba, 0x26, 0x6f, 0xbb, 0x76, 0xab, 0xd0, 0x2c, 0x21, - 0x84, 0x10, 0xb3, 0x2e, 0x3a, 0xb9, 0xf2, 0x5c, 0xee, 0x06, 0xe0, 0xcb, - 0x85, 0x6d, 0xdc, 0xaa, 0x1f, 0xaf, 0x04, 0xa0, 0xd2, 0xf1, 0xea, 0x17, - 0x99, 0x78, 0x95, 0xdd, 0xe0, 0x8e, 0xbf, 0x39, 0xd6, 0x6e, 0x51, 0x01, - 0x97, 0xbf, 0xb7, 0x54, 0x40, 0x40, 0xc0, 0x05, 0xac, 0xc3, 0x63, 0x73, - 0x4e, 0x00, 0x38, 0x31, 0xe7, 0xb1, 0x8b, 0x4c, 0xe8, 0x77, 0x6a, 0x93, - 0xe7, 0x01, 0xec, 0xed, 0x9d, 0x1f, 0xf5, 0xfe, 0x25, 0x44, 0x44, 0x44, - 0x44, 0x44, 0x74, 0x25, 0x33, 0x4f, 0x86, 0x0c, 0x39, 0xfe, 0xac, 0x96, - 0x54, 0xca, 0x51, 0x4f, 0xc8, 0x86, 0x0d, 0xdf, 0x9e, 0xff, 0xeb, 0x22, - 0xa5, 0x63, 0x87, 0x5f, 0x3d, 0x95, 0x8c, 0x85, 0x97, 0xce, 0x5c, 0x00, - 0x08, 0x71, 0xe6, 0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, 0xf8, 0x98, - 0xaf, 0x9f, 0x92, 0xd2, 0xa9, 0x77, 0x4d, 0xba, 0xa9, 0x14, 0x4b, 0x52, - 0x66, 0x47, 0x05, 0x26, 0x01, 0x00, 0x83, 0x3e, 0x91, 0x8a, 0x9a, 0x15, - 0xe7, 0x5f, 0x82, 0xe8, 0xf7, 0x52, 0x4f, 0x1f, 0x1c, 0x2d, 0x9f, 0x2b, - 0x30, 0x55, 0xd5, 0x03, 0xb3, 0x2a, 0xdd, 0x24, 0xe8, 0xbe, 0x3a, 0x3b, - 0x7b, 0x95, 0xde, 0xbd, 0xd7, 0xcd, 0xe7, 0x77, 0xcd, 0xb3, 0xc1, 0x47, - 0x97, 0x35, 0xc5, 0x17, 0xd3, 0xee, 0x9a, 0x74, 0x75, 0xc8, 0x67, 0x24, - 0x26, 0x37, 0x95, 0xeb, 0xdf, 0xc7, 0x15, 0x00, 0x10, 0xb8, 0x46, 0x9e, - 0xd8, 0xac, 0x38, 0xff, 0x12, 0xff, 0x98, 0x55, 0xe9, 0x26, 0xb1, 0xf2, - 0xef, 0x1b, 0x21, 0x22, 0x22, 0x22, 0x22, 0xa2, 0x2b, 0xd3, 0x97, 0x23, - 0x2d, 0xa1, 0x3e, 0xc4, 0xd6, 0x82, 0x05, 0x5a, 0x81, 0x57, 0x4e, 0xbc, - 0xfe, 0x07, 0xe7, 0xae, 0x76, 0x00, 0x80, 0xd9, 0x53, 0xa9, 0x73, 0x5a, - 0x9a, 0x32, 0x52, 0x4f, 0x83, 0xaf, 0xb2, 0xf2, 0x7f, 0xba, 0xe7, 0xb5, - 0x03, 0xf9, 0x3b, 0xfe, 0xc7, 0x7b, 0x33, 0x54, 0xd7, 0x75, 0xf9, 0x29, - 0xfd, 0x95, 0x89, 0xfc, 0x5b, 0x1f, 0x63, 0xe9, 0x96, 0xd9, 0x18, 0xe3, - 0x86, 0x99, 0xb3, 0xf1, 0x71, 0xab, 0x60, 0x80, 0x72, 0x19, 0xc5, 0xfc, - 0xec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0x32, 0x36, 0x28, 0x4c, 0x99, 0x9f, 0x99, 0x00, 0x7a, - 0xb3, 0x69, 0xb6, 0xe6, 0xd4, 0x96, 0xb6, 0x68, 0xb5, 0xf8, 0x44, 0xee, - 0x82, 0x36, 0xe7, 0xa3, 0xee, 0x1b, 0x0b, 0xf6, 0x3f, 0x29, 0x97, 0x31, - 0xab, 0xd2, 0x4d, 0x92, 0x27, 0xef, 0x57, 0xce, 0x2b, 0x9d, 0x06, 0x90, - 0x55, 0x05, 0x40, 0x95, 0x3c, 0xa3, 0x88, 0x5c, 0xd0, 0x4d, 0x55, 0xfa, - 0x97, 0x58, 0x3c, 0x73, 0xa6, 0x7d, 0x78, 0x7c, 0x4a, 0x5b, 0x27, 0x70, - 0x53, 0xdd, 0xc5, 0x34, 0x00, 0x37, 0x55, 0x69, 0x26, 0xb9, 0x91, 0xc0, - 0x3d, 0x25, 0x24, 0x66, 0xb3, 0xb1, 0xd2, 0x46, 0xe3, 0x36, 0xab, 0xd2, - 0x4d, 0xb2, 0x72, 0x90, 0x9e, 0x94, 0x5a, 0x03, 0x88, 0x01, 0x50, 0x45, - 0xde, 0xe0, 0x97, 0x56, 0x03, 0x48, 0x7c, 0x10, 0x40, 0x82, 0xb2, 0x95, - 0x30, 0x12, 0x53, 0xcc, 0xcc, 0xe7, 0x76, 0x14, 0x6c, 0xe9, 0x29, 0x25, - 0x02, 0x00, 0x02, 0x8d, 0xea, 0x2e, 0x21, 0x29, 0xe2, 0xa6, 0x2a, 0xcd, - 0x64, 0xc3, 0xb0, 0xf0, 0x66, 0x3b, 0x4a, 0x48, 0xec, 0xdb, 0x04, 0x83, - 0x36, 0x1a, 0xb7, 0x59, 0x95, 0x6e, 0x92, 0x76, 0x59, 0x7d, 0xab, 0x46, - 0xb4, 0x93, 0x87, 0x59, 0x2f, 0xad, 0x06, 0xb0, 0xac, 0x1b, 0x80, 0x1e, - 0xf2, 0x43, 0x37, 0xcd, 0x06, 0xe0, 0xa6, 0x2a, 0xcd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 0x2a, - 0xd7, 0x7a, 0x96, 0xa0, 0xb3, 0x7a, 0x4f, 0x27, 0x95, 0x27, 0x5a, 0xe5, - 0xda, 0x1a, 0x40, 0xed, 0xad, 0xf2, 0xe0, 0xa4, 0x54, 0xae, 0xe8, 0x95, - 0x6b, 0x69, 0x00, 0x22, 0xd7, 0xb8, 0xd7, 0x96, 0xca, 0x0b, 0x56, 0x2e, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x95, 0xe0, 0xff, 0x01, 0x92, 0xe1, 0xb4, 0x03, 0x57, 0x7b, 0x9b, 0xa9, - 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0xd1, 0x13, 0x8b, 0x26, 0x00, 0x00, 0x00, + 0x04, 0x67, 0x41, 0x4d, 0x41, 0x00, 0x00, 0xb1, 0x8f, 0x0b, 0xfc, 0x61, + 0x05, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x03, 0x37, 0xc7, + 0x4d, 0x53, 0x00, 0x00, 0x00, 0x20, 0x63, 0x48, 0x52, 0x4d, 0x00, 0x00, + 0x7a, 0x26, 0x00, 0x00, 0x80, 0x84, 0x00, 0x00, 0xfa, 0x00, 0x00, 0x00, + 0x80, 0xe8, 0x00, 0x00, 0x75, 0x30, 0x00, 0x00, 0xea, 0x60, 0x00, 0x00, + 0x3a, 0x98, 0x00, 0x00, 0x17, 0x70, 0x9c, 0xba, 0x51, 0x3c, 0x00, 0x00, + 0x00, 0x22, 0x74, 0x45, 0x58, 0x74, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x65, 0x64, 0x2d, 0x62, 0x79, 0x00, 0x4d, 0x69, 0x74, 0x73, 0x75, + 0x62, 0x61, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x30, + 0x2e, 0x34, 0x2e, 0x30, 0xd0, 0x43, 0xaf, 0x65, 0x00, 0x00, 0x20, 0x00, + 0x49, 0x44, 0x41, 0x54, 0x78, 0x5e, 0xed, 0xdd, 0x77, 0x60, 0x15, 0x55, + 0xa2, 0x06, 0xf0, 0x2f, 0x21, 0x8d, 0x14, 0x48, 0xa8, 0x42, 0x50, 0x94, + 0x05, 0xc5, 0x08, 0x2a, 0x60, 0xa1, 0xa8, 0x84, 0x22, 0x0a, 0x02, 0x06, + 0x44, 0x14, 0x5c, 0x01, 0xc5, 0x05, 0x7c, 0xb2, 0x02, 0xea, 0xfa, 0x9e, + 0xae, 0xb8, 0xba, 0x2a, 0xb8, 0xb2, 0xa2, 0x2e, 0xeb, 0x22, 0x2e, 0x4d, + 0x05, 0x6c, 0x08, 0x28, 0x45, 0x8a, 0x14, 0x81, 0x80, 0xd2, 0x7b, 0x0d, + 0x81, 0x10, 0x82, 0x21, 0x21, 0x01, 0x49, 0x20, 0x85, 0x72, 0xde, 0x1f, + 0x97, 0x9b, 0x39, 0xed, 0x26, 0xc3, 0x25, 0x01, 0x0d, 0xdf, 0xef, 0x0f, + 0xf4, 0x7e, 0xf7, 0x4c, 0xb9, 0xf7, 0x9c, 0xcc, 0xcc, 0x9d, 0x39, 0x73, + 0x26, 0x40, 0x00, 0x00, 0x10, 0x80, 0x22, 0x4c, 0xae, 0x84, 0x44, 0x7b, + 0x4b, 0x30, 0xb9, 0xc2, 0x12, 0xaf, 0x40, 0x4b, 0x46, 0x57, 0x10, 0x36, + 0x80, 0x2b, 0x1c, 0x1b, 0xc0, 0x15, 0x8e, 0x0d, 0xe0, 0x0a, 0xc7, 0x06, + 0x70, 0x85, 0x63, 0x03, 0xb8, 0xc2, 0xb1, 0x01, 0x5c, 0xe1, 0xd8, 0x00, + 0xae, 0x70, 0x6c, 0x00, 0x57, 0xb8, 0x20, 0xcb, 0xe9, 0x21, 0x26, 0x57, + 0x42, 0x42, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x57, 0x24, 0xe1, 0x71, + 0xd1, 0x89, 0xc9, 0xf6, 0x63, 0xd4, 0x32, 0x45, 0x68, 0x5e, 0x43, 0xac, + 0x7c, 0x4a, 0x2d, 0xa6, 0xa8, 0xb3, 0x38, 0xe7, 0x87, 0xda, 0x00, 0x7e, + 0x78, 0xbe, 0x28, 0xaa, 0xfb, 0x7d, 0xce, 0xde, 0x3f, 0x16, 0x33, 0x09, + 0x00, 0xbc, 0x3c, 0x47, 0x0b, 0xe6, 0xfd, 0x9f, 0x59, 0xc8, 0x36, 0xa1, + 0x16, 0x19, 0x25, 0xcc, 0x0f,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3e, 0xb2, 0x19, 0x35, 0x1e, 0x9d, 0xbe, 0xfc, 0x89, 0x12, + 0x77, 0x01, 0x4f, 0xae, 0x48, 0x7f, 0x57, 0xd9, 0x05, 0x1c, 0x8d, 0x55, + 0x4b, 0xe4, 0x56, 0xc6, 0xd1, 0x1a, 0x40, 0x4d, 0x81, 0xf0, 0xfc, 0xf3, + 0x51, 0xc2, 0x5b, 0x00, 0xa6, 0x25, 0x38, 0x65, 0x04, 0x80, 0x90, 0xb8, + 0xd9, 0x9f, 0x38, 0x89, 0xef, 0x06, 0xe0, 0xec, 0x27, 0xdc, 0x6c, 0x01, + 0xf2, 0x2a, 0x02, 0x80, 0x5c, 0xdf, 0x7e, 0x6e, 0x01, 0x6e, 0x4f, 0x57, + 0x2e, 0xfd, 0xda, 0x97, 0x1e, 0xb8, 0xe9, 0xba, 0xeb, 0x36, 0x49, 0x5d, + 0x3c, 0x05, 0xd0, 0x72, 0x7d, 0x85, 0x12, 0x1a, 0x80, 0x10, 0x05, 0x49, + 0x23, 0xe5, 0xee, 0x4e, 0xde, 0x32, 0xce, 0x5f, 0xbc, 0x10, 0x42, 0x88, + 0xf4, 0x1a, 0x52, 0x19, 0x54, 0xed, 0x33, 0x66, 0x43, 0xb2, 0xda, 0x1b, + 0xe1, 0xbc, 0xe3, 0xb1, 0x00, 0x62, 0x8f, 0xeb, 0x71, 0x7b, 0xf9, 0xa8, + 0xcb, 0x5c, 0x79, 0x6b, 0x6f, 0xf9, 0xa0, 0x07, 0x67, 0x66, 0x4f, 0x8e, + 0xb7, 0xbc, 0xe1, 0x15, 0x3f, 0xf9, 0xd8, 0xcc, 0xae, 0x25, 0xfc, 0x65, + 0xe4, 0x46, 0xe2, 0x68, 0x75, 0xa0, 0x86, 0x40, 0x6b, 0xef, 0x86, 0x62, + 0x96, 0x10, 0x42, 0x08, 0xa9, 0xab, 0xb3, 0x67, 0x9a, 0xab, 0xa4, 0x83, + 0x07, 0x9f, 0xbb, 0x80, 0x96, 0xce, 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 0xce, 0x43, 0x68, 0xea, 0x8c, 0xe5, 0xf0, 0xce, + 0x21, 0x6d, 0xf3, 0x5d, 0x27, 0xbd, 0x53, 0x7a, 0x1d, 0x28, 0x6e, 0x48, + 0x54, 0x76, 0x4d, 0x96, 0x2f, 0xc1, 0x18, 0x5c, 0xc5, 0xdf, 0xbf, 0x1e, + 0xdd, 0xd2, 0x91, 0xb1, 0x41, 0x61, 0xca, 0xac, 0xc4, 0x81, 0xd6, 0x91, + 0xf1, 0x29, 0x52, 0xef, 0x63, 0x64, 0x19, 0x0d, 0xe0, 0xbe, 0xfd, 0xad, + 0x23, 0xe3, 0x53, 0xe4, 0xc9, 0xf2, 0xe4, 0x0e, 0xeb, 0x1e, 0xc6, 0x0a, + 0x5a, 0x1a, 0x80, 0xb1, 0x59, 0x76, 0xd9, 0x00, 0x12, 0x52, 0x95, 0xbe, + 0x17, 0x3e, 0xb6, 0x09, 0xce, 0x3f, 0x45, 0xff, 0x2d, 0xcd, 0x06, 0x80, + 0xf5, 0xad, 0x70, 0xa7, 0xdc, 0x93, 0x0f, 0xcf, 0x7d, 0x80, 0x51, 0xc3, + 0xf0, 0xc2, 0x18, 0xbc, 0x30, 0xcc, 0x1b, 0x45, 0x2c, 0x8a, 0xdb, 0xa4, + 0x5d, 0x70, 0x1c, 0x70, 0x4e, 0x3b, 0xf0, 0xa8, 0x99, 0x78, 0xad, 0xf2, + 0xda, 0xf2, 0x25, 0x18, 0xc3, 0x2b, 0x95, 0x56, 0x03, 0xc8, 0x8d, 0x04, + 0xee, 0x51, 0x1b, 0x40, 0x17, 0x00, 0x09, 0xcb, 0xa4, 0x64, 0xe9, 0x43, + 0xd0, 0xfc, 0xd8, 0x05, 0x40, 0x82, 0x3c, 0xd9, 0xca, 0x41, 0x7a, 0x19, + 0x73, 0x05, 0x97, 0x77, 0x06, 0xd0, 0x59, 0x69, 0x00, 0xc6, 0x66, 0xd9, + 0x5d, 0x03, 0x78, 0x66, 0x8b, 0xda, 0xd5, 0xd2, 0xbf, 0x06, 0x90, 0xf8, + 0x20, 0x80, 0x04, 0x97, 0xbb, 0x80, 0x9c, 0xca, 0x00, 0x10, 0xad, 0xf4, + 0x0a, 0x1d, 0x38, 0x19, 0xff, 0x75, 0x0e, 0x01, 0x01, 0xc4, 0xed, 0xc6, + 0x9a, 0x26, 0xb8, 0x6d, 0x2b, 0xe6, 0xdd, 0xe8, 0x8d, 0xc6, 0x75, 0xc1, + 0x0b, 0x72, 0xc7, 0x12, 0x00, 0x01, 0xda, 0xea, 0x46, 0x2c, 0xd6, 0xee, + 0x02, 0xb1, 0x7d, 0x09, 0xfa, 0x00, 0x6b, 0xa5, 0xd5, 0x00, 0x36, 0x0c, + 0x0b, 0x6f, 0xb6, 0x43, 0x99, 0x95, 0x88, 0x06, 0x10, 0x23, 0x0f, 0xcd, + 0x19, 0x7f, 0xa8, 0x93, 0x76, 0x10, 0x98, 0x65, 0xfc, 0x2d, 0xb7, 0xcb, + 0xea, 0x5b, 0x35, 0xa2, 0x9d, 0x32, 0xfc, 0x84, 0xb1, 0x82, 0x9d, 0x93, + 0xef, 0x8e, 0xb8, 0x3b, 0x59, 0x69, 0x00, 0xc6, 0x66, 0xd9, 0x55, 0x03, + 0x78, 0x2d, 0x51, 0xeb, 0xd7, 0xe3, 0x5f, 0x03, 0xe8, 0x96, 0x12, 0x1f, + 0x19, 0x9f, 0xe2, 0xf2, 0x20, 0x70, 0xed, 0xbd, 0x00, 0x70, 0x9f, 0xd3, + 0x0d, 0x0d, 0x40, 0x54, 0x7a, 0xed, 0x34, 0xb5, 0xc3, 0x67, 0x4a, 0xa3, + 0x8c, 0x40, 0x54, 0x38, 0x56, 0xab, 0xa8, 0x27, 0x5a, 0xc7, 0xef, 0x80, + 0x0a, 0xeb, 0xee, 0x53, 0x0a, 0x69, 0x73, 0xae, 0x30, 0x53, 0x1f, 0xc2, + 0xd2, 0xf6, 0x25, 0xe8, 0x43, 0x2c, 0x96, 0x56, 0x03, 0x68, 0xb2, 0x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c, 0x62, 0x32, + 0x06, 0x42, 0xc1, 0x4f, 0xf7, 0x43, 0x7f, 0xf8, 0x90, 0x65, 0x1e, 0xd9, + 0xb5, 0x81, 0xda, 0xd2, 0x80, 0x5f, 0x42, 0x88, 0x3d, 0xda, 0x11, 0x88, + 0x31, 0x4d, 0x46, 0x95, 0x98, 0xd7, 0x4e, 0xbe, 0x65, 0xc4, 0x80, 0xbb, + 0x95, 0x67, 0x72, 0xf1, 0x89, 0xe9, 0x57, 0x23, 0x39, 0x5e, 0xc9, 0x68, + 0x00, 0x96, 0x63, 0xc9, 0x63, 0xb1, 0x40, 0xac, 0x32, 0xb0, 0x51, 0xcb, + 0x73, 0x25, 0x3d, 0x5f, 0x27, 0xab, 0x07, 0x70, 0x97, 0xfc, 0x2c, 0x59, + 0x87, 0x9b, 0x95, 0x67, 0x72, 0xf1, 0x89, 0xc9, 0x7c, 0xf7, 0x78, 0x25, + 0x18, 0x57, 0x34, 0xcd, 0x52, 0x33, 0xe6, 0xc4, 0xd6, 0x9e, 0xf3, 0x85, + 0x54, 0xc2, 0xc5, 0x2f, 0x8e, 0xc1, 0x67, 0xa7, 0x36, 0x8e, 0xdd, 0x6f, + 0x7d, 0xcb, 0xcd, 0xca, 0x33, 0xb9, 0xf8, 0xc4, 0x64, 0xbe, 0xfb, 0xf3, + 0x7d, 0x30, 0xba, 0x2c, 0x18, 0xa5, 0x1e, 0xc9, 0x99, 0x71, 0x2c, 0xeb, + 0xf3, 0x1c, 0xa5, 0xe7, 0xbc, 0x56, 0xc8, 0xb2, 0xdc, 0x07, 0x77, 0x89, + 0x54, 0xad, 0xb3, 0xfd, 0x79, 0x6e, 0x56, 0x9e, 0xc9, 0xc5, 0x27, 0x26, + 0xf3, 0xdd, 0xc7, 0xf6, 0x36, 0x3f, 0x73, 0x83, 0x3a, 0xca, 0x96, 0x59, + 0x6a, 0x52, 0x0f, 0x00, 0xe8, 0x31, 0xa6, 0x98, 0x42, 0xd6, 0xe5, 0x36, + 0x1c, 0xbf, 0xc4, 0x16, 0xbb, 0x5a, 0x79, 0x26, 0x17, 0x9f, 0x98, 0x2c, + 0xef, 0x3e, 0xbd, 0x57, 0xec, 0xeb, 0xad, 0x94, 0x71, 0xb1, 0x79, 0x87, + 0x31, 0x2b, 0x6b, 0xf9, 0x88, 0x47, 0x0e, 0xda, 0x62, 0x57, 0x2b, 0xcf, + 0xe4, 0xe2, 0x13, 0x97, 0xfc, 0x98, 0xc4, 0x64, 0xce, 0x44, 0x08, 0x91, + 0x3d, 0xdf, 0x79, 0x1c, 0xaa, 0x24, 0xc8, 0x56, 0x9a, 0x49, 0x19, 0x24, + 0x97, 0x95, 0xab, 0x5e, 0x75, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x74, + 0x05, 0x10, 0x96, 0x9f, 0xac, 0x5d, 0x97, 0xe5, 0xe4, 0x2c, 0xed, 0x2c, + 0x17, 0x3a, 0x97, 0x2c, 0x0f, 0x23, 0x05, 0x20, 0x60, 0x14, 0x02, 0x46, + 0xc9, 0x81, 0x10, 0xfa, 0x59, 0x2b, 0xdb, 0x29, 0x2c, 0x7d, 0xce, 0x66, + 0x99, 0x8e, 0x87, 0x0e, 0x5a, 0x06, 0xf0, 0x57, 0x0b, 0x09, 0x71, 0xf8, + 0x29, 0xed, 0x7d, 0x91, 0xa1, 0x8c, 0x20, 0x00, 0x60, 0x94, 0x74, 0xbd, + 0xc4, 0x53, 0x46, 0xfa, 0xd7, 0xa3, 0xf2, 0xd8, 0xc3, 0xda, 0xf2, 0x2d, + 0x3f, 0xdf, 0xdf, 0xd0, 0xaf, 0xa3, 0x9b, 0x9f, 0xaa, 0xce, 0xe2, 0x9c, + 0x25, 0xea, 0xed, 0xab, 0xef, 0x00, 0xda, 0x03, 0xb4, 0xce, 0x4f, 0xf5, + 0xbc, 0xf3, 0xa8, 0x19, 0x5b, 0x92, 0x31, 0x5c, 0x4d, 0xac, 0x6b, 0x34, + 0xce, 0x7c, 0xf4, 0x4b, 0xb5, 0x83, 0x2d, 0xd4, 0x20, 0x66, 0xe7, 0x4e, + 0xf5, 0xd1, 0x1d, 0x7f, 0xcd, 0x79, 0x3f, 0xce, 0xe7, 0x43, 0xa3, 0x34, + 0x6f, 0xee, 0xed, 0x1e, 0x15, 0x95, 0xb0, 0xeb, 0x0d, 0x29, 0x0a, 0x6c, + 0x23, 0x3f, 0xfd, 0x02, 0x08, 0x9a, 0x9c, 0x18, 0x34, 0x79, 0x15, 0x2c, + 0x8a, 0x3d, 0x03, 0x62, 0x99, 0xb3, 0xee, 0x50, 0xcb, 0xbb, 0x2c, 0xa7, + 0x2c, 0xb5, 0xb9, 0x06, 0xb4, 0x55, 0x47, 0x27, 0x01, 0x02, 0xda, 0xc8, + 0xcf, 0x63, 0x02, 0x70, 0xfd, 0x01, 0xfd, 0x01, 0x60, 0x66, 0x03, 0x98, + 0x22, 0x84, 0xd6, 0xfe, 0x2d, 0x6b, 0x7f, 0xa3, 0x71, 0xd9, 0xd6, 0x28, + 0x34, 0xf3, 0xed, 0x4a, 0x6f, 0xcf, 0x50, 0x92, 0x55, 0x93, 0x82, 0x56, + 0x4d, 0x52, 0xbb, 0x72, 0x08, 0x00, 0xa8, 0x99, 0xd1, 0xa0, 0xb8, 0x24, + 0xa0, 0xcd, 0x51, 0x2d, 0xb1, 0xad, 0x51, 0xe8, 0x02, 0xf5, 0x39, 0x52, + 0x00, 0xbe, 0xec, 0xa3, 0x05, 0x53, 0xbb, 0x75, 0x9f, 0xaa, 0x04, 0xc7, + 0x6e, 0xfc, 0x57, 0xce, 0xff, 0xc1, 0x95, 0x07, 0xf7, 0x5c, 0xf3, 0xef, + 0x34, 0x21, 0x2a, 0xef, 0x2c, 0xfa, 0x4b, 0x6d, 0xb7, 0x29, 0x5f, 0x7d, + 0xe0, 0x1e, 0xe6, 0xcc, 0xae, 0x38, 0x67, 0xae, 0xf6, 0x88, 0x30, 0x8f, + 0xe2, 0x1a, 0xc0, 0x83, 0x7b, 0xaa, 0x08, 0x91, 0xf5, 0x9a, 0x34, 0x67, + 0xd3, 0x2f, 0xcd, 0x5b, 0x1e, 0x32, 0x53, 0x7d, 0xae, 0x09, 0xfa, 0xe3, + 0x08, 0xc5, 0x39, 0xed, 0xc6, 0xbf, 0xb9, 0xc6, 0x1d, 0xc5, 0x66, 0x03, + 0x38, 0x66, 0x34, 0x00, 0x53, 0x46, 0x9e, 0xf4, 0xa0, 0x53, 0x0f, 0x63, + 0x8a, 0x63, 0x31, 0xfa, 0x23, 0xd9, 0xc2, 0xe7, 0xcd, 0xae, 0x38, 0x7b, + 0x36, 0x64, 0x02, 0x00, 0x26, 0xfe, 0xa3, 0xf8, 0xe4, 0xdc, 0x13, 0x5a, + 0x72, 0x39, 0x2c, 0xef, 0xf6, 0xf1, 0xf4, 0xab, 0x01, 0x24, 0x2c, 0xf5, + 0x26, 0x29, 0x5d, 0x2b, 0x46, 0xa9, 0x9f, 0xda, 0xbf, 0x06, 0xb0, 0xbc, + 0x1b, 0x04, 0x6e, 0xcb, 0x91, 0xe6, 0x6c, 0xea, 0xf6, 0xcb, 0x21, 0x79, + 0xc4, 0x30, 0xc0, 0xb2, 0x73, 0x41, 0x87, 0x83, 0x7a, 0x4f, 0xb9, 0xc0, + 0xf6, 0xca, 0x33, 0x41, 0x6d, 0xcc, 0x06, 0xb0, 0xdf, 0x45, 0x03, 0xb0, + 0x30, 0x1b, 0x40, 0x34, 0xa2, 0xb5, 0x06, 0x30, 0xd7, 0xda, 0x00, 0x6e, + 0x4f, 0x93, 0x9f, 0x01, 0x66, 0x26, 0x81, 0xed, 0x53, 0xb5, 0xc4, 0xb6, + 0x7a, 0x43, 0xf3, 0x86, 0x96, 0x4a, 0xe2, 0x4b, 0x6e, 0x54, 0x46, 0x4d, + 0x00, 0x88, 0x2a, 0xea, 0x41, 0x92, 0xd5, 0x26, 0x72, 0xb4, 0xba, 0x22, + 0x41, 0x9f, 0x24, 0x06, 0x7d, 0x62, 0xdd, 0x05, 0x14, 0x27, 0x37, 0x0a,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14, 0x76, 0xb3, 0x7a, 0x2c, 0x89, 0x84, 0xb7, 0x00, + 0x4c, 0x93, 0x1f, 0xeb, 0xe8, 0x5f, 0x52, 0x9c, 0x84, 0x15, 0xb9, 0xb9, + 0xcb, 0x1f, 0x2c, 0xa9, 0x94, 0x3f, 0xca, 0x6e, 0xce, 0x25, 0xbb, 0xdc, + 0x0d, 0x60, 0xee, 0xf9, 0x33, 0x4a, 0xce, 0x02, 0x3d, 0x89, 0x7c, 0x48, + 0xab, 0x97, 0x69, 0xba, 0x26, 0x6f, 0xbb, 0x76, 0xab, 0xd0, 0x2c, 0x21, + 0x84, 0x10, 0xb3, 0x2e, 0x3a, 0xb9, 0xf2, 0x5c, 0xee, 0x06, 0xe0, 0xcb, + 0x85, 0x6d, 0xdc, 0xaa, 0x1f, 0xaf, 0x04, 0xa0, 0xd2, 0xf1, 0xea, 0x17, + 0x99, 0x78, 0x95, 0xdd, 0xe0, 0x8e, 0xbf, 0x39, 0xd6, 0x6e, 0x51, 0x01, + 0x97, 0xbf, 0xb7, 0x54, 0x40, 0x40, 0xc0, 0x05, 0xac, 0xc3, 0x63, 0x73, + 0x4e, 0x00, 0x38, 0x31, 0xe7, 0xb1, 0x8b, 0x4c, 0xe8, 0x77, 0x6a, 0x93, + 0xe7, 0x01, 0xec, 0xed, 0x9d, 0x1f, 0xf5, 0xfe, 0x25, 0x44, 0x44, 0x44, + 0x44, 0x44, 0x74, 0x25, 0x33, 0x4f, 0x86, 0x0c, 0x39, 0xfe, 0xac, 0x96, + 0x54, 0xca, 0x51, 0x4f, 0xc8, 0x86, 0x0d, 0xdf, 0x9e, 0xff, 0xeb, 0x22, + 0xa5, 0x63, 0x87, 0x5f, 0x3d, 0x95, 0x8c, 0x85, 0x97, 0xce, 0x5c, 0x00, + 0x08, 0x71, 0xe6, 0xf8, 0x96, 0xf1, 0xad, 0xe5, 0xc8, 0xd2, 0x2d, 0xca, + 0xaf, 0xc5, 0x59, 0xe6, 0xa3, 0xad, 0xc0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47, 0x05, 0x26, 0x01, 0x00, 0x83, 0x3e, 0x91, 0x8a, 0x9a, 0x15, + 0xe7, 0x5f, 0x82, 0xe8, 0xf7, 0x52, 0x4f, 0x1f, 0x1c, 0x2d, 0x9f, 0x2b, + 0x30, 0x55, 0xd5, 0x03, 0xb3, 0x2a, 0xdd, 0x24, 0xe8, 0xbe, 0x3a, 0x3b, + 0x7b, 0x95, 0xde, 0xbd, 0xd7, 0xcd, 0xe7, 0x77, 0xcd, 0xb3, 0xc1, 0x47, + 0x97, 0x35, 0xc5, 0x17, 0xd3, 0xee, 0x9a, 0x74, 0x75, 0xc8, 0x67, 0x24, + 0x26, 0x37, 0x95, 0xeb, 0xdf, 0xc7, 0x15, 0x00, 0x10, 0xb8, 0x46, 0x9e, + 0xd8, 0xac, 0x38, 0xff, 0x12, 0xff, 0x98, 0x55, 0xe9, 0x26, 0xb1, 0xf2, + 0xef, 0x1b, 0x21, 0x22, 0x22, 0x22, 0x22, 0xa2, 0x2b, 0xd3, 0x97, 0x23, + 0x2d, 0xa1, 0x3e, 0xc4, 0xd6, 0x82, 0x05, 0x5a, 0x81, 0x57, 0x4e, 0xbc, + 0xfe, 0x07, 0xe7, 0xae, 0x76, 0x00, 0x80, 0xd9, 0x53, 0xa9, 0x73, 0x5a, + 0x9a, 0x32, 0x52, 0x4f, 0x83, 0xaf, 0xb2, 0xf2, 0x7f, 0xba, 0xe7, 0xb5, + 0x03, 0xf9, 0x3b, 0xfe, 0xc7, 0x7b, 0x33, 0x54, 0xd7, 0x75, 0xf9, 0x29, + 0xfd, 0x95, 0x89, 0xfc, 0x5b, 0x1f, 0x63, 0xe9, 0x96, 0xd9, 0x18, 0xe3, + 0x86, 0x99, 0xb3, 0xf1, 0x71, 0xab, 0x60, 0x80, 0x72, 0x19, 0xc5, 0xfc, + 0xec, 0xfe, 0xad, 0xb3, 0xab, 0xef, 0x10, 0xb0, 0xfe, 0x6e, 0xbe, 0x41, + 0x5a, 0x23, 0xff, 0x96, 0x5e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0x68, 0xb5, 0xf8, 0x44, 0xee, + 0x82, 0x36, 0xe7, 0xa3, 0xee, 0x1b, 0x0b, 0xf6, 0x3f, 0x29, 0x97, 0x31, + 0xab, 0xd2, 0x4d, 0x92, 0x27, 0xef, 0x57, 0xce, 0x2b, 0x9d, 0x06, 0x90, + 0x55, 0x05, 0x40, 0x95, 0x3c, 0xa3, 0x88, 0x5c, 0xd0, 0x4d, 0x55, 0xfa, + 0x97, 0x58, 0x3c, 0x73, 0xa6, 0x7d, 0x78, 0x7c, 0x4a, 0x5b, 0x27, 0x70, + 0x53, 0xdd, 0xc5, 0x34, 0x00, 0x37, 0x55, 0x69, 0x26, 0xb9, 0x91, 0xc0, + 0x3d, 0x25, 0x24, 0x66, 0xb3, 0xb1, 0xd2, 0x46, 0xe3, 0x36, 0xab, 0xd2, + 0x4d, 0xb2, 0x72, 0x90, 0x9e, 0x94, 0x5a, 0x03, 0x88, 0x01, 0x50, 0x45, + 0xde, 0xe0, 0x97, 0x56, 0x03, 0x48, 0x7c, 0x10, 0x40, 0x82, 0xb2, 0x95, + 0x30, 0x12, 0x53, 0xcc, 0xcc, 0xe7, 0x76, 0x14, 0x6c, 0xe9, 0x29, 0x25, + 0x02, 0x00, 0x02, 0x8d, 0xea, 0x2e, 0x21, 0x29, 0xe2, 0xa6, 0x2a, 0xcd, + 0x64, 0xc3, 0xb0, 0xf0, 0x66, 0x3b, 0x4a, 0x48, 0xec, 0xdb, 0x04, 0x83, + 0x36, 0x1a, 0xb7, 0x59, 0x95, 0x6e, 0x92, 0x76, 0x59, 0x7d, 0xab, 0x46, + 0xb4, 0x93, 0x87, 0x59, 0x2f, 0xad, 0x06, 0xb0, 0xac, 0x1b, 0x80, 0x1e, + 0xf2, 0x43, 0x37, 0xcd, 0x06, 0xe0, 0xa6, 0x2a, 0xcd, 0xa4, 0x5b, 0x4a, + 0x7c, 0x64, 0x7c, 0x8a, 0x72, 0x9c, 0x60, 0x24, 0xa6, 0x08, 0xa3, 0x5b, + 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x40, 0xed, 0xad, 0xf2, 0xe0, 0xa4, 0x54, 0xae, 0xe8, 0x95, + 0x6b, 0x69, 0x00, 0x22, 0xd7, 0xb8, 0xd7, 0x96, 0xca, 0x0b, 0x56, 0x2e, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x95, 0xe0, 0xff, 0x01, 0x92, 0xe1, 0xb4, 0x03, 0x57, 0x7b, 0x9b, 0xa9, + 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, }; uint32_t vera14_png_size = 8940; diff --git a/src/libhw/data/veramono14_dsc.h b/src/libhw/data/veramono14_dsc.h index 7776ff9c..7dfee9ba 100644 --- a/src/libhw/data/veramono14_dsc.h +++ b/src/libhw/data/veramono14_dsc.h @@ -1,140 +1,140 @@ /* Autogenerated by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, 0xeb, 0xcc, 0x47, 0xc7, 0x98, 0x9f, 0x1c, 0xce, 0xb3, - 0xc3, 0x79, 0x71, 0xcc, 0xeb, 0x2d, 0x73, 0xde, 0xd5, 0xf9, 0xd2, 0xca, - 0xc9, 0x8f, 0xd7, 0xab, 0x3a, 0xed, 0xfb, 0x99, 0x8b, 0xcc, 0xe9, 0x7e, - 0x4e, 0xf5, 0xfe, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, - 0x09, 0xb7, 0x64, 0xc5, 0x00, 0x24, 0x01, 0x00, + 0x1f, 0x8b, 0x08, 0x08, 0xa5, 0x63, 0x4e, 0x50, 0x00, 0x03, 0x76, 0x65, + 0x72, 0x61, 0x6d, 0x6f, 0x6e, 0x6f, 0x31, 0x34, 0x2e,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 0xab, 0x3a, 0xed, 0xfb, 0x99, 0x8b, 0xcc, 0xe9, 0x7e, + 0x4e, 0xf5, 0xfe, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, + 0x09, 0xb7, 0x64, 0xc5, 0x00, 0x24, 0x01, 0x00, }; uint32_t veramono14_dsc_size = 1604; diff --git a/src/libhw/data/veramono14_png.h b/src/libhw/data/veramono14_png.h index be2b520e..5f3d1de5 100644 --- a/src/libhw/data/veramono14_png.h +++ b/src/libhw/data/veramono14_png.h @@ -1,704 +1,704 @@ /* Autogenerated by bin2c */ uint8_t veramono14_png[] = { - 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, - 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, - 0x08, 0x00, 0x00, 0x00, 0x00, 0xd1, 0x13, 0x8b, 0x26, 0x00, 0x00, 0x00, - 0x04, 0x67, 0x41, 0x4d, 0x41, 0x00, 0x00, 0xb1, 0x8f, 0x0b, 0xfc, 0x61, - 0x05, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x03, 0x37, 0xc7, - 0x4d, 0x53, 0x00, 0x00, 0x00, 0x20, 0x63, 0x48, 0x52, 0x4d, 0x00, 0x00, - 0x7a, 0x26, 0x00, 0x00, 0x80, 0x84, 0x00, 0x00, 0xfa, 0x00, 0x00, 0x00, - 0x80, 0xe8, 0x00, 0x00, 0x75, 0x30, 0x00, 0x00, 0xea, 0x60, 0x00, 0x00, - 0x3a, 0x98, 0x00, 0x00, 0x17, 0x70, 0x9c, 0xba, 0x51, 0x3c, 0x00, 0x00, - 0x00, 0x22, 0x74, 0x45, 0x58, 0x74, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x65, 0x64, 0x2d, 0x62, 0x79, 0x00, 0x4d, 0x69, 0x74, 0x73, 0x75, - 0x62, 0x61, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x30, - 0x2e, 0x34, 0x2e, 0x30, 0xd0, 0x43, 0xaf, 0x65, 0x00, 0x00, 0x1f, 0xff, - 0x49, 0x44, 0x41, 0x54, 0x78, 0x5e, 0xed, 0xdd, 0x79, 0x7c, 0x14, 0x45, - 0xde, 0x06, 0xf0, 0x27, 0x21, 0x17, 0x30, 0xe1, 0x52, 0x31, 0x40, 0xc2, - 0x0d, 0x8a, 0x80, 0xaf, 0xba, 0x40, 0x00, 0x15, 0x5c, 0x41, 0x0e, 0x15, - 0x01, 0x15, 0x85, 0xf5, 0x40, 0x3c, 0x5f, 0x50, 0x5c, 0x50, 0x50, 0xbc, - 0x75, 0x75, 0x55, 0x14, 0x50, 0x14, 0x4f, 0x74, 0x55, 0x70, 0x11, 0x05, - 0x01, 0x11, 0x05, 0x62, 0xe4, 0x50, 0x40, 0x57, 0x14, 0x04, 0x85, 0x10, - 0x8e, 0x40, 0x42, 0xc2, 0x11, 0x42, 0x2e, 0x10, 0x92, 0x20, 0xd4, 0xfb, - 0x47, 0x98, 0xae, 0x5f, 0x55, 0xcf, 0x74, 0x32, 0x81, 0xb8, 0xbe, 0xe4, - 0xf9, 0x7e, 0xfc, 0x60, 0x9e, 0xae, 0x9a, 0xa3, 0xbb, 0xaa, 0xbb, 0x67, - 0xba, 0x6b, 0xba, 0xc3, 0x14, 0x00, 0x00, 0x61, 0xa5, 0xff, 0x03, 0xe3, - 0x29, 0x16, 0x2d, 0xca, 0x9e, 0x1e, 0x51, 0x5a, 0x53, 0x39, 0x13, 0x18, - 0x4f, 0xb1, 0x58, 0x86, 0xf0, 0xb2, 0x2a, 0xd0, 0xa9, 0x8d, 0x1d, 0xa0, - 0x8a, 0x63, 0x07, 0xa8, 0x5a, 0x0a, 0xec, 0x09, 0xec, 0x00, 0x55, 0x4b, - 0x96, 0x3d, 0x81, 0x1d, 0xa0, 0x6a, 0x69, 0x6b, 0x4f, 0x60, 0x07, 0xa8, - 0xe2, 0xd8, 0x01, 0xaa, 0x16, 0xd7, 0xd7, 0x43, 0x76, 0x80, 0x2a, 0x8e, - 0x1d, 0xa0, 0x6a, 0x09, 0xb3, 0x27, 0x44, 0xd8, 0x1b, 0x05, 0xc6, 0x53, - 0x2c, 0x12, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x09, 0xca, 0xf5, 0xbd, - 0xf1, 0x8b, 0xeb, 0xea, 0x1d, 0x8c, 0x90, 0x15, 0xb4, 0x2b, 0xb3, 0xd2, - 0xfb, 0xc8, 0xaa, 0x7d, 0x36, 0x1f, 0x13, 0xc5, 0xf6, 0x13, 0x3d, 0xfc, - 0x85, 0x4c, 0x5f, 0x3c, 0x64, 0x15, 0x7b, 0x7e, 0x7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c6, 0x68, 0x00, 0xf7, 0x39, 0x47, 0xfb, - 0x1b, 0xec, 0x2d, 0x3d, 0xbe, 0x92, 0x59, 0x7a, 0x48, 0x37, 0x7e, 0x6b, - 0x2c, 0xea, 0x66, 0x36, 0xf5, 0x97, 0x9e, 0xbf, 0xcb, 0x07, 0xdf, 0x2e, - 0xf3, 0xa4, 0xce, 0x64, 0xe7, 0x84, 0x87, 0x35, 0x83, 0xae, 0xc3, 0x95, - 0x66, 0xf9, 0xf9, 0x85, 0x63, 0x0b, 0xcf, 0x47, 0x10, 0xa7, 0xa5, 0x9b, - 0x43, 0x2b, 0x66, 0xb7, 0xae, 0xf1, 0xd0, 0x22, 0x27, 0x59, 0x2f, 0xd4, - 0x2f, 0xbd, 0x97, 0xef, 0xec, 0x77, 0x60, 0xd0, 0x55, 0x06, 0x25, 0x37, - 0xad, 0xfb, 0xee, 0x4b, 0xae, 0xb2, 0x27, 0x26, 0xba, 0xab, 0x06, 0x8a, - 0xcf, 0x4f, 0x0a, 0x50, 0x5a, 0xee, 0x0e, 0x10, 0xf1, 0xb1, 0xec, 0xe4, - 0x56, 0xbd, 0x87, 0xde, 0xc6, 0xd4, 0x71, 0xba, 0x03, 0x3c, 0xbe, 0x4c, - 0xd6, 0x99, 0x37, 0x08, 0xc0, 0x90, 0x39, 0x4e, 0x29, 0x00, 0x24, 0x38, - 0xa7, 0x65, 0x4b, 0x4b, 0xcd, 0x6e, 0x99, 0xe0, 0x9c, 0xff, 0x2a, 0xac, - 0x0b, 0x8b, 0x47, 0x07, 0x18, 0xb8, 0x10, 0xc0, 0xa2, 0x81, 0x4e, 0xf1, - 0x2f, 0xe7, 0x01, 0x40, 0xeb, 0xf5, 0xc7, 0xe3, 0x3d, 0x4f, 0x61, 0xa2, - 0x38, 0x69, 0xff, 0xe1, 0x13, 0x78, 0x72, 0x3a, 0xa4, 0x7e, 0x69, 0xb5, - 0xfd, 0x7f, 0x5a, 0x33, 0x68, 0x9f, 0xb0, 0x30, 0xcb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 0xe8, 0x72, 0xc3, 0x9e, 0xdc, 0x51, - 0xb2, 0x5b, 0x98, 0x1f, 0x02, 0xbd, 0xcd, 0x1d, 0xa7, 0xf0, 0xfc, 0xf4, - 0x71, 0x41, 0x76, 0x01, 0xde, 0x8e, 0x9a, 0x1b, 0x22, 0x75, 0x74, 0x4b, - 0x80, 0x7b, 0xde, 0x3a, 0xa5, 0x75, 0x80, 0x04, 0x51, 0x7d, 0x40, 0x52, - 0x76, 0xb9, 0xb7, 0x00, 0xe6, 0xeb, 0x20, 0xfe, 0xeb, 0x03, 0xc9, 0x8d, - 0x74, 0x7c, 0x31, 0x0c, 0x2f, 0x1a, 0x97, 0x18, 0x54, 0x6a, 0xc0, 0xd4, - 0xb5, 0x41, 0xa2, 0x3a, 0xba, 0xe5, 0x06, 0x11, 0x6b, 0xad, 0x7e, 0x1c, - 0x52, 0x78, 0x76, 0x62, 0x76, 0x58, 0x05, 0x63, 0x87, 0x5f, 0xb1, 0xe1, - 0x2f, 0x3a, 0x62, 0xda, 0xcf, 0xf2, 0xda, 0x34, 0x29, 0xe7, 0xcb, 0xb9, - 0x2d, 0x32, 0x57, 0x15, 0xcf, 0x6d, 0x56, 0x19, 0xf1, 0x04, 0xb9, 0xc7, - 0x17, 0x55, 0x12, 0xf5, 0x4a, 0xed, 0x86, 0xb3, 0x94, 0xbe, 0xb7, 0x19, - 0x80, 0x72, 0x77, 0x80, 0x90, 0xb4, 0xfa, 0x7b, 0x52, 0xe1, 0x57, 0xa3, - 0x5a, 0x95, 0x2f, 0x4e, 0x73, 0x06, 0xee, 0x97, 0xb2, 0x1a, 0x31, 0xa4, - 0xf8, 0xc8, 0x44, 0x4c, 0x12, 0xd7, 0x57, 0x8a, 0xd8, 0xdf, 0x29, 0x47, - 0x7f, 0x34, 0x6d, 0x60, 0xee, 0xb6, 0x53, 0xac, 0x5d, 0x80, 0x91, 0xca, - 0x8a, 0xf6, 0x67, 0x80, 0x70, 0xa5, 0x94, 0x52, 0x41, 0x6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 0x0a, 0xa8, 0x2e, 0x76, 0x01, 0x0a, 0xf9, 0x62, 0x94, 0x86, 0xab, - 0x4d, 0xbd, 0x23, 0x8c, 0x16, 0x6f, 0x3c, 0x2b, 0xdb, 0x58, 0xf6, 0x66, - 0x6f, 0x29, 0xa9, 0xa1, 0xe4, 0x3d, 0x89, 0xad, 0x5d, 0x80, 0xb5, 0x52, - 0x7b, 0xc7, 0xbc, 0xdf, 0x8f, 0x1e, 0x53, 0x46, 0x77, 0xf2, 0x6e, 0xd1, - 0xb2, 0xca, 0xcb, 0xee, 0x00, 0x67, 0x6d, 0xf2, 0x27, 0x5f, 0x76, 0x5f, - 0x51, 0xc3, 0x6a, 0xc4, 0x90, 0x62, 0x49, 0x04, 0x80, 0xc8, 0x12, 0x04, - 0x71, 0x24, 0x72, 0xde, 0x5b, 0x88, 0x2c, 0x3e, 0x9e, 0x42, 0x6a, 0x71, - 0xbb, 0x03, 0x34, 0xcd, 0x39, 0x37, 0xa7, 0x89, 0x93, 0x94, 0x52, 0xc5, - 0x69, 0x93, 0x9c, 0x0f, 0x81, 0x0a, 0x8f, 0x97, 0x3c, 0x61, 0xde, 0xf8, - 0xcc, 0x5a, 0x8b, 0x83, 0x47, 0xab, 0xc5, 0xbf, 0x7e, 0x31, 0x2e, 0xac, - 0xba, 0x58, 0x7a, 0x66, 0x6f, 0xd9, 0x7d, 0x85, 0x1a, 0x55, 0x53, 0x0f, - 0x30, 0xea, 0x97, 0xde, 0xcb, 0xd7, 0xfa, 0x0d, 0x27, 0x5a, 0x2b, 0xb5, - 0x77, 0xdc, 0xef, 0xba, 0x55, 0x5f, 0x65, 0x77, 0x00, 0xe7, 0x43, 0xa0, - 0xc2, 0xe8, 0xb5, 0x61, 0xba, 0x86, 0xd5, 0x88, 0x21, 0xc5, 0x23, 0xde, - 0x1d, 0x20, 0xff, 0xe3, 0x8f, 0xc3, 0xd1, 0xd0, 0x3f, 0x44, 0x3b, 0xa4, - 0x16, 0xb7, 0x3b, 0x00,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 0x84, 0xab, 0x4d, 0xbd, 0xa3, - 0x37, 0x05, 0x20, 0x6c, 0x8d, 0xae, 0x6e, 0x35, 0x62, 0x48, 0x31, 0x14, - 0x56, 0x9b, 0x7a, 0x47, 0xb7, 0x72, 0xcf, 0xdf, 0xc9, 0x14, 0x52, 0x6f, - 0x21, 0x22, 0x22, 0x22, 0x22, 0x22, 0x3a, 0xa9, 0x3c, 0x07, 0x14, 0x4d, - 0x5e, 0xd6, 0x76, 0x6c, 0x5b, 0x1d, 0xad, 0x61, 0x4e, 0x21, 0x0d, 0x55, - 0xf2, 0x1e, 0x22, 0x05, 0xb8, 0xbf, 0x6f, 0xc6, 0x39, 0x57, 0x04, 0x08, - 0xe9, 0x85, 0x5c, 0xcf, 0x2c, 0x2b, 0x07, 0x38, 0x0c, 0x52, 0xc5, 0xbf, - 0x8d, 0x79, 0x0e, 0x28, 0x8a, 0x7f, 0x26, 0x27, 0xa7, 0xbb, 0x38, 0xec, - 0x62, 0x0d, 0x73, 0x0a, 0x69, 0xa8, 0x92, 0xf7, 0x10, 0x29, 0xab, 0x03, - 0x54, 0x9b, 0x94, 0x93, 0x37, 0xf3, 0xf3, 0x2e, 0xfe, 0x18, 0xd2, 0x0b, - 0xd9, 0x8c, 0xca, 0x55, 0xbc, 0xb5, 0x03, 0xb0, 0x06, 0x14, 0x99, 0x07, - 0x7e, 0x5a, 0x77, 0x88, 0x5a, 0x39, 0xdc, 0x7e, 0x84, 0x10, 0xca, 0x50, - 0x25, 0x53, 0xe4, 0xeb, 0xf9, 0xf9, 0x53, 0x22, 0x82, 0x16, 0x8f, 0xfc, - 0x26, 0x21, 0x21, 0x45, 0xfc, 0xf8, 0x3e, 0x84, 0x17, 0x52, 0xce, 0x3f, - 0x81, 0x2a, 0x5b, 0x1d, 0x60, 0xcd, 0xc5, 0x1e, 0x3f, 0xd1, 0xab, 0xa2, - 0xe4, 0x22, 0x0a, 0x9f, 0x98, 0x7b, 0xac, 0x40, 0x9f, 0x2d, 0x53, 0xfd, - 0x53, 0x0e, 0xad, 0x92, 0x37, 0x9e, 0x0d, 0x81, 0xd5, 0xe2, 0xf7, 0x7f, - 0x93, 0xd0, 0x78, 0xc5, 0x28, 0x27, 0x2a, 0xeb, 0x18, 0xe5, 0xda, 0x4e, - 0xe8, 0x97, 0xba, 0x0d, 0x15, 0xe1, 0xea, 0x00, 0x66, 0xe9, 0xa8, 0x7d, - 0xf9, 0x13, 0xf5, 0x36, 0xed, 0xee, 0x37, 0x81, 0x31, 0x53, 0x82, 0x55, - 0xae, 0x12, 0x5c, 0xc7, 0x7a, 0x65, 0x1c, 0xfe, 0x43, 0xab, 0x1a, 0x33, - 0x1f, 0xd5, 0x45, 0x8b, 0x5b, 0xc6, 0x4e, 0xd0, 0xc3, 0x18, 0xac, 0x36, - 0xf5, 0x8e, 0x56, 0x8b, 0xaf, 0x4b, 0x04, 0xba, 0xea, 0x71, 0xb0, 0xb6, - 0x82, 0x1a, 0xed, 0x7e, 0x69, 0xe2, 0x1f, 0x6b, 0x66, 0xb7, 0x69, 0x48, - 0xd1, 0x5a, 0xc7, 0xd5, 0xf2, 0xc6, 0xf1, 0xcb, 0xef, 0x74, 0x62, 0x9d, - 0xcc, 0x28, 0x24, 0xf7, 0x43, 0xd5, 0xe6, 0xd1, 0x01, 0xd6, 0x5c, 0x04, - 0x74, 0x5d, 0xad, 0x8b, 0xda, 0x02, 0xf5, 0xf4, 0xb5, 0xd1, 0xac, 0x36, - 0xf5, 0x8e, 0x56, 0x8b, 0x17, 0xfa, 0x80, 0x58, 0xe3, 0x92, 0x9e, 0x46, - 0x47, 0x3c, 0xdc, 0x74, 0xfd, 0xb9, 0x3e, 0xe7, 0x23, 0x63, 0x48, 0x2d, - 0x6e, 0x45, 0x6b, 0x1d, 0x57, 0x89, 0x40, 0x67, 0x3d, 0x47, 0x98, 0xde, - 0xbf, 0x66, 0x61, 0x05, 0x2f, 0x91, 0x74, 0xca, 0xf0, 0xe8, 0x00, 0x05, - 0xb1, 0x40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 0x75, 0x6b, 0x2d, 0xf6, 0x8e, 0x63, 0x96, 0x25, - 0x24, 0x7c, 0x33, 0xc6, 0x89, 0x51, 0x6f, 0x16, 0x14, 0xbc, 0x19, 0xf4, - 0xea, 0xb0, 0xad, 0xcc, 0x9f, 0x2f, 0x59, 0x2b, 0xb5, 0x77, 0x3c, 0x6b, - 0xd5, 0xe1, 0xd4, 0xab, 0xe4, 0x3c, 0x19, 0xeb, 0xb8, 0x5a, 0x9e, 0x10, - 0xbf, 0x74, 0x84, 0x28, 0x8d, 0xdb, 0x55, 0x91, 0x1f, 0x18, 0x9d, 0x52, - 0xac, 0x5d, 0x80, 0x14, 0xf1, 0x4a, 0x7e, 0xfe, 0x2b, 0x7a, 0xed, 0xb2, - 0x3a, 0x80, 0xd5, 0xa6, 0xde, 0xd1, 0xbb, 0xc5, 0xbd, 0x2d, 0x9a, 0x10, - 0xdb, 0x62, 0xb1, 0x2a, 0x67, 0x74, 0x79, 0xf0, 0xd8, 0x79, 0x3a, 0xa8, - 0xfb, 0x72, 0x0a, 0x26, 0xcb, 0x91, 0xde, 0x3d, 0xe4, 0x35, 0x59, 0xab, - 0x20, 0xf7, 0x18, 0xa1, 0xf2, 0xb3, 0xda, 0xd4, 0x3b, 0x9e, 0x08, 0x6b, - 0xa5, 0xf6, 0x8e, 0x2e, 0xc6, 0x3a, 0x6e, 0xd7, 0x8b, 0x59, 0x71, 0x2d, - 0xe8, 0xd4, 0x66, 0xac, 0xe3, 0x76, 0x07, 0x38, 0x96, 0x14, 0xfc, 0x70, - 0x24, 0x9d, 0x12, 0xcc, 0x75, 0xbc, 0x62, 0xdb, 0x3a, 0xfa, 0x7f, 0x8c, - 0xeb, 0x38, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - 0x11, 0x11, 0x11, 0x9d, 0xfa, 0xfe, 0x0f, 0x73, 0x82, 0x6c, 0xfb, 0x27, - 0x34, 0xb3, 0x21, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, - 0x42, 0x60, 0x82, + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0xd1, 0x13, 0x8b, 0x26, 0x00, 0x00, 0x00, + 0x04, 0x67, 0x41, 0x4d, 0x41, 0x00, 0x00, 0xb1, 0x8f, 0x0b, 0xfc, 0x61, + 0x05, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x03, 0x37, 0xc7, + 0x4d, 0x53, 0x00, 0x00, 0x00, 0x20, 0x63, 0x48, 0x52, 0x4d, 0x00, 0x00, + 0x7a, 0x26, 0x00, 0x00, 0x80, 0x84, 0x00, 0x00, 0xfa, 0x00, 0x00, 0x00, + 0x80, 0xe8, 0x00, 0x00, 0x75, 0x30, 0x00, 0x00, 0xea, 0x60, 0x00, 0x00, + 0x3a, 0x98, 0x00, 0x00, 0x17, 0x70, 0x9c, 0xba, 0x51, 0x3c, 0x00, 0x00, + 0x00, 0x22, 0x74, 0x45, 0x58, 0x74, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x65, 0x64, 0x2d, 0x62, 0x79, 0x00, 0x4d, 0x69, 0x74, 0x73, 0x75, + 0x62, 0x61, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x30, + 0x2e, 0x34, 0x2e, 0x30, 0xd0, 0x43, 0xaf, 0x65, 0x00, 0x00, 0x1f, 0xff, + 0x49, 0x44, 0x41, 0x54, 0x78, 0x5e, 0xed, 0xdd, 0x79, 0x7c, 0x14, 0x45, + 0xde, 0x06, 0xf0, 0x27, 0x21, 0x17, 0x30, 0xe1, 0x52, 0x31, 0x40, 0xc2, + 0x0d, 0x8a, 0x80, 0xaf, 0xba, 0x40, 0x00, 0x15, 0x5c, 0x41, 0x0e, 0x15, + 0x01, 0x15, 0x85, 0xf5, 0x40, 0x3c, 0x5f, 0x50, 0x5c, 0x50, 0x50, 0xbc, + 0x75, 0x75, 0x55, 0x14, 0x50, 0x14, 0x4f, 0x74, 0x55, 0x70, 0x11, 0x05, + 0x01, 0x11, 0x05, 0x62, 0xe4, 0x50, 0x40, 0x57, 0x14, 0x04, 0x85, 0x10, + 0x8e, 0x40, 0x42, 0xc2, 0x11, 0x42, 0x2e, 0x10, 0x92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, 0x41, 0x83, 0x2c, 0x7d, 0xe5, 0xab, + 0xbb, 0xdf, 0x04, 0xc6, 0xc8, 0x2b, 0x82, 0x00, 0xf7, 0xc9, 0x2b, 0x6c, + 0xed, 0xea, 0x23, 0x4e, 0x1c, 0x59, 0xb3, 0x5f, 0xed, 0x4a, 0xe3, 0xfa, + 0x40, 0xaf, 0x9e, 0x1e, 0xff, 0xd8, 0xce, 0x2c, 0x67, 0x50, 0x88, 0x32, + 0x1f, 0xf2, 0xdf, 0x8a, 0x00, 0x80, 0xdf, 0xe5, 0xef, 0x0a, 0x57, 0x77, + 0x01, 0x3a, 0x7b, 0x75, 0x00, 0x0f, 0x65, 0x74, 0x80, 0x98, 0x18, 0x15, + 0x13, 0xe3, 0x5c, 0x25, 0x44, 0xb5, 0x05, 0xea, 0xe9, 0x73, 0x74, 0xeb, + 0x12, 0x81, 0xae, 0xfa, 0x9c, 0xad, 0x4a, 0x04, 0x3a, 0xeb, 0x0b, 0x66, + 0x58, 0x67, 0x34, 0x94, 0xbc, 0x4a, 0x1e, 0x70, 0xc0, 0x38, 0xcb, 0x66, + 0xaf, 0xa7, 0x56, 0x07, 0xe8, 0xbd, 0x02, 0x58, 0xd9, 0xdb, 0x89, 0xb7, + 0x4f, 0xc2, 0xb4, 0x7f, 0xe1, 0x25, 0x67, 0x65, 0xbd, 0xf7, 0x83, 0x0f, + 0xc4, 0xb8, 0xa5, 0x3a, 0x99, 0x51, 0x48, 0xee, 0x07, 0x61, 0xe0, 0xcf, + 0x72, 0x4c, 0xcc, 0x31, 0x79, 0xe2, 0xd0, 0x9e, 0xfd, 0x08, 0x63, 0xe0, + 0x8d, 0x25, 0xa4, 0x66, 0xaa, 0xbc, 0x08, 0xd7, 0xe2, 0xca, 0xf7, 0x01, + 0xe2, 0x7a, 0x33, 0xd6, 0x86, 0xda, 0x3e, 0x82, 0x69, 0x46, 0x05, 0xdc, + 0x94, 0xde, 0xc4, 0x28, 0x37, 0xff, 0x56, 0xf2, 0x9d,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x1b, 0x22, 0x75, 0x74, 0x4b, + 0x80, 0x7b, 0xde, 0x3a, 0xa5, 0x75, 0x80, 0x04, 0x51, 0x7d, 0x40, 0x52, + 0x76, 0xb9, 0xb7, 0x00, 0xe6, 0xeb, 0x20, 0xfe, 0xeb, 0x03, 0xc9, 0x8d, + 0x74, 0x7c, 0x31, 0x0c, 0x2f, 0x1a, 0x97, 0x18, 0x54, 0x6a, 0xc0, 0xd4, + 0xb5, 0x41, 0xa2, 0x3a, 0xba, 0xe5, 0x06, 0x11, 0x6b, 0xad, 0x7e, 0x1c, + 0x52, 0x78, 0x76, 0x62, 0x76, 0x58, 0x05, 0x63, 0x87, 0x5f, 0xb1, 0xe1, + 0x2f, 0x3a, 0x62, 0xda, 0xcf, 0xf2, 0xda, 0x34, 0x29, 0xe7, 0xcb, 0xb9, + 0x2d, 0x32, 0x57, 0x15, 0xcf, 0x6d, 0x56, 0x19, 0xf1, 0x04, 0xb9, 0xc7, + 0x17, 0x55, 0x12, 0xf5, 0x4a, 0xed, 0x86, 0xb3, 0x94, 0xbe, 0xb7, 0x19, + 0x80, 0x72, 0x77, 0x80, 0x90, 0xb4, 0xfa, 0x7b, 0x52, 0xe1, 0x57, 0xa3, + 0x5a, 0x95, 0x2f, 0x4e, 0x73, 0x06, 0xee, 0x97, 0xb2, 0x1a, 0x31, 0xa4, + 0xf8, 0xc8, 0x44, 0x4c, 0x12, 0xd7, 0x57, 0x8a, 0xd8, 0xdf, 0x29, 0x47, + 0x7f, 0x34, 0x6d, 0x60, 0xee, 0xb6, 0x53, 0xac, 0x5d, 0x80, 0x91, 0xca, + 0x8a, 0xf6, 0x67, 0x80, 0x70, 0xa5, 0x94, 0x52, 0x41, 0x6f, 0x5b, 0xed, + 0x6d, 0xeb, 0xc5, 0x89, 0x9b, 0x37, 0x27, 0x76, 0xd3, 0x97, 0x59, 0xf4, + 0xe2, 0x7a, 0xe9, 0x10, 0xec, 0x53, 0xa9, 0x6b, 0xf6, 0x4c, 0xff, 0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9, 0xa1, 0xe4, 0x3d, 0x89, 0xad, 0x5d, 0x80, 0xb5, 0x52, + 0x7b, 0xc7, 0xbc, 0xdf, 0x8f, 0x1e, 0x53, 0x46, 0x77, 0xf2, 0x6e, 0xd1, + 0xb2, 0xca, 0xcb, 0xee, 0x00, 0x67, 0x6d, 0xf2, 0x27, 0x5f, 0x76, 0x5f, + 0x51, 0xc3, 0x6a, 0xc4, 0x90, 0x62, 0x49, 0x04, 0x80, 0xc8, 0x12, 0x04, + 0x71, 0x24, 0x72, 0xde, 0x5b, 0x88, 0x2c, 0x3e, 0x9e, 0x42, 0x6a, 0x71, + 0xbb, 0x03, 0x34, 0xcd, 0x39, 0x37, 0xa7, 0x89, 0x93, 0x94, 0x52, 0xc5, + 0x69, 0x93, 0x9c, 0x0f, 0x81, 0x0a, 0x8f, 0x97, 0x3c, 0x61, 0xde, 0xf8, + 0xcc, 0x5a, 0x8b, 0x83, 0x47, 0xab, 0xc5, 0xbf, 0x7e, 0x31, 0x2e, 0xac, + 0xba, 0x58, 0x7a, 0x66, 0x6f, 0xd9, 0x7d, 0x85, 0x1a, 0x55, 0x53, 0x0f, + 0x30, 0xea, 0x97, 0xde, 0xcb, 0xd7, 0xfa, 0x0d, 0x27, 0x5a, 0x2b, 0xb5, + 0x77, 0xdc, 0xef, 0xba, 0x55, 0x5f, 0x65, 0x77, 0x00, 0xe7, 0x43, 0xa0, + 0xc2, 0xe8, 0xb5, 0x61, 0xba, 0x86, 0xd5, 0x88, 0x21, 0xc5, 0x23, 0xde, + 0x1d, 0x20, 0xff, 0xe3, 0x8f, 0xc3, 0xd1, 0xd0, 0x3f, 0x44, 0x3b, 0xa4, + 0x16, 0xb7, 0x3b, 0x00, 0x26, 0xe5, 0x05, 0xff, 0x1a, 0xa8, 0x80, 0xc1, + 0xe9, 0x2f, 0x3b, 0xd1, 0x6a, 0x53, 0xef, 0x68, 0xb5, 0xf8, 0x41, 0x1f, + 0x70, 0x91, 0xf9, 0xf4, 0xa2, 0x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0x14, 0x52, 0x6f, + 0x21, 0x22, 0x22, 0x22, 0x22, 0x22, 0x3a, 0xa9, 0x3c, 0x07, 0x14, 0x4d, + 0x5e, 0xd6, 0x76, 0x6c, 0x5b, 0x1d, 0xad, 0x61, 0x4e, 0x21, 0x0d, 0x55, + 0xf2, 0x1e, 0x22, 0x05, 0xb8, 0xbf, 0x6f, 0xc6, 0x39, 0x57, 0x04, 0x08, + 0xe9, 0x85, 0x5c, 0xcf, 0x2c, 0x2b, 0x07, 0x38, 0x0c, 0x52, 0xc5, 0xbf, + 0x8d, 0x79, 0x0e, 0x28, 0x8a, 0x7f, 0x26, 0x27, 0xa7, 0xbb, 0x38, 0xec, + 0x62, 0x0d, 0x73, 0x0a, 0x69, 0xa8, 0x92, 0xf7, 0x10, 0x29, 0xab, 0x03, + 0x54, 0x9b, 0x94, 0x93, 0x37, 0xf3, 0xf3, 0x2e, 0xfe, 0x18, 0xd2, 0x0b, + 0xd9, 0x8c, 0xca, 0x55, 0xbc, 0xb5, 0x03, 0xb0, 0x06, 0x14, 0x99, 0x07, + 0x7e, 0x5a, 0x77, 0x88, 0x5a, 0x39, 0xdc, 0x7e, 0x84, 0x10, 0xca, 0x50, + 0x25, 0x53, 0xe4, 0xeb, 0xf9, 0xf9, 0x53, 0x22, 0x82, 0x16, 0x8f, 0xfc, + 0x26, 0x21, 0x21, 0x45, 0xfc, 0xf8, 0x3e, 0x84, 0x17, 0x52, 0xce, 0x3f, + 0x81, 0x2a, 0x5b, 0x1d, 0x60, 0xcd, 0xc5, 0x1e, 0x3f, 0xd1, 0xab, 0xa2, + 0xe4, 0x22, 0x0a, 0x9f, 0x98, 0x7b, 0xac, 0x40, 0x9f, 0x2d, 0x53, 0xfd, + 0x53, 0x0e, 0xad, 0x92, 0x37, 0x9e, 0x0d, 0x81, 0xd5, 0xe2, 0xf7, 0x7f, + 0x93, 0xd0, 0x78, 0xc5, 0x28, 0x27, 0x2a, 0xeb, 0x18, 0xe5, 0xda, 0x4e, + 0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 0xca, 0x19, 0xc5, 0x85, 0x35, 0xad, 0x75, 0x5c, 0xf9, + 0x00, 0x5f, 0x9e, 0x13, 0xd1, 0x7d, 0xd6, 0x95, 0x4b, 0x51, 0xc5, 0x79, + 0x75, 0x00, 0xb3, 0x99, 0xac, 0x45, 0xed, 0xdd, 0xa6, 0xde, 0x71, 0x7d, + 0x22, 0xd0, 0x65, 0x1d, 0x82, 0x99, 0xb7, 0xb1, 0x51, 0xfc, 0x52, 0xe7, + 0x0e, 0xd9, 0x65, 0xb7, 0xb8, 0x88, 0x79, 0xf5, 0x80, 0xf6, 0x62, 0x26, + 0xcc, 0x75, 0x5c, 0xf9, 0x00, 0x9f, 0xec, 0x78, 0xeb, 0xa6, 0x8d, 0x43, + 0x15, 0x56, 0xc6, 0x25, 0x62, 0xd2, 0xfe, 0x07, 0x38, 0xcf, 0xba, 0x30, + 0x65, 0x05, 0xed, 0x68, 0x0b, 0xb4, 0xdb, 0xe1, 0xc4, 0x69, 0xe3, 0x13, + 0x12, 0xc6, 0xeb, 0xe1, 0xb8, 0x96, 0x5e, 0x47, 0x7f, 0xfe, 0x75, 0xfd, + 0x5a, 0x3d, 0x2c, 0x12, 0x80, 0xf5, 0x8d, 0x21, 0x78, 0xfc, 0xcf, 0xc3, + 0xb1, 0x2d, 0x26, 0x88, 0xa2, 0x77, 0x6e, 0xfc, 0xeb, 0x4f, 0x07, 0x75, + 0x6c, 0x07, 0xb4, 0x95, 0x9f, 0x2e, 0x67, 0xdc, 0x68, 0x8e, 0xe4, 0xad, + 0x82, 0xe4, 0x2a, 0x6f, 0x7d, 0x18, 0x1f, 0xb9, 0xaa, 0x49, 0x93, 0xef, + 0x47, 0x9a, 0x35, 0x75, 0x75, 0x6b, 0x2d, 0xf6, 0x8e, 0x63, 0x96, 0x25, + 0x24, 0x7c, 0x33, 0xc6, 0x89, 0x51, 0x6f, 0x16, 0x14, 0xbc, 0x19, 0xf4, + 0xea, 0xb0, 0xad, 0xcc, 0x9f, 0x2f, 0x59, 0x2b, 0xb5, 0x77, 0x3c, 0x6b, + 0xd5, 0xe1, 0xd4, 0xab, 0xe4, 0x3c, 0x19, 0xeb, 0xb8, 0x5a, 0x9e, 0x10, + 0xbf, 0x74, 0x84, 0x28, 0x8d, 0xdb, 0x55, 0x91, 0x1f, 0x18, 0x9d, 0x52, + 0xac, 0x5d, 0x80, 0x14, 0xf1, 0x4a, 0x7e, 0xfe, 0x2b, 0x7a, 0xed, 0xb2, + 0x3a, 0x80, 0xd5, 0xa6, 0xde, 0xd1, 0xbb, 0xc5, 0xbd, 0x2d, 0x9a, 0x10, + 0xdb, 0x62, 0xb1, 0x2a, 0x67, 0x74, 0x79, 0xf0, 0xd8, 0x79, 0x3a, 0xa8, + 0xfb, 0x72, 0x0a, 0x26, 0xcb, 0x91, 0xde, 0x3d, 0xe4, 0x35, 0x59, 0xab, + 0x20, 0xf7, 0x18, 0xa1, 0xf2, 0xb3, 0xda, 0xd4, 0x3b, 0x9e, 0x08, 0x6b, + 0xa5, 0xf6, 0x8e, 0x2e, 0xc6, 0x3a, 0x6e, 0xd7, 0x8b, 0x59, 0x71, 0x2d, + 0xe8, 0xd4, 0x66, 0xac, 0xe3, 0x76, 0x07, 0x38, 0x96, 0x14, 0xfc, 0x70, + 0x24, 0x9d, 0x12, 0xcc, 0x75, 0xbc, 0x62, 0xdb, 0x3a, 0xfa, 0x7f, 0x8c, + 0xeb, 0x38, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0x11, 0x9d, 0xfa, 0xfe, 0x0f, 0x73, 0x82, 0x6c, 0xfb, 0x27, + 0x34, 0xb3, 0x21, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, + 0x42, 0x60, 0x82, }; uint32_t veramono14_png_size = 8367; diff --git a/src/libhw/device.cpp b/src/libhw/device.cpp index 3d92ca80..6ed80af0 100644 --- a/src/libhw/device.cpp +++ b/src/libhw/device.cpp @@ -187,12 +187,12 @@ std::string DeviceEvent::toString() const { break; case Device::EKeyDownEvent: oss << "keyDown, key='" << (m_keyboard.key == 0 ? ' ' : m_keyboard.key) << "', special=" - << (int) m_keyboard.special << ", modifiers=" << (int) m_keyboard.modifiers + << (int) m_keyboard.special << ", modifiers=" << (int) m_keyboard.modifiers << ", interpreted='" << m_keyboard.interpreted << "'"; break; case Device::EKeyUpEvent: oss << "keyUp, key='" << (m_keyboard.key == 0 ? ' ' : m_keyboard.key) << "', special=" - << (int) m_keyboard.special << ", modifiers=" << (int) m_keyboard.modifiers + << (int) m_keyboard.special << ", modifiers=" << (int) m_keyboard.modifiers << ", interpreted='" << m_keyboard.interpreted << "'"; break; case Device::EMouseMotionEvent: diff --git a/src/libhw/font.cpp b/src/libhw/font.cpp index 0b76515c..dc705f3c 100644 --- a/src/libhw/font.cpp +++ b/src/libhw/font.cpp @@ -60,7 +60,7 @@ Font::Font(EFont font) { m_bitmap = new Bitmap(Bitmap::EPNG, pngStream); for (int i=0; i<256; ++i) { Glyph &g = m_glyphs[i]; - + g.tx.x = dscStream->readSingle(); g.tx.y = dscStream->readSingle(); g.ts.x = dscStream->readSingle(); diff --git a/src/libhw/glgeometry.cpp b/src/libhw/glgeometry.cpp index c5ca45c4..68aac897 100644 --- a/src/libhw/glgeometry.cpp +++ b/src/libhw/glgeometry.cpp @@ -26,7 +26,7 @@ MTS_NAMESPACE_BEGIN -GLGeometry::GLGeometry(const TriMesh *mesh) +GLGeometry::GLGeometry(const TriMesh *mesh) : GPUGeometry(mesh) { m_id[0] = m_id[1] = 0; } @@ -35,8 +35,8 @@ void GLGeometry::init() { Assert(m_id[0] == 0 && m_id[1] == 0); glGenBuffers(2, m_id); refresh(); - } + void GLGeometry::refresh() { Assert(m_id[0] != 0 && m_id[1] != 0); m_stride = 3; @@ -54,7 +54,7 @@ void GLGeometry::refresh() { m_size[EVertexID] = (GLuint) (vertexCount * m_stride); m_size[EIndexID] = (GLuint) (triCount * sizeof(GLuint) * 3); - Log(ETrace, "Uploading a GPU geometry object (\"%s\", " SIZE_T_FMT + Log(ETrace, "Uploading a GPU geometry object (\"%s\", " SIZE_T_FMT " vertices, " SIZE_T_FMT " triangles, %s)", getName().c_str(), vertexCount, triCount, memString(m_size[EVertexID] + m_size[EIndexID]).c_str()); @@ -118,7 +118,7 @@ void GLGeometry::refresh() { } } Assert(pos * sizeof(GLfloat) == m_stride * vertexCount); - + bind(); glBufferData(GL_ARRAY_BUFFER, m_size[EVertexID], vertices, GL_STATIC_DRAW); diff --git a/src/libhw/glprogram.cpp b/src/libhw/glprogram.cpp index 09ce6086..48c41b00 100644 --- a/src/libhw/glprogram.cpp +++ b/src/libhw/glprogram.cpp @@ -43,7 +43,7 @@ namespace { } } -GLProgram::GLProgram(const std::string &name) +GLProgram::GLProgram(const std::string &name) : GPUProgram(name) { m_id[EVertexProgram] = 0; m_id[EFragmentProgram] = 0; @@ -61,7 +61,7 @@ void GLProgram::init() { m_program = glCreateProgramObjectARB(); - m_id[EVertexProgram] = createShader(GL_VERTEX_SHADER_ARB, + m_id[EVertexProgram] = createShader(GL_VERTEX_SHADER_ARB, m_source[EVertexProgram]); m_id[EFragmentProgram] = createShader(GL_FRAGMENT_SHADER_ARB, m_source[EFragmentProgram]); @@ -71,10 +71,10 @@ void GLProgram::init() { if (m_id[EGeometryProgram] != 0) { Assert(m_maxVertices > 0); glProgramParameteriEXT(m_program, GL_GEOMETRY_INPUT_TYPE_EXT, - translateGeometryType(m_inputGeometryType)); - glProgramParameteriEXT(m_program, GL_GEOMETRY_OUTPUT_TYPE_EXT, - translateGeometryType(m_outputGeometryType)); - glProgramParameteriEXT(m_program, GL_GEOMETRY_VERTICES_OUT_EXT, + translateGeometryType(m_inputGeometryType)); + glProgramParameteriEXT(m_program, GL_GEOMETRY_OUTPUT_TYPE_EXT, + translateGeometryType(m_outputGeometryType)); + glProgramParameteriEXT(m_program, GL_GEOMETRY_VERTICES_OUT_EXT, m_maxVertices); } @@ -282,7 +282,7 @@ void GLProgram::setParameter(int id, const GPUTexture *value) { if (id == -1) return; const std::set &units = value->getTextureUnits(); - if (units.size() > 0) + if (units.size() > 0) glUniform1i(id, *(units.begin())); else Log(EWarn, "Unable to supply unbound texture \"%s\" to shader \"%s\"", diff --git a/src/libhw/glrenderer.cpp b/src/libhw/glrenderer.cpp index 96771ac1..1c8c6083 100644 --- a/src/libhw/glrenderer.cpp +++ b/src/libhw/glrenderer.cpp @@ -95,7 +95,7 @@ void GLRenderer::init(Device *device, Renderer *other) { /* OpenGL extensions */ GLenum err = glewInit(); - if (err != GLEW_OK) + if (err != GLEW_OK) Log(EError, "GLEW Error: %s\n", glewGetErrorString(err)); if (glewIsSupported("GL_EXT_framebuffer_object")) { @@ -138,7 +138,7 @@ void GLRenderer::init(Device *device, Renderer *other) { Log(m_warnLogLevel, "Capabilities: Fast buffer blitting is NOT supported!"); } - if (glewIsSupported("GL_EXT_framebuffer_multisample") && + if (glewIsSupported("GL_EXT_framebuffer_multisample") && glewIsSupported("GL_EXT_framebuffer_blit") && glewIsSupported("GL_ARB_texture_multisample")) { m_capabilities->setSupported( @@ -194,7 +194,7 @@ void GLRenderer::init(Device *device, Renderer *other) { RendererCapabilities::EBindless, true); Log(m_logLevel, "Capabilities: Bindless rendering is supported."); } else { - Log((m_warnLogLevel == EWarn) ? EInfo : m_warnLogLevel, + Log((m_warnLogLevel == EWarn) ? EInfo : m_warnLogLevel, "Capabilities: Bindless rendering is NOT supported!"); } @@ -250,7 +250,7 @@ GPUGeometry *GLRenderer::createGPUGeometry(const Shape *shape) { GPUProgram *GLRenderer::createGPUProgram(const std::string &name) { return new GLProgram(name); } - + GPUSync *GLRenderer::createGPUSync() { return new GLSync(); } @@ -329,7 +329,7 @@ void GLRenderer::drawMesh(const TriMesh *mesh) { glEnableClientState(GL_TEXTURE_COORD_ARRAY); m_tangentsEnabled = true; } - glTexCoordPointer(3, dataType, sizeof(Vector), tangents); + glTexCoordPointer(3, dataType, sizeof(Vector), tangents); } else if (m_tangentsEnabled) { glDisableClientState(GL_TEXTURE_COORD_ARRAY); m_tangentsEnabled = false; @@ -350,7 +350,7 @@ void GLRenderer::drawMesh(const TriMesh *mesh) { size_t size = mesh->getTriangleCount(); if (EXPECT_TAKEN(m_queuedTriangles + size < MTS_GL_MAX_QUEUED_TRIS)) { /* Draw all triangles */ - glDrawElements(GL_TRIANGLES, (GLsizei) (mesh->getTriangleCount()*3), + glDrawElements(GL_TRIANGLES, (GLsizei) (mesh->getTriangleCount()*3), GL_UNSIGNED_INT, indices); m_queuedTriangles += size; } else { @@ -360,7 +360,7 @@ void GLRenderer::drawMesh(const TriMesh *mesh) { size_t drawAmt = std::min(size - cur, MTS_GL_MAX_QUEUED_TRIS - m_queuedTriangles); if (drawAmt > 0) - glDrawElements(GL_TRIANGLES, (GLsizei) (drawAmt * 3), + glDrawElements(GL_TRIANGLES, (GLsizei) (drawAmt * 3), GL_UNSIGNED_INT, indices + cur * 3); m_queuedTriangles += drawAmt; cur += drawAmt; if (cur < size) @@ -393,19 +393,19 @@ void GLRenderer::drawMesh(const GPUGeometry *_geo) { glColorFormatNV(3, GL_FLOAT, stride); m_stride = stride; } - - glBufferAddressRangeNV(GL_VERTEX_ARRAY_ADDRESS_NV, + + glBufferAddressRangeNV(GL_VERTEX_ARRAY_ADDRESS_NV, 0, vertexAddr, vertexSize); if (!m_transmitOnlyPositions) { int pos = 3 * sizeof(GLfloat); - + if (mesh->hasVertexNormals()) { if (!m_normalsEnabled) { glEnableClientState(GL_NORMAL_ARRAY); m_normalsEnabled = true; } - glBufferAddressRangeNV(GL_NORMAL_ARRAY_ADDRESS_NV, 0, + glBufferAddressRangeNV(GL_NORMAL_ARRAY_ADDRESS_NV, 0, vertexAddr + pos, vertexSize - pos); pos += 3 * sizeof(GLfloat); @@ -453,7 +453,7 @@ void GLRenderer::drawMesh(const GPUGeometry *_geo) { m_colorsEnabled = true; } - glBufferAddressRangeNV(GL_COLOR_ARRAY_ADDRESS_NV, 0, + glBufferAddressRangeNV(GL_COLOR_ARRAY_ADDRESS_NV, 0, vertexAddr + pos, vertexSize - pos); } else if (m_colorsEnabled) { glDisableClientState(GL_COLOR_ARRAY); @@ -529,7 +529,7 @@ void GLRenderer::drawMesh(const GPUGeometry *_geo) { size_t size = mesh->getTriangleCount(); if (EXPECT_TAKEN(m_queuedTriangles + size < MTS_GL_MAX_QUEUED_TRIS)) { /* Draw all triangles */ - glDrawElements(GL_TRIANGLES, (GLsizei) (size * 3), + glDrawElements(GL_TRIANGLES, (GLsizei) (size * 3), GL_UNSIGNED_INT, (GLvoid *) 0); m_queuedTriangles += size; } else { @@ -539,10 +539,10 @@ void GLRenderer::drawMesh(const GPUGeometry *_geo) { size_t drawAmt = std::min(size - cur, MTS_GL_MAX_QUEUED_TRIS - m_queuedTriangles); if (drawAmt > 0) - glDrawElements(GL_TRIANGLES, (GLsizei) (drawAmt * 3), + glDrawElements(GL_TRIANGLES, (GLsizei) (drawAmt * 3), GL_UNSIGNED_INT, (GLuint *) 0 + cur * 3); m_queuedTriangles += drawAmt; cur += drawAmt; - if (cur < size) + if (cur < size) finish(); } } @@ -591,7 +591,7 @@ void GLRenderer::drawAll(const std::vector &allGeometry) GLRenderer::beginDrawingMeshes(true); if (m_capabilities->isSupported(RendererCapabilities::EBindless)) { - for (std::vector::const_iterator it = allGeometry.begin(); + for (std::vector::const_iterator it = allGeometry.begin(); it != allGeometry.end(); ++it) { const GLGeometry *geo = static_cast((*it).first); const Matrix4x4 &trafo = (*it).second; @@ -614,14 +614,14 @@ void GLRenderer::drawAll(const std::vector &allGeometry) glBufferAddressRangeNV(GL_VERTEX_ARRAY_ADDRESS_NV, 0, vertexAddr, vertexSize); - glBufferAddressRangeNV(GL_ELEMENT_ARRAY_ADDRESS_NV, 0, + glBufferAddressRangeNV(GL_ELEMENT_ARRAY_ADDRESS_NV, 0, indexAddr, indexSize); size_t size = mesh->getTriangleCount(); if (EXPECT_TAKEN(m_queuedTriangles + size < MTS_GL_MAX_QUEUED_TRIS)) { /* Draw all triangles */ - glDrawElements(GL_TRIANGLES, (GLsizei) (size * 3), + glDrawElements(GL_TRIANGLES, (GLsizei) (size * 3), GL_UNSIGNED_INT, (GLvoid *) 0); m_queuedTriangles += size; } else { @@ -631,7 +631,7 @@ void GLRenderer::drawAll(const std::vector &allGeometry) size_t drawAmt = std::min(size - cur, MTS_GL_MAX_QUEUED_TRIS - m_queuedTriangles); if (drawAmt > 0) - glDrawElements(GL_TRIANGLES, (GLsizei) (drawAmt * 3), + glDrawElements(GL_TRIANGLES, (GLsizei) (drawAmt * 3), GL_UNSIGNED_INT, (GLuint *) 0 + cur * 3); m_queuedTriangles += drawAmt; cur += drawAmt; if (cur < size) @@ -640,7 +640,7 @@ void GLRenderer::drawAll(const std::vector &allGeometry) } } } else { - for (std::vector::const_iterator it = allGeometry.begin(); + for (std::vector::const_iterator it = allGeometry.begin(); it != allGeometry.end(); ++it) { const GLGeometry *geo = static_cast((*it).first); const Matrix4x4 &trafo = (*it).second; @@ -661,7 +661,7 @@ void GLRenderer::drawAll(const std::vector &allGeometry) if (EXPECT_TAKEN(m_queuedTriangles + size < MTS_GL_MAX_QUEUED_TRIS)) { /* Draw all triangles */ - glDrawElements(GL_TRIANGLES, (GLsizei) (size * 3), + glDrawElements(GL_TRIANGLES, (GLsizei) (size * 3), GL_UNSIGNED_INT, (GLvoid *) 0); m_queuedTriangles += size; } else { @@ -671,7 +671,7 @@ void GLRenderer::drawAll(const std::vector &allGeometry) size_t drawAmt = std::min(size - cur, MTS_GL_MAX_QUEUED_TRIS - m_queuedTriangles); if (drawAmt > 0) - glDrawElements(GL_TRIANGLES, (GLsizei) (drawAmt * 3), + glDrawElements(GL_TRIANGLES, (GLsizei) (drawAmt * 3), GL_UNSIGNED_INT, (GLuint *) 0 + cur * 3); m_queuedTriangles += drawAmt; cur += drawAmt; if (cur < size) @@ -690,7 +690,7 @@ void GLRenderer::blitTexture(const GPUTexture *tex, bool flipVertically, tex->bind(); glColor4f(1.0f, 1.0f, 1.0f, 1.0f); - GLint viewport[4]; + GLint viewport[4]; glGetIntegerv(GL_VIEWPORT, viewport); Vector2i scrSize = Vector2i(viewport[2], viewport[3]); Vector2i texSize = Vector2i(tex->getSize().x, tex->getSize().y); @@ -733,7 +733,7 @@ void GLRenderer::blitTexture(const GPUTexture *tex, bool flipVertically, } void GLRenderer::blitQuad(bool flipVertically) { - GLint viewport[4]; + GLint viewport[4]; glGetIntegerv(GL_VIEWPORT, viewport); Vector2 scrSize((float) viewport[2], (float) viewport[3]); glMatrixMode(GL_PROJECTION); @@ -759,7 +759,7 @@ void GLRenderer::blitQuad(bool flipVertically) { glPopMatrix(); } -void GLRenderer::drawText(const Point2i &_pos, +void GLRenderer::drawText(const Point2i &_pos, const Font *font, const std::string &text) { int viewport[4]; glGetIntegerv(GL_VIEWPORT, viewport); @@ -895,13 +895,13 @@ void GLRenderer::drawFilledRectangle(const Point2i &a, const Point2i &b) { glEnd(); } -void GLRenderer::drawEllipse(const Point ¢er, +void GLRenderer::drawEllipse(const Point ¢er, const Vector &axis1, const Vector &axis2) { const int nSteps = 100; const float stepSize = 2*M_PI/nSteps; glBegin(GL_LINE_LOOP); for (int i=0; i<100; ++i) { - Point p = center + axis1 * std::cos(i*stepSize) + Point p = center + axis1 * std::cos(i*stepSize) + axis2 * std::sin(i*stepSize); glVertex3f(p.x, p.y, p.z); } @@ -928,7 +928,7 @@ Matrix4x4 GLRenderer::getMatrix(EMatrixType type) const { return fetchMatrix(type == EProjection ? GL_PROJECTION_MATRIX : GL_MODELVIEW_MATRIX); } -void GLRenderer::setCamera(const ProjectiveCamera *camera, +void GLRenderer::setCamera(const ProjectiveCamera *camera, const Point2 &apertureSample, const Point2 &aaSample, Float timeSample) { Float time = camera->getShutterOpen() + camera->getShutterOpenTime() * timeSample; @@ -937,7 +937,7 @@ void GLRenderer::setCamera(const ProjectiveCamera *camera, apertureSample, aaSample).getMatrix()); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); - /* Apply a rotation to account for the difference in camera + /* Apply a rotation to account for the difference in camera conventions. In OpenGL, forward is z=-1, in Mitsuba it is z=+1 */ glScalef(-1.0f, 1.0f, -1.0f); multMatrix(camera->getViewTransform(time).getMatrix()); @@ -948,7 +948,7 @@ void GLRenderer::setCamera(const Matrix4x4 &proj, const Matrix4x4 &view) { loadMatrix(proj); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); - /* Apply a rotation to account for the difference in camera + /* Apply a rotation to account for the difference in camera conventions. In OpenGL, forward is z=-1, in Mitsuba it is z=+1 */ glScalef(-1.0f, 1.0f, -1.0f); multMatrix(view); @@ -984,7 +984,7 @@ void GLRenderer::finish() { void GLRenderer::setColor(const Color3 &col, Float alpha) { glColor4f((GLfloat) col[0], (GLfloat) col[1], (GLfloat) col[2], alpha); } - + void GLRenderer::setColor(const Spectrum &spec, Float alpha) { Float r, g, b; spec.toLinearRGB(r, g, b); diff --git a/src/libhw/glsync.cpp b/src/libhw/glsync.cpp index 738642c8..b72a9dc4 100644 --- a/src/libhw/glsync.cpp +++ b/src/libhw/glsync.cpp @@ -46,7 +46,7 @@ void GLSync::cleanup() { } void GLSync::wait() { - GLenum retval = glClientWaitSync(m_sync, + GLenum retval = glClientWaitSync(m_sync, GL_SYNC_FLUSH_COMMANDS_BIT, MTS_SYNC_TIMEOUT); while (true) { diff --git a/src/libhw/gltexture.cpp b/src/libhw/gltexture.cpp index b522c7f2..26d4783e 100644 --- a/src/libhw/gltexture.cpp +++ b/src/libhw/gltexture.cpp @@ -39,14 +39,14 @@ void GLTexture::init() { Log(ETrace, "Uploading a texture : %s", toString().c_str()); else Log(ETrace, "Creating a framebuffer : %s", toString().c_str()); - + if (m_samples > 1) { int maxSamples = 1; if (GLEW_ARB_texture_multisample) glGetIntegerv(GL_MAX_SAMPLES_EXT, &maxSamples); if (m_samples > maxSamples) { Log(EWarn, "Attempted to create a multisample framebuffer " - "with an unsupported number of samples (requested=%i, supported=%i)", + "with an unsupported number of samples (requested=%i, supported=%i)", m_samples, maxSamples); m_samples = maxSamples; } @@ -60,7 +60,7 @@ void GLTexture::init() { /* Bind to the texture */ glBindTexture(m_glType, m_id); - /* Set the texture filtering / wrapping modes + /* Set the texture filtering / wrapping modes (don't do this for multisample textures)*/ if (!((m_fbType & EColorBuffer) && m_samples > 1)) configureTexture(); /* Multisample textures don't have these parameters */ @@ -77,19 +77,19 @@ void GLTexture::init() { bool depthAsTexture = m_fbType & EDepthBuffer; switch (m_fbType) { - case EColorAndDepthBuffer: + case EColorAndDepthBuffer: case EColorBuffer: { if (m_type == ETexture2D) { if (!depthAsTexture) { glGenRenderbuffersEXT(1, &m_depthId); glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_depthId); if (m_samples == 1) - glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, + glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT32, m_size.x, m_size.y); else - glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, + glRenderbufferStorageMultisampleEXT(GL_RENDERBUFFER_EXT, m_samples, GL_DEPTH_COMPONENT32, m_size.x, m_size.y); - glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, + glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_depthId); } else { glGenTextures(1, &m_depthId); @@ -101,32 +101,32 @@ void GLTexture::init() { glTexImage2D(m_glType, 0, GL_DEPTH_COMPONENT32, m_size.x, m_size.y, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, NULL); else - glTexImage2DMultisample(m_glType, + glTexImage2DMultisample(m_glType, m_samples, GL_DEPTH_COMPONENT32, m_size.x, m_size.y, GL_FALSE); - glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, + glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT, m_glType, m_depthId, 0); glBindTexture(m_glType, m_id); } - if (m_samples == 1) + if (m_samples == 1) glTexImage2D(m_glType, 0, m_internalFormat, m_size.x, m_size.y, 0, m_format, m_dataFormat, NULL); else - glTexImage2DMultisample(m_glType, + glTexImage2DMultisample(m_glType, m_samples, m_internalFormat, m_size.x, m_size.y, GL_FALSE); if (isMipMapped()) glGenerateMipmapEXT(m_glType); - glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, + glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, m_glType, m_id, 0); } else if (m_type == ETextureCubeMap) { Assert(m_size.x == m_size.y && isPowerOfTwo(m_size.x)); Assert(m_fbType == EColorBuffer); Assert(m_samples == 1); - for (int i=0; i<6; i++) - glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, m_internalFormat, + for (int i=0; i<6; i++) + glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, m_internalFormat, m_size.x, m_size.y, 0, m_format, m_dataFormat, NULL); if (isMipMapped()) @@ -139,8 +139,8 @@ void GLTexture::init() { glTexParameteri(m_glType, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(m_glType, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - for (int i=0; i<6; i++) - glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, GL_DEPTH_COMPONENT32, + for (int i=0; i<6; i++) + glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, GL_DEPTH_COMPONENT32, m_size.x, m_size.y, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, NULL); if (GLEW_EXT_geometry_shader4) @@ -150,9 +150,9 @@ void GLTexture::init() { } else { glGenRenderbuffersEXT(1, &m_depthId); glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_depthId); - glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, + glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT32, m_size.x, m_size.y); - glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, + glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_depthId); activateSide(0); } @@ -170,17 +170,17 @@ void GLTexture::init() { if (m_type == ETexture2D) { /* Allocate the texture memory */ - glTexImage2D(m_glType, 0, m_internalFormat, - m_size.x, m_size.y, 0, GL_DEPTH_COMPONENT, + glTexImage2D(m_glType, 0, m_internalFormat, + m_size.x, m_size.y, 0, GL_DEPTH_COMPONENT, m_dataFormat, NULL); /* Attach the texture as a depth target */ - glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, + glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, m_glType, m_id, 0); } else if (m_type == ETextureCubeMap) { Assert(m_size.x == m_size.y && isPowerOfTwo(m_size.x)); for (int i=0; i<6; i++) - glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, m_internalFormat, + glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, m_internalFormat, m_size.x, m_size.y, 0, m_format, m_dataFormat, NULL); if (GLEW_EXT_geometry_shader4) @@ -226,15 +226,15 @@ void GLTexture::init() { errorStatus = "Unknown error status"; break; } if (!errorStatus.empty()) - Log(EError, "FBO Error 0x%x: %s!\nFramebuffer configuration: %s", + Log(EError, "FBO Error 0x%x: %s!\nFramebuffer configuration: %s", errorStatusID, errorStatus.c_str(), toString().c_str()); - + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, GL_NONE); } glBindTexture(m_glType, GL_NONE); } - + void GLTexture::refresh(const Point2i &offset, const Vector2i &size) { Assert(m_type == ETexture2D); @@ -242,7 +242,7 @@ void GLTexture::refresh(const Point2i &offset, const Vector2i &size) { Bitmap *bitmap = getBitmap(); - uint8_t *ptr = bitmap->getUInt8Data() + + uint8_t *ptr = bitmap->getUInt8Data() + bitmap->getBytesPerPixel() * (offset.x + offset.y * bitmap->getWidth()); glPixelStorei(GL_UNPACK_ROW_LENGTH, bitmap->getWidth()); @@ -274,7 +274,7 @@ void GLTexture::refresh() { } else if (m_type == ETexture2D) { /* Anisotropic texture filtering */ float anisotropy = (float) getMaxAnisotropy(); - if (isMipMapped() && m_filterType == EMipMapLinear && anisotropy > 1.0f) + if (isMipMapped() && m_filterType == EMipMapLinear && anisotropy > 1.0f) glTexParameterf(m_glType, GL_TEXTURE_MAX_ANISOTROPY_EXT, anisotropy); glTexImage2D(m_glType, 0, m_internalFormat, m_size.x, m_size.y, @@ -314,7 +314,7 @@ void GLTexture::lookupGLConstants() { /* Convert the texture type */ switch (m_type) { case ETexture1D: m_glType = GL_TEXTURE_1D; break; - case ETexture2D: + case ETexture2D: if (m_samples == 1) m_glType = GL_TEXTURE_2D; else @@ -462,8 +462,8 @@ void GLTexture::configureTexture() { } if (border && m_type == ETexture2D) { - const GLfloat color[] = { (GLfloat) m_borderColor[0], - (GLfloat) m_borderColor[1], (GLfloat) m_borderColor[2], + const GLfloat color[] = { (GLfloat) m_borderColor[0], + (GLfloat) m_borderColor[1], (GLfloat) m_borderColor[2], (GLfloat) 1.0f }; glTexParameterfv(m_glType, GL_TEXTURE_BORDER_COLOR, color); } @@ -486,7 +486,7 @@ void GLTexture::download(Bitmap *bitmap) { case Bitmap::EFloat32: dataFormat = GL_FLOAT; break; case Bitmap::EFloat64: dataFormat = GL_DOUBLE; break; default: - Log(EError, "GLTexture::download(): Unknown/unsupported component format %i!", + Log(EError, "GLTexture::download(): Unknown/unsupported component format %i!", (int) bitmap->getComponentFormat()); return; } @@ -502,7 +502,7 @@ void GLTexture::download(Bitmap *bitmap) { case Bitmap::ERGB: format = GL_RGB; break; case Bitmap::ERGBA: format = GL_RGBA; break; default: - Log(EError, "GLTexture::download(): Unknown/unsupported pixel format %i!", + Log(EError, "GLTexture::download(): Unknown/unsupported pixel format %i!", (int) bitmap->getPixelFormat()); return; } @@ -511,9 +511,9 @@ void GLTexture::download(Bitmap *bitmap) { switch (m_type) { case ETexture2D: - glReadPixels(0, 0, bitmap->getWidth(), bitmap->getHeight(), format, + glReadPixels(0, 0, bitmap->getWidth(), bitmap->getHeight(), format, dataFormat, bitmap->getUInt8Data()); - /* OpenGL associates (0, 0) with the lower left position and + /* OpenGL associates (0, 0) with the lower left position and the resulting bitmap must thus be vertically flipped. */ bitmap->flipVertically(); break; @@ -521,7 +521,7 @@ void GLTexture::download(Bitmap *bitmap) { for (int i=0; i<6; ++i) { activateSide(i); bitmap = getBitmap(i); - glReadPixels(0, 0, bitmap->getWidth(), bitmap->getHeight(), format, + glReadPixels(0, 0, bitmap->getWidth(), bitmap->getHeight(), format, dataFormat, bitmap->getUInt8Data()); bitmap->flipVertically(); } @@ -581,7 +581,7 @@ void GLTexture::activateSide(int side) { } } } - + void GLTexture::setTargetRegion(const Point2i &offset, const Vector2i &size) { glViewport(offset.x, offset.y, size.x, size.y); } @@ -659,7 +659,7 @@ void GLTexture::blit(GPUTexture *target, int what) const { "framebuffer blitting!"); glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_fboId); - glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, + glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, (dest == NULL) ? GL_NONE : dest->m_fboId); int flags = 0; @@ -669,19 +669,19 @@ void GLTexture::blit(GPUTexture *target, int what) const { flags |= GL_COLOR_BUFFER_BIT; if (!dest) { - glBlitFramebufferEXT(0, 0, m_size.x, m_size.y, 0, 0, + glBlitFramebufferEXT(0, 0, m_size.x, m_size.y, 0, 0, m_size.x, m_size.y, flags, GL_NEAREST); } else { - glBlitFramebufferEXT(0, 0, m_size.x, m_size.y, 0, 0, - dest->m_size.x, dest->m_size.y, flags, + glBlitFramebufferEXT(0, 0, m_size.x, m_size.y, 0, 0, + dest->m_size.x, dest->m_size.y, flags, (m_size == dest->m_size) ? GL_NEAREST : GL_LINEAR); } - + glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, GL_NONE); glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, GL_NONE); } -void GLTexture::blit(GPUTexture *target, int what, +void GLTexture::blit(GPUTexture *target, int what, const Point2i &sourceOffset, const Vector2i &sourceSize, const Point2i &destOffset, const Vector2i &destSize) const { GLTexture *dest = static_cast(target); @@ -692,7 +692,7 @@ void GLTexture::blit(GPUTexture *target, int what, "framebuffer blitting!"); glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_fboId); - glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, + glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, (dest == NULL) ? GL_NONE : dest->m_fboId); int flags = 0; @@ -701,10 +701,10 @@ void GLTexture::blit(GPUTexture *target, int what, if (what & EColorBuffer) flags |= GL_COLOR_BUFFER_BIT; - glBlitFramebufferEXT(sourceOffset.x, sourceOffset.y, + glBlitFramebufferEXT(sourceOffset.x, sourceOffset.y, sourceOffset.x + sourceSize.x, sourceOffset.x + sourceSize.y, - destOffset.x, destOffset.y, destOffset.x + destSize.x, - destOffset.y + destSize.y, flags, + destOffset.x, destOffset.y, destOffset.x + destSize.x, + destOffset.y + destSize.y, flags, (sourceSize == destSize) ? GL_NEAREST : GL_LINEAR); glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, GL_NONE); @@ -713,10 +713,10 @@ void GLTexture::blit(GPUTexture *target, int what, void GLTexture::clear() { Assert(m_fbType != ENone); - glClear(GL_DEPTH_BUFFER_BIT + glClear(GL_DEPTH_BUFFER_BIT | ((m_fbType & EColorBuffer) ? GL_COLOR_BUFFER_BIT : 0)); } - + GLTexture::~GLTexture() { cleanup(); } diff --git a/src/libhw/glxdevice.cpp b/src/libhw/glxdevice.cpp index 664db3fa..2819a2d0 100644 --- a/src/libhw/glxdevice.cpp +++ b/src/libhw/glxdevice.cpp @@ -42,7 +42,7 @@ void GLXDevice::flip() { X11Session *session = static_cast(getSession()); glFinish(); - if (m_doubleBuffer) + if (m_doubleBuffer) glXSwapBuffers(session->m_display, m_window); } diff --git a/src/libhw/glxrenderer.cpp b/src/libhw/glxrenderer.cpp index b664a840..6a559d31 100644 --- a/src/libhw/glxrenderer.cpp +++ b/src/libhw/glxrenderer.cpp @@ -71,7 +71,7 @@ void GLXRenderer::shutdown() { if (!m_borrowed) { Log(EDebug, "Shutting down GLX Renderer"); - X11Session *session = static_cast(m_session.get()); + X11Session *session = static_cast(m_session.get()); glXDestroyContext(session->m_display, m_context); } diff --git a/src/libhw/gpuprogram.cpp b/src/libhw/gpuprogram.cpp index 743e553e..c357af4d 100644 --- a/src/libhw/gpuprogram.cpp +++ b/src/libhw/gpuprogram.cpp @@ -23,16 +23,16 @@ MTS_NAMESPACE_BEGIN GPUProgram::GPUProgram(const std::string &name) : m_name(name), m_inputGeometryType(ETriangles), - m_outputGeometryType(ETriangleStrips), + m_outputGeometryType(ETriangleStrips), m_maxVertices(0), m_bound(false) { } GPUProgram::~GPUProgram() { } - + void GPUProgram::setSourceFile(EType type, const fs::path &path) { fs::ifstream ifs(path); - if (ifs.fail() || ifs.bad()) + if (ifs.fail() || ifs.bad()) Log(EError, "Unable to load GPU program \"%s\"", path.string().c_str()); std::string code, line; diff --git a/src/libhw/gputexture.cpp b/src/libhw/gputexture.cpp index 1c6a97df..17bd5dfc 100644 --- a/src/libhw/gputexture.cpp +++ b/src/libhw/gputexture.cpp @@ -119,7 +119,7 @@ void GPUTexture::setFrameBufferType(EFrameBufferType type) { case EColorBuffer: case EColorAndDepthBuffer: break; - case EDepthBuffer: + case EDepthBuffer: m_pixelFormat = EDepth; m_mipmapped = false; m_wrapTypeU = m_wrapTypeV = EClamp; @@ -177,7 +177,7 @@ namespace detail { } static const char *toString(GPUTexture::EFilterType filter) { - switch (filter) { + switch (filter) { case GPUTexture::ENearest: return "nearest"; case GPUTexture::ELinear: return "linear"; case GPUTexture::EMipMapNearest: return "mipMapNearest"; @@ -187,7 +187,7 @@ namespace detail { } static const char *toString(GPUTexture::EWrapType wrap) { - switch (wrap) { + switch (wrap) { case GPUTexture::EClamp: return "clamp"; case GPUTexture::EClampToEdge: return "clampToEdge"; case GPUTexture::EClampToBorder: return "clampToBorder"; @@ -198,7 +198,7 @@ namespace detail { } static const char *toString(GPUTexture::EFrameBufferType fbType) { - switch (fbType) { + switch (fbType) { case GPUTexture::ENone: return "none"; case GPUTexture::EDepthBuffer: return "depthBuffer"; case GPUTexture::EColorBuffer: return "colorBuffer"; @@ -208,7 +208,7 @@ namespace detail { } static const char *toString(GPUTexture::EDepthMode depthMode) { - switch (depthMode) { + switch (depthMode) { case GPUTexture::ENormal: return "normal"; case GPUTexture::ECompare: return "compare"; default: SLog(EError, "Invalid depth read mode"); return NULL; @@ -226,7 +226,7 @@ std::string GPUTexture::toString() const { << " fbType = " << detail::toString(m_fbType) << "," << endl << " size = " << m_size.toString() << "," << endl << " filterType = " << detail::toString(m_filterType) << "," << endl - << " wrapType = [" << detail::toString(m_wrapTypeU) + << " wrapType = [" << detail::toString(m_wrapTypeU) << ", " << detail::toString(m_wrapTypeV) << "]," << endl; if (m_samples > 1) diff --git a/src/libhw/nsgldevice.mm b/src/libhw/nsgldevice.mm index 0f8cf445..67fa9d8a 100644 --- a/src/libhw/nsgldevice.mm +++ b/src/libhw/nsgldevice.mm @@ -259,10 +259,10 @@ using namespace mitsuba; } } - if (cursorInWindow) + if (cursorInWindow) m_mouseInWindow = true; - if (absolute.x > m_device->getSize().x || absolute.x < 0 + if (absolute.x > m_device->getSize().x || absolute.x < 0 || absolute.y > m_device->getSize().y || absolute.y< 0) return; } @@ -289,7 +289,7 @@ using namespace mitsuba; deviceEvent.setKeyboardSpecial(m_keymap[scanCode]); deviceEvent.setKeyboardModifiers([self extractModifiers: [event modifierFlags]]); } else { - if (count > 0) + if (count > 0) deviceEvent.setKeyboardKey([[event charactersIgnoringModifiers] UTF8String][0]); else deviceEvent.setKeyboardKey('\0'); @@ -299,7 +299,7 @@ using namespace mitsuba; } } } - + if (deviceEvent.getType() != Device::ENoEvent) m_device->pushEvent(deviceEvent); } @@ -415,7 +415,7 @@ void NSGLDevice::init(Device *other) { if (m_window == nil) Log(EError, "Could not create window"); - if (m_center) + if (m_center) [m_window center]; /* Create a sub-view as drawing destination and in order to catch events */ @@ -501,7 +501,7 @@ void NSGLDevice::setPosition(const Point2i &position) { NSPoint point = NSMakePoint(position.x, CGDisplayPixelsHigh(kCGDirectMainDisplay) - position.y); - + [m_window setFrameTopLeftPoint: point]; Device::setPosition(position); } @@ -584,7 +584,7 @@ void NSGLDevice::processEvents() { Assert(m_initialized); m_mutex->lock(); - for (std::vector::iterator it = m_deviceEvents.begin(); it!=m_deviceEvents.end(); ++it) + for (std::vector::iterator it = m_deviceEvents.begin(); it!=m_deviceEvents.end(); ++it) fireDeviceEvent(*it); m_deviceEvents.clear(); m_mutex->unlock(); diff --git a/src/libhw/nsglrenderer.mm b/src/libhw/nsglrenderer.mm index f92303b2..a3341cab 100644 --- a/src/libhw/nsglrenderer.mm +++ b/src/libhw/nsglrenderer.mm @@ -55,7 +55,7 @@ void NSGLRenderer::init(Device *device, Renderer *other) { /* Create a GL context */ m_context = [[NSOpenGLContext alloc] - initWithFormat: format + initWithFormat: format shareContext: otherContext]; // long vsync = 1; diff --git a/src/libhw/nsglsession.mm b/src/libhw/nsglsession.mm index 4660df1f..b9b0d557 100644 --- a/src/libhw/nsglsession.mm +++ b/src/libhw/nsglsession.mm @@ -50,7 +50,7 @@ void NSGLSession::processEvents() { /* NSRunloop emulation */ do { - event = [NSApp nextEventMatchingMask: NSAnyEventMask + event = [NSApp nextEventMatchingMask: NSAnyEventMask untilDate: nil inMode: NSDefaultRunLoopMode dequeue: YES]; if (event == nil) break; @@ -71,7 +71,7 @@ void NSGLSession::processEventsBlocking(bool &stop) { /* NSRunloop emulation */ while (true) { - event = [NSApp nextEventMatchingMask: NSAnyEventMask + event = [NSApp nextEventMatchingMask: NSAnyEventMask untilDate: nil inMode: NSDefaultRunLoopMode dequeue: YES]; if (event != nil) { @@ -85,7 +85,7 @@ void NSGLSession::processEventsBlocking(bool &stop) { break; /* Wait for the next event (blocking) */ - event = [NSApp nextEventMatchingMask: NSAnyEventMask + event = [NSApp nextEventMatchingMask: NSAnyEventMask untilDate: [NSDate distantFuture] inMode: NSDefaultRunLoopMode dequeue: YES]; if (event != nil) diff --git a/src/libhw/renderer.cpp b/src/libhw/renderer.cpp index 0fafb62d..515f26f1 100644 --- a/src/libhw/renderer.cpp +++ b/src/libhw/renderer.cpp @@ -69,7 +69,7 @@ Shader *Renderer::registerShaderForResource(const HWResource *resource) { ShaderRecord sRec; sRec.shader = resource->createShader(this); if (sRec.shader == NULL) { - Log(EWarn, "Resource does not have a hardware shader implementation: %s", + Log(EWarn, "Resource does not have a hardware shader implementation: %s", dynamic_cast(resource)->toString().c_str()); return NULL; } diff --git a/src/libhw/shadow.cpp b/src/libhw/shadow.cpp index d99cb828..0ea3df7c 100644 --- a/src/libhw/shadow.cpp +++ b/src/libhw/shadow.cpp @@ -37,7 +37,7 @@ ShadowMapGenerator::ShadowMapGenerator(Renderer *renderer) { if (renderer->getCapabilities()->isSupported(RendererCapabilities::EGeometryShaders)) { /* Paraboloid shadow map generator based on "Fast Non-Linear Projections - using Graphics Hardware" by Jean-Dominique Gascuel, Nicolas Holzschuch, + using Graphics Hardware" by Jean-Dominique Gascuel, Nicolas Holzschuch, Gabrier Fournier, and Bernhard Peroche (I3D, 2008) */ prog = renderer->createGPUProgram("Paraboloid shadow map generator"); prog->setSource(GPUProgram::EVertexProgram, sh_paraboloid_vert); @@ -55,7 +55,7 @@ ShadowMapGenerator::ShadowMapGenerator(Renderer *renderer) { prog->setSource(GPUProgram::EFragmentProgram, sh_cube_1pass_frag); prog->setInputGeometryType(GPUProgram::ETriangles); prog->setOutputGeometryType(GPUProgram::ETriangleStrips); - prog->setMaxVertices(6*3); /* One triangle per cube map face */ + prog->setMaxVertices(6*3); /* One triangle per cube map face */ m_program[ECubeSinglePass] = prog; /* Hemicube shadow map generator (single pass via a geometry shader) */ @@ -65,7 +65,7 @@ ShadowMapGenerator::ShadowMapGenerator(Renderer *renderer) { prog->setSource(GPUProgram::EFragmentProgram, sh_hemicube_1pass_frag); prog->setInputGeometryType(GPUProgram::ETriangles); prog->setOutputGeometryType(GPUProgram::ETriangleStrips); - prog->setMaxVertices(5*3); /* One triangle per hemicube map face */ + prog->setMaxVertices(5*3); /* One triangle per hemicube map face */ m_program[EHemicubeSinglePass] = prog; } @@ -74,7 +74,7 @@ ShadowMapGenerator::ShadowMapGenerator(Renderer *renderer) { /* By default, assume that cube depth maps are supported by the driver */ m_cubeDepthMapsSupported = true; } - + size_t ShadowMapGenerator::getShaderCount() const { size_t result = 0; for (int i=0; i &geo) { GPUProgram *prog = m_program[type]; @@ -245,7 +245,7 @@ void ShadowMapGenerator::render(Renderer *renderer, GPUTexture *shadowMap, /* Need a left-handed view matrix to render the faces (see the ARB_texture_cube_map spec) */ viewTrafo = Transform::scale(Vector(1, -1, 1)) * viewTrafo.inverse() * trafo; prog->setParameter(m_cubeTransform, projTrafo * viewTrafo); - prog->setParameter(m_cubeProjDir, + prog->setParameter(m_cubeProjDir, (-viewTrafo.getMatrix().row(2) - Vector4(0, 0, 0, minDepth)) * invDepthRange); shadowMap->activateSide(i); if (type == ECube || i != 4) { @@ -284,7 +284,7 @@ void ShadowMapGenerator::render(Renderer *renderer, GPUTexture *shadowMap, /* Need a left-handed view matrix to render the faces (see the ARB_texture_cube_map spec) */ viewTrafo = Transform::scale(Vector(1, -1, 1)) * viewTrafo.inverse() * trafo; prog->setParameter(m_cubeSinglePassTransform[i], projTrafo * viewTrafo); - prog->setParameter(m_cubeSinglePassProjDir[i], + prog->setParameter(m_cubeSinglePassProjDir[i], (-viewTrafo.getMatrix().row(2) - Vector4(0, 0, 0, minDepth)) * invDepthRange); } @@ -326,7 +326,7 @@ void ShadowMapGenerator::render(Renderer *renderer, GPUTexture *shadowMap, /* Need a left-handed view matrix to render the faces (see the ARB_texture_cube_map spec) */ viewTrafo = Transform::scale(Vector(1, -1, 1)) * viewTrafo.inverse() * trafo; prog->setParameter(m_hemicubeSinglePassTransform[i], projTrafo * viewTrafo); - prog->setParameter(m_hemicubeSinglePassProjDir[i], + prog->setParameter(m_hemicubeSinglePassProjDir[i], (-viewTrafo.getMatrix().row(2) - Vector4(0, 0, 0, minDepth)) * invDepthRange); } @@ -356,7 +356,7 @@ Transform ShadowMapGenerator::directionalFindGoodFrame(const AABB &aabb, const V for (int i=0; i<8; ++i) samples[i] -= center; - /* Heuristic: do a 3x3 principal components analysis to try + /* Heuristic: do a 3x3 principal components analysis to try to align the projection with the coordinate axis. This is to make best use of the shadow map resolution */ Matrix2x2 M; diff --git a/src/libhw/viewer.cpp b/src/libhw/viewer.cpp index 1aba55ed..29d72c40 100644 --- a/src/libhw/viewer.cpp +++ b/src/libhw/viewer.cpp @@ -44,7 +44,7 @@ int Viewer::run(int argc, char **argv) { while (true) { m_session->processEventsBlocking(m_leaveEventLoop); m_leaveEventLoop = false; - if (m_quit) + if (m_quit) break; m_renderer->clear(); draw(); @@ -83,7 +83,7 @@ void Viewer::windowResized(const DeviceEvent &event) { } bool Viewer::deviceEventOccurred(const DeviceEvent &event) { switch (event.getType()) { case Device::EKeyDownEvent: - if (event.getKeyboardKey() == 'q' + if (event.getKeyboardKey() == 'q' || event.getKeyboardSpecial() == Device::EKeyEscape) { m_quit = true; m_leaveEventLoop = true; diff --git a/src/libhw/vpl.cpp b/src/libhw/vpl.cpp index a114b0c7..79cd24e4 100644 --- a/src/libhw/vpl.cpp +++ b/src/libhw/vpl.cpp @@ -38,7 +38,7 @@ * \brief Render cube/hemicube shadow maps in a single pass? * (using multiple render targets and geometry shaders) * - * Some benchmarking on different ATI/NVidia hardware shows that + * Some benchmarking on different ATI/NVidia hardware shows that * this is *always* slower! So it is disabled for now. */ //#define MTS_VPL_USE_SINGLE_PASS @@ -50,7 +50,7 @@ MTS_NAMESPACE_BEGIN static StatsCounter statsMaxResidentShaders("VPL renderer", "Max. # of resident shaders", EMaximumValue); static StatsCounter statsMaxTriangles("VPL renderer", "Max. # of drawn triangles", EMaximumValue); -VPLShaderManager::VPLShaderManager(Renderer *renderer) +VPLShaderManager::VPLShaderManager(Renderer *renderer) : m_renderer(renderer) { m_shadowMapResolution = 0; m_clamping = 0.1f; @@ -100,7 +100,7 @@ void VPLShaderManager::setScene(const Scene *scene) { if (shape->getClass()->getName() == "Instance") { const Instance *instance = static_cast(shape); - const std::vector &instantiatedShapes = + const std::vector &instantiatedShapes = instance->getShapeGroup()->getKDTree()->getShapes(); for (size_t j=0; jgetClass()->getName() == "Instance") { const Instance *instance = static_cast(shape); - const std::vector &instantiatedShapes = + const std::vector &instantiatedShapes = instance->getShapeGroup()->getKDTree()->getShapes(); const Matrix4x4 &trafo = instance->getWorldTransform().getMatrix(); @@ -175,7 +175,7 @@ void VPLShaderManager::setScene(const Scene *scene) { gpuGeo->setShader(shader); m_geometry.push_back(std::make_pair(gpuGeo, trafo)); - if (shader && !(shader->getFlags() & Shader::ETransparent)) + if (shader && !(shader->getFlags() & Shader::ETransparent)) m_opaqueGeometry.push_back(std::make_pair(gpuGeo, trafo)); } } else { @@ -192,7 +192,7 @@ void VPLShaderManager::setScene(const Scene *scene) { gpuGeo->setShader(shader); m_geometry.push_back(std::make_pair(gpuGeo, identityTrafo)); - if (shader && !(shader->getFlags() & Shader::ETransparent)) + if (shader && !(shader->getFlags() & Shader::ETransparent)) m_opaqueGeometry.push_back(std::make_pair(gpuGeo, identityTrafo)); } } @@ -218,7 +218,7 @@ void VPLShaderManager::setScene(const Scene *scene) { prog->setSource(GPUProgram::EVertexProgram, sh_background_vert); prog->setSource(GPUProgram::EFragmentProgram, code.c_str()); prog->define("BACKGROUND_EVAL_NAME", evalName + "_background"); - + if (scene->getSensor()->getType() & Sensor::EOrthographicCamera) prog->define("DIRECTIONAL_CAMERA"); @@ -250,7 +250,7 @@ void VPLShaderManager::setVPL(const VPL &vpl) { Point2 sample = sample02(i); Ray ray; - if (vpl.type == ESurfaceVPL || (vpl.type == EPointEmitterVPL && + if (vpl.type == ESurfaceVPL || (vpl.type == EPointEmitterVPL && vpl.emitter->getType() & Emitter::EOnSurface)) { ray = Ray(vpl.its.p, vpl.its.shFrame.toWorld( Warp::squareToCosineHemisphere(sample)), 0); @@ -312,7 +312,7 @@ void VPLShaderManager::setVPL(const VPL &vpl) { m_farClip *= 1.5f; } - m_shadowMapTransform = + m_shadowMapTransform = (Transform::translate(Vector(vpl.its.p)) * Transform::fromFrame(vpl.its.shFrame)).inverse(); } else { @@ -321,15 +321,15 @@ void VPLShaderManager::setVPL(const VPL &vpl) { m_scene->getKDTree()->getAABB(), vpl.its.shFrame.n); } - bool is2D = - m_shadowMapType == ShadowMapGenerator::EParaboloid || + bool is2D = + m_shadowMapType == ShadowMapGenerator::EParaboloid || m_shadowMapType == ShadowMapGenerator::EDirectional; if (is2D) { if (!m_shadowMap2D || m_shadowMap2D->getSize().x != m_shadowMapResolution) { if (m_shadowMap2D) m_shadowMap2D->cleanup(); - m_shadowMap2D = m_shadowGen->allocate(m_renderer, + m_shadowMap2D = m_shadowGen->allocate(m_renderer, m_shadowMapType, m_shadowMapResolution); } m_shadowMap = m_shadowMap2D; @@ -337,7 +337,7 @@ void VPLShaderManager::setVPL(const VPL &vpl) { if (!m_shadowMapCube || m_shadowMapCube->getSize().x != m_shadowMapResolution) { if (m_shadowMapCube) m_shadowMapCube->cleanup(); - m_shadowMapCube = m_shadowGen->allocate(m_renderer, + m_shadowMapCube = m_shadowGen->allocate(m_renderer, m_shadowMapType, m_shadowMapResolution); } m_shadowMap = m_shadowMapCube; @@ -345,7 +345,7 @@ void VPLShaderManager::setVPL(const VPL &vpl) { Float sample = sampleTEAFloat(m_vplIndex++, 0x12345); m_shadowGen->render(m_renderer, m_shadowMap, m_shadowMapType, - m_shadowMapTransform, m_nearClip, m_farClip, + m_shadowMapTransform, m_nearClip, m_farClip, sample > 0.3 ? m_opaqueGeometry : m_geometry); /* Convert between the Mitsuba and OpenGL matrix conventions */ @@ -353,13 +353,13 @@ void VPLShaderManager::setVPL(const VPL &vpl) { Vector(-1.0f, 1.0f, -1.0f)) * m_shadowMapTransform; } -void VPLShaderManager::bind(const VPL &vpl, const BSDF *bsdf, const Sensor *sensor, +void VPLShaderManager::bind(const VPL &vpl, const BSDF *bsdf, const Sensor *sensor, const Emitter *emitter, const Matrix4x4 &instanceTransform, bool faceNormals) { Shader *bsdfShader = m_renderer->getShaderForResource(bsdf); Shader *vplShader = (vpl.type == EPointEmitterVPL || vpl.type == EDirectionalEmitterVPL) ? m_renderer->getShaderForResource(vpl.emitter) : m_renderer->getShaderForResource(vpl.its.getBSDF()); - Shader *emitterShader = (emitter == NULL) ? NULL + Shader *emitterShader = (emitter == NULL) ? NULL : m_renderer->getShaderForResource(emitter); /* Find situations in which we won't be able to render the @@ -391,17 +391,17 @@ void VPLShaderManager::bind(const VPL &vpl, const BSDF *bsdf, const Sensor *sens prog->init(); prog->incRef(); m_currentProgram.program = prog; - + m_currentProgram.param_instanceTransform = prog->getParameterID("instanceTransform", false); m_configurations["unsupported"] = m_currentProgram; } GPUProgram *prog = m_currentProgram.program; prog->bind(); - prog->setParameter(m_currentProgram.param_instanceTransform, instanceTransform); + prog->setParameter(m_currentProgram.param_instanceTransform, instanceTransform); return; } - m_targetConfiguration = VPLConfiguration(vplShader, + m_targetConfiguration = VPLConfiguration(vplShader, bsdfShader, emitterShader, faceNormals); m_alpha = bsdfShader->getAlpha(); @@ -443,7 +443,7 @@ void VPLShaderManager::bind(const VPL &vpl, const BSDF *bsdf, const Sensor *sens prog->setOutputGeometryType(GPUProgram::ETriangleStrips); prog->setMaxVertices(3); } - + std::string code(sh_render_frag); std::string marker(SUPPLEMENTAL_CODE_MARKER); size_t insertionPos = code.find(marker); @@ -480,8 +480,8 @@ void VPLShaderManager::bind(const VPL &vpl, const BSDF *bsdf, const Sensor *sens else prog->define("VPL_EVAL_NAME", vplEvalName); } - - if (vpl.type == ESurfaceVPL || (vpl.type == EPointEmitterVPL && + + if (vpl.type == ESurfaceVPL || (vpl.type == EPointEmitterVPL && vpl.emitter->getType() & Emitter::EOnSurface)) prog->define("VPL_ON_SURFACE"); @@ -515,15 +515,15 @@ void VPLShaderManager::bind(const VPL &vpl, const BSDF *bsdf, const Sensor *sens m_currentProgram.param_shadowMap = prog->getParameterID("shadowMap", false); m_currentProgram.resolve(prog); m_configurations[fingerprint] = m_currentProgram; - + statsMaxResidentShaders.recordMaximum(m_configurations.size() + m_shadowGen->getShaderCount()); } - + GPUProgram *prog = m_currentProgram.program; prog->bind(); Float minDist = m_nearClip + (m_farClip - m_nearClip) * m_clamping; - prog->setParameter(m_currentProgram.param_instanceTransform, instanceTransform); + prog->setParameter(m_currentProgram.param_instanceTransform, instanceTransform); prog->setParameter(m_currentProgram.param_vplTransform, m_shadowMapTransform); prog->setParameter(m_currentProgram.param_depthRange, Vector2(m_nearClip, m_farClip)); prog->setParameter(m_currentProgram.param_vplPower, vpl.P); @@ -570,11 +570,11 @@ void VPLShaderManager::drawAllGeometryForVPL(const VPL &vpl, const Sensor *senso Matrix4x4 currentObjTrafo; currentObjTrafo.setIdentity(); m_shadowMap->bind(0); - + m_renderer->beginDrawingMeshes(); size_t nTriangles = 0; - for (std::vector::const_iterator it = m_geometry.begin(); + for (std::vector::const_iterator it = m_geometry.begin(); it != m_geometry.end(); ++it) { const GPUGeometry *geo = (*it).first; const Matrix4x4 &trafo = (*it).second; @@ -598,7 +598,7 @@ void VPLShaderManager::drawAllGeometryForVPL(const VPL &vpl, const Sensor *senso } else if (trafo != currentObjTrafo) { if (m_currentProgram.program) m_currentProgram.program->setParameter( - m_currentProgram.param_instanceTransform, trafo); + m_currentProgram.param_instanceTransform, trafo); currentObjTrafo = trafo; } @@ -616,18 +616,18 @@ void VPLShaderManager::drawAllGeometryForVPL(const VPL &vpl, const Sensor *senso m_renderer->checkError(); } -void VPLShaderManager::drawBackground(const Sensor *sensor, +void VPLShaderManager::drawBackground(const Sensor *sensor, const Transform &projectionTransform, Float scaleFactor) { if (m_backgroundProgram == NULL) return; const Transform &trafo = sensor->getWorldTransform()->eval(0); - Transform clipToWorld = trafo + Transform clipToWorld = trafo * Transform::scale(Vector(-1, 1, -1)) * projectionTransform.inverse(); GPUProgram *prog = m_backgroundProgram; - int tuOffset = 0; + int tuOffset = 0; prog->bind(); m_backgroundDependencies.bind(prog, m_backgroundDependencies, tuOffset); diff --git a/src/libhw/wgldevice.cpp b/src/libhw/wgldevice.cpp index 9e0496c3..d3cac1e6 100644 --- a/src/libhw/wgldevice.cpp +++ b/src/libhw/wgldevice.cpp @@ -50,7 +50,7 @@ #define WGL_DOUBLE_BUFFER_ARB 0x2011 #define WGL_FULL_ACCELERATION_ARB 0x2027 -typedef BOOL (APIENTRY * wglChoosePixelFormatARBProc) (HDC hdc, const int *piAttribIList, +typedef BOOL (APIENTRY * wglChoosePixelFormatARBProc) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); #endif @@ -67,7 +67,7 @@ LONG WINAPI WGLDevice::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara /* See comment above */ WGLDevice *device = reinterpret_cast(GetWindowLong(hWnd, 0)); - if (device == NULL) + if (device == NULL) device = __global_workaround; PAINTSTRUCT ps; @@ -87,7 +87,7 @@ LONG WINAPI WGLDevice::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara break; case WM_PAINT: BeginPaint(hWnd, &ps); - if (device->getDoubleBuffer()) + if (device->getDoubleBuffer()) SwapBuffers(device->m_hdc); EndPaint(hWnd, &ps); break; @@ -288,11 +288,11 @@ void WGLDevice::init(Device *other) { for (int i=0; i<2; i++) { /* Do this twice, the first pass creates a dummy device & rendering context in order to get hold of a proper pixel format - (windows is soo bugged!), the second pass creates the actual + (windows is soo bugged!), the second pass creates the actual window with the matching pixel format */ int extra = 0; - if (m_resizeAllowed) + if (m_resizeAllowed) extra = WS_SIZEBOX | WS_MAXIMIZEBOX; m_hwnd = CreateWindow( @@ -455,7 +455,7 @@ bool WGLDevice::translateMouse(UINT uMsg, WPARAM wParam, DeviceEvent &event) { event.setType(EMouseMotionEvent); event.setMouseButton(ENoButton); if (m_grab) - warpMouse(Point2i(getSize().x / 2, + warpMouse(Point2i(getSize().x / 2, getSize().y/2)); break; case WM_LBUTTONDOWN: @@ -516,7 +516,7 @@ void WGLDevice::initPixelFormat(HWND hWnd) { } if (m_pf != -1) { - if (!SetPixelFormat(m_hdc, m_pf, &m_pfd)) + if (!SetPixelFormat(m_hdc, m_pf, &m_pfd)) Log(EError, "Could not set the pixel format"); return; } @@ -541,7 +541,7 @@ void WGLDevice::initPixelFormat(HWND hWnd) { if (!m_pf) Log(EError, "Could not find a matching pixel format"); - if (!SetPixelFormat(m_hdc, m_pf, &m_pfd)) + if (!SetPixelFormat(m_hdc, m_pf, &m_pfd)) Log(EError, "Could not set the pixel format"); HGLRC context = wglCreateContext(m_hdc); @@ -585,7 +585,7 @@ void WGLDevice::initPixelFormat(HWND hWnd) { float fAttributes[] = {0,0}; bool valid = wglChoosePixelFormatARB(m_hdc,attribs,fAttributes,1,&m_pf,&numFormats); - if (!(valid && numFormats >= 1)) + if (!(valid && numFormats >= 1)) Log(EError, "Could not find a matching pixel format!"); /* Self destruction .. */ @@ -616,7 +616,7 @@ void WGLDevice::flip() { void WGLDevice::setPosition(const Point2i &position) { Assert(m_initialized); - SetWindowPos(m_hwnd, HWND_TOP, + SetWindowPos(m_hwnd, HWND_TOP, getPosition().x, getPosition().y, 0, 0, SWP_NOSIZE | SWP_NOZORDER); } @@ -645,7 +645,7 @@ void WGLDevice::warpMouse(const Point2i &position) { m_mouse = position; ClientToScreen(m_hwnd, &pt); SetCursorPos(pt.x, pt.y); - // Not so nice but does the job + // Not so nice but does the job PeekMessage(&msg, m_hwnd, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE); } diff --git a/src/libhw/wglrenderer.cpp b/src/libhw/wglrenderer.cpp index 3d00be55..8ea7aeee 100644 --- a/src/libhw/wglrenderer.cpp +++ b/src/libhw/wglrenderer.cpp @@ -45,9 +45,9 @@ void WGLRenderer::init(Device *device, Renderer *other) { if (other != NULL) { Assert(other->getClass() == m_theClass); - if (wglShareLists(m_context, - static_cast(other)->m_context) != TRUE) - Log(EError, "Unable to set up context sharing: %s", + if (wglShareLists(m_context, + static_cast(other)->m_context) != TRUE) + Log(EError, "Unable to set up context sharing: %s", lastErrorText().c_str()); } diff --git a/src/libhw/wglsession.cpp b/src/libhw/wglsession.cpp index 2c9d12dd..218f35f8 100644 --- a/src/libhw/wglsession.cpp +++ b/src/libhw/wglsession.cpp @@ -46,7 +46,7 @@ void WGLSession::init() { wndclass.hCursor = LoadCursor(NULL, IDC_ARROW); wndclass.hbrBackground = (HBRUSH) GetStockObject(NULL_BRUSH); wndclass.lpszMenuName = NULL; - + for (int i=0; i<100; ++i) { m_wndClassName = formatString("Mitsuba_WGL_%i", i); wndclass.lpszClassName = m_wndClassName.c_str(); @@ -58,7 +58,7 @@ void WGLSession::init() { } } - if (!m_initialized) + if (!m_initialized) Log(EError, "Unable to register window class!"); } @@ -77,7 +77,7 @@ void WGLSession::processEvents() { MSG msg; while (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) { - if (GetMessage(&msg, NULL, 0, 0) > 0) + if (GetMessage(&msg, NULL, 0, 0) > 0) DispatchMessage(&msg); } } @@ -88,7 +88,7 @@ void WGLSession::processEventsBlocking(bool &stop) { while (true) { if (!PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) && stop) break; - if (GetMessage(&msg, NULL, 0, 0) > 0) + if (GetMessage(&msg, NULL, 0, 0) > 0) DispatchMessage(&msg); } } diff --git a/src/libhw/x11device.cpp b/src/libhw/x11device.cpp index 2b75ec05..70ab24ca 100644 --- a/src/libhw/x11device.cpp +++ b/src/libhw/x11device.cpp @@ -119,7 +119,7 @@ namespace algo { inline int getVSync(XF86VidModeModeInfo *mode) { return ((int) (0.5f + (1000.0f * mode->dotclock) / (mode->htotal * mode->vtotal))); } - + bool operator() (XF86VidModeModeInfo *mode1, XF86VidModeModeInfo *mode2) { return getVSync(mode1) > getVSync(mode2); } @@ -204,7 +204,7 @@ void X11Device::init(Device *other) { m_size.x, m_size.y, 0, m_visinfo->depth, /* border width, color depth */ InputOutput, m_visinfo->visual, - CWBackPixel | CWBorderPixel | CWColormap | + CWBackPixel | CWBorderPixel | CWColormap | CWOverrideRedirect, &x11attr); XWarpPointer(session->m_display, None, m_window, 0, 0, 0, 0, 0, 0); @@ -238,12 +238,12 @@ void X11Device::init(Device *other) { XSizeHints *hints = XAllocSizeHints(); hints->width = m_size.x; hints->height = m_size.y; - + if (m_resizeAllowed) { hints->min_width = hints->min_height = 10; hints->max_width = hints->max_height = INT_MAX; } else { - hints->min_width = hints->max_width = m_size.x; + hints->min_width = hints->max_width = m_size.x; hints->min_height = hints->max_height = m_size.y; } diff --git a/src/libhw/x11session.cpp b/src/libhw/x11session.cpp index 51423e5e..fe1a0883 100644 --- a/src/libhw/x11session.cpp +++ b/src/libhw/x11session.cpp @@ -31,7 +31,7 @@ X11Session::~X11Session() { } static int X11SessionErrorHandler(Display *pDisplay, XErrorEvent *pEvent) { - SLog(EWarn, "Xlib error: Error code %d, request code %d", + SLog(EWarn, "Xlib error: Error code %d, request code %d", pEvent->error_code, pEvent->request_code); return 0; } @@ -65,7 +65,7 @@ void X11Session::init() { if(!XQueryExtension(m_display, "GLX", &temp, &temp, &temp)) { Log(EError, "OpenGL is not supported"); - } else { + } else { if (glXQueryVersion(m_display, &major, &minor)) { if (major == 1 && minor < 1) { Log(EWarn, "GLX Version is too old (1.1 or higher is required)"); @@ -96,7 +96,7 @@ void X11Session::processEvents() { while (XPending(m_display)) { XNextEvent(m_display, &event); Window window = event.xany.window; - + std::vector::iterator it = m_devices.begin(); for (; it!=m_devices.end(); ++it) { @@ -116,7 +116,7 @@ void X11Session::processEventsBlocking(bool &stop) { break; XNextEvent(m_display, &event); Window window = event.xany.window; - + std::vector::iterator it = m_devices.begin(); for (; it!=m_devices.end(); ++it) { diff --git a/src/libpython/base.h b/src/libpython/base.h index 5702bd10..c58efadf 100644 --- a/src/libpython/base.h +++ b/src/libpython/base.h @@ -86,7 +86,7 @@ .def("__len__", &FixedSizeSupport::len) \ .def("__getitem__", &FixedSizeSupport::get) \ .def("__setitem__", &FixedSizeSupport::set) - + #define BP_SETSCOPE(value) do { \ bp::detail::current_scope = value.ptr(); \ } while (0); @@ -137,7 +137,7 @@ public: static void set(T &value, int i, Scalar arg) { using namespace mitsuba; - if (i < 0 || i >= Size) + if (i < 0 || i >= Size) SLog(EError, "Index %i is out of range!", i); else value[i] = arg; diff --git a/src/libpython/core.cpp b/src/libpython/core.cpp index 418869c9..ac625321 100644 --- a/src/libpython/core.cpp +++ b/src/libpython/core.cpp @@ -59,9 +59,9 @@ public: } return spec[i]; } - + static void set(Spectrum &spec, int i, Float value) { - if (i < 0 || i >= SPECTRUM_SAMPLES) + if (i < 0 || i >= SPECTRUM_SAMPLES) SLog(EError, "Index %i is out of range!", i); else spec[i] = value; @@ -190,16 +190,16 @@ void logger_logProgress(Logger *logger, Float progress, const std::string &name, const std::string &formatted, const std::string &eta) { logger->logProgress(progress, name, formatted, eta, NULL); } - + void mts_log(ELogLevel level, const std::string &msg) { bp::object traceback(bp::import("traceback")); bp::object extract_stack(traceback.attr("extract_stack")); bp::object stack = extract_stack(); bp::object top(stack[bp::len(stack)-1]); std::string module = bp::extract(top[2]); - Thread::getThread()->getLogger()->log(level, - NULL, bp::extract(top[0]), - bp::extract(top[1]), "%s%s: %s", + Thread::getThread()->getLogger()->log(level, + NULL, bp::extract(top[0]), + bp::extract(top[1]), "%s%s: %s", module.c_str(), module[0] == '<' ? "" : "()", msg.c_str()); } @@ -209,9 +209,9 @@ public: FormatterWrapper(PyObject *self) : m_self(self) { Py_INCREF(m_self); } std::string format(ELogLevel logLevel, const Class *theClass, - const Thread *thread, const std::string &text, + const Thread *thread, const std::string &text, const char *file, int line) { - return bp::call_method(m_self, "format", logLevel, + return bp::call_method(m_self, "format", logLevel, bp::ptr(const_cast(theClass)), bp::ptr(const_cast(thread)), text, file, line); } @@ -232,7 +232,7 @@ public: } void logProgress(Float progress, const std::string &name, - const std::string &formatted, const std::string &eta, + const std::string &formatted, const std::string &eta, const void *ptr) { bp::call_method(m_self, "logProgress", name, formatted, eta); } @@ -369,7 +369,7 @@ ConfigurableObject *pluginmgr_create(PluginManager *manager, bp::dict dict) { ConfigurableObject *object = manager->createObject(properties); for (std::map::iterator it = children.begin(); - it != children.end(); ++it) + it != children.end(); ++it) object->addChild(it->first, it->second); object->configure(); return object; @@ -518,7 +518,7 @@ void export_core() { BP_CLASS(FileStream, Stream, bp::init<>()) .def(bp::init()) - .def("getPath", &FileStream::getPath, + .def("getPath", &FileStream::getPath, BP_RETURN_CONSTREF) .def("open", &FileStream::open) .def("close", &FileStream::close) @@ -550,7 +550,7 @@ void export_core() { BP_CLASS(SerializableObject, Object, bp::no_init) .def("serialize", &SerializableObject::serialize); - + void (ConfigurableObject::*cobject_add_child_1)(ConfigurableObject *) = &ConfigurableObject::addChild; void (ConfigurableObject::*cobject_add_child_2)(const std::string &, ConfigurableObject *) = &ConfigurableObject::addChild; @@ -609,7 +609,7 @@ void export_core() { BP_WRAPPED_CLASS(Formatter, FormatterWrapper, Object, bp::init<>()) .def("format", &Formatter::format); - + Appender *(Logger::*logger_get_appender)(size_t) = &Logger::getAppender; BP_CLASS(Logger, Object, bp::init()) .def("logProgress", logger_logProgress) @@ -746,11 +746,11 @@ void export_core() { .def("set", &WorkUnit::set) .def("load", &WorkUnit::load) .def("save", &WorkUnit::save); - + BP_CLASS(WorkResult, Object, bp::no_init) .def("load", &WorkResult::load) .def("save", &WorkResult::save); - + BP_CLASS(WorkProcessor, SerializableObject, bp::no_init) .def("createWorkUnit", &WorkProcessor::createWorkUnit, BP_RETURN_VALUE) .def("createWorkResult", &WorkProcessor::createWorkResult, BP_RETURN_VALUE) @@ -768,7 +768,7 @@ void export_core() { .def("isLocal", &ParallelProcess::isLocal) .def("getLogLevel", &ParallelProcess::getLogLevel) .def("getRequiredPlugins", &ParallelProcess::getRequiredPlugins, BP_RETURN_VALUE); - + BP_SETSCOPE(ParallelProcess_class); bp::enum_("EStatus") .value("EUnknown", ParallelProcess::EUnknown) @@ -782,7 +782,7 @@ void export_core() { .def("getCoreCount", &Worker::getCoreCount) .def("isRemoteWorker", &Worker::isRemoteWorker); - BP_CLASS(LocalWorker, Worker, bp::init()) + BP_CLASS(LocalWorker, Worker, bp::init()) .def(bp::init()); BP_CLASS(RemoteWorker, Worker, (bp::init())) @@ -967,7 +967,7 @@ void export_core() { .def_readwrite("x", &Point3::x) .def_readwrite("y", &Point3::y) .def_readwrite("z", &Point3::z); - + BP_STRUCT(Point3i, bp::init<>()) .def(bp::init()) .def(bp::init()) @@ -1122,7 +1122,7 @@ void export_core() { .def("getBSphere", &AABB::getBSphere, BP_RETURN_VALUE) .def("serialize", &AABB::serialize) .def("__repr__", &AABB::toString); - + bp::class_("Frame", bp::init<>()) .def(bp::init()) .def(bp::init()) @@ -1151,7 +1151,7 @@ void export_core() { .staticmethod("cosPhi") .staticmethod("sinPhi2") .staticmethod("cosPhi2"); - + bp::class_("Transform", bp::init<>()) .def(bp::init()) .def(bp::init()) diff --git a/src/libpython/render.cpp b/src/libpython/render.cpp index e35256dc..9ce5c597 100644 --- a/src/libpython/render.cpp +++ b/src/libpython/render.cpp @@ -49,7 +49,7 @@ void export_render() { .value("ERadiance", ERadiance) .value("EImportance", EImportance) .export_values(); - + bp::enum_("EMeasure") .value("EInvalidMeasure", EInvalidMeasure) .value("ESolidAngle", ESolidAngle) diff --git a/src/librender/bsdf.cpp b/src/librender/bsdf.cpp index 324ac874..da5ea1b5 100644 --- a/src/librender/bsdf.cpp +++ b/src/librender/bsdf.cpp @@ -32,7 +32,7 @@ BSDF::BSDF(const Properties &props) m_usesRayDifferentials = false; } -BSDF::BSDF(Stream *stream, InstanceManager *manager) +BSDF::BSDF(Stream *stream, InstanceManager *manager) : ConfigurableObject(stream, manager) { m_ensureEnergyConservation = stream->readBool(); m_usesRayDifferentials = false; @@ -73,7 +73,7 @@ Spectrum BSDF::getDiffuseReflectance(const Intersection &its) const { return eval(bRec) * M_PI; } -Texture *BSDF::ensureEnergyConservation(Texture *texture, +Texture *BSDF::ensureEnergyConservation(Texture *texture, const std::string ¶mName, Float max) const { if (!m_ensureEnergyConservation) return texture; @@ -83,7 +83,7 @@ Texture *BSDF::ensureEnergyConservation(Texture *texture, std::ostringstream oss; Float scale = 0.99f * (max / actualMax); oss << "The BSDF" << endl << toString() << endl - << "violates energy conservation! The parameter \"" << paramName << "\" " + << "violates energy conservation! The parameter \"" << paramName << "\" " << "has a component-wise maximum of "<< actualMax << " (which is > " << max << "!) " << "and will therefore be scaled by " << scale << " to prevent " << "issues. Specify the parameter ensureEnergyConservation=false " @@ -110,7 +110,7 @@ std::pair BSDF::ensureEnergyConservation( std::ostringstream oss; Float scale = 0.99f * (max / actualMax); oss << "The BSDF" << endl << toString() << endl - << "violates energy conservation! The parameters \"" << paramName1 << "\" " + << "violates energy conservation! The parameters \"" << paramName1 << "\" " << "and \"" << paramName2 << "\" sum to a component-wise maximum of " << actualMax << " (which is > " << max << "!) and will therefore be " << "scaled by " << scale << " to prevent issues. Specify the parameter " @@ -179,6 +179,6 @@ std::string BSDFSamplingRecord::toString() const { << "]"; return oss.str(); } - + MTS_IMPLEMENT_CLASS(BSDF, true, ConfigurableObject) MTS_NAMESPACE_END diff --git a/src/librender/emitter.cpp b/src/librender/emitter.cpp index 63e95814..bbd39055 100644 --- a/src/librender/emitter.cpp +++ b/src/librender/emitter.cpp @@ -56,7 +56,7 @@ void AbstractEmitter::addChild(const std::string &name, ConfigurableObject *chil ConfigurableObject::addChild(name, child); } } - + ref AbstractEmitter::createShape(const Scene *scene) { return NULL; } @@ -67,7 +67,7 @@ Spectrum AbstractEmitter::samplePosition(PositionSamplingRecord &pRec, } Spectrum AbstractEmitter::sampleDirection(DirectionSamplingRecord &dRec, - PositionSamplingRecord &pRec, const Point2 &sample, + PositionSamplingRecord &pRec, const Point2 &sample, const Point2 *extra) const { NotImplementedError("sampleDirection"); } @@ -136,7 +136,7 @@ bool Emitter::fillDirectSamplingRecord(DirectSamplingRecord &dRec, } Emitter::~Emitter() { } - + Emitter *Emitter::getElement(size_t index) { return NULL; } diff --git a/src/librender/film.cpp b/src/librender/film.cpp index ad80a5df..78f8123d 100644 --- a/src/librender/film.cpp +++ b/src/librender/film.cpp @@ -47,14 +47,14 @@ Film::Film(const Properties &props) m_cropOffset.y + m_cropSize.y > m_size.y ) Log(EError, "Invalid crop window specification!"); - /* If set to true, regions slightly outside of the film - plane will also be sampled, which improves the image - quality at the edges especially with large reconstruction + /* If set to true, regions slightly outside of the film + plane will also be sampled, which improves the image + quality at the edges especially with large reconstruction filters. */ m_highQualityEdges = props.getBoolean("highQualityEdges", false); } -Film::Film(Stream *stream, InstanceManager *manager) +Film::Film(Stream *stream, InstanceManager *manager) : ConfigurableObject(stream, manager) { m_size = Vector2i(stream); m_cropOffset = Point2i(stream); diff --git a/src/librender/gatherproc.cpp b/src/librender/gatherproc.cpp index 53d7816b..ea3fe0e0 100644 --- a/src/librender/gatherproc.cpp +++ b/src/librender/gatherproc.cpp @@ -21,7 +21,7 @@ MTS_NAMESPACE_BEGIN /** - * \brief This work result implementation stores a sequence of photons, which can be + * \brief This work result implementation stores a sequence of photons, which can be * sent over the wire as needed. * * It is used to implement parallel networked photon tracing passes. @@ -41,7 +41,7 @@ public: inline size_t size() const { return m_photons.size(); } - + inline size_t getParticleCount() const { return m_particleIndices.size()-1; } @@ -102,7 +102,7 @@ public: int maxDepth, int rrDepth) : ParticleTracer(maxDepth, rrDepth, false), m_type(type), m_granularity(granularity) { } - GatherPhotonWorker(Stream *stream, InstanceManager *manager) + GatherPhotonWorker(Stream *stream, InstanceManager *manager) : ParticleTracer(stream, manager) { m_type = (GatherPhotonProcess::EGatherType) stream->readInt(); m_granularity = stream->readSize(); @@ -123,7 +123,7 @@ public: return new PhotonVector(); } - void process(const WorkUnit *workUnit, WorkResult *workResult, + void process(const WorkUnit *workUnit, WorkResult *workResult, const bool &stop) { m_workResult = static_cast(workResult); m_workResult->clear(); @@ -145,7 +145,7 @@ public: if ((m_type == GatherPhotonProcess::ECausticPhotons && depth > 1 && delta) || (m_type == GatherPhotonProcess::ESurfacePhotons && depth > 1 && !delta) - || (m_type == GatherPhotonProcess::EAllSurfacePhotons)) + || (m_type == GatherPhotonProcess::EAllSurfacePhotons)) m_workResult->put(Photon(its.p, its.geoFrame.n, -its.toWorld(its.wi), weight, depth)); } @@ -166,10 +166,10 @@ protected: ref m_workResult; }; -GatherPhotonProcess::GatherPhotonProcess(EGatherType type, size_t photonCount, +GatherPhotonProcess::GatherPhotonProcess(EGatherType type, size_t photonCount, size_t granularity, int maxDepth, int rrDepth, bool isLocal, bool autoCancel, const void *progressReporterPayload) - : ParticleProcess(ParticleProcess::EGather, photonCount, granularity, "Gathering photons", + : ParticleProcess(ParticleProcess::EGather, photonCount, granularity, "Gathering photons", progressReporterPayload), m_type(type), m_photonCount(photonCount), m_maxDepth(maxDepth), m_rrDepth(rrDepth), m_isLocal(isLocal), m_autoCancel(autoCancel), m_excess(0), m_numShot(0) { m_photonMap = new PhotonMap(photonCount); @@ -221,7 +221,7 @@ ParallelProcess::EStatus GatherPhotonProcess::generateWork(WorkUnit *unit, int w return ParticleProcess::generateWork(unit, worker); } -MTS_IMPLEMENT_CLASS(GatherPhotonProcess, false, ParticleProcess) -MTS_IMPLEMENT_CLASS_S(GatherPhotonWorker, false, ParticleTracer) -MTS_IMPLEMENT_CLASS(PhotonVector, false, WorkResult) +MTS_IMPLEMENT_CLASS(GatherPhotonProcess, false, ParticleProcess) +MTS_IMPLEMENT_CLASS_S(GatherPhotonWorker, false, ParticleTracer) +MTS_IMPLEMENT_CLASS(PhotonVector, false, WorkResult) MTS_NAMESPACE_END diff --git a/src/librender/imageblock.cpp b/src/librender/imageblock.cpp index 89cee84a..691db390 100644 --- a/src/librender/imageblock.cpp +++ b/src/librender/imageblock.cpp @@ -20,13 +20,13 @@ MTS_NAMESPACE_BEGIN -ImageBlock::ImageBlock(Bitmap::EPixelFormat fmt, const Vector2i &size, - const ReconstructionFilter *filter, int channels) : m_offset(0), +ImageBlock::ImageBlock(Bitmap::EPixelFormat fmt, const Vector2i &size, + const ReconstructionFilter *filter, int channels) : m_offset(0), m_size(size), m_filter(filter), m_weightsX(NULL), m_weightsY(NULL) { m_borderSize = filter ? filter->getBorderSize() : 0; /* Allocate a small bitmap data structure for the block */ - m_bitmap = new Bitmap(fmt, Bitmap::EFloat, + m_bitmap = new Bitmap(fmt, Bitmap::EFloat, size + Vector2i(2 * m_borderSize), channels); if (filter) { @@ -46,7 +46,7 @@ void ImageBlock::load(Stream *stream) { m_offset = Point2i(stream); m_size = Vector2i(stream); stream->readFloatArray( - m_bitmap->getFloatData(), + m_bitmap->getFloatData(), (size_t) m_bitmap->getSize().x * (size_t) m_bitmap->getSize().y * m_bitmap->getChannelCount()); } @@ -55,7 +55,7 @@ void ImageBlock::save(Stream *stream) const { m_offset.serialize(stream); m_size.serialize(stream); stream->writeFloatArray( - m_bitmap->getFloatData(), + m_bitmap->getFloatData(), (size_t) m_bitmap->getSize().x * (size_t) m_bitmap->getSize().y * m_bitmap->getChannelCount()); } diff --git a/src/librender/imageproc.cpp b/src/librender/imageproc.cpp index 5da5f549..9a8a334a 100644 --- a/src/librender/imageproc.cpp +++ b/src/librender/imageproc.cpp @@ -39,7 +39,7 @@ void BlockedImageProcess::init(const Point2i &offset, const Vector2i &size, uint m_stepsLeft = 1; m_numSteps = 1; } - + ParallelProcess::EStatus BlockedImageProcess::generateWork(WorkUnit *unit, int worker) { /* Reimplementation of the spiraling block generator by Adam Arbree */ RectangularWorkUnit &rect = *static_cast(unit); @@ -66,7 +66,7 @@ ParallelProcess::EStatus BlockedImageProcess::generateWork(WorkUnit *unit, int w if (--m_stepsLeft == 0) { m_direction = (m_direction + 1) % 4; - if (m_direction == ELeft || m_direction == ERight) + if (m_direction == ELeft || m_direction == ERight) ++m_numSteps; m_stepsLeft = m_numSteps; } diff --git a/src/librender/integrator.cpp b/src/librender/integrator.cpp index 43cab269..b7a090f0 100644 --- a/src/librender/integrator.cpp +++ b/src/librender/integrator.cpp @@ -35,7 +35,7 @@ void Integrator::postprocess(const Scene *scene, RenderQueue *queue, const Rende void Integrator::serialize(Stream *stream, InstanceManager *manager) const { NetworkedObject::serialize(stream, manager); } -void Integrator::configureSampler(const Scene *scene, Sampler *sampler) { +void Integrator::configureSampler(const Scene *scene, Sampler *sampler) { /* Prepare the sampler for bucket-based rendering */ sampler->setFilmResolution(scene->getFilm()->getCropSize(), getClass()->derivesFrom(MTS_CLASS(SamplingIntegrator))); @@ -52,7 +52,7 @@ void SamplingIntegrator::serialize(Stream *stream, InstanceManager *manager) con Integrator::serialize(stream, manager); } -Spectrum SamplingIntegrator::E(const Scene *scene, const Intersection &its, +Spectrum SamplingIntegrator::E(const Scene *scene, const Intersection &its, const Medium *medium, Sampler *sampler, int nSamples, bool handleIndirect) const { Spectrum E(0.0f); RadianceQueryRecord query(scene, sampler); @@ -68,7 +68,7 @@ Spectrum SamplingIntegrator::E(const Scene *scene, const Intersection &its, if (!directRadiance.isZero()) { Float dp = dot(dRec.d, its.shFrame.n); - if (dp > 0) + if (dp > 0) E += directRadiance * dp; } @@ -103,13 +103,13 @@ bool SamplingIntegrator::render(Scene *scene, const Sampler *sampler = static_cast(sched->getResource(samplerResID, 0)); size_t sampleCount = sampler->getSampleCount(); - Log(EInfo, "Starting render job (%ix%i, " SIZE_T_FMT " %s, " SIZE_T_FMT - " %s, " SSE_STR ") ..", film->getCropSize().x, film->getCropSize().y, - sampleCount, sampleCount == 1 ? "sample" : "samples", nCores, + Log(EInfo, "Starting render job (%ix%i, " SIZE_T_FMT " %s, " SIZE_T_FMT + " %s, " SSE_STR ") ..", film->getCropSize().x, film->getCropSize().y, + sampleCount, sampleCount == 1 ? "sample" : "samples", nCores, nCores == 1 ? "core" : "cores"); /* This is a sampling-based integrator - parallelize */ - ref proc = new BlockedRenderProcess(job, + ref proc = new BlockedRenderProcess(job, queue, scene->getBlockSize()); int integratorResID = sched->registerResource(this); proc->bindResource("integrator", integratorResID); @@ -138,12 +138,12 @@ void SamplingIntegrator::wakeup(ConfigurableObject *parent, } void SamplingIntegrator::renderBlock(const Scene *scene, - const Sensor *sensor, Sampler *sampler, ImageBlock *block, + const Sensor *sensor, Sampler *sampler, ImageBlock *block, const bool &stop, const std::vector< TPoint2 > &points) const { - Float diffScaleFactor = 1.0f / + Float diffScaleFactor = 1.0f / std::sqrt((Float) sampler->getSampleCount()); - + bool needsApertureSample = sensor->needsApertureSample(); bool needsTimeSample = sensor->needsTimeSample(); @@ -156,7 +156,7 @@ void SamplingIntegrator::renderBlock(const Scene *scene, for (size_t i = 0; igetOffset()); - if (stop) + if (stop) break; sampler->generate(offset); @@ -186,7 +186,7 @@ MonteCarloIntegrator::MonteCarloIntegrator(const Properties &props) : SamplingIn /* Depth to begin using russian roulette */ m_rrDepth = props.getInteger("rrDepth", 5); - /* Longest visualized path depth (\c -1 = infinite). + /* Longest visualized path depth (\c -1 = infinite). A value of \c 1 will visualize only directly visible light sources. \c 2 will lead to single-bounce (direct-only) illumination, and so on. */ m_maxDepth = props.getInteger("maxDepth", -1); @@ -196,7 +196,7 @@ MonteCarloIntegrator::MonteCarloIntegrator(const Properties &props) : SamplingIn * and shading normals of a surface don't agree on whether a ray is on * the front or back-side of a surface. * - * When \c strictNormals is set to \c false, the shading normal has + * When \c strictNormals is set to \c false, the shading normal has * precedence, and rendering proceeds normally at the risk of * introducing small light leaks (this is the default). * diff --git a/src/librender/intersection.cpp b/src/librender/intersection.cpp index b73822a3..b005995d 100644 --- a/src/librender/intersection.cpp +++ b/src/librender/intersection.cpp @@ -6,7 +6,7 @@ void Intersection::computePartials(const RayDifferential &ray) { Float A[2][2], Bx[2], By[2], x[2]; int axes[2]; - /* Compute the texture coordinates partials wrt. + /* Compute the texture coordinates partials wrt. changes in the screen-space position. Based on PBRT */ if (hasUVPartials || !ray.hasDifferentials) return; @@ -61,7 +61,7 @@ void Intersection::computePartials(const RayDifferential &ray) { Bx[1] = px[axes[1]] - p[axes[1]]; By[0] = py[axes[0]] - p[axes[0]]; By[1] = py[axes[1]] - p[axes[1]]; - + if (EXPECT_TAKEN(solveLinearSystem2x2(A, Bx, x))) { dudx = x[0]; dvdx = x[1]; } else { diff --git a/src/librender/irrcache.cpp b/src/librender/irrcache.cpp index f89183f4..a7f6dbe4 100644 --- a/src/librender/irrcache.cpp +++ b/src/librender/irrcache.cpp @@ -57,7 +57,7 @@ void HemisphereSampler::generateDirections(const Intersection &its) { } } - /* Precompute planar vectors - see "Practical Global Illumination" by Jaroslav Krivanek + /* Precompute planar vectors - see "Practical Global Illumination" by Jaroslav Krivanek and Pascal Gautron for more details on this notation */ for (uint32_t k=0; k1) { @@ -123,7 +123,7 @@ void HemisphereSampler::process(const Intersection &its) { if (minDist > 0) { const Spectrum spec = (entry.L - other.L) * (cosTheta * cosThetaDiff / (minDist * sinTheta)); - for (int i=0; i<3; ++i) + for (int i=0; i<3; ++i) m_tGrad[i] += spec * m_vkMinus[k][i]; } @@ -139,7 +139,7 @@ void HemisphereSampler::process(const Intersection &its) { } if (invDists > 0) m_hMean = (m_M*m_N) / invDists; - for (int i=0; i<3; ++i) + for (int i=0; i<3; ++i) m_rGrad[i] *= M_PI/(m_M*m_N); m_E *= M_PI / (m_M*m_N); } @@ -171,7 +171,7 @@ struct clamp_neighbors_functor { /* Update valid range and clamp back into the permitted interval */ sample->originalR0 = distanceLimit; - sample->R0 = std::min(sample->R0_max, + sample->R0 = std::min(sample->R0_max, std::max(sample->R0_min, sample->originalR0)); } } @@ -182,7 +182,7 @@ struct clamp_neighbors_functor { /* Irradiance interpolation functor */ struct irr_interp_functor { - irr_interp_functor(const Intersection &its, Float kappa, bool gradients) : its(its), + irr_interp_functor(const Intersection &its, Float kappa, bool gradients) : its(its), kappa(kappa), weightSum(0), gradients(gradients), E(0.0f) { } @@ -199,7 +199,7 @@ struct irr_interp_functor { for (int i=0; irGrad[j][i] + diff[j] * sample->tGrad[j][i]; } @@ -217,7 +217,7 @@ struct irr_interp_functor { Spectrum E; }; -IrradianceCache::IrradianceCache(const AABB &aabb) +IrradianceCache::IrradianceCache(const AABB &aabb) : m_octree(aabb) { /* Use the longest AABB axis as an estimate of the scene dimensions */ m_sceneSize = (aabb.max-aabb.min)[aabb.getLargestAxis()]; @@ -230,7 +230,7 @@ IrradianceCache::IrradianceCache(const AABB &aabb) clampScreen(true); } -IrradianceCache::IrradianceCache(Stream *stream, InstanceManager *manager) : +IrradianceCache::IrradianceCache(Stream *stream, InstanceManager *manager) : m_octree(AABB(stream)) { m_mutex = new Mutex(); m_kappa = stream->readFloat(); @@ -268,7 +268,7 @@ void IrradianceCache::serialize(Stream *stream, InstanceManager *manager) const m_records[i]->serialize(stream); } -IrradianceCache::Record *IrradianceCache::put(const RayDifferential &ray, const Intersection &its, +IrradianceCache::Record *IrradianceCache::put(const RayDifferential &ray, const Intersection &its, const HemisphereSampler &hs) { const Spectrum &E = hs.getIrradiance(); TranslationalGradient tGrad; @@ -281,17 +281,17 @@ IrradianceCache::Record *IrradianceCache::put(const RayDifferential &ray, const } Float R0_min = 0, R0_max = std::numeric_limits::infinity(); - /* Clamping recommended by Tabellion and Lamourlette ("An Approximate Global + /* Clamping recommended by Tabellion and Lamourlette ("An Approximate Global Illumination System for Computer Generated Films") */ if (m_clampScreen && ray.hasDifferentials) { const Float d = -dot(its.geoFrame.n, Vector(its.p)); const Float txRecip = dot(its.geoFrame.n, ray.rxDirection), tyRecip = dot(its.geoFrame.n, ray.ryDirection); if (txRecip != 0 && tyRecip != 0) { - // Ray distances traveled - const Float tx = -(dot(its.geoFrame.n, Vector(ray.rxOrigin)) + d) / + // Ray distances traveled + const Float tx = -(dot(its.geoFrame.n, Vector(ray.rxOrigin)) + d) / txRecip; - const Float ty = -(dot(its.geoFrame.n, Vector(ray.ryOrigin)) + d) / + const Float ty = -(dot(its.geoFrame.n, Vector(ray.ryOrigin)) + d) / tyRecip; Point px = ray.rxOrigin + ray.rxDirection * tx, py = ray.ryOrigin + ray.ryDirection * ty; @@ -313,12 +313,12 @@ IrradianceCache::Record *IrradianceCache::put(const RayDifferential &ray, const /* Limit the translational gradient magnitude [Krivanek et al.] */ for (int i=0; i<3; ++i) - tGrad[i] = tGrad[i] * + tGrad[i] = tGrad[i] * std::min((Float) 1, hs.getMinimumDistance() / R0_min); } if (m_clampNeighbor) { - /* Perform neighbor clamping [Krivanek et al.] to distribute + /* Perform neighbor clamping [Krivanek et al.] to distribute geometric feature information amongst neighboring hss */ clamp_self_functor clampSelf(its.p, R0); m_octree.searchSphere(BSphere(its.p, R0), clampSelf); diff --git a/src/librender/medium.cpp b/src/librender/medium.cpp index 7857fc19..e40d225e 100644 --- a/src/librender/medium.cpp +++ b/src/librender/medium.cpp @@ -26,7 +26,7 @@ MTS_NAMESPACE_BEGIN Medium::Medium(const Properties &props) : NetworkedObject(props) { - lookupMaterial(props, m_sigmaS, m_sigmaA); + lookupMaterial(props, m_sigmaS, m_sigmaA); m_sigmaT = m_sigmaA + m_sigmaS; } @@ -37,7 +37,7 @@ Medium::Medium(Stream *stream, InstanceManager *manager) m_sigmaS = Spectrum(stream); m_sigmaT = m_sigmaA + m_sigmaS; } - + void Medium::addChild(const std::string &name, ConfigurableObject *child) { const Class *cClass = child->getClass(); diff --git a/src/librender/noise.cpp b/src/librender/noise.cpp index 84c5fef1..a012b303 100644 --- a/src/librender/noise.cpp +++ b/src/librender/noise.cpp @@ -8,35 +8,35 @@ MTS_NAMESPACE_BEGIN #define NOISE_PERM_SIZE 256 static int NoisePerm[2 * NOISE_PERM_SIZE] = { 151, 160, 137, 91, 90, 15, 131, 13, 201, 95, 96, 53, 194, 233, 7, 225, 140, - 36, 103, 30, 69, 142, 8, 99, 37, 240, 21, 10, 23, 190, 6, 148, 247, 120, - 234, 75, 0, 26, 197, 62, 94, 252, 219, 203, 117, 35, 11, 32, 57, 177, 33, - 88, 237, 149, 56, 87, 174, 20, 125, 136, 171, 168, 68, 175, 74, 165, 71, - 134, 139, 48, 27, 166, 77, 146, 158, 231, 83, 111, 229, 122, 60, 211, 133, + 36, 103, 30, 69, 142, 8, 99, 37, 240, 21, 10, 23, 190, 6, 148, 247, 120, + 234, 75, 0, 26, 197, 62, 94, 252, 219, 203, 117, 35, 11, 32, 57, 177, 33, + 88, 237, 149, 56, 87, 174, 20, 125, 136, 171, 168, 68, 175, 74, 165, 71, + 134, 139, 48, 27, 166, 77, 146, 158, 231, 83, 111, 229, 122, 60, 211, 133, 230, 220, 105, 92, 41, 55, 46, 245, 40, 244, 102, 143, 54, 65, 25, 63, 161, 1, 216, 80, 73, 209, 76, 132, 187, 208, 89, 18, 169, 200, 196, 135, 130, 116, 188, 159, 86, 164, 100, 109, 198, 173, 186, 3, 64, 52, 217, 226, 250, 124, 123, 5, 202, 38, 147, 118, 126, 255, 82, 85, 212, 207, 206, 59, 227, 47, 16, 58, 17, 182, 189, 28, 42, 223, 183, 170, 213, 119, 248, 152, 2, 44, 154, - 163, 70, 221, 153, 101, 155, 167, 43, 172, 9, 129, 22, 39, 253, 19, 98, + 163, 70, 221, 153, 101, 155, 167, 43, 172, 9, 129, 22, 39, 253, 19, 98, 108, 110, 79, 113, 224, 232, 178, 185, 112, 104, 218, 246, 97, 228, 251, 34, 242, 193, 238, 210, 144, 12, 191, 179, 162, 241, 81, 51, 145, 235, 249, 14, 239, 107, 49, 192, 214, 31, 181, 199, 106, 157, 184, 84, 204, 176, 115, 121, - 50, 45, 127, 4, 150, 254, 138, 236, 205, 93, 222, 114, 67, 29, 24, 72, 243, + 50, 45, 127, 4, 150, 254, 138, 236, 205, 93, 222, 114, 67, 29, 24, 72, 243, 141, 128, 195, 78, 66, 215, 61, 156, 180, 151, 160, 137, 91, 90, 15, 131, 13, - 201, 95, 96, 53, 194, 233, 7, 225, 140, 36, 103, 30, 69, 142, 8, 99, 37, 240, - 21, 10, 23, 190, 6, 148, 247, 120, 234, 75, 0, 26, 197, 62, 94, 252, 219, - 203, 117, 35, 11, 32, 57, 177, 33, 88, 237, 149, 56, 87, 174, 20, 125, 136, + 201, 95, 96, 53, 194, 233, 7, 225, 140, 36, 103, 30, 69, 142, 8, 99, 37, 240, + 21, 10, 23, 190, 6, 148, 247, 120, 234, 75, 0, 26, 197, 62, 94, 252, 219, + 203, 117, 35, 11, 32, 57, 177, 33, 88, 237, 149, 56, 87, 174, 20, 125, 136, 171, 168, 68, 175, 74, 165, 71, 134, 139, 48, 27, 166, 77, 146, 158, 231, 83, 111, 229, 122, 60, 211, 133, 230, 220, 105, 92, 41, 55, 46, 245, 40, 244, 102, - 143, 54, 65, 25, 63, 161, 1, 216, 80, 73, 209, 76, 132, 187, 208, 89, 18, - 169, 200, 196, 135, 130, 116, 188, 159, 86, 164, 100, 109, 198, 173, 186, 3, - 64, 52, 217, 226, 250, 124, 123, 5, 202, 38, 147, 118, 126, 255, 82, 85, 212, - 207, 206, 59, 227, 47, 16, 58, 17, 182, 189, 28, 42, 223, 183, 170, 213, 119, - 248, 152, 2, 44, 154, 163, 70, 221, 153, 101, 155, 167, 43, 172, 9, 129, - 22, 39, 253, 19, 98, 108, 110, 79, 113, 224, 232, 178, 185, 112, 104, 218, - 246, 97, 228, 251, 34, 242, 193, 238, 210, 144, 12, 191, 179, 162, 241, 81, + 143, 54, 65, 25, 63, 161, 1, 216, 80, 73, 209, 76, 132, 187, 208, 89, 18, + 169, 200, 196, 135, 130, 116, 188, 159, 86, 164, 100, 109, 198, 173, 186, 3, + 64, 52, 217, 226, 250, 124, 123, 5, 202, 38, 147, 118, 126, 255, 82, 85, 212, + 207, 206, 59, 227, 47, 16, 58, 17, 182, 189, 28, 42, 223, 183, 170, 213, 119, + 248, 152, 2, 44, 154, 163, 70, 221, 153, 101, 155, 167, 43, 172, 9, 129, + 22, 39, 253, 19, 98, 108, 110, 79, 113, 224, 232, 178, 185, 112, 104, 218, + 246, 97, 228, 251, 34, 242, 193, 238, 210, 144, 12, 191, 179, 162, 241, 81, 51, 145, 235, 249, 14, 239, 107, 49, 192, 214, 31, 181, 199, 106, 157, 184, - 84, 204, 176, 115, 121, 50, 45, 127, 4, 150, 254, 138, 236, 205, 93, 222, + 84, 204, 176, 115, 121, 50, 45, 127, 4, 150, 254, 138, 236, 205, 93, 222, 114, 67, 29, 24, 72, 243, 141, 128, 195, 78, 66, 215, 61, 156, 180 }; @@ -75,7 +75,7 @@ Float Noise::perlinNoise(const Point &p) { ix &= (NOISE_PERM_SIZE-1); iy &= (NOISE_PERM_SIZE-1); iz &= (NOISE_PERM_SIZE-1); - + Float w000 = grad(ix, iy, iz, dx, dy, dz); Float w100 = grad(ix+1, iy, iz, dx-1, dy, dz); Float w010 = grad(ix, iy+1, iz, dx, dy-1, dz); @@ -96,11 +96,11 @@ Float Noise::perlinNoise(const Point &p) { x11 = lerp(wx, w011, w111), y0 = lerp(wy, x00, x10), y1 = lerp(wy, x01, x11); - + return lerp(wz, y0, y1); } -Float Noise::fbm(const Point &p, const Vector &dpdx, +Float Noise::fbm(const Point &p, const Vector &dpdx, const Vector &dpdy, Float omega, int maxOctaves) { // Compute number of octaves for antialiased FBm Float s2 = std::max(dpdx.lengthSquared(), dpdy.lengthSquared()); @@ -115,12 +115,12 @@ Float Noise::fbm(const Point &p, const Vector &dpdx, o *= omega; } Float partialOctave = foctaves - octaves; - sum += o * smoothStep(.3f, .7f, partialOctave) + sum += o * smoothStep(.3f, .7f, partialOctave) * perlinNoise(lambda * p); return sum; } -Float Noise::turbulence(const Point &p, const Vector &dpdx, +Float Noise::turbulence(const Point &p, const Vector &dpdx, const Vector &dpdy, Float omega, int maxOctaves) { // Compute number of octaves for antialiased FBm Float s2 = std::max(dpdx.lengthSquared(), dpdy.lengthSquared()); diff --git a/src/librender/particleproc.cpp b/src/librender/particleproc.cpp index 216d4128..f3bfd0ad 100644 --- a/src/librender/particleproc.cpp +++ b/src/librender/particleproc.cpp @@ -35,7 +35,7 @@ ParticleProcess::ParticleProcess(EMode mode, size_t workCount, size_t granularit (16 * Scheduler::getInstance()->getWorkerCount())); /* Create a visual progress reporter */ - m_progress = new ProgressReporter(progressText, workCount, + m_progress = new ProgressReporter(progressText, workCount, progressReporterPayload); m_resultMutex = new Mutex(); } @@ -78,9 +78,9 @@ ParticleTracer::ParticleTracer(int maxDepth, int rrDepth, bool emissionEvents) ParticleTracer::ParticleTracer(Stream *stream, InstanceManager *manager) : WorkProcessor(stream, manager) { - m_maxDepth = stream->readInt(); - m_rrDepth = stream->readInt(); - m_emissionEvents = stream->readBool(); + m_maxDepth = stream->readInt(); + m_rrDepth = stream->readInt(); + m_emissionEvents = stream->readBool(); } void ParticleTracer::serialize(Stream *stream, InstanceManager *manager) const { @@ -104,8 +104,8 @@ void ParticleTracer::prepare() { m_scene->initializeBidirectional(); } -void ParticleTracer::process(const WorkUnit *workUnit, WorkResult *workResult, - const bool &stop) { +void ParticleTracer::process(const WorkUnit *workUnit, WorkResult *workResult, + const bool &stop) { const RangeWorkUnit *range = static_cast(workUnit); MediumSamplingRecord mRec; Intersection its; @@ -141,16 +141,16 @@ void ParticleTracer::process(const WorkUnit *workUnit, WorkResult *workResult, handleEmission(pRec, medium, power); DirectionSamplingRecord dRec; - power *= emitter->sampleDirection(dRec, pRec, + power *= emitter->sampleDirection(dRec, pRec, emitter->needsDirectionSample() ? m_sampler->next2D() : Point2(0.5f)); ray.setTime(pRec.time); ray.setOrigin(pRec.p); ray.setDirection(dRec.d); } else { - /* Sample both components together, which is potentially + /* Sample both components together, which is potentially faster / uses a better sampling strategy */ - power = m_scene->sampleEmitterRay(ray, emitter, + power = m_scene->sampleEmitterRay(ray, emitter, m_sampler->next2D(), m_sampler->next2D(), pRec.time); medium = emitter->getMedium(); handleNewParticle(); @@ -161,7 +161,7 @@ void ParticleTracer::process(const WorkUnit *workUnit, WorkResult *workResult, Spectrum throughput(1.0f); // unitless path throughput (used for russian roulette) while (!throughput.isZero() && (depth <= m_maxDepth || m_maxDepth < 0)) { - m_scene->rayIntersectAll(ray, its); + m_scene->rayIntersectAll(ray, its); /* ==================================================================== */ /* Radiative Transfer Equation sampling */ @@ -174,9 +174,9 @@ void ParticleTracer::process(const WorkUnit *workUnit, WorkResult *workResult, throughput *= mRec.sigmaS * mRec.transmittance / mRec.pdfSuccess; /* Forward the medium scattering event to the attached handler */ - handleMediumInteraction(depth, + handleMediumInteraction(depth, delta, mRec, medium, -ray.d, throughput*power); - + PhaseFunctionSamplingRecord pRec(mRec, -ray.d, EImportance); throughput *= medium->getPhaseFunction()->sample(pRec, m_sampler); @@ -188,7 +188,7 @@ void ParticleTracer::process(const WorkUnit *workUnit, WorkResult *workResult, /* There is no surface in this direction */ break; } else { - /* Sample + /* Sample tau(x, y) (Surface integral). This happens with probability mRec.pdfFailure Account for this and multiply by the proper per-color-channel transmittance. */ @@ -209,7 +209,7 @@ void ParticleTracer::process(const WorkUnit *workUnit, WorkResult *workResult, Vector wi = -ray.d, wo = its.toWorld(bRec.wo); Float wiDotGeoN = dot(its.geoFrame.n, wi), woDotGeoN = dot(its.geoFrame.n, wo); - if (wiDotGeoN * Frame::cosTheta(bRec.wi) <= 0 || + if (wiDotGeoN * Frame::cosTheta(bRec.wi) <= 0 || woDotGeoN * Frame::cosTheta(bRec.wo) <= 0) break; @@ -221,18 +221,18 @@ void ParticleTracer::process(const WorkUnit *workUnit, WorkResult *workResult, #if 0 /* This is somewhat unfortunate: for accuracy, we'd really want the - correction factor below to match the path tracing interpretation + correction factor below to match the path tracing interpretation of a scene with surface normals. However, this factor can become extremely large, which adds unacceptable variance to output renderings. So for now, it is disabled. The adjoint particle tracer and the - photon mapping variants still use this factor for the last + photon mapping variants still use this factor for the last bounce -- just not for the intermediate ones, which introduces - a small (though in practice not noticeable) amount of error. This + a small (though in practice not noticeable) amount of error. This is also what the implementation of SPPM by Toshiya Hachisuka does. - - Ultimately, we'll need better adjoint BSDF sampling strategies + + Ultimately, we'll need better adjoint BSDF sampling strategies that incorporate these extra terms */ /* Adjoint BSDF for shading normals -- [Veach, p. 155] */ @@ -249,11 +249,11 @@ void ParticleTracer::process(const WorkUnit *workUnit, WorkResult *workResult, if (depth++ >= m_rrDepth) { /* Russian roulette: try to keep path weights equal to one, - Stop with at least some probability to avoid + Stop with at least some probability to avoid getting stuck (e.g. due to total internal reflection) */ Float q = std::min(throughput.max(), (Float) 0.95f); - if (m_sampler->next1D() >= q) + if (m_sampler->next1D() >= q) break; throughput /= q; } @@ -261,7 +261,7 @@ void ParticleTracer::process(const WorkUnit *workUnit, WorkResult *workResult, } } -void ParticleTracer::handleEmission(const PositionSamplingRecord &pRec, +void ParticleTracer::handleEmission(const PositionSamplingRecord &pRec, const Medium *medium, const Spectrum &weight) { } void ParticleTracer::handleNewParticle() { } @@ -270,7 +270,7 @@ void ParticleTracer::handleSurfaceInteraction(int depth, bool delta, const Intersection &its, const Medium *medium, const Spectrum &weight) { } void ParticleTracer::handleMediumInteraction(int depth, bool delta, - const MediumSamplingRecord &mRec, const Medium *medium, + const MediumSamplingRecord &mRec, const Medium *medium, const Vector &wi, const Spectrum &weight) { } MTS_IMPLEMENT_CLASS(RangeWorkUnit, false, WorkUnit) diff --git a/src/librender/phase.cpp b/src/librender/phase.cpp index 3761e91f..246ae5cd 100644 --- a/src/librender/phase.cpp +++ b/src/librender/phase.cpp @@ -21,11 +21,11 @@ void PhaseFunction::configure() { Float PhaseFunction::pdf(const PhaseFunctionSamplingRecord &pRec) const { return eval(pRec); } - + bool PhaseFunction::needsDirectionallyVaryingCoefficients() const { return false; } - + Float PhaseFunction::sigmaDir(Float cosTheta) const { Log(EError, "%s::sigmaDir(Float) is not implemented (this is not " "an anisotropic medium!)", getClass()->getName().c_str()); @@ -37,7 +37,7 @@ Float PhaseFunction::sigmaDirMax() const { "an anisotropic medium!)", getClass()->getName().c_str()); return 0.0f; } - + Float PhaseFunction::getMeanCosine() const { Log(EError, "%s::getMeanCosine() is not implemented!", getClass()->getName().c_str()); diff --git a/src/librender/photon.cpp b/src/librender/photon.cpp index 50517e8b..34ea86e3 100644 --- a/src/librender/photon.cpp +++ b/src/librender/photon.cpp @@ -79,7 +79,7 @@ void Photon::serialize(Stream *stream) const { Photon::Photon(const Point &p, const Normal &normal, const Vector &dir, const Spectrum &P, uint16_t _depth) { - if (!P.isValid()) + if (!P.isValid()) SLog(EWarn, "Creating an invalid photon with power: %s", P.toString().c_str()); /* Possibly convert to single precision floating point (if Mitsuba is configured to use double precision) */ @@ -87,7 +87,7 @@ Photon::Photon(const Point &p, const Normal &normal, data.depth = _depth; flags = 0; - /* Convert the direction into an approximate spherical + /* Convert the direction into an approximate spherical coordinate format to reduce storage requirements */ data.theta = (uint8_t) std::min(255, (int) (math::safe_acos(dir.z) * (256.0 / M_PI))); @@ -98,7 +98,7 @@ Photon::Photon(const Point &p, const Normal &normal, data.phi = (uint8_t) (tmp + 256); else data.phi = (uint8_t) tmp; - + if (normal.isZero()) { data.thetaN = data.phiN = 0; } else { @@ -132,6 +132,6 @@ std::string Photon::toString() const { << "]"; return oss.str(); } - + MTS_NAMESPACE_END diff --git a/src/librender/photonmap.cpp b/src/librender/photonmap.cpp index 1b2f9c11..7836bab3 100644 --- a/src/librender/photonmap.cpp +++ b/src/librender/photonmap.cpp @@ -23,26 +23,26 @@ MTS_NAMESPACE_BEGIN -PhotonMap::PhotonMap(size_t photonCount) +PhotonMap::PhotonMap(size_t photonCount) : m_kdtree(0, PhotonTree::ESlidingMidpoint), m_scale(1.0f) { m_kdtree.reserve(photonCount); Assert(Photon::m_precompTableReady); } -PhotonMap::PhotonMap(Stream *stream, InstanceManager *manager) - : SerializableObject(stream, manager), +PhotonMap::PhotonMap(Stream *stream, InstanceManager *manager) + : SerializableObject(stream, manager), m_kdtree(0, PhotonTree::ESlidingMidpoint) { Assert(Photon::m_precompTableReady); m_scale = (Float) stream->readFloat(); m_kdtree.resize(stream->readSize()); m_kdtree.setDepth(stream->readSize()); m_kdtree.setAABB(AABB(stream)); - for (size_t i=0; iwriteFloat(m_scale); stream->writeSize(m_kdtree.size()); @@ -75,13 +75,13 @@ void PhotonMap::dumpOBJ(const std::string &filename) { } /// Need to generate some fake geometry so that blender will import the points - for (size_t i=3; i<=m_kdtree.size(); i++) + for (size_t i=3; i<=m_kdtree.size(); i++) os << "f " << i << " " << i-1 << " " << i-2 << endl; os.close(); } Spectrum PhotonMap::estimateIrradiance( - const Point &p, const Normal &n, + const Point &p, const Normal &n, Float searchRadius, int maxDepth, size_t maxPhotons) const { SearchResult *results = static_cast( @@ -151,7 +151,7 @@ Spectrum PhotonMap::estimateRadiance(const Intersection &its, struct RawRadianceQuery { RawRadianceQuery(const Intersection &its, int maxDepth) - : its(its), maxDepth(maxDepth), result(0.0f) { + : its(its), maxDepth(maxDepth), result(0.0f) { bsdf = its.getBSDF(); } @@ -172,7 +172,7 @@ struct RawRadianceQuery { return; /* Account for non-symmetry due to shading normals */ - value *= std::abs(Frame::cosTheta(bRec.wi) / + value *= std::abs(Frame::cosTheta(bRec.wi) / (wiDotGeoN * Frame::cosTheta(bRec.wo))); result += value; diff --git a/src/librender/rectwu.cpp b/src/librender/rectwu.cpp index 7d1c9304..efab19f2 100644 --- a/src/librender/rectwu.cpp +++ b/src/librender/rectwu.cpp @@ -23,7 +23,7 @@ MTS_NAMESPACE_BEGIN /* ==================================================================== */ /* RectangularWorkUnit */ /* ==================================================================== */ - + void RectangularWorkUnit::set(const WorkUnit *wu) { const RectangularWorkUnit *rect = static_cast(wu); m_offset = rect->m_offset; @@ -50,7 +50,7 @@ void RectangularWorkUnit::save(Stream *stream) const { std::string RectangularWorkUnit::toString() const { std::ostringstream oss; - oss << "RectangularWorkUnit[offset=" << m_offset.toString() + oss << "RectangularWorkUnit[offset=" << m_offset.toString() << ", size=" << m_size.toString() << "]"; return oss.str(); } diff --git a/src/librender/renderjob.cpp b/src/librender/renderjob.cpp index 8549ff1f..146dbb4a 100644 --- a/src/librender/renderjob.cpp +++ b/src/librender/renderjob.cpp @@ -21,14 +21,14 @@ #include MTS_NAMESPACE_BEGIN - -RenderJob::RenderJob(const std::string &threadName, - Scene *scene, RenderQueue *queue, int sceneResID, int sensorResID, - int samplerResID, bool threadIsCritical, bool interactive) + +RenderJob::RenderJob(const std::string &threadName, + Scene *scene, RenderQueue *queue, int sceneResID, int sensorResID, + int samplerResID, bool threadIsCritical, bool interactive) : Thread(threadName), m_scene(scene), m_queue(queue), m_interactive(interactive) { /* Optional: bring the process down when this thread crashes */ - setCritical(threadIsCritical); + setCritical(threadIsCritical); m_queue->addJob(this); ref sched = Scheduler::getInstance(); @@ -39,10 +39,10 @@ RenderJob::RenderJob(const std::string &threadName, /* Register the scene with the scheduler if needed */ if (sceneResID == -1) { m_sceneResID = sched->registerResource(m_scene); - m_ownsSceneResource = true; + m_ownsSceneResource = true; } else { m_sceneResID = sceneResID; - m_ownsSceneResource = false; + m_ownsSceneResource = false; } /* Register the sensor with the scheduler if needed */ @@ -63,7 +63,7 @@ RenderJob::RenderJob(const std::string &threadName, clonedSampler->incRef(); samplers[i] = clonedSampler.get(); } - m_samplerResID = sched->registerMultiResource(samplers); + m_samplerResID = sched->registerMultiResource(samplers); for (size_t i=0; igetCoreCount(); ++i) samplers[i]->decRef(); m_ownsSamplerResource = true; diff --git a/src/librender/renderproc.cpp b/src/librender/renderproc.cpp index 7654d6a8..a76b88bc 100644 --- a/src/librender/renderproc.cpp +++ b/src/librender/renderproc.cpp @@ -25,7 +25,7 @@ MTS_NAMESPACE_BEGIN class BlockRenderer : public WorkProcessor { public: - BlockRenderer(int blockSize, int borderSize) + BlockRenderer(int blockSize, int borderSize) : m_blockSize(blockSize), m_borderSize(borderSize) { } BlockRenderer(Stream *stream, InstanceManager *manager) { @@ -39,7 +39,7 @@ public: ref createWorkResult() const { return new ImageBlock(Bitmap::ESpectrumAlphaWeight, - Vector2i(m_blockSize), + Vector2i(m_blockSize), m_sensor->getFilm()->getReconstructionFilter()); } @@ -60,7 +60,7 @@ public: m_scene->initializeBidirectional(); } - void process(const WorkUnit *workUnit, WorkResult *workResult, + void process(const WorkUnit *workUnit, WorkResult *workResult, const bool &stop) { const RectangularWorkUnit *rect = static_cast(workUnit); ImageBlock *block = static_cast(workResult); @@ -72,7 +72,7 @@ public: block->setOffset(rect->getOffset()); block->setSize(rect->getSize()); m_hilbertCurve.initialize(TVector2(rect->getSize())); - m_integrator->renderBlock(m_scene, m_sensor, m_sampler, + m_integrator->renderBlock(m_scene, m_sensor, m_sampler, block, stop, m_hilbertCurve.getPoints()); #ifdef MTS_DEBUG_FP @@ -112,7 +112,7 @@ BlockedRenderProcess::~BlockedRenderProcess() { if (m_progress) delete m_progress; } - + ref BlockedRenderProcess::createWorkProcessor() const { return new BlockRenderer(m_blockSize, m_borderSize); } @@ -158,7 +158,7 @@ void BlockedRenderProcess::bindResource(const std::string &name, int id) { } BlockedImageProcess::bindResource(name, id); } - + MTS_IMPLEMENT_CLASS(BlockedRenderProcess, false, BlockedImageProcess) MTS_IMPLEMENT_CLASS_S(BlockRenderer, false, WorkProcessor) MTS_NAMESPACE_END diff --git a/src/librender/renderqueue.cpp b/src/librender/renderqueue.cpp index ff88cf2d..31eb2263 100644 --- a/src/librender/renderqueue.cpp +++ b/src/librender/renderqueue.cpp @@ -27,7 +27,7 @@ RenderQueue::RenderQueue() { m_cond = new ConditionVariable(m_mutex); m_timer = new Timer(); } - + RenderQueue::~RenderQueue() { for (size_t i=0; idecRef(); @@ -53,7 +53,7 @@ void RenderQueue::unregisterListener(RenderListener *listener) { } listener->decRef(); } - + void RenderQueue::flush() { LockGuard lock(m_mutex); std::map::iterator it = m_jobs.begin(); @@ -79,10 +79,10 @@ void RenderQueue::removeJob(RenderJob *job, bool cancelled) { } signalFinishJob(job, cancelled); } - + void RenderQueue::waitLeft(size_t njobs) const { UniqueLock lock(m_mutex); - while (m_jobs.size() > njobs) + while (m_jobs.size() > njobs) m_cond->wait(); lock.unlock(); join(); diff --git a/src/librender/sampler.cpp b/src/librender/sampler.cpp index 1bca2faa..5ef134c6 100644 --- a/src/librender/sampler.cpp +++ b/src/librender/sampler.cpp @@ -20,17 +20,17 @@ MTS_NAMESPACE_BEGIN -Sampler::Sampler(const Properties &props) +Sampler::Sampler(const Properties &props) : ConfigurableObject(props), m_sampleCount(0), m_sampleIndex(0) { } -Sampler::Sampler(Stream *stream, InstanceManager *manager) +Sampler::Sampler(Stream *stream, InstanceManager *manager) : ConfigurableObject(stream, manager) { m_sampleCount = stream->readSize(); size_t n1DArrays = stream->readSize(); - for (size_t i=0; ireadSize()); size_t n2DArrays = stream->readSize(); - for (size_t i=0; ireadSize()); } diff --git a/src/librender/scene.cpp b/src/librender/scene.cpp index 371f76b8..eae1ca87 100644 --- a/src/librender/scene.cpp +++ b/src/librender/scene.cpp @@ -29,7 +29,7 @@ MTS_NAMESPACE_BEGIN // Constructors, destructor and serialization-related code // =========================================================================== -Scene::Scene() +Scene::Scene() : NetworkedObject(Properties()), m_blockSize(DEFAULT_BLOCKSIZE) { m_kdtree = new ShapeKDTree(); m_sourceFile = new fs::path(); @@ -39,30 +39,30 @@ Scene::Scene() Scene::Scene(const Properties &props) : NetworkedObject(props), m_blockSize(DEFAULT_BLOCKSIZE) { m_kdtree = new ShapeKDTree(); - /* kd-tree construction: Enable primitive clipping? Generally leads to a + /* kd-tree construction: Enable primitive clipping? Generally leads to a significant improvement of the resulting tree. */ if (props.hasProperty("kdClip")) m_kdtree->setClip(props.getBoolean("kdClip")); - /* kd-tree construction: Relative cost of a triangle intersection operation + /* kd-tree construction: Relative cost of a triangle intersection operation in the surface area heuristic. */ if (props.hasProperty("kdIntersectionCost")) m_kdtree->setQueryCost(props.getFloat("kdIntersectionCost")); - /* kd-tree construction: Relative cost of a kd-tree traversal operation + /* kd-tree construction: Relative cost of a kd-tree traversal operation in the surface area heuristic. */ if (props.hasProperty("kdTraversalCost")) m_kdtree->setTraversalCost(props.getFloat("kdTraversalCost")); /* kd-tree construction: Bonus factor for cutting away regions of empty space */ if (props.hasProperty("kdEmptySpaceBonus")) m_kdtree->setEmptySpaceBonus(props.getFloat("kdEmptySpaceBonus")); - /* kd-tree construction: A kd-tree node containing this many or fewer + /* kd-tree construction: A kd-tree node containing this many or fewer primitives will not be split */ if (props.hasProperty("kdStopPrims")) m_kdtree->setStopPrims(props.getInteger("kdStopPrims")); /* kd-tree construction: Maximum tree depth */ if (props.hasProperty("kdMaxDepth")) m_kdtree->setMaxDepth(props.getInteger("kdMaxDepth")); - /* kd-tree construction: Specify the number of primitives, at which the - builder will switch from (approximate) Min-Max binning to the accurate + /* kd-tree construction: Specify the number of primitives, at which the + builder will switch from (approximate) Min-Max binning to the accurate O(n log n) SAH-based optimization method. */ if (props.hasProperty("kdExactPrimitiveThreshold")) m_kdtree->setExactPrimitiveThreshold(props.getInteger("kdExactPrimitiveThreshold")); @@ -103,7 +103,7 @@ Scene::Scene(Scene *scene) : NetworkedObject(Properties()) { m_degenerateEmitters = scene->m_degenerateEmitters; } -Scene::Scene(Stream *stream, InstanceManager *manager) +Scene::Scene(Stream *stream, InstanceManager *manager) : NetworkedObject(stream, manager) { m_kdtree = new ShapeKDTree(); m_kdtree->setQueryCost(stream->readFloat()); @@ -146,11 +146,11 @@ Scene::Scene(Stream *stream, InstanceManager *manager) m_emitters.push_back(static_cast(manager->getInstance(stream))); count = stream->readSize(); m_media.reserve(count); - for (size_t i=0; i(manager->getInstance(stream))); count = stream->readSize(); m_ssIntegrators.reserve(count); - for (size_t i=0; i(manager->getInstance(stream))); count = stream->readSize(); m_objects.reserve(count); @@ -191,40 +191,40 @@ void Scene::serialize(Stream *stream, InstanceManager *manager) const { stream->writeString(m_destinationFile->string()); stream->writeSize(m_shapes.size()); - for (size_t i=0; iserialize(stream, m_shapes[i].get()); - + stream->writeSize(m_specialShapes.size()); - for (size_t i=0; iserialize(stream, m_specialShapes[i].get()); stream->writeSize(m_meshes.size()); - for (size_t i=0; iserialize(stream, m_meshes[i]); - + stream->writeSize(m_sensors.size()); - for (size_t i=0; iserialize(stream, m_sensors[i].get()); stream->writeSize(m_emitters.size()); - for (size_t i=0; iserialize(stream, m_emitters[i].get()); stream->writeSize(m_media.size()); for (ref_vector::const_iterator it = m_media.begin(); it != m_media.end(); ++it) manager->serialize(stream, it->get()); - + stream->writeSize(m_ssIntegrators.size()); for (ref_vector::const_iterator it = m_ssIntegrators.begin(); it != m_ssIntegrators.end(); ++it) manager->serialize(stream, it->get()); - + stream->writeSize(m_objects.size()); for (ref_vector::const_iterator it = m_objects.begin(); it != m_objects.end(); ++it) manager->serialize(stream, it->get()); - + stream->writeSize(m_netObjects.size()); for (ref_vector::const_iterator it = m_netObjects.begin(); it != m_netObjects.end(); ++it) @@ -257,13 +257,13 @@ void Scene::removeSensor(Sensor *sensor) { if (!sensor) return; ref oldSensor = sensor; - m_sensors.erase(std::remove(m_sensors.begin(), + m_sensors.erase(std::remove(m_sensors.begin(), m_sensors.end(), oldSensor)); } void Scene::addSensor(Sensor *sensor) { ref newSensor = sensor; - if (!newSensor || std::find(m_sensors.begin(), + if (!newSensor || std::find(m_sensors.begin(), m_sensors.end(), newSensor) != m_sensors.end()) return; m_sensors.push_back(newSensor); @@ -300,7 +300,7 @@ void Scene::configure() { props.setFloat("nearClip", distance / 100); props.setFloat("focusDistance", distance + extents.z/2); - props.setTransform("toWorld", Transform::translate(Vector(center.x, + props.setTransform("toWorld", Transform::translate(Vector(center.x, center.y, aabb.min.z - distance))); } Sensor *sensor = static_cast (PluginManager::getInstance()-> @@ -320,7 +320,7 @@ void Scene::initialize() { /* Expand all geometry */ ref_vector temp; temp.reserve(m_shapes.size()); - + m_shapes.ensureUnique(); m_shapes.swap(temp); size_t primitiveCount = 0, effPrimitiveCount = 0; @@ -354,7 +354,7 @@ void Scene::initialize() { if (m_emitters.size() == 0) { Log(EWarn, "No emitters found -- adding sun & sky."); /* This is not a particularly realistic sky -- it extends below the - horizon and uses an enlarged sun :). This is done to get better + horizon and uses an enlarged sun :). This is done to get better results for arbitrary input (and with a path tracer). */ Properties skyProps("sunsky"); @@ -369,7 +369,7 @@ void Scene::initialize() { } /* Calculate a discrete PDF to importance sample emitters */ - for (ref_vector::iterator it = m_emitters.begin(); + for (ref_vector::iterator it = m_emitters.begin(); it != m_emitters.end(); ++it) m_emitterPDF.append(it->get()->getSamplingWeight()); @@ -409,7 +409,7 @@ void Scene::initializeBidirectional() { m_aabb = aabb; } -bool Scene::preprocess(RenderQueue *queue, const RenderJob *job, +bool Scene::preprocess(RenderQueue *queue, const RenderJob *job, int sceneResID, int sensorResID, int samplerResID) { initialize(); @@ -421,8 +421,8 @@ bool Scene::preprocess(RenderQueue *queue, const RenderJob *job, /* Pre-process step for all sub-surface integrators */ for (ref_vector::iterator it = m_ssIntegrators.begin(); - it != m_ssIntegrators.end(); ++it) - if (!(*it)->preprocess(this, queue, job, + it != m_ssIntegrators.end(); ++it) + if (!(*it)->preprocess(this, queue, job, sceneResID, sensorResID, samplerResID)) return false; @@ -432,13 +432,13 @@ bool Scene::preprocess(RenderQueue *queue, const RenderJob *job, bool Scene::render(RenderQueue *queue, const RenderJob *job, int sceneResID, int sensorResID, int samplerResID) { m_sensor->getFilm()->clear(); - return m_integrator->render(this, queue, job, sceneResID, + return m_integrator->render(this, queue, job, sceneResID, sensorResID, samplerResID); } void Scene::cancel() { for (ref_vector::iterator it = m_ssIntegrators.begin(); - it != m_ssIntegrators.end(); ++it) + it != m_ssIntegrators.end(); ++it) (*it)->cancel(); m_integrator->cancel(); } @@ -446,7 +446,7 @@ void Scene::cancel() { void Scene::flush() { m_sensor->getFilm()->develop(); } - + void Scene::setDestinationFile(const fs::path &name) { *m_destinationFile = name; } @@ -457,7 +457,7 @@ void Scene::setSourceFile(const fs::path &name) { void Scene::postprocess(RenderQueue *queue, const RenderJob *job, int sceneResID, int sensorResID, int samplerResID) { - m_integrator->postprocess(this, queue, job, sceneResID, + m_integrator->postprocess(this, queue, job, sceneResID, sensorResID, samplerResID); m_sensor->getFilm()->develop(); } @@ -466,7 +466,7 @@ void Scene::addChild(const std::string &name, ConfigurableObject *child) { const Class *cClass = child->getClass(); if (cClass->derivesFrom(MTS_CLASS(NetworkedObject)) && - !cClass->derivesFrom(MTS_CLASS(Integrator))) + !cClass->derivesFrom(MTS_CLASS(Integrator))) m_netObjects.push_back(static_cast(child)); if (cClass->derivesFrom(MTS_CLASS(Sensor))) { @@ -526,11 +526,11 @@ void Scene::addChild(const std::string &name, ConfigurableObject *child) { addChild(shapes[i]); for (ref_vector::iterator it = refObjects.begin(); - it != refObjects.end(); ++it) + it != refObjects.end(); ++it) addChild(it->get()); for (ref_vector::iterator it = scene->getMedia().begin(); - it != scene->getMedia().end(); ++it) + it != scene->getMedia().end(); ++it) addChild(it->get()); if (scene->getIntegrator() != NULL) @@ -553,9 +553,9 @@ void Scene::addShape(Shape *shape) { addShape(element); } while (true); } else { - if (shape->isSensor() && !m_sensors.contains(shape->getSensor())) + if (shape->isSensor() && !m_sensors.contains(shape->getSensor())) m_sensors.push_back(shape->getSensor()); - if (shape->isEmitter()) + if (shape->isEmitter()) m_emitters.push_back(shape->getEmitter()); if (shape->hasSubsurface()) { m_netObjects.push_back(shape->getSubsurface()); @@ -571,7 +571,7 @@ void Scene::addShape(Shape *shape) { if (iMedium != NULL) m_media.push_back(iMedium); - if (shape->getClass()->derivesFrom(MTS_CLASS(TriMesh))) + if (shape->getClass()->derivesFrom(MTS_CLASS(TriMesh))) m_meshes.push_back(static_cast(shape)); m_kdtree->addShape(shape); @@ -631,7 +631,7 @@ Spectrum Scene::evalTransmittance(const Point &p1, bool p1OnSurface, const Point transmittance *= medium->evalTransmittance( Ray(ray, 0, std::min(its.t, remaining)), sampler); - if (!surface || transmittance.isZero()) + if (!surface || transmittance.isZero()) break; const BSDF *bsdf = its.getBSDF(); @@ -676,7 +676,7 @@ bool Scene::rayIntersectAll(const Ray &ray) const { Float mint = ray.mint; if (mint == Epsilon) - mint *= std::max(std::max(std::max(std::abs(ray.o.x), + mint *= std::max(std::max(std::max(std::abs(ray.o.x), std::abs(ray.o.y)), std::abs(ray.o.z)), Epsilon); for (size_t i=0; ievalTransmittance( Ray(ray, 0, std::min(its.t, remaining)), sampler); - if (!surface || transmittance.isZero()) + if (!surface || transmittance.isZero()) break; const BSDF *bsdf = its.getBSDF(); @@ -814,7 +814,7 @@ Spectrum Scene::evalTransmittanceAll(const Point &p1, bool p1OnSurface, const Po // Emission and direct illumination sampling // =========================================================================== -Spectrum Scene::sampleEmitterDirect(DirectSamplingRecord &dRec, +Spectrum Scene::sampleEmitterDirect(DirectSamplingRecord &dRec, const Point2 &_sample, bool testVisibility) const { Point2 sample(_sample); @@ -826,7 +826,7 @@ Spectrum Scene::sampleEmitterDirect(DirectSamplingRecord &dRec, if (dRec.pdf != 0) { if (testVisibility) { - Ray ray(dRec.ref, dRec.d, Epsilon, + Ray ray(dRec.ref, dRec.d, Epsilon, dRec.dist*(1-ShadowEpsilon), dRec.time); if (m_kdtree->rayIntersect(ray)) return Spectrum(0.0f); @@ -852,7 +852,7 @@ Spectrum Scene::sampleAttenuatedEmitterDirect(DirectSamplingRecord &dRec, if (dRec.pdf != 0) { value *= evalTransmittance(dRec.ref, false, - dRec.p, emitter->isOnSurface(), dRec.time, medium, + dRec.p, emitter->isOnSurface(), dRec.time, medium, interactions, sampler) / emPdf; dRec.object = emitter; dRec.pdf *= emPdf; @@ -886,13 +886,13 @@ Spectrum Scene::sampleAttenuatedEmitterDirect(DirectSamplingRecord &dRec, } } -Spectrum Scene::sampleSensorDirect(DirectSamplingRecord &dRec, +Spectrum Scene::sampleSensorDirect(DirectSamplingRecord &dRec, const Point2 &sample, bool testVisibility) const { Spectrum value = m_sensor->sampleDirect(dRec, sample); if (dRec.pdf != 0) { if (testVisibility) { - Ray ray(dRec.ref, dRec.d, Epsilon, + Ray ray(dRec.ref, dRec.d, Epsilon, dRec.dist*(1-ShadowEpsilon), dRec.time); if (m_kdtree->rayIntersect(ray)) return Spectrum(0.0f); @@ -904,7 +904,7 @@ Spectrum Scene::sampleSensorDirect(DirectSamplingRecord &dRec, } } -Spectrum Scene::sampleAttenuatedSensorDirect(DirectSamplingRecord &dRec, +Spectrum Scene::sampleAttenuatedSensorDirect(DirectSamplingRecord &dRec, const Medium *medium, int &interactions, const Point2 &sample, Sampler *sampler) const { Spectrum value = m_sensor->sampleDirect(dRec, sample); diff --git a/src/librender/scenehandler.cpp b/src/librender/scenehandler.cpp index bb82a207..30017839 100644 --- a/src/librender/scenehandler.cpp +++ b/src/librender/scenehandler.cpp @@ -101,7 +101,7 @@ SceneHandler::SceneHandler(const SAXParser *parser, m_tags["alias"] = TagEntry(EAlias, (Class *) NULL); - XMLTransService::Codes failReason; + XMLTransService::Codes failReason; m_transcoder = XMLPlatformUtils::fgTransService->makeNewTranscoderFor( "UTF-8", failReason, TRANSCODE_BLOCKSIZE); } @@ -125,14 +125,14 @@ void SceneHandler::clear() { std::string SceneHandler::transcode(const XMLCh * input) const { XMLSize_t charsToBeConsumed = XMLString::stringLen(input); - char output[TRANSCODE_BLOCKSIZE + 4]; + char output[TRANSCODE_BLOCKSIZE + 4]; XMLSize_t totalCharsConsumed = 0; std::string result; while (totalCharsConsumed < charsToBeConsumed) { XMLSize_t charsConsumed = 0; XMLSize_t charsProduced = m_transcoder->transcodeTo(input, - std::min((XMLSize_t) 2048, charsToBeConsumed - totalCharsConsumed), + std::min((XMLSize_t) 2048, charsToBeConsumed - totalCharsConsumed), (XMLByte *) output, TRANSCODE_BLOCKSIZE, charsConsumed, XMLTranscoder::UnRep_RepChar); @@ -211,7 +211,7 @@ void SceneHandler::startElement(const XMLCh* const xmlName, switch (tag.first) { case EScene: { std::string versionString = context.attributes["version"]; - if (versionString == "") + if (versionString == "") throw VersionException(formatString("The requested scene cannot be loaded, since it " "is missing version information! Since Mitsuba 0.3.0, it is " "mandatory that scene XML files specify the version of Mitsuba " @@ -288,7 +288,7 @@ void SceneHandler::endElement(const XMLCh* const xmlName) { int64_t i = strtoll(context.attributes["value"].c_str(), &end_ptr, 10); #endif if (*end_ptr != '\0') - XMLLog(EError, "Invalid integer value specified (in <%s>)", + XMLLog(EError, "Invalid integer value specified (in <%s>)", context.attributes["name"].c_str()); context.parent->properties.setLong(context.attributes["name"], i); } @@ -377,11 +377,11 @@ void SceneHandler::endElement(const XMLCh* const xmlName) { break; case EScale: { - bool hasXYZ = + bool hasXYZ = context.attributes["x"] != "" || context.attributes["y"] != "" || context.attributes["z"] != ""; - bool hasValue = + bool hasValue = context.attributes["value"] != ""; Float x=0, y=0, z=0; @@ -463,7 +463,7 @@ void SceneHandler::endElement(const XMLCh* const xmlName) { } else if (tokens.size() == 1) { value[0] = value[1] = value[2] = parseFloat(name, tokens[0]); } else if (tokens.size() == 3) { - for (int i=0; i<3; i++) + for (int i=0; i<3; i++) value[i] = parseFloat(name, tokens[i]); } else { value[0] = value[1] = value[2] = 0; // avoid warning @@ -492,7 +492,7 @@ void SceneHandler::endElement(const XMLCh* const xmlName) { } else if (tokens.size() == 1) { value[0] = value[1] = value[2] = parseFloat(name, tokens[0]); } else if (tokens.size() == 3) { - for (int i=0; i<3; i++) + for (int i=0; i<3; i++) value[i] = parseFloat(name, tokens[i]); } else { value[0] = value[1] = value[2] = 0; // avoid warning @@ -550,7 +550,7 @@ void SceneHandler::endElement(const XMLCh* const xmlName) { /* Wavelength -> Value mapping */ for (size_t i=0; i tokens2 = tokenize(tokens[i], ":"); - if (tokens2.size() != 2) + if (tokens2.size() != 2) XMLLog(EError, "Invalid spectrum->value mapping specified"); Float wavelength = parseFloat(name, tokens2[0]); Float value = parseFloat(name, tokens2[1]); @@ -565,7 +565,7 @@ void SceneHandler::endElement(const XMLCh* const xmlName) { } else { if (tokens.size() != SPECTRUM_SAMPLES) XMLLog(EError, "Invalid spectrum value specified (incorrect length)"); - for (int i=0; iproperties.setSpectrum(context.attributes["name"], Spectrum(value)); @@ -655,7 +655,7 @@ void SceneHandler::endElement(const XMLCh* const xmlName) { } /* Don't configure a scene object if it is from an included file */ - if (name != "include" && (!m_isIncludedFile || !object->getClass()->derivesFrom(MTS_CLASS(Scene)))) + if (name != "include" && (!m_isIncludedFile || !object->getClass()->derivesFrom(MTS_CLASS(Scene)))) object->configure(); if (object->getClass()->derivesFrom(MTS_CLASS(Texture))) @@ -721,7 +721,7 @@ ref SceneHandler::loadScene(const fs::path &filename, const ParameterMap parser->setDoNamespaces(true); parser->setDocumentHandler(handler); parser->setErrorHandler(handler); - + parser->parse(filename.c_str()); ref scene = handler->getScene(); @@ -751,7 +751,7 @@ ref SceneHandler::loadSceneFromString(const std::string &content, const P XMLCh *inputName = XMLString::transcode(""); - MemBufInputSource input((const XMLByte *) content.c_str(), + MemBufInputSource input((const XMLByte *) content.c_str(), content.length(), inputName); parser->parse(input); ref scene = handler->getScene(); diff --git a/src/librender/sensor.cpp b/src/librender/sensor.cpp index b13f8fae..2d8fcbb1 100644 --- a/src/librender/sensor.cpp +++ b/src/librender/sensor.cpp @@ -67,7 +67,7 @@ Spectrum Sensor::eval(const Intersection &its, const Vector &d, bool Sensor::getSamplePosition(const PositionSamplingRecord &pRec, const DirectionSamplingRecord &dRec, Point2 &samplePosition) const { Log(EError, "%s::getSamplePosition(const PositionSamplingRecord &, " - "const DirectionSamplingRecord &, Point2&) is not implemented!", + "const DirectionSamplingRecord &, Point2&) is not implemented!", getClass()->getName().c_str()); return false; } @@ -89,31 +89,31 @@ void Sensor::configure() { m_sampler->configure(); } - m_aspect = m_film->getSize().x / + m_aspect = m_film->getSize().x / (Float) m_film->getSize().y; - + m_resolution = Vector2(m_film->getCropSize()); m_invResolution = Vector2( (Float) 1 / m_resolution.x, (Float) 1 / m_resolution.y); } -Spectrum Sensor::sampleRayDifferential(RayDifferential &ray, +Spectrum Sensor::sampleRayDifferential(RayDifferential &ray, const Point2 &samplePosition, const Point2 &apertureSample, Float timeSample) const { - Spectrum result = sampleRay(ray, samplePosition, + Spectrum result = sampleRay(ray, samplePosition, apertureSample, timeSample); /* Sample a ray for X+1 */ Ray tempRay; - sampleRay(tempRay, samplePosition + Vector2(1, 0), + sampleRay(tempRay, samplePosition + Vector2(1, 0), apertureSample, timeSample); ray.rxOrigin = tempRay.o; ray.rxDirection = tempRay.d; /* Sample a ray for Y+1 */ - sampleRay(tempRay, samplePosition + Vector2(0, 1), + sampleRay(tempRay, samplePosition + Vector2(0, 1), apertureSample, timeSample); ray.ryOrigin = tempRay.o; ray.ryDirection = tempRay.d; @@ -128,7 +128,7 @@ Float Sensor::pdfTime(const Ray &ray, EMeasure measure) const { if (m_shutterOpenTime == 0 && measure == EDiscrete) return 1.0f; - else if (m_shutterOpenTime > 0 && measure == ELength) + else if (m_shutterOpenTime > 0 && measure == ELength) return 1.0f / m_shutterOpenTime; else return 0.0f; @@ -205,7 +205,7 @@ void ProjectiveCamera::setInverseViewTransform(const Transform &trafo) { m_properties.setTransform("toWorld", trafo, false); } -PerspectiveCamera::PerspectiveCamera(const Properties &props) +PerspectiveCamera::PerspectiveCamera(const Properties &props) : ProjectiveCamera(props), m_xfov(0.0f) { props.markQueried("fov"); props.markQueried("fovAxis"); @@ -232,7 +232,7 @@ void PerspectiveCamera::configure() { if (m_properties.hasProperty("fov")) { Float fov = m_properties.getFloat("fov"); - std::string fovAxis = + std::string fovAxis = boost::to_lower_copy(m_properties.getString("fovAxis", "x")); if (fovAxis == "smaller") @@ -240,7 +240,7 @@ void PerspectiveCamera::configure() { else if (fovAxis == "larger") fovAxis = m_aspect > 1 ? "x" : "y"; - if (fovAxis == "x") + if (fovAxis == "x") setXFov(fov); else if (fovAxis == "y") setYFov(fov); diff --git a/src/librender/shader.cpp b/src/librender/shader.cpp index 4c3a560f..a77d536d 100644 --- a/src/librender/shader.cpp +++ b/src/librender/shader.cpp @@ -19,7 +19,7 @@ #include MTS_NAMESPACE_BEGIN - + Shader::Shader(Renderer *renderer, EShaderType type) : m_type(type), m_flags(0) { } @@ -29,9 +29,9 @@ Shader::~Shader() { /* These do nothing by default */ void Shader::putDependencies(std::vector &deps) { } -void Shader::bind(GPUProgram *program, const std::vector ¶meterIDs, +void Shader::bind(GPUProgram *program, const std::vector ¶meterIDs, int &textureUnitOffset) const { } -void Shader::resolve(const GPUProgram *program, const std::string &evalName, +void Shader::resolve(const GPUProgram *program, const std::string &evalName, std::vector ¶meterIDs) const { } void Shader::unbind() const { } void Shader::cleanup(Renderer *renderer) { } diff --git a/src/librender/shape.cpp b/src/librender/shape.cpp index ecc9506f..8a865e70 100644 --- a/src/librender/shape.cpp +++ b/src/librender/shape.cpp @@ -27,10 +27,10 @@ MTS_NAMESPACE_BEGIN -Shape::Shape(const Properties &props) +Shape::Shape(const Properties &props) : ConfigurableObject(props) { } -Shape::Shape(Stream *stream, InstanceManager *manager) +Shape::Shape(Stream *stream, InstanceManager *manager) : ConfigurableObject(stream, manager) { m_bsdf = static_cast(manager->getInstance(stream)); m_subsurface = static_cast(manager->getInstance(stream)); @@ -72,7 +72,7 @@ void Shape::configure() { bool Shape::isCompound() const { return false; } - + std::string Shape::getName() const { return "Unnamed"; } @@ -80,14 +80,14 @@ std::string Shape::getName() const { Shape *Shape::getElement(int i) { return NULL; } - + AABB Shape::getClippedAABB(const AABB &box) const { AABB result = getAABB(); result.clip(box); return result; } -void Shape::sampleDirect(DirectSamplingRecord &dRec, +void Shape::sampleDirect(DirectSamplingRecord &dRec, const Point2 &sample) const { /* Piggyback on sampleArea() */ samplePosition(dRec, sample); @@ -181,24 +181,24 @@ void Shape::serialize(Stream *stream, InstanceManager *manager) const { manager->serialize(stream, m_interiorMedium.get()); manager->serialize(stream, m_exteriorMedium.get()); } - + Float Shape::getSurfaceArea() const { NotImplementedError("getSurfaceArea"); } -bool Shape::rayIntersect(const Ray &ray, Float mint, +bool Shape::rayIntersect(const Ray &ray, Float mint, Float maxt, Float &t, void *temp) const { NotImplementedError("rayIntersect"); } -bool Shape::rayIntersect(const Ray &ray, Float mint, +bool Shape::rayIntersect(const Ray &ray, Float mint, Float maxt) const { NotImplementedError("rayIntersect"); } -void Shape::fillIntersectionRecord(const Ray &ray, +void Shape::fillIntersectionRecord(const Ray &ray, const void *temp, Intersection &its) const { NotImplementedError("fillIntersectionRecord"); } -void Shape::getCurvature(const Intersection &its, Float &H, Float &K, +void Shape::getCurvature(const Intersection &its, Float &H, Float &K, bool shadingFrame) const { Vector dndu, dndv; getNormalDerivative(its, dndu, dndv, shadingFrame); /* Compute the coefficients of the first and second fundamental form */ - Float + Float E = dot(its.dpdu, its.dpdu), F = dot(its.dpdu, its.dpdv), G = dot(its.dpdv, its.dpdv), diff --git a/src/librender/skdtree.cpp b/src/librender/skdtree.cpp index 236b72c0..aacd2a85 100644 --- a/src/librender/skdtree.cpp +++ b/src/librender/skdtree.cpp @@ -54,7 +54,7 @@ void ShapeKDTree::addShape(const Shape *shape) { // Triangle meshes are expanded into individual primitives, // which are visible to the tree construction code. Generic // primitives are only handled by their AABBs - m_shapeMap.push_back((SizeType) + m_shapeMap.push_back((SizeType) static_cast(shape)->getTriangleCount()); m_triangleFlag.push_back(true); } else { @@ -70,7 +70,7 @@ void ShapeKDTree::build() { m_shapeMap[i] += m_shapeMap[i-1]; SAHKDTree3D::buildInternal(); - + #if !defined(MTS_KD_CONSERVE_MEMORY) ref timer = new Timer(); SizeType primCount = getPrimitiveCount(); @@ -111,15 +111,15 @@ void ShapeKDTree::build() { bool ShapeKDTree::rayIntersect(const Ray &ray, Intersection &its) const { uint8_t temp[MTS_KD_INTERSECTION_TEMP]; - its.t = std::numeric_limits::infinity(); + its.t = std::numeric_limits::infinity(); Float mint, maxt; ++raysTraced; if (m_aabb.rayIntersect(ray, mint, maxt)) { /* Use an adaptive ray epsilon */ Float rayMinT = ray.mint; - if (rayMinT == Epsilon) - rayMinT *= std::max(std::max(std::max(std::abs(ray.o.x), + if (rayMinT == Epsilon) + rayMinT *= std::max(std::max(std::max(std::abs(ray.o.x), std::abs(ray.o.y)), std::abs(ray.o.z)), Epsilon); if (rayMinT > mint) mint = rayMinT; @@ -135,11 +135,11 @@ bool ShapeKDTree::rayIntersect(const Ray &ray, Intersection &its) const { return false; } -bool ShapeKDTree::rayIntersect(const Ray &ray, Float &t, ConstShapePtr &shape, +bool ShapeKDTree::rayIntersect(const Ray &ray, Float &t, ConstShapePtr &shape, Normal &n, Point2 &uv) const { uint8_t temp[MTS_KD_INTERSECTION_TEMP]; Float mint, maxt; - + t = std::numeric_limits::infinity(); ++shadowRaysTraced; @@ -147,7 +147,7 @@ bool ShapeKDTree::rayIntersect(const Ray &ray, Float &t, ConstShapePtr &shape, /* Use an adaptive ray epsilon */ Float rayMinT = ray.mint; if (rayMinT == Epsilon) - rayMinT *= std::max(std::max(std::abs(ray.o.x), + rayMinT *= std::max(std::max(std::abs(ray.o.x), std::abs(ray.o.y)), std::abs(ray.o.z)); if (rayMinT > mint) mint = rayMinT; @@ -182,7 +182,7 @@ bool ShapeKDTree::rayIntersect(const Ray &ray, Float &t, ConstShapePtr &shape, /// Uh oh... -- much unnecessary work is done here Intersection its; its.t = t; - shape->fillIntersectionRecord(ray, + shape->fillIntersectionRecord(ray, reinterpret_cast(temp) + 8, its); n = its.geoFrame.n; uv = its.uv; @@ -206,14 +206,14 @@ bool ShapeKDTree::rayIntersect(const Ray &ray) const { /* Use an adaptive ray epsilon */ Float rayMinT = ray.mint; if (rayMinT == Epsilon) - rayMinT *= std::max(std::max(std::abs(ray.o.x), + rayMinT *= std::max(std::max(std::abs(ray.o.x), std::abs(ray.o.y)), std::abs(ray.o.z)); if (rayMinT > mint) mint = rayMinT; if (ray.maxt < maxt) maxt = ray.maxt; - if (EXPECT_TAKEN(maxt > mint)) - if (rayIntersectHavran(ray, mint, maxt, t, NULL)) + if (EXPECT_TAKEN(maxt > mint)) + if (rayIntersectHavran(ray, mint, maxt, t, NULL)) return true; } return false; @@ -232,7 +232,7 @@ struct CoherentKDStackEntry { static StatsCounter coherentPackets("General", "Coherent ray packets"); static StatsCounter incoherentPackets("General", "Incoherent ray packets"); -void ShapeKDTree::rayIntersectPacket(const RayPacket4 &packet, +void ShapeKDTree::rayIntersectPacket(const RayPacket4 &packet, const RayInterval4 &rayInterval, Intersection4 &its, void *temp) const { CoherentKDStackEntry MM_ALIGN16 stack[MTS_KD_MAXDEPTH]; RayInterval4 MM_ALIGN16 interval; @@ -266,7 +266,7 @@ void ShapeKDTree::rayIntersectPacket(const RayPacket4 &packet, packet.dRcp[axis].ps); const __m128 - startsAfterSplit = _mm_or_ps(masked.ps, + startsAfterSplit = _mm_or_ps(masked.ps, _mm_cmplt_ps(t, interval.mint.ps)), endsBeforeSplit = _mm_or_ps(masked.ps, _mm_cmpgt_ps(t, interval.maxt.ps)); @@ -280,14 +280,14 @@ void ShapeKDTree::rayIntersectPacket(const RayPacket4 &packet, continue; } - if (EXPECT_TAKEN(_mm_movemask_ps(endsBeforeSplit) == 15)) + if (EXPECT_TAKEN(_mm_movemask_ps(endsBeforeSplit) == 15)) continue; stack[stackIndex].node = currNode->getSibling(); stack[stackIndex].interval.maxt = interval.maxt; stack[stackIndex].interval.mint.ps = _mm_max_ps(t, interval.mint.ps); interval.maxt.ps = _mm_min_ps(t, interval.maxt.ps); - masked.ps = _mm_or_ps(masked.ps, + masked.ps = _mm_or_ps(masked.ps, _mm_cmpgt_ps(interval.mint.ps, interval.maxt.ps)); stackIndex++; } @@ -297,16 +297,16 @@ void ShapeKDTree::rayIntersectPacket(const RayPacket4 &packet, const IndexType primEnd = currNode->getPrimEnd(); if (EXPECT_NOT_TAKEN(primStart != primEnd)) { - SSEVector - searchStart(_mm_max_ps(rayInterval.mint.ps, + SSEVector + searchStart(_mm_max_ps(rayInterval.mint.ps, _mm_mul_ps(interval.mint.ps, SSEConstants::om_eps.ps))), - searchEnd(_mm_min_ps(rayInterval.maxt.ps, + searchEnd(_mm_min_ps(rayInterval.maxt.ps, _mm_mul_ps(interval.maxt.ps, SSEConstants::op_eps.ps))); for (IndexType entry=primStart; entry != primEnd; entry++) { const TriAccel &kdTri = m_triAccel[m_indices[entry]]; if (EXPECT_TAKEN(kdTri.k != KNoTriangleFlag)) { - itsFound.ps = _mm_or_ps(itsFound.ps, + itsFound.ps = _mm_or_ps(itsFound.ps, mitsuba::rayIntersectPacket(kdTri, packet, searchStart.ps, searchEnd.ps, masked.ps, its)); } else { const Shape *shape = m_shapes[kdTri.shapeIndex]; @@ -322,7 +322,7 @@ void ShapeKDTree::rayIntersectPacket(const RayPacket4 &packet, } Float t; - if (shape->rayIntersect(ray, searchStart.f[i], searchEnd.f[i], t, + if (shape->rayIntersect(ray, searchStart.f[i], searchEnd.f[i], t, reinterpret_cast(temp) + i * MTS_KD_INTERSECTION_TEMP + 8)) { its.t.f[i] = t; @@ -344,12 +344,12 @@ void ShapeKDTree::rayIntersectPacket(const RayPacket4 &packet, /* Pop from the stack */ currNode = stack[stackIndex].node; interval = stack[stackIndex].interval; - masked.ps = _mm_or_ps(itsFound.ps, + masked.ps = _mm_or_ps(itsFound.ps, _mm_cmpgt_ps(interval.mint.ps, interval.maxt.ps)); } } - -void ShapeKDTree::rayIntersectPacketIncoherent(const RayPacket4 &packet, + +void ShapeKDTree::rayIntersectPacketIncoherent(const RayPacket4 &packet, const RayInterval4 &rayInterval, Intersection4 &its4, void *temp) const { ++incoherentPackets; diff --git a/src/librender/subsurface.cpp b/src/librender/subsurface.cpp index f7d074f5..982a15e8 100644 --- a/src/librender/subsurface.cpp +++ b/src/librender/subsurface.cpp @@ -35,7 +35,7 @@ Subsurface::Subsurface(Stream *stream, InstanceManager *manager) : } Subsurface::~Subsurface() { } - + void Subsurface::cancel() { } void Subsurface::setParent(ConfigurableObject *parent) { diff --git a/src/librender/texture.cpp b/src/librender/texture.cpp index 044668ca..66797fb9 100644 --- a/src/librender/texture.cpp +++ b/src/librender/texture.cpp @@ -33,10 +33,10 @@ Texture::Texture(const Properties &props) : ConfigurableObject(props) { } -Texture::Texture(Stream *stream, InstanceManager *manager) +Texture::Texture(Stream *stream, InstanceManager *manager) : ConfigurableObject(stream, manager) { } - + Vector3i Texture::getResolution() const { return Vector3i(0); } @@ -74,7 +74,7 @@ Texture2D::Texture2D(const Properties &props) : Texture(props) { } } -Texture2D::Texture2D(Stream *stream, InstanceManager *manager) +Texture2D::Texture2D(Stream *stream, InstanceManager *manager) : Texture(stream, manager) { m_uvOffset = Point2(stream); m_uvScale = Vector2(stream); @@ -92,7 +92,7 @@ void Texture2D::serialize(Stream *stream, InstanceManager *manager) const { Spectrum Texture2D::eval(const Intersection &its, bool filter) const { Point2 uv = Point2(its.uv.x * m_uvScale.x, its.uv.y * m_uvScale.y) + m_uvOffset; if (its.hasUVPartials && filter) { - return eval(uv, + return eval(uv, Vector2(its.dudx * m_uvScale.x, its.dvdx * m_uvScale.y), Vector2(its.dudy * m_uvScale.x, its.dvdy * m_uvScale.y)); } else { diff --git a/src/librender/track.cpp b/src/librender/track.cpp index 1867aa38..e438d0f4 100644 --- a/src/librender/track.cpp +++ b/src/librender/track.cpp @@ -9,7 +9,7 @@ AnimatedTransform::AnimatedTransform(Stream *stream) { m_transform = Transform(stream); } else { for (size_t i=0; ireadUInt(); AbstractAnimationTrack *track = NULL; switch (type) { @@ -47,7 +47,7 @@ void AnimatedTransform::addTrack(AbstractAnimationTrack *track) { } AABB1 AnimatedTransform::getTimeBounds() const { - if (m_tracks.size() == 0) + if (m_tracks.size() == 0) #if !defined(__clang__) return AABB1(0.0f, 0.0f); #else @@ -96,7 +96,7 @@ AABB AnimatedTransform::getTranslationBounds() const { case AbstractAnimationTrack::ETranslationY: case AbstractAnimationTrack::ETranslationZ: { int idx = absTrack->getType() - AbstractAnimationTrack::ETranslationX; - const FloatTrack *track = + const FloatTrack *track = static_cast(absTrack); for (size_t j=0; jgetSize(); ++j) { Float value = track->getValue(j); @@ -107,9 +107,9 @@ AABB AnimatedTransform::getTranslationBounds() const { break; case AbstractAnimationTrack::ETranslationXYZ: { - const VectorTrack *track = + const VectorTrack *track = static_cast(absTrack); - for (size_t j=0; jgetSize(); ++j) + for (size_t j=0; jgetSize(); ++j) aabb.expandBy(Point(track->getValue(j))); } break; @@ -173,28 +173,28 @@ void AnimatedTransform::TransformFunctor::operator()(const Float &t, Transform & case AbstractAnimationTrack::ETranslationX: translation.x = static_cast(track)->eval(t); break; - case AbstractAnimationTrack::ETranslationY: + case AbstractAnimationTrack::ETranslationY: translation.y = static_cast(track)->eval(t); break; - case AbstractAnimationTrack::ETranslationZ: + case AbstractAnimationTrack::ETranslationZ: translation.z = static_cast(track)->eval(t); break; - case AbstractAnimationTrack::ETranslationXYZ: + case AbstractAnimationTrack::ETranslationXYZ: translation = static_cast(track)->eval(t); break; case AbstractAnimationTrack::EScaleX: scale.x = static_cast(track)->eval(t); break; - case AbstractAnimationTrack::EScaleY: + case AbstractAnimationTrack::EScaleY: scale.y = static_cast(track)->eval(t); break; - case AbstractAnimationTrack::EScaleZ: + case AbstractAnimationTrack::EScaleZ: scale.z = static_cast(track)->eval(t); break; - case AbstractAnimationTrack::EScaleXYZ: + case AbstractAnimationTrack::EScaleXYZ: scale = static_cast(track)->eval(t); break; - case AbstractAnimationTrack::ERotationQuat: + case AbstractAnimationTrack::ERotationQuat: rotation = static_cast(track)->eval(t); break; default: @@ -203,7 +203,7 @@ void AnimatedTransform::TransformFunctor::operator()(const Float &t, Transform & } } - trafo = Transform::translate(translation) * + trafo = Transform::translate(translation) * rotation.toTransform() * Transform::scale(scale); } diff --git a/src/librender/trimesh.cpp b/src/librender/trimesh.cpp index 71fcf9ca..a32bd3ac 100644 --- a/src/librender/trimesh.cpp +++ b/src/librender/trimesh.cpp @@ -35,8 +35,8 @@ MTS_NAMESPACE_BEGIN -TriMesh::TriMesh(const std::string &name, size_t triangleCount, - size_t vertexCount, bool hasNormals, bool hasTexcoords, +TriMesh::TriMesh(const std::string &name, size_t triangleCount, + size_t vertexCount, bool hasNormals, bool hasTexcoords, bool hasVertexColors, bool flipNormals, bool faceNormals) : Shape(Properties()), m_triangleCount(triangleCount), m_vertexCount(vertexCount), m_flipNormals(flipNormals), @@ -52,14 +52,14 @@ TriMesh::TriMesh(const std::string &name, size_t triangleCount, m_mutex = new Mutex(); } -TriMesh::TriMesh(const Properties &props) +TriMesh::TriMesh(const Properties &props) : Shape(props), m_triangles(NULL), m_positions(NULL), m_normals(NULL), m_texcoords(NULL), m_tangents(NULL), m_colors(NULL) { /* By default, any existing normals will be used for rendering. If no normals are found, Mitsuba will - automatically generate smooth vertex normals. + automatically generate smooth vertex normals. Setting the 'faceNormals' parameter instead forces the use of face normals, which will result in a faceted appearance. @@ -68,15 +68,15 @@ TriMesh::TriMesh(const Properties &props) /* Causes all normals to be flipped */ m_flipNormals = props.getBoolean("flipNormals", false); - + m_triangles = NULL; m_surfaceArea = m_invSurfaceArea = -1; m_mutex = new Mutex(); } TriMesh::TriMesh(Stream *stream, int index) - : Shape(Properties()), m_triangles(NULL), - m_positions(NULL), m_normals(NULL), m_texcoords(NULL), + : Shape(Properties()), m_triangles(NULL), + m_positions(NULL), m_normals(NULL), m_texcoords(NULL), m_tangents(NULL), m_colors(NULL) { m_mutex = new Mutex(); @@ -95,7 +95,7 @@ enum ETriMeshFlags { EDoublePrecision = 0x2000 }; -TriMesh::TriMesh(Stream *stream, InstanceManager *manager) +TriMesh::TriMesh(Stream *stream, InstanceManager *manager) : Shape(stream, manager), m_tangents(NULL) { m_name = stream->readString(); m_aabb = AABB(stream); @@ -105,14 +105,14 @@ TriMesh::TriMesh(Stream *stream, InstanceManager *manager) m_triangleCount = stream->readSize(); m_positions = new Point[m_vertexCount]; - stream->readFloatArray(reinterpret_cast(m_positions), + stream->readFloatArray(reinterpret_cast(m_positions), m_vertexCount * sizeof(Point)/sizeof(Float)); m_faceNormals = flags & EFaceNormals; if (flags & EHasNormals) { m_normals = new Normal[m_vertexCount]; - stream->readFloatArray(reinterpret_cast(m_normals), + stream->readFloatArray(reinterpret_cast(m_normals), m_vertexCount * sizeof(Normal)/sizeof(Float)); } else { m_normals = NULL; @@ -120,7 +120,7 @@ TriMesh::TriMesh(Stream *stream, InstanceManager *manager) if (flags & EHasTexcoords) { m_texcoords = new Point2[m_vertexCount]; - stream->readFloatArray(reinterpret_cast(m_texcoords), + stream->readFloatArray(reinterpret_cast(m_texcoords), m_vertexCount * sizeof(Point2)/sizeof(Float)); } else { m_texcoords = NULL; @@ -128,14 +128,14 @@ TriMesh::TriMesh(Stream *stream, InstanceManager *manager) if (flags & EHasColors) { m_colors = new Color3[m_vertexCount]; - stream->readFloatArray(reinterpret_cast(m_colors), + stream->readFloatArray(reinterpret_cast(m_colors), m_vertexCount * sizeof(Color3)/sizeof(Float)); } else { m_colors = NULL; } m_triangles = new Triangle[m_triangleCount]; - stream->readUIntArray(reinterpret_cast(m_triangles), + stream->readUIntArray(reinterpret_cast(m_triangles), m_triangleCount * sizeof(Triangle)/sizeof(uint32_t)); m_flipNormals = false; m_surfaceArea = m_invSurfaceArea = -1; @@ -143,7 +143,7 @@ TriMesh::TriMesh(Stream *stream, InstanceManager *manager) configure(); } -static void readHelper(Stream *stream, bool fileDoublePrecision, +static void readHelper(Stream *stream, bool fileDoublePrecision, Float *target, size_t count, size_t nelems) { #if defined(SINGLE_PRECISION) bool hostDoublePrecision = false; @@ -175,7 +175,7 @@ static void readHelper(Stream *stream, bool fileDoublePrecision, void TriMesh::loadCompressed(Stream *_stream, int index) { ref stream = _stream; - if (stream->getByteOrder() != Stream::ELittleEndian) + if (stream->getByteOrder() != Stream::ELittleEndian) Log(EError, "Tried to unserialize a shape from a stream, " "which was not previously set to little endian byte order!"); @@ -243,7 +243,7 @@ void TriMesh::loadCompressed(Stream *_stream, int index) { if (flags & EHasNormals) { m_normals = new Normal[m_vertexCount]; - readHelper(stream, fileDoublePrecision, + readHelper(stream, fileDoublePrecision, reinterpret_cast(m_normals), m_vertexCount, sizeof(Normal)/sizeof(Float)); } else { @@ -267,7 +267,7 @@ void TriMesh::loadCompressed(Stream *_stream, int index) { if (flags & EHasColors) { m_colors = new Color3[m_vertexCount]; - readHelper(stream, fileDoublePrecision, + readHelper(stream, fileDoublePrecision, reinterpret_cast(m_colors), m_vertexCount, sizeof(Color3)/sizeof(Float)); } else { @@ -275,7 +275,7 @@ void TriMesh::loadCompressed(Stream *_stream, int index) { } m_triangles = new Triangle[m_triangleCount]; - stream->readUIntArray(reinterpret_cast(m_triangles), + stream->readUIntArray(reinterpret_cast(m_triangles), m_triangleCount * sizeof(Triangle)/sizeof(uint32_t)); m_surfaceArea = m_invSurfaceArea = -1; @@ -296,7 +296,7 @@ TriMesh::~TriMesh() { if (m_triangles) delete[] m_triangles; } - + std::string TriMesh::getName() const { return m_name; } @@ -313,9 +313,9 @@ void TriMesh::configure() { Shape::configure(); if (!m_aabb.isValid()) { - /* Most shape objects should compute the AABB while + /* Most shape objects should compute the AABB while loading the geometry -- but let's be on the safe side */ - for (size_t i=0; igetType() & BSDF::EAnisotropic) || m_bsdf->usesRayDifferentials())) computeUVTangents(); - /* For manifold exploration: always compute UV tangents when a glossy material + /* For manifold exploration: always compute UV tangents when a glossy material is involved. TODO: find a way to avoid this expense (compute on demand?) */ if (hasBSDF() && (m_bsdf->getType() & BSDF::EGlossy)) computeUVTangents(); @@ -346,7 +346,7 @@ void TriMesh::prepareSamplingTable() { if (m_surfaceArea < 0) { /* Generate a PDF for sampling wrt. area */ m_areaDistr.reserve(m_triangleCount); - for (size_t i=0; i(this)->prepareSamplingTable(); @@ -380,7 +380,7 @@ struct Vertex { }; /// For using vertices as keys in an associative structure -struct vertex_key_order : public +struct vertex_key_order : public std::binary_function { static int compare(const Vertex &v1, const Vertex &v2) { if (v1.p.x < v2.p.x) return -1; @@ -430,8 +430,8 @@ void TriMesh::rebuildTopology(Float maxAngle) { m_tangents = NULL; } - Log(EInfo, "Rebuilding the topology of \"%s\" (" SIZE_T_FMT - " triangles, " SIZE_T_FMT " vertices, max. angle = %f)", + Log(EInfo, "Rebuilding the topology of \"%s\" (" SIZE_T_FMT + " triangles, " SIZE_T_FMT " vertices, max. angle = %f)", m_name.c_str(), m_triangleCount, m_vertexCount, maxAngle); ref timer = new Timer(); @@ -510,7 +510,7 @@ void TriMesh::rebuildTopology(Float maxAngle) { it = end; } - for (size_t i=0; igetMilliseconds(), m_vertexCount); configure(); @@ -559,7 +559,7 @@ void TriMesh::computeNormals() { } else { if (m_normals) { if (m_flipNormals) { - for (size_t i=0; i 0) - Log(EWarn, "\"%s\": Unable to generate %i vertex normals", + Log(EWarn, "\"%s\": Unable to generate %i vertex normals", m_name.c_str(), invalidNormals); } @@ -659,7 +659,7 @@ void TriMesh::computeUVTangents() { Float determinant = dUV1.x * dUV2.y - dUV1.y * dUV2.x; if (determinant == 0) { - /* The user-specified parameterization is degenerate. Pick + /* The user-specified parameterization is degenerate. Pick arbitrary tangents that are perpendicular to the geometric normal */ coordinateSystem(n/length, m_tangents[i].dpdu, m_tangents[i].dpdv); } else { @@ -684,7 +684,7 @@ void TriMesh::getNormalDerivative(const Intersection &its, const Triangle &tri = m_triangles[its.primIndex]; uint32_t idx0 = tri.idx[0], - idx1 = tri.idx[1], + idx1 = tri.idx[1], idx2 = tri.idx[2]; const Point @@ -711,7 +711,7 @@ void TriMesh::getNormalDerivative(const Intersection &its, v = (-a12 * b1 + a11 * b2) * invDet, w = 1 - u - v; - const Normal + const Normal &n0 = m_normals[idx0], &n1 = m_normals[idx1], &n2 = m_normals[idx2]; @@ -719,7 +719,7 @@ void TriMesh::getNormalDerivative(const Intersection &its, /* Now compute the derivative of "normalize(u*n1 + v*n2 + (1-u-v)*n0)" with respect to [u, v] in the local triangle parameterization. - Since d/du [f(u)/|f(u)|] = [d/du f(u)]/|f(u)| + Since d/du [f(u)/|f(u)|] = [d/du f(u)]/|f(u)| - f(u)/|f(u)|^3 , this results in */ @@ -730,7 +730,7 @@ void TriMesh::getNormalDerivative(const Intersection &its, dndv = (n2 - n0) * il; dndv -= N * dot(N, dndv); if (m_tangents) { - /* Compute derivatives with respect to a specified texture + /* Compute derivatives with respect to a specified texture UV parameterization. */ const Point2 &uv0 = m_texcoords[idx0], @@ -775,18 +775,18 @@ void TriMesh::serialize(Stream *stream, InstanceManager *manager) const { stream->writeSize(m_vertexCount); stream->writeSize(m_triangleCount); - stream->writeFloatArray(reinterpret_cast(m_positions), + stream->writeFloatArray(reinterpret_cast(m_positions), m_vertexCount * sizeof(Point)/sizeof(Float)); if (m_normals) - stream->writeFloatArray(reinterpret_cast(m_normals), + stream->writeFloatArray(reinterpret_cast(m_normals), m_vertexCount * sizeof(Normal)/sizeof(Float)); if (m_texcoords) - stream->writeFloatArray(reinterpret_cast(m_texcoords), + stream->writeFloatArray(reinterpret_cast(m_texcoords), m_vertexCount * sizeof(Point2)/sizeof(Float)); if (m_colors) - stream->writeFloatArray(reinterpret_cast(m_colors), + stream->writeFloatArray(reinterpret_cast(m_colors), m_vertexCount * sizeof(Color3)/sizeof(Float)); - stream->writeUIntArray(reinterpret_cast(m_triangles), + stream->writeUIntArray(reinterpret_cast(m_triangles), m_triangleCount * sizeof(Triangle)/sizeof(uint32_t)); } @@ -794,7 +794,7 @@ void TriMesh::writeOBJ(const fs::path &path) const { fs::ofstream os(path); os << "o " << m_name << endl; for (size_t i=0; i stream = _stream; - if (stream->getByteOrder() != Stream::ELittleEndian) + if (stream->getByteOrder() != Stream::ELittleEndian) Log(EError, "Tried to unserialize a shape from a stream, " "which was not previously set to little endian byte order!"); @@ -868,18 +868,18 @@ void TriMesh::serialize(Stream *_stream) const { stream->writeSize(m_vertexCount); stream->writeSize(m_triangleCount); - stream->writeFloatArray(reinterpret_cast(m_positions), + stream->writeFloatArray(reinterpret_cast(m_positions), m_vertexCount * sizeof(Point)/sizeof(Float)); if (m_normals) - stream->writeFloatArray(reinterpret_cast(m_normals), + stream->writeFloatArray(reinterpret_cast(m_normals), m_vertexCount * sizeof(Normal)/sizeof(Float)); if (m_texcoords) - stream->writeFloatArray(reinterpret_cast(m_texcoords), + stream->writeFloatArray(reinterpret_cast(m_texcoords), m_vertexCount * sizeof(Point2)/sizeof(Float)); if (m_colors) - stream->writeFloatArray(reinterpret_cast(m_colors), + stream->writeFloatArray(reinterpret_cast(m_colors), m_vertexCount * sizeof(Color3)/sizeof(Float)); - stream->writeUIntArray(reinterpret_cast(m_triangles), + stream->writeUIntArray(reinterpret_cast(m_triangles), m_triangleCount * sizeof(Triangle)/sizeof(uint32_t)); } @@ -905,7 +905,7 @@ std::string TriMesh::toString() const { << " surfaceArea = " << m_surfaceArea << "," << endl << " aabb = " << m_aabb.toString() << "," << endl << " bsdf = " << indent(m_bsdf.toString()) << "," << endl; - if (isMediumTransition()) + if (isMediumTransition()) oss << " interiorMedium = " << indent(m_interiorMedium.toString()) << "," << endl << " exteriorMedium = " << indent(m_exteriorMedium.toString()) << "," << endl; oss << " subsurface = " << indent(m_subsurface.toString()) << "," << endl diff --git a/src/librender/vpl.cpp b/src/librender/vpl.cpp index 1a0f5d26..def62936 100644 --- a/src/librender/vpl.cpp +++ b/src/librender/vpl.cpp @@ -99,7 +99,7 @@ size_t generateVPLs(const Scene *scene, Random *random, PositionSamplingRecord pRec(time); DirectionSamplingRecord dRec; - Spectrum weight = scene->sampleEmitterPosition(pRec, + Spectrum weight = scene->sampleEmitterPosition(pRec, sampler->next2D()); size_t start = vpls.size(); @@ -168,16 +168,16 @@ size_t generateVPLs(const Scene *scene, Random *random, if (BSDF::getMeasure(bRec.sampledType) == ESolidAngle) appendVPL(scene, random, vpl, prune, vpls); - + weight *= bsdfVal; - + Vector wi = -ray.d, wo = its.toWorld(bRec.wo); ray = Ray(its.p, wo, 0.0f); /* Prevent light leaks due to the use of shading normals -- [Veach, p. 158] */ Float wiDotGeoN = dot(its.geoFrame.n, wi), woDotGeoN = dot(its.geoFrame.n, wo); - if (wiDotGeoN * Frame::cosTheta(bRec.wi) <= 0 || + if (wiDotGeoN * Frame::cosTheta(bRec.wi) <= 0 || woDotGeoN * Frame::cosTheta(bRec.wo) <= 0) break; diff --git a/src/medium/heterogeneous.cpp b/src/medium/heterogeneous.cpp index 324e4b19..bc5e6fd0 100644 --- a/src/medium/heterogeneous.cpp +++ b/src/medium/heterogeneous.cpp @@ -24,7 +24,7 @@ MTS_NAMESPACE_BEGIN /** - * \brief When the following line is uncommented, the medium implementation + * \brief When the following line is uncommented, the medium implementation * stops integrating density when it is determined that the segment has a * throughput of less than 'Epsilon' (see \c mitsuba/core/constants.h) */ @@ -34,13 +34,13 @@ MTS_NAMESPACE_BEGIN // #define HETVOL_STATISTICS 1 #if defined(HETVOL_STATISTICS) -static StatsCounter avgNewtonIterations("Heterogeneous volume", +static StatsCounter avgNewtonIterations("Heterogeneous volume", "Avg. # of Newton-Bisection iterations", EAverage); -static StatsCounter avgRayMarchingStepsTransmittance("Heterogeneous volume", +static StatsCounter avgRayMarchingStepsTransmittance("Heterogeneous volume", "Avg. # of ray marching steps (transmittance)", EAverage); -static StatsCounter avgRayMarchingStepsSampling("Heterogeneous volume", +static StatsCounter avgRayMarchingStepsSampling("Heterogeneous volume", "Avg. # of ray marching steps (sampling)", EAverage); -static StatsCounter earlyExits("Heterogeneous volume", +static StatsCounter earlyExits("Heterogeneous volume", "Number of early exits", EPercentage); #endif @@ -51,12 +51,12 @@ static StatsCounter earlyExits("Heterogeneous volume", * Specifies the sampling method that is used to generate * scattering events within the medium. * \begin{enumerate}[(i)] - * \item \code{simpson}: Sampling is done by inverting a + * \item \code{simpson}: Sampling is done by inverting a * deterministic quadrature rule based on composite * Simpson integration over small ray segments. Benefits * from the use of good sample generators (e.g. \pluginref{ldsampler}). - * \item \code{woodcock}: Generate samples using - * Woodcock tracking. This is usually faster and + * \item \code{woodcock}: Generate samples using + * Woodcock tracking. This is usually faster and * always unbiased, but has the disadvantages of not benefiting * from good sample generators and not providing * information that is required by bidirectional @@ -66,14 +66,14 @@ static StatsCounter earlyExits("Heterogeneous volume", * } * \parameter{density}{\Volume}{ * Volumetric data source that supplies the medium densities - * (in inverse scene units) + * (in inverse scene units) * } * \parameter{albedo}{\Volume}{ - * Volumetric data source that supplies the + * Volumetric data source that supplies the * single-scattering albedo * } * \parameter{orientation}{\Volume}{ - * Optional: volumetric data source that supplies the + * Optional: volumetric data source that supplies the * local particle orientations throughout the medium * } * \parameter{scale}{\Float}{ @@ -88,7 +88,7 @@ static StatsCounter earlyExits("Heterogeneous volume", * \pluginref{isotropic}. * } * } - * + * * \renderings{ * \medrendering{40}{medium_heterogeneous_density_40} * \medrendering{200}{medium_heterogeneous_density_200} @@ -96,27 +96,27 @@ static StatsCounter earlyExits("Heterogeneous volume", * \vspace{-2mm} * \caption{Renderings of an index-matched medium using different scale factors (\lstref{hetvolume})} * } - * - * This plugin provides a flexible heterogeneous medium implementation, which - * acquires its data from nested \code{volume} instances. These can be - * constant, use a procedural function, or fetch data from disk, e.g. using a + * + * This plugin provides a flexible heterogeneous medium implementation, which + * acquires its data from nested \code{volume} instances. These can be + * constant, use a procedural function, or fetch data from disk, e.g. using a * memory-mapped density grid. See \secref{volumes} for details on volume data * sources. * * Instead of allowing separate volumes to be provided for the scattering * and absorption parameters \code{sigmaS} and \code{sigmaA} (as is done in - * \pluginref{homogeneous}), this class instead takes the approach of + * \pluginref{homogeneous}), this class instead takes the approach of * enforcing a spectrally uniform value of \code{sigmaT}, which must be * provided using a nested scalar-valued volume named \code{density}. * - * Another nested spectrum-valued \code{albedo} volume must also be provided, which is + * Another nested spectrum-valued \code{albedo} volume must also be provided, which is * used to compute the scattering coefficient $\sigma_s$ using the expression - * $\sigma_s = \code{scale} * \code{density} * \code{albedo}$ (i.e. 'albedo' contains the + * $\sigma_s = \code{scale} * \code{density} * \code{albedo}$ (i.e. 'albedo' contains the * single-scattering albedo of the medium. - * + * * Optionally, one can also provide an vector-valued \code{orientation} volume, * which contains local particle orientation that will be passed to - * scattering models that support this, such as a the Micro-flake or + * scattering models that support this, such as a the Micro-flake or * Kajiya-Kay phase functions. * * \vspace{4mm} @@ -148,12 +148,12 @@ static StatsCounter earlyExits("Heterogeneous volume", * * - * + * * * * * * * @@ -80,7 +80,7 @@ public: "its parent shape"); } - IrradianceMeter(Stream *stream, InstanceManager *manager) + IrradianceMeter(Stream *stream, InstanceManager *manager) : Sensor(stream, manager) { m_shape = static_cast(manager->getInstance(stream)); configure(); @@ -142,7 +142,7 @@ public: return m_shape->pdfPosition(pRec); } - Spectrum sampleDirection(DirectionSamplingRecord &dRec, + Spectrum sampleDirection(DirectionSamplingRecord &dRec, PositionSamplingRecord &pRec, const Point2 &sample, const Point2 *extra) const { Vector local = Warp::squareToCosineHemisphere(sample); @@ -172,11 +172,11 @@ public: return INV_PI * dp; } - Spectrum sampleDirect(DirectSamplingRecord &dRec, + Spectrum sampleDirect(DirectSamplingRecord &dRec, const Point2 &sample) const { m_shape->sampleDirect(dRec, sample); - /* Check that the sensor and reference position are oriented correctly + /* Check that the sensor and reference position are oriented correctly with respect to each other. Note that the >= 0 check for 'refN' is intentional -- those sampling requests that specify a reference point within a medium or on a transmissive surface @@ -191,7 +191,7 @@ public: } Float pdfDirect(const DirectSamplingRecord &dRec) const { - /* Check that the sensor and reference position are oriented correctly + /* Check that the sensor and reference position are oriented correctly with respect to each other. */ if (dot(dRec.d, dRec.refN) >= 0 && dot(dRec.d, dRec.n) < 0) { return m_shape->pdfDirect(dRec); diff --git a/src/sensors/orthographic.cpp b/src/sensors/orthographic.cpp index 256a7fef..37ea76d4 100644 --- a/src/sensors/orthographic.cpp +++ b/src/sensors/orthographic.cpp @@ -38,7 +38,7 @@ MTS_NAMESPACE_BEGIN * } * \parameter{nearClip, farClip}{\Float}{ * Distance to the near/far clip - * planes.\default{\code{near\code}-\code{Clip=1e-2} (i.e. + * planes.\default{\code{near\code}-\code{Clip=1e-2} (i.e. * \code{0.01}) and {\code{farClip=1e4} (i.e. \code{10000})}} * } * } @@ -50,9 +50,9 @@ MTS_NAMESPACE_BEGIN * * This plugin implements a simple orthographic camera, i.e. a sensor * based on an orthographic projection without any form of perspective. - * It can be thought of as a planar sensor that measures the radiance + * It can be thought of as a planar sensor that measures the radiance * along its normal direction. By default, this is the region $[-1, 1]^2$ inside - * the XY-plane facing along the positive Z direction. Transformed versions + * the XY-plane facing along the positive Z direction. Transformed versions * can be instantiated e.g. as follows: * * \begin{xml} @@ -61,7 +61,7 @@ MTS_NAMESPACE_BEGIN * * * - * * * @@ -75,7 +75,7 @@ public: m_type |= EDeltaDirection | EOrthographicCamera | EPositionSampleMapsToPixels; } - OrthographicCamera(Stream *stream, InstanceManager *manager) + OrthographicCamera(Stream *stream, InstanceManager *manager) : ProjectiveCamera(stream, manager) { configure(); } @@ -104,7 +104,7 @@ public: * 4+5. Translate and scale the coordinates once more to account * for a cropping window (if there is any) */ - m_cameraToSample = + m_cameraToSample = Transform::scale(Vector(1.0f / relSize.x, 1.0f / relSize.y, 1.0f)) * Transform::translate(Vector(-relOffset.x, -relOffset.y, 0.0f)) * Transform::scale(Vector(-0.5f, -0.5f*m_aspect, 1.0f)) @@ -114,9 +114,9 @@ public: m_sampleToCamera = m_cameraToSample.inverse(); /* Position differentials on the near plane */ - m_dx = m_sampleToCamera(Point(m_invResolution.x, 0.0f, 0.0f)) + m_dx = m_sampleToCamera(Point(m_invResolution.x, 0.0f, 0.0f)) - m_sampleToCamera(Point(0.0f)); - m_dy = m_sampleToCamera(Point(0.0f, m_invResolution.y, 0.0f)) + m_dy = m_sampleToCamera(Point(0.0f, m_invResolution.y, 0.0f)) - m_sampleToCamera(Point(0.0f)); /* Clip-space transformation for OpenGL */ @@ -139,7 +139,7 @@ public: ray.time = sampleTime(timeSample); const Transform &trafo = m_worldTransform->eval(ray.time); - /* Compute the corresponding position on the + /* Compute the corresponding position on the near plane (in local camera space) */ Point nearP = m_sampleToCamera.transformAffine(Point( pixelSample.x * m_invResolution.x, @@ -159,7 +159,7 @@ public: ray.time = sampleTime(timeSample); const Transform &trafo = m_worldTransform->eval(ray.time); - /* Compute the corresponding position on the + /* Compute the corresponding position on the near plane (in local camera space) */ Point nearP = m_sampleToCamera.transformAffine(Point( pixelSample.x * m_invResolution.x, @@ -211,7 +211,7 @@ public: return (pRec.measure == EArea) ? m_invSurfaceArea : 0.0f; } - Spectrum sampleDirection(DirectionSamplingRecord &dRec, + Spectrum sampleDirection(DirectionSamplingRecord &dRec, PositionSamplingRecord &pRec, const Point2 &sample, const Point2 *extra) const { @@ -243,7 +243,7 @@ public: Point sample = m_cameraToSample.transformAffine(localP); - if (sample.x < 0 || sample.x > 1 || sample.y < 0 || + if (sample.x < 0 || sample.x > 1 || sample.y < 0 || sample.y > 1 || sample.z < 0 || sample.z > 1) { dRec.pdf = 0.0f; return Spectrum(0.0f); @@ -280,7 +280,7 @@ public: return true; } - Transform getProjectionTransform(const Point2 &apertureSample, + Transform getProjectionTransform(const Point2 &apertureSample, const Point2 &aaSample) const { Point2 offset( 2.0f * m_invResolution.x * (aaSample.x-0.5f), diff --git a/src/sensors/perspective.cpp b/src/sensors/perspective.cpp index b43bf6c8..6a521467 100644 --- a/src/sensors/perspective.cpp +++ b/src/sensors/perspective.cpp @@ -39,24 +39,24 @@ MTS_NAMESPACE_BEGIN * \parameter{fov}{\Float}{ * An alternative to \code{focalLength}: * denotes the camera's field of view in degrees---must be - * between 0 and 180, excluding the extremes. + * between 0 and 180, excluding the extremes. * } * \parameter{fovAxis}{\String}{ * When the parameter \code{fov} is given (and only then), - * this parameter further specifies the image axis, to + * this parameter further specifies the image axis, to * which it applies. * \begin{enumerate}[(i)] - * \item \code{\textbf{x}}: \code{fov} maps to the + * \item \code{\textbf{x}}: \code{fov} maps to the * \code{x}-axis in screen space. - * \item \code{\textbf{y}}: \code{fov} maps to the + * \item \code{\textbf{y}}: \code{fov} maps to the * \code{y}-axis in screen space. * \item \code{\textbf{diagonal}}: \code{fov} * maps to the screen diagonal. * \item \code{\textbf{smaller}}: \code{fov} - * maps to the smaller dimension + * maps to the smaller dimension * (e.g. \code{x} when \code{width}<\code{height}) * \item \code{\textbf{larger}}: \code{fov} - * maps to the larger dimension + * maps to the larger dimension * (e.g. \code{y} when \code{width}<\code{height}) * \end{enumerate} * The default is \code{\textbf{x}}. @@ -68,24 +68,24 @@ MTS_NAMESPACE_BEGIN * } * \parameter{nearClip, farClip}{\Float}{ * Distance to the near/far clip - * planes.\default{\code{near\code}-\code{Clip=1e-2} (i.e. + * planes.\default{\code{near\code}-\code{Clip=1e-2} (i.e. * \code{0.01}) and {\code{farClip=1e4} (i.e. \code{10000})}} * } * } * \renderings{ - * \rendering{The material test ball viewed through a perspective pinhole + * \rendering{The material test ball viewed through a perspective pinhole * camera. Everything is in sharp focus.}{sensor_perspective} * \medrendering{A rendering of the Cornell box}{sensor_perspective_2} * } * - * This plugin implements a simple idealizied perspective camera model, which + * This plugin implements a simple idealizied perspective camera model, which * has an infinitely small aperture. This creates an infinite depth of field, * i.e. no optical blurring occurs. The camera is can be specified to move during * an exposure, hence temporal blur is still possible. * * By default, the camera's field of view is specified using a 35mm film - * equivalent focal length, which is first converted into a diagonal field - * of view and subsequently applied to the camera. This assumes that + * equivalent focal length, which is first converted into a diagonal field + * of view and subsequently applied to the camera. This assumes that * the film's aspect ratio matches that of 35mm film (1.5:1), though the * parameter still behaves intuitively when this is not the case. * Alternatively, it is also possible to specify a field of view in degrees @@ -109,16 +109,16 @@ public: PerspectiveCameraImpl(const Properties &props) : PerspectiveCamera(props) { /* This sensor is the result of a limiting process where the aperture - radius tends to zero. However, it still has all the cosine + radius tends to zero. However, it still has all the cosine foreshortening terms caused by the aperture, hence the flag "EOnSurface" */ m_type |= EDeltaPosition | EPerspectiveCamera | EOnSurface | EDirectionSampleMapsToPixels; - if (props.getTransform("toWorld", Transform()).hasScale()) + if (props.getTransform("toWorld", Transform()).hasScale()) Log(EError, "Scale factors in the camera-to-world " "transformation are not allowed!"); } - PerspectiveCameraImpl(Stream *stream, InstanceManager *manager) + PerspectiveCameraImpl(Stream *stream, InstanceManager *manager) : PerspectiveCamera(stream, manager) { configure(); } @@ -147,7 +147,7 @@ public: * 4+5. Translate and scale the coordinates once more to account * for a cropping window (if there is any) */ - m_cameraToSample = + m_cameraToSample = Transform::scale(Vector(1.0f / relSize.x, 1.0f / relSize.y, 1.0f)) * Transform::translate(Vector(-relOffset.x, -relOffset.y, 0.0f)) * Transform::scale(Vector(-0.5f, -0.5f*m_aspect, 1.0f)) @@ -157,12 +157,12 @@ public: m_sampleToCamera = m_cameraToSample.inverse(); /* Position differentials on the near plane */ - m_dx = m_sampleToCamera(Point(m_invResolution.x, 0.0f, 0.0f)) + m_dx = m_sampleToCamera(Point(m_invResolution.x, 0.0f, 0.0f)) - m_sampleToCamera(Point(0.0f)); - m_dy = m_sampleToCamera(Point(0.0f, m_invResolution.y, 0.0f)) + m_dy = m_sampleToCamera(Point(0.0f, m_invResolution.y, 0.0f)) - m_sampleToCamera(Point(0.0f)); - /* Precompute some data for importance(). Please + /* Precompute some data for importance(). Please look at that function for further details */ Point min(m_sampleToCamera(Point(0, 0, 0))), max(m_sampleToCamera(Point(1, 1, 0))); @@ -180,11 +180,11 @@ public: } /** - * \brief Compute the directional sensor response function + * \brief Compute the directional sensor response function * of the camera multiplied with the cosine foreshortening * factor associated with the image plane * - * \param d + * \param d * A normalized direction vector from the aperture position to the * reference point in question (all in local camera space) */ @@ -196,14 +196,14 @@ public: A = (2 * tan(0.5 * xfov in radians))^2 / aspect - Since we allow crop regions, the actual visible area is + Since we allow crop regions, the actual visible area is potentially reduced: A' = A * (cropX / filmX) * (cropY / filmY) Perspective transformations of such aligned rectangles produce - an equivalent scaled (but otherwise undistorted) rectangle - in screen space. This means that a strategy, which uniformly + an equivalent scaled (but otherwise undistorted) rectangle + in screen space. This means that a strategy, which uniformly generates samples in screen space has an associated area density of 1/A' on this rectangle. @@ -215,7 +215,7 @@ public: where theta is the angle that the unit direction vector from the origin to P makes with the rectangle. Since - distance(P, origin)^2 = Px^2 + Py^2 + 1 + distance(P, origin)^2 = Px^2 + Py^2 + 1 and @@ -240,7 +240,7 @@ public: if (!m_imageRect.contains(p)) return 0.0f; - return m_normalization * invCosTheta + return m_normalization * invCosTheta * invCosTheta * invCosTheta; } @@ -248,7 +248,7 @@ public: const Point2 &otherSample, Float timeSample) const { ray.time = sampleTime(timeSample); - /* Compute the corresponding position on the + /* Compute the corresponding position on the near plane (in local camera space) */ Point nearP = m_sampleToCamera(Point( pixelSample.x * m_invResolution.x, @@ -272,7 +272,7 @@ public: const Point2 &otherSample, Float timeSample) const { ray.time = sampleTime(timeSample); - /* Compute the corresponding position on the + /* Compute the corresponding position on the near plane (in local camera space) */ Point nearP = m_sampleToCamera(Point( pixelSample.x * m_invResolution.x, @@ -315,7 +315,7 @@ public: return (pRec.measure == EDiscrete) ? 1.0f : 0.0f; } - Spectrum sampleDirection(DirectionSamplingRecord &dRec, + Spectrum sampleDirection(DirectionSamplingRecord &dRec, PositionSamplingRecord &pRec, const Point2 &sample, const Point2 *extra) const { const Transform &trafo = m_worldTransform->eval(pRec.time); @@ -331,7 +331,7 @@ public: pRec.uv = Point2(samplePos.x * m_resolution.x, samplePos.y * m_resolution.y); - /* Compute the corresponding position on the + /* Compute the corresponding position on the near plane (in local camera space) */ Point nearP = m_sampleToCamera(samplePos); @@ -374,11 +374,11 @@ public: Point screenSample = m_cameraToSample(local); if (screenSample.x < 0 || screenSample.x > 1 || - screenSample.y < 0 || screenSample.y > 1) + screenSample.y < 0 || screenSample.y > 1) return false; samplePosition = Point2( - screenSample.x * m_resolution.x, + screenSample.x * m_resolution.x, screenSample.y * m_resolution.y); return true; @@ -427,7 +427,7 @@ public: return (dRec.measure == EDiscrete) ? 1.0f : 0.0f; } - Transform getProjectionTransform(const Point2 &apertureSample, + Transform getProjectionTransform(const Point2 &apertureSample, const Point2 &aaSample) const { Float right = std::tan(m_xfov * M_PI/360) * m_nearClip, left = -right; Float top = right / m_aspect, bottom = -top; @@ -436,8 +436,8 @@ public: (right-left)/m_film->getSize().x * (aaSample.x-0.5f), (top-bottom)/m_film->getSize().y * (aaSample.y-0.5f)); - return m_clipTransform * - Transform::glFrustum(left+offset.x, right+offset.x, + return m_clipTransform * + Transform::glFrustum(left+offset.x, right+offset.x, bottom+offset.y, top+offset.y, m_nearClip, m_farClip); } diff --git a/src/sensors/radiancemeter.cpp b/src/sensors/radiancemeter.cpp index 422f4ff0..758b9d7c 100644 --- a/src/sensors/radiancemeter.cpp +++ b/src/sensors/radiancemeter.cpp @@ -38,12 +38,12 @@ MTS_NAMESPACE_BEGIN * * This sensor plugin implements a simple radiance meter, which measures * the incident power per unit area per unit solid angle along a - * certain ray. It can be thought of as the limit of a standard + * certain ray. It can be thought of as the limit of a standard * perspective camera as its field of view tends to zero. - * Hence, when this sensor is given a film with multiple pixels, all + * Hence, when this sensor is given a film with multiple pixels, all * of them will record the same value. * - * Such a sensor is useful for conducting virtual experiments and + * Such a sensor is useful for conducting virtual experiments and * testing the renderer for correctness. * * By default, the sensor is located at the origin and performs @@ -82,12 +82,12 @@ public: RadianceMeter(const Properties &props) : Sensor(props) { m_type |= EDeltaPosition | EDeltaDirection; - if (props.getTransform("toWorld", Transform()).hasScale()) + if (props.getTransform("toWorld", Transform()).hasScale()) Log(EError, "Scale factors in the sensor-to-world " "transformation are not allowed!"); } - RadianceMeter(Stream *stream, InstanceManager *manager) + RadianceMeter(Stream *stream, InstanceManager *manager) : Sensor(stream, manager) { configure(); } @@ -122,7 +122,7 @@ public: return (pRec.measure == EDiscrete) ? 1.0f : 0.0f; } - Spectrum sampleDirection(DirectionSamplingRecord &dRec, + Spectrum sampleDirection(DirectionSamplingRecord &dRec, PositionSamplingRecord &pRec, const Point2 &sample, const Point2 *extra) const { diff --git a/src/sensors/spherical.cpp b/src/sensors/spherical.cpp index a7dac4fc..4ef108a4 100644 --- a/src/sensors/spherical.cpp +++ b/src/sensors/spherical.cpp @@ -54,12 +54,12 @@ public: SphericalCamera(const Properties &props) : Sensor(props) { m_type |= EDeltaPosition | EDirectionSampleMapsToPixels; - if (props.getTransform("toWorld", Transform()).hasScale()) + if (props.getTransform("toWorld", Transform()).hasScale()) Log(EError, "Scale factors in the sensor-to-world " "transformation are not allowed!"); } - SphericalCamera(Stream *stream, InstanceManager *manager) + SphericalCamera(Stream *stream, InstanceManager *manager) : Sensor(stream, manager) { configure(); } @@ -101,7 +101,7 @@ public: return (pRec.measure == EDiscrete) ? 1.0f : 0.0f; } - Spectrum sampleDirection(DirectionSamplingRecord &dRec, + Spectrum sampleDirection(DirectionSamplingRecord &dRec, PositionSamplingRecord &pRec, const Point2 &sample, const Point2 *extra) const { const Transform &trafo = m_worldTransform->eval(pRec.time); diff --git a/src/sensors/telecentric.cpp b/src/sensors/telecentric.cpp index f8ca6fba..96f06fe3 100644 --- a/src/sensors/telecentric.cpp +++ b/src/sensors/telecentric.cpp @@ -36,7 +36,7 @@ MTS_NAMESPACE_BEGIN * \default{\code{0}} * } * \parameter{focusDistance}{\Float}{ - * Denotes the world-space distance from the camera's aperture to the + * Denotes the world-space distance from the camera's aperture to the * focal plane. \default{\code{0}} * } * \parameter{shutterOpen, shutterClose}{\Float}{ @@ -46,7 +46,7 @@ MTS_NAMESPACE_BEGIN * } * \parameter{nearClip, farClip}{\Float}{ * Distance to the near/far clip - * planes.\default{\code{near\code}-\code{Clip=1e-2} (i.e. + * planes.\default{\code{near\code}-\code{Clip=1e-2} (i.e. * \code{0.01}) and {\code{farClip=1e4} (i.e. \code{10000})}} * } * } @@ -58,15 +58,15 @@ MTS_NAMESPACE_BEGIN * } * * This plugin implements a simple model of a camera with a \emph{telecentric lens}. - * This is a type of lens that produces an in-focus orthographic view on a - * plane at some distance from the sensor. Points away from this plane are out of focus + * This is a type of lens that produces an in-focus orthographic view on a + * plane at some distance from the sensor. Points away from this plane are out of focus * and project onto a circle of confusion. In comparison to idealized orthographic cameras, * telecentric lens cameras exist in the real world and find use in some computer * vision applications where perspective effects cause problems. * This sensor relates to the \pluginref{orthographic} plugin in the same way * that \pluginref{thinlens} does to \pluginref{perspective}. * - * The configuration is identical to the \pluginref{orthographic} plugin, except that + * The configuration is identical to the \pluginref{orthographic} plugin, except that * the additional parameters \code{apertureRadius} and \code{focusDistance} must be provided. */ class TelecentricLensCamera : public ProjectiveCamera { @@ -81,7 +81,7 @@ public: m_apertureRadius = props.getFloat("apertureRadius", 0.0f); } - TelecentricLensCamera(Stream *stream, InstanceManager *manager) + TelecentricLensCamera(Stream *stream, InstanceManager *manager) : ProjectiveCamera(stream, manager) { m_apertureRadius = stream->readFloat(); configure(); @@ -116,7 +116,7 @@ public: * 4+5. Translate and scale the coordinates once more to account * for a cropping window (if there is any) */ - m_cameraToSample = + m_cameraToSample = Transform::scale(Vector(1.0f / relSize.x, 1.0f / relSize.y, 1.0f)) * Transform::translate(Vector(-relOffset.x, -relOffset.y, 0.0f)) * Transform::scale(Vector(-0.5f, -0.5f*m_aspect, 1.0f)) @@ -126,9 +126,9 @@ public: m_sampleToCamera = m_cameraToSample.inverse(); /* Position differentials on the near plane */ - m_dx = m_sampleToCamera(Point(m_invResolution.x, 0.0f, 0.0f)) + m_dx = m_sampleToCamera(Point(m_invResolution.x, 0.0f, 0.0f)) - m_sampleToCamera(Point(0.0f)); - m_dy = m_sampleToCamera(Point(0.0f, m_invResolution.y, 0.0f)) + m_dy = m_sampleToCamera(Point(0.0f, m_invResolution.y, 0.0f)) - m_sampleToCamera(Point(0.0f)); /* Clip-space transformation for OpenGL */ @@ -153,10 +153,10 @@ public: } /** - * \brief Compute the percentage of overlap between an arbitrary disk and a + * \brief Compute the percentage of overlap between an arbitrary disk and a * rectangle that is centered at the origin * - * \remark To restrict the possible number of cases to a sane amount, the + * \remark To restrict the possible number of cases to a sane amount, the * implementation here assumes that size.{x,y}/2 < radius. * * \param center @@ -164,7 +164,7 @@ public: * \param radius * Radius of the disk * \param size - * Total width and height of the rectangular region + * Total width and height of the rectangular region * \author Wenzel Jakob */ Float convolve(const Point2 ¢er, Float radius, const Vector2 &size) const { @@ -198,7 +198,7 @@ public: * (m_apertureRadius / m_scale.x); ray.time = sampleTime(timeSample); - /* Compute the corresponding position on the + /* Compute the corresponding position on the near plane (in local camera space) */ Point focusP = m_sampleToCamera.transformAffine(Point( pixelSample.x * m_invResolution.x, @@ -206,7 +206,7 @@ public: focusP.z = m_focusDistance/m_scale.z; /* Compute the ray origin */ - Point orig(diskSample.x+focusP.x, + Point orig(diskSample.x+focusP.x, diskSample.y+focusP.y, 0.0f); /* Turn these into a normalized ray direction, and @@ -227,7 +227,7 @@ public: * (m_apertureRadius / m_scale.x); ray.time = sampleTime(timeSample); - /* Compute the corresponding position on the + /* Compute the corresponding position on the near plane (in local camera space) */ Point focusP = m_sampleToCamera.transformAffine(Point( pixelSample.x * m_invResolution.x, @@ -235,7 +235,7 @@ public: focusP.z = m_focusDistance/m_scale.z; /* Compute the ray origin */ - Point orig(diskSample.x+focusP.x, + Point orig(diskSample.x+focusP.x, diskSample.y+focusP.y, 0.0f); /* Turn these into a normalized ray direction, and @@ -260,11 +260,11 @@ public: Log(EError, "The telecentric lens camera is currently incompatible " "with bidirectional rendering algorithms!"); - /* This function should sample from a rectangle that has been + /* This function should sample from a rectangle that has been convolved with a circle, but using only two random numbers. Turns out that this is actually fairly difficult to do. - Since the precision requirements are modest, we can get away - with the following *terrible* hack, which makes four random + Since the precision requirements are modest, we can get away + with the following *terrible* hack, which makes four random numbers out of two and then does convolution the "trivial" way */ #if defined(SINGLE_PRECISION) @@ -286,7 +286,7 @@ public: #endif Point2 aperturePos = Warp::squareToUniformDiskConcentric(Point2(rand1, rand2)) - * (m_apertureRadius / m_scale.x); + * (m_apertureRadius / m_scale.x); Point2 samplePos(rand3, rand4); if (extra) { @@ -319,14 +319,14 @@ public: return (pRec.measure == EArea) ? m_aperturePdf : 0.0f; } - Spectrum sampleDirection(DirectionSamplingRecord &dRec, + Spectrum sampleDirection(DirectionSamplingRecord &dRec, PositionSamplingRecord &pRec, const Point2 &sample, const Point2 *extra) const { Log(EError, "The telecentric lens camera is currently incompatible " "with bidirectional rendering algorithms!"); const Transform &trafo = m_worldTransform->eval(pRec.time); - /* Compute the corresponding position on the + /* Compute the corresponding position on the near plane (in local camera space) */ Point nearP = m_sampleToCamera(Point( sample.x, sample.y, 0.0f)); @@ -414,7 +414,7 @@ public: return 0.0f; } - Transform getProjectionTransform(const Point2 &apertureSample, + Transform getProjectionTransform(const Point2 &apertureSample, const Point2 &aaSample) const { Point2 offset( 2.0f * m_invResolution.x * (aaSample.x-.5f), diff --git a/src/sensors/thinlens.cpp b/src/sensors/thinlens.cpp index 252d1624..0107915f 100644 --- a/src/sensors/thinlens.cpp +++ b/src/sensors/thinlens.cpp @@ -37,7 +37,7 @@ MTS_NAMESPACE_BEGIN * Denotes the radius of the camera's aperture in scene units. * } * \parameter{focusDistance}{\Float}{ - * Denotes the world-space distance from the camera's aperture to the + * Denotes the world-space distance from the camera's aperture to the * focal plane. \default{\code{0}} * } * \parameter{focalLength}{\String}{ @@ -48,24 +48,24 @@ MTS_NAMESPACE_BEGIN * \parameter{fov}{\Float}{ * An alternative to \code{focalLength}: * denotes the camera's field of view in degrees---must be - * between 0 and 180, excluding the extremes. + * between 0 and 180, excluding the extremes. * } * \parameter{fovAxis}{\String}{ * When the parameter \code{fov} is given (and only then), - * this parameter further specifies the image axis, to + * this parameter further specifies the image axis, to * which it applies. * \begin{enumerate}[(i)] - * \item \code{\textbf{x}}: \code{fov} maps to the + * \item \code{\textbf{x}}: \code{fov} maps to the * \code{x}-axis in screen space.\vspace{-1mm} - * \item \code{\textbf{y}}: \code{fov} maps to the + * \item \code{\textbf{y}}: \code{fov} maps to the * \code{y}-axis in screen space.\vspace{-1mm} * \item \code{\textbf{diagonal}}: \code{fov} * maps to the screen diagonal.\vspace{-1mm} * \item \code{\textbf{smaller}}: \code{fov} - * maps to the smaller dimension + * maps to the smaller dimension * (e.g. \code{x} when \code{width}<\code{height})\vspace{-1mm} * \item \code{\textbf{larger}}: \code{fov} - * maps to the larger dimension + * maps to the larger dimension * (e.g. \code{y} when \code{width}<\code{height}) * \vspace{-1mm} * \end{enumerate} @@ -78,7 +78,7 @@ MTS_NAMESPACE_BEGIN * } * \parameter{nearClip, farClip}{\Float}{ * Distance to the near/far clip - * planes.\default{\code{near\code}-\code{Clip=1e-2} (i.e. + * planes.\default{\code{near\code}-\code{Clip=1e-2} (i.e. * \code{0.01}) and {\code{farClip=1e4} (i.e. \code{10000})}} * } * } @@ -89,15 +89,15 @@ MTS_NAMESPACE_BEGIN * \medrendering{A rendering of the Cornell box}{sensor_thinlens_2} * } * - * This plugin implements a simple perspective camera model with a thin lens + * This plugin implements a simple perspective camera model with a thin lens * at its circular aperture. It is very similar to the \pluginref{perspective} plugin - * except that the extra lens element permits rendering with a + * except that the extra lens element permits rendering with a * specifiable (i.e. non-infinite) depth of field. To configure this, it has two * extra parameters named \code{apertureRadius} and \code{focusDistance}. * * By default, the camera's field of view is specified using a 35mm film - * equivalent focal length, which is first converted into a diagonal field - * of view and subsequently applied to the camera. This assumes that + * equivalent focal length, which is first converted into a diagonal field + * of view and subsequently applied to the camera. This assumes that * the film's aspect ratio matches that of 35mm film (1.5:1), though the * parameter still behaves intuitively when this is not the case. * Alternatively, it is also possible to specify a field of view in degrees @@ -137,12 +137,12 @@ public: m_apertureRadius = Epsilon; } - if (props.getTransform("toWorld", Transform()).hasScale()) + if (props.getTransform("toWorld", Transform()).hasScale()) Log(EError, "Scale factors in the camera-to-world " "transformation are not allowed!"); } - ThinLens(Stream *stream, InstanceManager *manager) + ThinLens(Stream *stream, InstanceManager *manager) : PerspectiveCamera(stream, manager) { m_apertureRadius = stream->readFloat(); configure(); @@ -177,7 +177,7 @@ public: * 4+5. Translate and scale the coordinates once more to account * for a cropping window (if there is any) */ - m_cameraToSample = + m_cameraToSample = Transform::scale(Vector(1.0f / relSize.x, 1.0f / relSize.y, 1.0f)) * Transform::translate(Vector(-relOffset.x, -relOffset.y, 0.0f)) * Transform::scale(Vector(-0.5f, -0.5f*m_aspect, 1.0f)) @@ -187,12 +187,12 @@ public: m_sampleToCamera = m_cameraToSample.inverse(); /* Position differentials on the near plane */ - m_dx = m_sampleToCamera(Point(m_invResolution.x, 0.0f, 0.0f)) + m_dx = m_sampleToCamera(Point(m_invResolution.x, 0.0f, 0.0f)) - m_sampleToCamera(Point(0.0f)); - m_dy = m_sampleToCamera(Point(0.0f, m_invResolution.y, 0.0f)) + m_dy = m_sampleToCamera(Point(0.0f, m_invResolution.y, 0.0f)) - m_sampleToCamera(Point(0.0f)); - /* Precompute some data for importance(). Please + /* Precompute some data for importance(). Please look at that function for further details */ Point min(m_sampleToCamera(Point(0, 0, 0))), max(m_sampleToCamera(Point(1, 1, 0))); @@ -212,20 +212,20 @@ public: } /** - * \brief Compute the directional sensor response function + * \brief Compute the directional sensor response function * of the camera multiplied with the cosine foreshortening * factor associated with the image plane * * \param p * A position on the aperture * - * \param d + * \param d * A normalized direction vector from the aperture position to the * reference point in question (all in local camera space) * * \param sample - * Optional: a pointer to a 2D point data structure, which will be - * used to return the fractional pixel position associated with the + * Optional: a pointer to a 2D point data structure, which will be + * used to return the fractional pixel position associated with the * reference point */ inline Float importance(const Point &p, const Vector &d, Point2 *sample = NULL) const { @@ -236,14 +236,14 @@ public: A = (2 * tan(0.5 * xfov in radians))^2 / aspect - Since we allow crop regions, the actual visible area is + Since we allow crop regions, the actual visible area is potentially reduced: A' = A * (cropX / filmX) * (cropY / filmY) Perspective transformations of such aligned rectangles produce - an equivalent scaled (but otherwise undistorted) rectangle - in screen space. This means that a strategy, which uniformly + an equivalent scaled (but otherwise undistorted) rectangle + in screen space. This means that a strategy, which uniformly generates samples in screen space has an associated area density of 1/A' on this rectangle. @@ -255,7 +255,7 @@ public: where theta is the angle that the unit direction vector from the origin to P makes with the rectangle. Since - distance(P, origin)^2 = Px^2 + Py^2 + 1 + distance(P, origin)^2 = Px^2 + Py^2 + 1 and @@ -275,10 +275,10 @@ public: Float invCosTheta = 1.0f / cosTheta; /* Check if the associated pixel is visible */ - Point scr = m_cameraToSample(p + Point scr = m_cameraToSample(p + d * (m_focusDistance*invCosTheta)); if (scr.x < 0 || scr.x > 1 || - scr.y < 0 || scr.y > 1) + scr.y < 0 || scr.y > 1) return 0.0f; if (sample) { @@ -286,7 +286,7 @@ public: sample->y = scr.y * m_resolution.y; } - return m_normalization * invCosTheta * + return m_normalization * invCosTheta * invCosTheta * invCosTheta; } @@ -296,7 +296,7 @@ public: * m_apertureRadius; ray.time = sampleTime(timeSample); - /* Compute the corresponding position on the + /* Compute the corresponding position on the near plane (in local camera space) */ Point nearP = m_sampleToCamera(Point( pixelSample.x * m_invResolution.x, @@ -327,7 +327,7 @@ public: * m_apertureRadius; ray.time = sampleTime(timeSample); - /* Compute the corresponding position on the + /* Compute the corresponding position on the near plane (in local camera space) */ Point nearP = m_sampleToCamera(Point( pixelSample.x * m_invResolution.x, @@ -383,7 +383,7 @@ public: return (pRec.measure == EArea) ? m_aperturePdf : 0.0f; } - Spectrum sampleDirection(DirectionSamplingRecord &dRec, + Spectrum sampleDirection(DirectionSamplingRecord &dRec, PositionSamplingRecord &pRec, const Point2 &sample, const Point2 *extra) const { const Transform &trafo = m_worldTransform->eval(pRec.time); @@ -399,7 +399,7 @@ public: pRec.uv = Point2(samplePos.x * m_resolution.x, samplePos.y * m_resolution.y); - /* Compute the corresponding position on the + /* Compute the corresponding position on the near plane (in local camera space) */ Point nearP = m_sampleToCamera(samplePos); nearP.x = nearP.x * (m_focusDistance / nearP.z); @@ -453,7 +453,7 @@ public: * m_apertureRadius; Point apertureP(tmp.x, tmp.y, 0); - /* Compute the normalized direction vector from the + /* Compute the normalized direction vector from the aperture position to the reference point */ Vector localD(refP - apertureP); Float dist = localD.length(), @@ -473,7 +473,7 @@ public: dRec.pdf = m_aperturePdf * dist*dist/(Frame::cosTheta(localD)); dRec.measure = ESolidAngle; - /* intentionally missing a cosine factor wrt. the aperture + /* intentionally missing a cosine factor wrt. the aperture disk (it is already accounted for in importance()) */ return Spectrum(value * invDist * invDist); } @@ -491,7 +491,7 @@ public: return 0.0f; } - Transform getProjectionTransform(const Point2 &apertureSample, + Transform getProjectionTransform(const Point2 &apertureSample, const Point2 &aaSample) const { Float right = std::tan(m_xfov * M_PI/360) * m_nearClip, left = -right; Float top = right / m_aspect, bottom = -top; @@ -508,7 +508,7 @@ public: (top-bottom)/m_film->getSize().y * (aaSample.y-0.5f)); return m_clipTransform * - Transform::glFrustum(left+offset.x, right+offset.x, + Transform::glFrustum(left+offset.x, right+offset.x, bottom+offset.y, top+offset.y, m_nearClip, m_farClip) * Transform::translate(Vector(apertureP.x, apertureP.y, 0)); } @@ -549,11 +549,11 @@ public: Point screenSample = m_cameraToSample(intersection); if (screenSample.x < 0 || screenSample.x > 1 || - screenSample.y < 0 || screenSample.y > 1) + screenSample.y < 0 || screenSample.y > 1) return false; samplePosition = Point2( - screenSample.x * m_resolution.x, + screenSample.x * m_resolution.x, screenSample.y * m_resolution.y); return true; diff --git a/src/shapes/animatedinstance.cpp b/src/shapes/animatedinstance.cpp index 84344e05..aa288645 100644 --- a/src/shapes/animatedinstance.cpp +++ b/src/shapes/animatedinstance.cpp @@ -28,15 +28,15 @@ MTS_NAMESPACE_BEGIN * \parameters{ * \parameter{filename}{\String}{Filename of an animated * transformation} - * \parameter{\Unnamed}{\ShapeGroup}{A reference to a + * \parameter{\Unnamed}{\ShapeGroup}{A reference to a * shape group that should be instantiated} * } - * + * * This plugin implements an \emph{animated} geometry instance, * i.e. one or more shapes that are undergoing \emph{ridgid} * transformations over time. * - * The input file should contain a binary / serialized + * The input file should contain a binary / serialized * \code{AnimatedTransform} data structure -- for details, * please refer to the C++ implementation of this class. */ @@ -52,7 +52,7 @@ public: m_transform = new AnimatedTransform(fs); } - AnimatedInstance(Stream *stream, InstanceManager *manager) + AnimatedInstance(Stream *stream, InstanceManager *manager) : Shape(stream, manager) { m_shapeGroup = static_cast(manager->getInstance(stream)); m_transform = new AnimatedTransform(stream); @@ -94,7 +94,7 @@ public: } } - bool rayIntersect(const Ray &_ray, Float mint, + bool rayIntersect(const Ray &_ray, Float mint, Float maxt, Float &t, void *temp) const { const ShapeKDTree *kdtree = m_shapeGroup->getKDTree(); Ray ray; @@ -113,7 +113,7 @@ public: return kdtree->rayIntersect(ray, mint, maxt); } - void fillIntersectionRecord(const Ray &_ray, + void fillIntersectionRecord(const Ray &_ray, const void *temp, Intersection &its) const { const ShapeKDTree *kdtree = m_shapeGroup->getKDTree(); const Transform &objectToWorld = m_transform->eval(_ray.time); @@ -137,7 +137,7 @@ public: const Transform &objectToWorld = m_transform->eval(its.time); its.shape->getNormalDerivative(its, dndu, dndv, shadingFrame); - /* The following will probably be incorrect for + /* The following will probably be incorrect for non-rigid transformations */ dndu = objectToWorld(dndu); dndv = objectToWorld(dndv); diff --git a/src/shapes/cylinder.cpp b/src/shapes/cylinder.cpp index d8fc753c..d66f471f 100644 --- a/src/shapes/cylinder.cpp +++ b/src/shapes/cylinder.cpp @@ -55,14 +55,14 @@ MTS_NAMESPACE_BEGIN * \rendering{Cylinder with two-sided shading, see \lstref{cylinder-twosided}} * {shape_cylinder_twosided} * } - * This shape plugin describes a simple cylinder intersection primitive. + * This shape plugin describes a simple cylinder intersection primitive. * It should always be preferred over approximations modeled using * triangles. Note that the cylinder does not have endcaps -- also, - * it's interior has inward-facing normals, which most scattering + * it's interior has inward-facing normals, which most scattering * models in Mitsuba will treat as fully absorbing. If this is not * desirable, consider using the \pluginref{twosided} plugin. * - * \begin{xml}[caption={A simple example for instantiating a + * \begin{xml}[caption={A simple example for instantiating a * cylinder, whose interior is visible}, label=lst:cylinder-twosided] * * @@ -85,7 +85,7 @@ public: Point p2 = props.getPoint("p1", Point(0.0f, 0.0f, 1.0f)); Vector d = p2 - p1; Float length = d.length(); - m_objectToWorld = + m_objectToWorld = Transform::translate(Vector(p1)) * Transform::fromFrame(Frame(d / length)) * Transform::scale(Vector(radius, radius, length)); @@ -107,7 +107,7 @@ public: Assert(m_length > 0 && m_radius > 0); } - Cylinder(Stream *stream, InstanceManager *manager) + Cylinder(Stream *stream, InstanceManager *manager) : Shape(stream, manager) { m_objectToWorld = Transform(stream); m_radius = stream->readFloat(); @@ -134,7 +134,7 @@ public: const Float ox = ray.o.x, oy = ray.o.y, - dx = ray.d.x, + dx = ray.d.x, dy = ray.d.y; const Float A = dx*dx + dy*dy; @@ -172,7 +172,7 @@ public: const Float ox = ray.o.x, oy = ray.o.y, - dx = ray.d.x, + dx = ray.d.x, dy = ray.d.y; const Float A = dx*dx + dy*dy; @@ -258,9 +258,9 @@ public: for (int i=0; i<3; ++i) { Float range = std::sqrt(x1[i]*x1[i] + x2[i]*x2[i]); - result.min[i] = std::min(std::min(result.min[i], + result.min[i] = std::min(std::min(result.min[i], p0[i]-range), p1[i]-range); - result.max[i] = std::max(std::max(result.max[i], + result.max[i] = std::max(std::max(result.max[i], p0[i]+range), p1[i]+range); } @@ -328,7 +328,7 @@ public: Float ellipseLengths[2]; AABB aabb; - if (!intersectCylPlane(min, planeNrml, cylPt, cylD, m_radius, + if (!intersectCylPlane(min, planeNrml, cylPt, cylD, m_radius, ellipseCenter, ellipseAxes, ellipseLengths)) { /* Degenerate case -- return an invalid AABB. This is not a problem, since one of the other faces will provide @@ -380,9 +380,9 @@ public: Point p1 = ellipseCenter + cosTheta*ellipseAxes[0] + sinTheta*ellipseAxes[1]; Point p2 = ellipseCenter - cosTheta*ellipseAxes[0] - sinTheta*ellipseAxes[1]; - if (faceBounds.contains(p1)) + if (faceBounds.contains(p1)) aabb.expandBy(p1); - if (faceBounds.contains(p2)) + if (faceBounds.contains(p2)) aabb.expandBy(p2); } @@ -393,14 +393,14 @@ public: /* Compute a base bounding box */ AABB base(getAABB()); base.clip(box); - + Point cylPt = m_objectToWorld(Point(0, 0, 0)); Vector cylD(m_objectToWorld(Vector(0, 0, 1))); - /* Now forget about the cylinder ends and + /* Now forget about the cylinder ends and intersect an infinite cylinder with each AABB face */ AABB clippedAABB; - clippedAABB.expandBy(intersectCylFace(0, + clippedAABB.expandBy(intersectCylFace(0, Point(base.min.x, base.min.y, base.min.z), Point(base.min.x, base.max.y, base.max.z), cylPt, cylD)); @@ -410,7 +410,7 @@ public: Point(base.max.x, base.max.y, base.max.z), cylPt, cylD)); - clippedAABB.expandBy(intersectCylFace(1, + clippedAABB.expandBy(intersectCylFace(1, Point(base.min.x, base.min.y, base.min.z), Point(base.max.x, base.min.y, base.max.z), cylPt, cylD)); @@ -420,7 +420,7 @@ public: Point(base.max.x, base.max.y, base.max.z), cylPt, cylD)); - clippedAABB.expandBy(intersectCylFace(2, + clippedAABB.expandBy(intersectCylFace(2, Point(base.min.x, base.min.y, base.min.z), Point(base.max.x, base.max.y, base.min.z), cylPt, cylD)); @@ -513,7 +513,7 @@ public: << " length = " << m_length << ", " << endl << " objectToWorld = " << indent(m_objectToWorld.toString()) << "," << endl << " bsdf = " << indent(m_bsdf.toString()) << "," << endl; - if (isMediumTransition()) + if (isMediumTransition()) oss << " interiorMedium = " << indent(m_interiorMedium.toString()) << "," << endl << " exteriorMedium = " << indent(m_exteriorMedium.toString()) << "," << endl; oss << " emitter = " << indent(m_emitter.toString()) << "," << endl diff --git a/src/shapes/disk.cpp b/src/shapes/disk.cpp index 35c74894..93c389b7 100644 --- a/src/shapes/disk.cpp +++ b/src/shapes/disk.cpp @@ -46,14 +46,14 @@ MTS_NAMESPACE_BEGIN * \rendering{Rendering with an disk emitter and a textured disk, showing * the default parameterization. (\lstref{disk})}{shape_disk} * } - * + * * \vspace{-1mm} * This shape plugin describes a simple disk intersection primitive. It is * usually preferable over discrete approximations made from triangles. * * By default, the disk has unit radius and is located at the origin. Its * surface normal points into the positive $Z$ direction. - * To change the disk scale, rotation, or translation, use the + * To change the disk scale, rotation, or translation, use the * \code{toWorld} parameter. * * \begin{xml}[caption={A simple example involving two disk instances}, label=lst:disk] @@ -87,7 +87,7 @@ public: m_worldToObject = m_objectToWorld.inverse(); } - Disk(Stream *stream, InstanceManager *manager) + Disk(Stream *stream, InstanceManager *manager) : Shape(stream, manager) { m_objectToWorld = Transform(stream); m_worldToObject = m_objectToWorld.inverse(); @@ -161,7 +161,7 @@ public: return Disk::rayIntersect(ray, mint, maxt, t, NULL); } - void fillIntersectionRecord(const Ray &ray, + void fillIntersectionRecord(const Ray &ray, const void *temp, Intersection &its) const { const Float *data = static_cast(temp); diff --git a/src/shapes/hair.cpp b/src/shapes/hair.cpp index cd178adf..daa52646 100644 --- a/src/shapes/hair.cpp +++ b/src/shapes/hair.cpp @@ -38,20 +38,20 @@ MTS_NAMESPACE_BEGIN * } * \parameter{radius}{\Float}{ * Radius of the hair segments in world-space units - * \default{0.025, which assumes that the scene + * \default{0.025, which assumes that the scene * is modeled in millimeters.}. * } * \parameter{angleThreshold}{\Float}{ - * For performance reasons, the plugin will merge adjacent hair + * For performance reasons, the plugin will merge adjacent hair * segments when the angle of their tangent directions is below * than this value (in degrees). \default{1}. * } * \parameter{reduction}{\Float}{ - * When the reduction ratio is set to a value between zero and one, the hair + * When the reduction ratio is set to a value between zero and one, the hair * plugin stochastically culls this portion of the input data (where - * 1 corresponds to removing all hairs). To approximately preserve the - * appearance in renderings, the hair radius is enlarged (see Cook et al. - * \cite{Cook2007Stochastic}). This parameter is convenient for fast + * 1 corresponds to removing all hairs). To approximately preserve the + * appearance in renderings, the hair radius is enlarged (see Cook et al. + * \cite{Cook2007Stochastic}). This parameter is convenient for fast * previews. \default{0, i.e. all geometry is rendered} * } * \parameter{toWorld}{\Transform}{ @@ -64,37 +64,37 @@ MTS_NAMESPACE_BEGIN * \centering * \fbox{\includegraphics[width=6cm]{images/shape_hair}}\hspace{4.5cm} * \caption{A close-up of the hair shape rendered with a diffuse - * scattering model (an actual hair scattering model will + * scattering model (an actual hair scattering model will * be needed for realistic apperance)} * } - * The plugin implements a space-efficient acceleration structure for - * hairs made from many straight cylindrical hair segments with miter - * joints. The underlying idea is that intersections with straight cylindrical - * hairs can be found quite efficiently, and curved hairs are easily + * The plugin implements a space-efficient acceleration structure for + * hairs made from many straight cylindrical hair segments with miter + * joints. The underlying idea is that intersections with straight cylindrical + * hairs can be found quite efficiently, and curved hairs are easily * approximated using a series of such segments. * * The plugin supports two different input formats: a simple (but not - * particularly efficient) ASCII format containing the coordinates of a - * hair vertex on every line. An empty line marks the beginning of a + * particularly efficient) ASCII format containing the coordinates of a + * hair vertex on every line. An empty line marks the beginning of a * new hair. The following snippet is an example of this format:\newpage * \begin{xml} - * ..... + * ..... * -18.5498 -21.7669 22.8138 * -18.6358 -21.3581 22.9262 * -18.7359 -20.9494 23.0256 - * + * * -30.6367 -21.8369 6.78397 * -30.7289 -21.4145 6.76688 * -30.8226 -20.9933 6.73948 - * ..... + * ..... * \end{xml} * * There is also a binary format, which starts with the identifier - * ``\texttt{BINARY\_HAIR}'' (11 bytes), followed by the number of - * vertices as a 32-bit little endian integer. - * The remainder of the file consists of the vertex positions stored as + * ``\texttt{BINARY\_HAIR}'' (11 bytes), followed by the number of + * vertices as a 32-bit little endian integer. + * The remainder of the file consists of the vertex positions stored as * single-precision XYZ coordinates (again in little-endian byte ordering). - * To mark the beginning of a new hair strand, a single $+\infty$ floating + * To mark the beginning of a new hair strand, a single $+\infty$ floating * point value can be inserted between the vertex data. */ @@ -105,7 +105,7 @@ public: using SAHKDTree3D::IndexType; using SAHKDTree3D::SizeType; - HairKDTree(std::vector &vertices, + HairKDTree(std::vector &vertices, std::vector &vertexStartsFiber, Float radius) : m_radius(radius) { /* Take the supplied vertex & start fiber arrays (without copying) */ @@ -124,11 +124,11 @@ public: m_segmentCount = m_segIndex.size(); Log(EDebug, "Building a kd-tree for " SIZE_T_FMT " hair vertices, " - SIZE_T_FMT " segments, " SIZE_T_FMT " hairs", + SIZE_T_FMT " segments, " SIZE_T_FMT " hairs", m_vertices.size(), m_segmentCount, m_hairCount); /* Ray-cylinder intersections are expensive. Use only the - SAH cost as the tree subdivision stopping criterion, + SAH cost as the tree subdivision stopping criterion, not the number of primitives */ setStopPrims(1); @@ -143,13 +143,13 @@ public: buildInternal(); Log(EDebug, "Total amount of storage (kd-tree & vertex data): %s", - memString(m_nodeCount * sizeof(KDNode) + memString(m_nodeCount * sizeof(KDNode) + m_indexCount * sizeof(IndexType) + vertices.size() * sizeof(Point) + vertexStartsFiber.size() / 8).c_str()); /* Optimization: replace all primitive indices by the - associated vertex indices (this avoids an extra + associated vertex indices (this avoids an extra indirection during traversal later on) */ for (SizeType i=0; i &getStartFiber() const { @@ -185,21 +185,21 @@ public: inline size_t getSegmentCount() const { return m_segmentCount; } - + /// Return the total number of hairs inline size_t getHairCount() const { return m_hairCount; } - + /// Return the total number of vertices inline size_t getVertexCount() const { return m_vertices.size(); } /// Intersect a ray with all segments stored in the kd-tree - inline bool rayIntersect(const Ray &ray, Float _mint, Float _maxt, + inline bool rayIntersect(const Ray &ray, Float _mint, Float _maxt, Float &t, void *temp) const { - Float tempT = std::numeric_limits::infinity(); + Float tempT = std::numeric_limits::infinity(); Float mint, maxt; if (m_aabb.rayIntersect(ray, mint, maxt)) { @@ -221,7 +221,7 @@ public: * (Visiblity query version) */ inline bool rayIntersect(const Ray &ray, Float _mint, Float _maxt) const { - Float tempT = std::numeric_limits::infinity(); + Float tempT = std::numeric_limits::infinity(); Float mint, maxt; if (m_aabb.rayIntersect(ray, mint, maxt)) { @@ -229,7 +229,7 @@ public: if (_maxt < maxt) maxt = _maxt; if (EXPECT_TAKEN(maxt > mint)) { - if (rayIntersectHavran(ray, mint, maxt, tempT, NULL)) + if (rayIntersectHavran(ray, mint, maxt, tempT, NULL)) return true; } } @@ -286,7 +286,7 @@ public: } /** - * \brief Intersect an infinite cylinder with an + * \brief Intersect an infinite cylinder with an * AABB face and bound the resulting clipped ellipse */ AABB intersectCylFace(int axis, @@ -303,7 +303,7 @@ public: Float ellipseLengths[2]; AABB aabb; - if (!intersectCylPlane(min, planeNrml, cylPt, cylD, m_radius * (1 + Epsilon), + if (!intersectCylPlane(min, planeNrml, cylPt, cylD, m_radius * (1 + Epsilon), ellipseCenter, ellipseAxes, ellipseLengths)) { /* Degenerate case -- return an invalid AABB. This is not a problem, since one of the other faces will provide @@ -355,9 +355,9 @@ public: Point p1 = ellipseCenter + cosTheta*ellipseAxes[0] + sinTheta*ellipseAxes[1]; Point p2 = ellipseCenter - cosTheta*ellipseAxes[0] - sinTheta*ellipseAxes[1]; - if (faceBounds.contains(p1)) + if (faceBounds.contains(p1)) aabb.expandBy(p1); - if (faceBounds.contains(p2)) + if (faceBounds.contains(p2)) aabb.expandBy(p2); } @@ -370,7 +370,7 @@ public: Vector axes[2]; Float lengths[2]; - bool success = intersectCylPlane(firstVertex(iv), firstMiterNormal(iv), + bool success = intersectCylPlane(firstVertex(iv), firstMiterNormal(iv), firstVertex(iv), tangent(iv), m_radius * (1-Epsilon), center, axes, lengths); Assert(success); @@ -382,7 +382,7 @@ public: result.max[i] = std::max(result.max[i], center[i]+range); } - success = intersectCylPlane(secondVertex(iv), secondMiterNormal(iv), + success = intersectCylPlane(secondVertex(iv), secondMiterNormal(iv), secondVertex(iv), tangent(iv), m_radius * (1-Epsilon), center, axes, lengths); Assert(success); @@ -404,10 +404,10 @@ public: Point cylPt = firstVertex(iv); Vector cylD = tangent(iv); - /* Now forget about the cylinder ends and + /* Now forget about the cylinder ends and intersect an infinite cylinder with each AABB face */ AABB clippedAABB; - clippedAABB.expandBy(intersectCylFace(0, + clippedAABB.expandBy(intersectCylFace(0, Point(base.min.x, base.min.y, base.min.z), Point(base.min.x, base.max.y, base.max.z), cylPt, cylD)); @@ -417,7 +417,7 @@ public: Point(base.max.x, base.max.y, base.max.z), cylPt, cylD)); - clippedAABB.expandBy(intersectCylFace(1, + clippedAABB.expandBy(intersectCylFace(1, Point(base.min.x, base.min.y, base.min.z), Point(base.max.x, base.min.y, base.max.z), cylPt, cylD)); @@ -427,7 +427,7 @@ public: Point(base.max.x, base.max.y, base.max.z), cylPt, cylD)); - clippedAABB.expandBy(intersectCylFace(2, + clippedAABB.expandBy(intersectCylFace(2, Point(base.min.x, base.min.y, base.min.z), Point(base.max.x, base.max.y, base.min.z), cylPt, cylD)); @@ -481,7 +481,7 @@ public: Point p; }; - inline bool intersect(const Ray &ray, IndexType iv, + inline bool intersect(const Ray &ray, IndexType iv, Float mint, Float maxt, Float &t, void *tmp) const { /* First compute the intersection with the infinite cylinder */ Vector3d axis = tangentDouble(iv); @@ -511,8 +511,8 @@ public: Point3d pointNear = rayO + rayD * nearT; Point3d pointFar = rayO + rayD * farT; - Vector3d n1 = firstMiterNormalDouble(iv); - Vector3d n2 = secondMiterNormalDouble(iv); + Vector3d n1 = firstMiterNormalDouble(iv); + Vector3d n2 = secondMiterNormalDouble(iv); Point3d v2 = secondVertexDouble(iv); IntersectionStorage *storage = static_cast(tmp); Point p; @@ -539,8 +539,8 @@ public: return true; } - - inline bool intersect(const Ray &ray, IndexType iv, + + inline bool intersect(const Ray &ray, IndexType iv, Float mint, Float maxt) const { Float tempT; return intersect(ray, iv, mint, maxt, tempT, NULL); @@ -614,7 +614,7 @@ HairShape::HairShape(const Properties &props) : Shape(props) { Float angleThreshold = degToRad(props.getFloat("angleThreshold", 1.0f)); Float dpThresh = std::cos(angleThreshold); - /* When set to a value n>1, the hair shape object will reduce + /* When set to a value n>1, the hair shape object will reduce the input by only loading every n-th hair */ Float reduction = props.getFloat("reduction", 0); if (reduction < 0 || reduction >= 1) { @@ -772,7 +772,7 @@ HairShape::HairShape(const Properties &props) : Shape(props) { } if (nDegenerate > 0) - Log(EInfo, "Encountered " SIZE_T_FMT + Log(EInfo, "Encountered " SIZE_T_FMT " degenerate segments!", nDegenerate); if (nSkipped > 0) Log(EInfo, "Skipped " SIZE_T_FMT " segments.", nSkipped); @@ -783,7 +783,7 @@ HairShape::HairShape(const Properties &props) : Shape(props) { m_kdtree = new HairKDTree(vertices, vertexStartsFiber, radius); } -HairShape::HairShape(Stream *stream, InstanceManager *manager) +HairShape::HairShape(Stream *stream, InstanceManager *manager) : Shape(stream, manager) { Float radius = stream->readFloat(); size_t vertexCount = stream->readSize(); @@ -792,7 +792,7 @@ HairShape::HairShape(Stream *stream, InstanceManager *manager) std::vector vertexStartsFiber(vertexCount+1); stream->readFloatArray((Float *) &vertices[0], vertexCount * 3); - for (size_t i=0; ireadBool(); vertexStartsFiber[vertexCount] = true; @@ -812,7 +812,7 @@ void HairShape::serialize(Stream *stream, InstanceManager *manager) const { stream->writeBool(vertexStartsFiber[i]); } -bool HairShape::rayIntersect(const Ray &ray, Float mint, +bool HairShape::rayIntersect(const Ray &ray, Float mint, Float maxt, Float &t, void *temp) const { return m_kdtree->rayIntersect(ray, mint, maxt, t, temp); } @@ -821,14 +821,14 @@ bool HairShape::rayIntersect(const Ray &ray, Float mint, Float maxt) const { return m_kdtree->rayIntersect(ray, mint, maxt); } -void HairShape::fillIntersectionRecord(const Ray &ray, +void HairShape::fillIntersectionRecord(const Ray &ray, const void *temp, Intersection &its) const { /* No UV coordinates for now */ its.uv = Point2(0,0); its.dpdu = Vector(0,0,0); its.dpdv = Vector(0,0,0); - const HairKDTree::IntersectionStorage *storage = + const HairKDTree::IntersectionStorage *storage = static_cast(temp); HairKDTree::IndexType iv = storage->iv; its.p = storage->p; @@ -858,7 +858,7 @@ ref HairShape::createTriMesh() { Normal *normals = mesh->getVertexNormals(); Triangle *triangles = mesh->getTriangles(); size_t triangleIdx = 0, vertexIdx = 0; - + const std::vector &hairVertices = m_kdtree->getVertices(); const std::vector &vertexStartsFiber = m_kdtree->getStartFiber(); const Float radius = m_kdtree->getRadius(); diff --git a/src/shapes/hair.h b/src/shapes/hair.h index 1d61f133..b396ec0a 100644 --- a/src/shapes/hair.h +++ b/src/shapes/hair.h @@ -22,7 +22,7 @@ #include MTS_NAMESPACE_BEGIN - + class HairKDTree; /** @@ -36,7 +36,7 @@ class HairShape : public Shape { public: /// Construct a new HairShape instance given a properties object HairShape(const Properties &props); - + /// Unserialize from a binary data stream HairShape(Stream *stream, InstanceManager *manager); @@ -46,12 +46,12 @@ public: // ============================================================= //! @{ \name Access the internal vertex data // ============================================================= - + /// Return the list of vertices underlying the hair shape const std::vector &getVertices() const; /** - * Return a boolean list specifying whether a vertex + * Return a boolean list specifying whether a vertex * marks the beginning of a new fiber */ const std::vector &getStartFiber() const; @@ -63,12 +63,12 @@ public: //! @{ \name Implementation of the \ref Shape interface // ============================================================= - bool rayIntersect(const Ray &ray, Float mint, + bool rayIntersect(const Ray &ray, Float mint, Float maxt, Float &t, void *temp) const; - + bool rayIntersect(const Ray &ray, Float mint, Float maxt) const; - void fillIntersectionRecord(const Ray &ray, + void fillIntersectionRecord(const Ray &ray, const void *temp, Intersection &its) const; ref createTriMesh(); @@ -78,9 +78,9 @@ public: AABB getAABB() const; Float getSurfaceArea() const; - + size_t getPrimitiveCount() const; - + size_t getEffectivePrimitiveCount() const; //! @} diff --git a/src/shapes/instance.cpp b/src/shapes/instance.cpp index d87b9588..b4e5cfa3 100644 --- a/src/shapes/instance.cpp +++ b/src/shapes/instance.cpp @@ -19,18 +19,18 @@ #include "instance.h" MTS_NAMESPACE_BEGIN - + /*!\plugin{instance}{Geometry instance} * \order{9} * \parameters{ - * \parameter{\Unnamed}{\ShapeGroup}{A reference to a + * \parameter{\Unnamed}{\ShapeGroup}{A reference to a * shape group that should be instantiated} * \parameter{toWorld}{\Transform}{ * Specifies an optional linear instance-to-world transformation. * \default{none (i.e. instance space $=$ world space)} * } * } - * + * * This plugin implements a geometry instance used to efficiently replicate * geometry many times. For details, please refer to the \pluginref{shapegroup} * plugin. @@ -42,7 +42,7 @@ Instance::Instance(const Properties &props) : Shape(props) { m_invScale = 1.0f/m_objectToWorld(Vector(0, 0, 1)).length(); } -Instance::Instance(Stream *stream, InstanceManager *manager) +Instance::Instance(Stream *stream, InstanceManager *manager) : Shape(stream, manager) { m_shapeGroup = static_cast(manager->getInstance(stream)); m_objectToWorld = Transform(stream); @@ -95,7 +95,7 @@ size_t Instance::getEffectivePrimitiveCount() const { return m_shapeGroup->getPrimitiveCount(); } -bool Instance::rayIntersect(const Ray &_ray, Float mint, +bool Instance::rayIntersect(const Ray &_ray, Float mint, Float maxt, Float &t, void *temp) const { const ShapeKDTree *kdtree = m_shapeGroup->getKDTree(); Ray ray; @@ -110,7 +110,7 @@ bool Instance::rayIntersect(const Ray &_ray, Float mint, Float maxt) const { return kdtree->rayIntersect(ray, mint, maxt); } -void Instance::fillIntersectionRecord(const Ray &_ray, +void Instance::fillIntersectionRecord(const Ray &_ray, const void *temp, Intersection &its) const { const ShapeKDTree *kdtree = m_shapeGroup->getKDTree(); Ray ray; @@ -137,7 +137,7 @@ void Instance::getNormalDerivative(const Intersection &its, temp.dpdv = m_worldToObject(its.dpdv); its.shape->getNormalDerivative(temp, dndu, dndv, shadingFrame); - /* The following will probably be incorrect for + /* The following will probably be incorrect for non-rigid transformations */ dndu = m_objectToWorld(Normal(dndu))*m_invScale; dndv = m_objectToWorld(Normal(dndv))*m_invScale; diff --git a/src/shapes/instance.h b/src/shapes/instance.h index d6f057ec..de17530b 100644 --- a/src/shapes/instance.h +++ b/src/shapes/instance.h @@ -44,13 +44,13 @@ public: /// Add a child ConfigurableObject void addChild(const std::string &name, ConfigurableObject *child); - + /// Return a pointer to the associated \ref ShapeGroup inline ShapeGroup* getShapeGroup() { return m_shapeGroup; } /// Return a pointer to the associated \ref ShapeGroup (const version) inline const ShapeGroup* getShapeGroup() const { return m_shapeGroup.get(); } - + // ============================================================= //! @{ \name Implementation of the Shape interface // ============================================================= @@ -59,14 +59,14 @@ public: Float getSurfaceArea() const; - bool rayIntersect(const Ray &_ray, Float mint, + bool rayIntersect(const Ray &_ray, Float mint, Float maxt, Float &t, void *temp) const; bool rayIntersect(const Ray &_ray, Float mint, Float maxt) const; - void fillIntersectionRecord(const Ray &ray, + void fillIntersectionRecord(const Ray &ray, const void *temp, Intersection &its) const; - + void getNormalDerivative(const Intersection &its, Vector &dndu, Vector &dndv, bool shadingFrame) const; diff --git a/src/shapes/obj.cpp b/src/shapes/obj.cpp index 7d631e10..14834ed0 100644 --- a/src/shapes/obj.cpp +++ b/src/shapes/obj.cpp @@ -37,7 +37,7 @@ MTS_NAMESPACE_BEGIN * Filename of the OBJ file that should be loaded * } * \parameter{faceNormals}{\Boolean}{ - * When set to \code{true}, any existing or computed vertex normals are + * When set to \code{true}, any existing or computed vertex normals are * discarded and \emph{face normals} will instead be used during rendering. * This gives the rendered object a faceted apperance.\default{\code{false}} * } @@ -68,8 +68,8 @@ MTS_NAMESPACE_BEGIN * } * * This plugin implements a simple loader for Wavefront OBJ files. It handles - * meshes containing triangles and quadrilaterals, and it also imports vertex normals - * and texture coordinates. + * meshes containing triangles and quadrilaterals, and it also imports vertex normals + * and texture coordinates. * * Loading an ordinary OBJ file is as simple as writing: * \begin{xml} @@ -79,9 +79,9 @@ MTS_NAMESPACE_BEGIN * \end{xml} * \paragraph{Material import:} * When the OBJ file references a Wavefront material description (a \code{.mtl} file), - * Mitsuba attempts to reproduce the material within and associate it with the shape. + * Mitsuba attempts to reproduce the material within and associate it with the shape. * This is restricted to fairly basic materials and textures, hence in most cases - * it will be preferable to override this behavior by specifying an + * it will be preferable to override this behavior by specifying an * explicit Mitsuba BSDF that should be used instead. * This can be done by passing it as a child argument, e.g. * \begin{xml} @@ -117,15 +117,15 @@ MTS_NAMESPACE_BEGIN * \end{xml} * \paragraph{The \code{maxSmoothAngle} parameter:} * \label{sec:maxSmoothAngle} - * When given a mesh without vertex normals, Mitsuba will by default + * When given a mesh without vertex normals, Mitsuba will by default * create a smoothly varying normal field over the entire shape. This can produce * undesirable output when the input mesh contains regions that are intentionally * not smooth (i.e. corners, creases). Meshes that do include vertex - * normals sometimes incorrectly interpolate normals over such regions, leading to + * normals sometimes incorrectly interpolate normals over such regions, leading to * much the same problem. * - * The \code{maxSmoothAngle} parameter can be issued to force inspection of the dihedral angle associated with - * each edge in the input mesh and disable normal interpolation locally where this angle exceeds + * The \code{maxSmoothAngle} parameter can be issued to force inspection of the dihedral angle associated with + * each edge in the input mesh and disable normal interpolation locally where this angle exceeds * a certain threshold value. A reasonable value might be something like \code{30} (degrees). * The underlying analysis is somewhat costly and hence this parameter should only be used when it is * actually needed (i.e. when the mesh contains creases or edges and does not come with @@ -137,9 +137,9 @@ MTS_NAMESPACE_BEGIN * last resort. Due to inherent limitations of this format, the files tend to be unreasonably * large, and parsing them requires significant amounts of memory and processing power. What's worse * is that the internally stored data is often truncated, causing a loss of precision. - * + * * If possible, use the \pluginref{ply} or \pluginref{serialized} plugins instead. For convenience, it - * is also possible to convert legacy OBJ files into \code{.serialized} files using the \code{mtsimport} + * is also possible to convert legacy OBJ files into \code{.serialized} files using the \code{mtsimport} * utility. Using the resulting output will significantly accelerate the scene loading time. * } */ @@ -162,7 +162,7 @@ public: if (line == "") return true; int lastCharacter = (int) line.size() - 1; - while (lastCharacter >= 0 && + while (lastCharacter >= 0 && (line[lastCharacter] == '\r' || line[lastCharacter] == '\n' || line[lastCharacter] == '\t' || @@ -184,10 +184,10 @@ public: fs::path path = fileResolver->resolve(props.getString("filename")); m_name = path.stem().string(); - + /* By default, any existing normals will be used for rendering. If no normals are found, Mitsuba will - automatically generate smooth vertex normals. + automatically generate smooth vertex normals. Setting the 'faceNormals' parameter instead forces the use of face normals, which will result in a faceted appearance. @@ -196,7 +196,7 @@ public: /* Causes all normals to be flipped */ m_flipNormals = props.getBoolean("flipNormals", false); - + /* Causes all texture coordinates to be vertically flipped */ bool flipTexCoords = props.getBoolean("flipTexCoords", true); @@ -257,7 +257,7 @@ public: if (geomNames.find(targetName) != geomNames.end()) targetName = formatString("%s_%i", targetName.c_str(), geomIdx++); geomNames.insert(targetName); - createMesh(targetName, vertices, normals, texcoords, + createMesh(targetName, vertices, normals, texcoords, triangles, materialName, objectToWorld, vertexBuffer); triangles.clear(); } else { @@ -271,7 +271,7 @@ public: if (geomNames.find(name) != geomNames.end()) name = formatString("%s_%i", name.c_str(), geomIdx++); geomNames.insert(name); - createMesh(name, vertices, normals, texcoords, + createMesh(name, vertices, normals, texcoords, triangles, materialName, objectToWorld, vertexBuffer); triangles.clear(); name = m_name; @@ -283,7 +283,7 @@ public: } else if (buf == "vt") { Float u, v; iss >> u >> v; - if (flipTexCoords) + if (flipTexCoords) v = 1-v; texcoords.push_back(Point2(u, v)); } else if (buf == "f") { @@ -298,7 +298,7 @@ public: t.uv[1] = t.uv[0]; t.n[1] = t.n[0]; parse(t, 0, tmp); - + triangles.push_back(t); } if (iss >> tmp) @@ -312,7 +312,7 @@ public: /// make sure that we have unique names name = formatString("%s_%i", m_name.c_str(), geomIdx); - createMesh(name, vertices, normals, texcoords, + createMesh(name, vertices, normals, texcoords, triangles, materialName, objectToWorld, vertexBuffer); if (props.hasProperty("maxSmoothAngle")) { @@ -335,7 +335,7 @@ public: m_name = stream->readString(); uint32_t meshCount = stream->readUInt(); m_meshes.resize(meshCount); - + for (uint32_t i=0; i(manager->getInstance(stream)); m_meshes[i]->incRef(); @@ -373,8 +373,8 @@ public: } } - Texture *loadTexture(const FileResolver *fileResolver, - std::map &cache, + Texture *loadTexture(const FileResolver *fileResolver, + std::map &cache, const fs::path &mtlPath, std::string filename) { /* Prevent Linux/OSX fs::path handling issues for DAE files created on Windows */ for (size_t i=0; iresolve(fs::path(filename).filename()); if (!fs::exists(path)) { - Log(EWarn, "Unable to find texture \"%s\" referenced from \"%s\"!", + Log(EWarn, "Unable to find texture \"%s\" referenced from \"%s\"!", path.string().c_str(), mtlPath.string().c_str()); return new ConstantSpectrumTexture(Spectrum(0.0f)); } @@ -406,7 +406,7 @@ public: void loadMaterialLibrary(const FileResolver *fileResolver, const fs::path &mtlPath) { if (!fs::exists(mtlPath)) { - Log(EWarn, "Could not find referenced material library '%s'", + Log(EWarn, "Could not find referenced material library '%s'", mtlPath.string().c_str()); return; } @@ -414,7 +414,7 @@ public: Log(EInfo, "Loading OBJ materials from \"%s\" ..", mtlPath.filename().string().c_str()); fs::ifstream is(mtlPath); if (is.bad() || is.fail()) - Log(EError, "Unexpected I/O error while accessing material file '%s'!", + Log(EError, "Unexpected I/O error while accessing material file '%s'!", mtlPath.string().c_str()); std::string buf, line; std::string mtlName; @@ -431,11 +431,11 @@ public: continue; if (buf == "newmtl") { - if (mtlName != "") + if (mtlName != "") addMaterial(mtlName, diffuse, specular, exponent, bump, mask, illum); mtlName = trim(line.substr(6, line.length()-6)); - + specular = new ConstantSpectrumTexture(Spectrum(0.0f)); diffuse = new ConstantSpectrumTexture(Spectrum(0.0f)); exponent = new ConstantFloatTexture(0.0f); @@ -487,7 +487,7 @@ public: /* Ignore */ } } - + addMaterial(mtlName, diffuse, specular, exponent, bump, mask, illum); for (std::map::iterator it = cache.begin(); @@ -505,7 +505,7 @@ public: if (model == 2) { props.setPluginName("phong"); - + bsdf = static_cast (PluginManager::getInstance()-> createObject(MTS_CLASS(BSDF), props)); bsdf->addChild("diffuseReflectance", diffuse); @@ -562,7 +562,7 @@ public: }; /// For using vertices as keys in an associative structure - struct vertex_key_order : public + struct vertex_key_order : public std::binary_function { public: bool operator()(const Vertex &v1, const Vertex &v2) const { @@ -690,11 +690,11 @@ public: mesh->incRef(); m_materialAssignment.push_back(materialName); m_meshes.push_back(mesh); - Log(EInfo, "%s: " SIZE_T_FMT " triangles, " SIZE_T_FMT + Log(EInfo, "%s: " SIZE_T_FMT " triangles, " SIZE_T_FMT " vertices (merged " SIZE_T_FMT " vertices).", name.c_str(), triangles.size(), vertexBuffer.size(), numMerged); } - + virtual ~WavefrontOBJ() { for (size_t i=0; idecRef(); @@ -716,7 +716,7 @@ public: Shape::addChild(name, child); Assert(m_meshes.size() > 0); if (name == "") { - for (size_t i=0; iaddChild(name, child); } else { bool found = false; @@ -748,13 +748,13 @@ public: } else if (cClass->derivesFrom(MTS_CLASS(Subsurface))) { Assert(m_subsurface == NULL); m_subsurface = static_cast(child); - for (size_t i=0; isetParent(m_meshes[i]); m_meshes[i]->addChild(name, child); } } else if (cClass->derivesFrom(MTS_CLASS(Medium))) { Shape::addChild(name, child); - for (size_t i=0; iaddChild(name, child); } else { Shape::addChild(name, child); diff --git a/src/shapes/ply.cpp b/src/shapes/ply.cpp index d0971d2e..4faa7f25 100644 --- a/src/shapes/ply.cpp +++ b/src/shapes/ply.cpp @@ -79,7 +79,7 @@ MTS_NAMESPACE_BEGIN * the faceted appearance.}{shape_ply_bunny} * } * This plugin implements a fast loader for the Stanford PLY format (both - * the ASCII and binary format). It is based on the \code{libply} library by + * the ASCII and binary format). It is based on the \code{libply} library by * Ares Lagae (\url{http://people.cs.kuleuven.be/~ares.lagae/libply}). * The current plugin implementation supports triangle meshes with optional * UV coordinates, vertex normals, and vertex colors. @@ -95,10 +95,10 @@ public: props.getString("filename")); m_name = filePath.stem().string(); - /* Determines whether vertex colors should be + /* Determines whether vertex colors should be treated as linear RGB or sRGB. */ m_sRGB = props.getBoolean("srgb", true); - + /* Object-space -> World-space transformation */ m_objectToWorld = props.getTransform("toWorld", Transform()); @@ -151,16 +151,16 @@ public: message.c_str()); } - template std::tr1::function - scalar_property_definition_callback(const std::string& element_name, + template std::tr1::function + scalar_property_definition_callback(const std::string& element_name, const std::string& property_name); - template std::tr1::tuple, - std::tr1::function, std::tr1::function > + template std::tr1::tuple, + std::tr1::function, std::tr1::function > list_property_definition_callback(const std::string& element_name, const std::string& property_name); - std::tr1::tuple, std::tr1::function > + std::tr1::tuple, std::tr1::function > element_definition_callback(const std::string& element_name, std::size_t count) { if (element_name == "vertex") { m_vertexCount = count; @@ -194,10 +194,10 @@ public: void vertex_x_callback(ply::float32 x) { m_position.x = x; } void vertex_y_callback(ply::float32 y) { m_position.y = y; } void vertex_z_callback(ply::float32 z) { m_position.z = z; } - void normal_x_callback(ply::float32 x) { + void normal_x_callback(ply::float32 x) { if (!m_normals) m_normals = new Normal[m_vertexCount]; - m_normal.x = x; + m_normal.x = x; } void normal_y_callback(ply::float32 y) { m_normal.y = y; } void normal_z_callback(ply::float32 z) { m_normal.z = z; } @@ -262,13 +262,13 @@ public: void face_begin_callback() { } void face_end_callback() { } - void face_vertex_indices_begin_uint8(ply::uint8 size) { + void face_vertex_indices_begin_uint8(ply::uint8 size) { if (size != 3) Log(EError, "Only triangle PLY meshes are supported for now."); m_triangleIdxCtr = 0; } - void face_vertex_indices_begin_uint32(ply::uint32 size) { + void face_vertex_indices_begin_uint32(ply::uint32 size) { if (size != 3) Log(EError, "Only triangle PLY meshes are supported for now."); m_triangleIdxCtr = 0; @@ -286,7 +286,7 @@ public: m_triangle.idx[m_triangleIdxCtr++] = element; } - void face_vertex_indices_end() { + void face_vertex_indices_end() { Assert(m_triangleIdxCtr == 3); m_triangles[m_triangleCtr++] = m_triangle; } @@ -303,9 +303,9 @@ private: Point2 m_uv; bool m_sRGB; }; - -template<> std::tr1::function - PLYLoader::scalar_property_definition_callback(const std::string& element_name, + +template<> std::tr1::function + PLYLoader::scalar_property_definition_callback(const std::string& element_name, const std::string& property_name) { if (element_name == "vertex") { if (property_name == "x") { @@ -349,8 +349,8 @@ template<> std::tr1::function #endif } -template<> std::tr1::function - PLYLoader::scalar_property_definition_callback(const std::string& element_name, +template<> std::tr1::function + PLYLoader::scalar_property_definition_callback(const std::string& element_name, const std::string& property_name) { if (element_name == "vertex") { if (property_name == "diffuse_red" || property_name == "red") { @@ -376,12 +376,12 @@ template<> std::tr1::function #endif } -template<> std::tr1::tuple, - std::tr1::function, std::tr1::function > +template<> std::tr1::tuple, + std::tr1::function, std::tr1::function > PLYLoader::list_property_definition_callback(const std::string& element_name, const std::string& property_name) { if ((element_name == "face") && (property_name == "vertex_indices")) { - return std::tr1::tuple, + return std::tr1::tuple, std::tr1::function, std::tr1::function >( std::tr1::bind(&PLYLoader::face_vertex_indices_begin_uint8, this, _1), std::tr1::bind(&PLYLoader::face_vertex_indices_element_int32, this, _1), @@ -389,23 +389,23 @@ template<> std::tr1::tuple, ); } else { #if PLY_USE_NULLPTR - return std::tr1::tuple, - std::tr1::function, + return std::tr1::tuple, + std::tr1::function, std::tr1::function >(nullptr, nullptr, nullptr); #else - return std::tr1::tuple, - std::tr1::function, + return std::tr1::tuple, + std::tr1::function, std::tr1::function >(0, 0, 0); #endif } } -template<> std::tr1::tuple, - std::tr1::function, std::tr1::function > +template<> std::tr1::tuple, + std::tr1::function, std::tr1::function > PLYLoader::list_property_definition_callback(const std::string& element_name, const std::string& property_name) { if ((element_name == "face") && (property_name == "vertex_indices")) { - return std::tr1::tuple, + return std::tr1::tuple, std::tr1::function, std::tr1::function >( std::tr1::bind(&PLYLoader::face_vertex_indices_begin_uint32, this, _1), std::tr1::bind(&PLYLoader::face_vertex_indices_element_int32, this, _1), @@ -413,23 +413,23 @@ template<> std::tr1::tuple, ); } else { #if PLY_USE_NULLPTR - return std::tr1::tuple, - std::tr1::function, + return std::tr1::tuple, + std::tr1::function, std::tr1::function >(nullptr, nullptr, nullptr); #else - return std::tr1::tuple, - std::tr1::function, + return std::tr1::tuple, + std::tr1::function, std::tr1::function >(0, 0, 0); #endif } } -template<> std::tr1::tuple, - std::tr1::function, std::tr1::function > +template<> std::tr1::tuple, + std::tr1::function, std::tr1::function > PLYLoader::list_property_definition_callback(const std::string& element_name, const std::string& property_name) { if ((element_name == "face") && (property_name == "vertex_indices")) { - return std::tr1::tuple, + return std::tr1::tuple, std::tr1::function, std::tr1::function >( std::tr1::bind(&PLYLoader::face_vertex_indices_begin_uint8, this, _1), std::tr1::bind(&PLYLoader::face_vertex_indices_element_uint32, this, _1), @@ -437,23 +437,23 @@ template<> std::tr1::tuple, ); } else { #if PLY_USE_NULLPTR - return std::tr1::tuple, - std::tr1::function, + return std::tr1::tuple, + std::tr1::function, std::tr1::function >(nullptr, nullptr, nullptr); #else - return std::tr1::tuple, - std::tr1::function, + return std::tr1::tuple, + std::tr1::function, std::tr1::function >(0, 0, 0); #endif } } -template<> std::tr1::tuple, - std::tr1::function, std::tr1::function > +template<> std::tr1::tuple, + std::tr1::function, std::tr1::function > PLYLoader::list_property_definition_callback(const std::string& element_name, const std::string& property_name) { if ((element_name == "face") && (property_name == "vertex_indices")) { - return std::tr1::tuple, + return std::tr1::tuple, std::tr1::function, std::tr1::function >( std::tr1::bind(&PLYLoader::face_vertex_indices_begin_uint32, this, _1), std::tr1::bind(&PLYLoader::face_vertex_indices_element_uint32, this, _1), @@ -461,12 +461,12 @@ template<> std::tr1::tuple, ); } else { #if PLY_USE_NULLPTR - return std::tr1::tuple, - std::tr1::function, + return std::tr1::tuple, + std::tr1::function, std::tr1::function >(nullptr, nullptr, nullptr); #else - return std::tr1::tuple, - std::tr1::function, + return std::tr1::tuple, + std::tr1::function, std::tr1::function >(0, 0, 0); #endif } @@ -477,10 +477,10 @@ void PLYLoader::loadPLY(const fs::path &path) { ply::ply_parser ply_parser; ply_parser.info_callback(std::tr1::bind(&PLYLoader::info_callback, this, std::tr1::ref(m_name), _1, _2)); - ply_parser.warning_callback(std::tr1::bind(&PLYLoader::warning_callback, + ply_parser.warning_callback(std::tr1::bind(&PLYLoader::warning_callback, + this, std::tr1::ref(m_name), _1, _2)); + ply_parser.error_callback(std::tr1::bind(&PLYLoader::error_callback, this, std::tr1::ref(m_name), _1, _2)); - ply_parser.error_callback(std::tr1::bind(&PLYLoader::error_callback, - this, std::tr1::ref(m_name), _1, _2)); ply_parser.element_definition_callback(std::tr1::bind(&PLYLoader::element_definition_callback, this, _1, _2)); @@ -520,7 +520,7 @@ void PLYLoader::loadPLY(const fs::path &path) { if (m_texcoords) vertexSize += sizeof(Point2); - Log(EInfo, "\"%s\": Loaded " SIZE_T_FMT " triangles, " SIZE_T_FMT + Log(EInfo, "\"%s\": Loaded " SIZE_T_FMT " triangles, " SIZE_T_FMT " vertices (%s in %i ms).", m_name.c_str(), m_triangleCount, m_vertexCount, memString(sizeof(uint32_t) * m_triangleCount * 3 + vertexSize * m_vertexCount).c_str(), timer->getMilliseconds()); diff --git a/src/shapes/rectangle.cpp b/src/shapes/rectangle.cpp index 1389b5e5..97a67e29 100644 --- a/src/shapes/rectangle.cpp +++ b/src/shapes/rectangle.cpp @@ -44,15 +44,15 @@ MTS_NAMESPACE_BEGIN * \rendering{Two rectangles configured as a reflective surface and an * emitter (\lstref{rectangle})}{shape_rectangle} * } - * + * * This shape plugin describes a simple rectangular intersection primitive. * It is mainly provided as a convenience for those cases when creating and - * loading an external mesh with two triangles is simply too tedious, e.g. + * loading an external mesh with two triangles is simply too tedious, e.g. * when an area light source or a simple ground plane are needed. * * By default, the rectangle covers the XY-range $[-1,1]\times[-1,1]$ * and has a surface normal that points into the positive $Z$ direction. - * To change the rectangle scale, rotation, or translation, use the + * To change the rectangle scale, rotation, or translation, use the * \code{toWorld} parameter. * * \vspace{2mm} @@ -84,7 +84,7 @@ public: m_worldToObject = m_objectToWorld.inverse(); } - Rectangle(Stream *stream, InstanceManager *manager) + Rectangle(Stream *stream, InstanceManager *manager) : Shape(stream, manager) { m_objectToWorld = Transform(stream); m_worldToObject = m_objectToWorld.inverse(); @@ -152,7 +152,7 @@ public: return Rectangle::rayIntersect(ray, mint, maxt, t, NULL); } - void fillIntersectionRecord(const Ray &ray, + void fillIntersectionRecord(const Ray &ray, const void *temp, Intersection &its) const { const Float *data = static_cast(temp); its.shFrame = its.geoFrame = m_frame; @@ -189,7 +189,7 @@ public: triangles[0].idx[0] = 0; triangles[0].idx[1] = 1; triangles[0].idx[2] = 2; - + triangles[1].idx[0] = 2; triangles[1].idx[1] = 3; triangles[1].idx[2] = 0; @@ -229,7 +229,7 @@ public: std::ostringstream oss; oss << "Rectangle[" << endl << " objectToWorld = " << indent(m_objectToWorld.toString()) << ", " << endl; - if (isMediumTransition()) + if (isMediumTransition()) oss << " interiorMedium = " << indent(m_interiorMedium.toString()) << "," << endl << " exteriorMedium = " << indent(m_exteriorMedium.toString()) << "," << endl; oss << " bsdf = " << indent(m_bsdf.toString()) << "," << endl diff --git a/src/shapes/serialized.cpp b/src/shapes/serialized.cpp index 72d70d5d..279283fa 100644 --- a/src/shapes/serialized.cpp +++ b/src/shapes/serialized.cpp @@ -35,7 +35,7 @@ MTS_NAMESPACE_BEGIN * specifies which one should be loaded. \default{\code{0}, i.e. the first one} * } * \parameter{faceNormals}{\Boolean}{ - * When set to \code{true}, any existing or computed vertex normals are + * When set to \code{true}, any existing or computed vertex normals are * discarded and \emph{face normals} will instead be used during rendering. * This gives the rendered object a faceted apperance.\default{\code{false}} * } @@ -57,8 +57,8 @@ MTS_NAMESPACE_BEGIN * The serialized mesh format represents the most space and time-efficient way * of getting geometry information into Mitsuba. It stores indexed triangle meshes * in a lossless gzip-based encoding that (after decompression) nicely matches up - * with the internally used data structures. Loading such files is considerably - * faster than the \pluginref{ply} plugin and orders of magnitude faster than + * with the internally used data structures. Loading such files is considerably + * faster than the \pluginref{ply} plugin and orders of magnitude faster than * the \pluginref{obj} plugin. \vspace{-3mm} * * \paragraph{Format description:} @@ -92,16 +92,16 @@ MTS_NAMESPACE_BEGIN * \code{string}&A null-terminated string (utf-8), which denotes the name of the shape.\\ * \code{uint64}&Number of vertices in the mesh\\ * \code{uint64}&Number of triangles in the mesh\\ - * \code{array}&Array of all vertex positions (X, Y, Z, X, Y, Z, ...) + * \code{array}&Array of all vertex positions (X, Y, Z, X, Y, Z, ...) * specified in binary single or double precision format (as denoted by the * flags)\\ - * \code{array}&Array of all vertex normal directions (X, Y, Z, X, Y, Z, ...) + * \code{array}&Array of all vertex normal directions (X, Y, Z, X, Y, Z, ...) * specified in binary single or double precision format. When the mesh has * no vertex normals, this field is omitted.\\ - * \code{array}&Array of all vertex texture coordinates (U, V, U, V, ...) + * \code{array}&Array of all vertex texture coordinates (U, V, U, V, ...) * specified in binary single or double precision format. When the mesh has * no texture coordinates, this field is omitted.\\ - * \code{array}&Array of all vertex colors (R, G, B, R, G, B, ...) + * \code{array}&Array of all vertex colors (R, G, B, R, G, B, ...) * specified in binary single or double precision format. When the mesh has * no vertex colors, this field is omitted.\\ * \code{array}&Indexed triangle data (\code{[i1, i2, i3]}, \code{[i1, i2, i3]}, ..) @@ -114,12 +114,12 @@ MTS_NAMESPACE_BEGIN * It is possible to store multiple meshes in a single \code{.serialized} * file. This is done by simply concatenating their data streams, * where every one is structured according to the above description. - * Hence, after each mesh, the stream briefly reverts back to an - * uncompressed format, followed by an uncompressed header, and so on. + * Hence, after each mesh, the stream briefly reverts back to an + * uncompressed format, followed by an uncompressed header, and so on. * This is neccessary for efficient read access to arbitrary sub-meshes. * * \paragraph{End-of-file dictionary:} In addition to the previous table, - * a \code{.serialized} file also concludes with a brief summary at the end of + * a \code{.serialized} file also concludes with a brief summary at the end of * the file, which specifies the starting position of each sub-mesh: * \begin{center} * \begin{longtable}{>{\bfseries}p{2cm}p{11cm}} @@ -144,11 +144,11 @@ public: /* Object-space -> World-space transformation */ Transform objectToWorld = props.getTransform("toWorld", Transform()); - /// When the file contains multiple meshes, this index specifies which one to load + /// When the file contains multiple meshes, this index specifies which one to load int shapeIndex = props.getInteger("shapeIndex", 0); - m_name = (props.getID() != "unnamed") ? props.getID() - : formatString("%s@%i", filePath.stem().string().c_str(), shapeIndex); + m_name = (props.getID() != "unnamed") ? props.getID() + : formatString("%s@%i", filePath.stem().string().c_str(), shapeIndex); /* Load the geometry */ Log(EInfo, "Loading shape %i from \"%s\" ..", shapeIndex, filePath.filename().string().c_str()); @@ -160,7 +160,7 @@ public: /* By default, any existing normals will be used for rendering. If no normals are found, Mitsuba will - automatically generate smooth vertex normals. + automatically generate smooth vertex normals. Setting the 'faceNormals' parameter instead forces the use of face normals, which will result in a faceted appearance. @@ -178,7 +178,7 @@ public: m_aabb.expandBy(p); } if (m_normals) { - for (size_t i=0; ireadSize(); diff --git a/src/shapes/shapegroup.h b/src/shapes/shapegroup.h index 826c3433..47559fe8 100644 --- a/src/shapes/shapegroup.h +++ b/src/shapes/shapegroup.h @@ -27,8 +27,8 @@ MTS_NAMESPACE_BEGIN * \brief "Fake" shape that groups sub-shapes into a * separate KD-tree. * - * This shape doesn't actually generate any intersectable - * geometry on its own. Instead, the "instance" plugin must + * This shape doesn't actually generate any intersectable + * geometry on its own. Instead, the "instance" plugin must * be used to create references to the geometry stored inside it. */ class ShapeGroup : public Shape { @@ -64,7 +64,7 @@ public: /// Return the primitive count of the nested shapes size_t getPrimitiveCount() const; - + /// Return the effective primitive count of this shape (always zero) size_t getEffectivePrimitiveCount() const; diff --git a/src/shapes/sphere.cpp b/src/shapes/sphere.cpp index 63f17da6..1d1de05d 100644 --- a/src/shapes/sphere.cpp +++ b/src/shapes/sphere.cpp @@ -47,7 +47,7 @@ MTS_NAMESPACE_BEGIN * be flipped? \default{\code{false}, i.e. the normals point outside} * } * } - * + * * \renderings{ * \rendering{Basic example, see \lstref{sphere-basic}} * {shape_sphere_basic} @@ -55,11 +55,11 @@ MTS_NAMESPACE_BEGIN * {shape_sphere_parameterization} * } * - * This shape plugin describes a simple sphere intersection primitive. It should + * This shape plugin describes a simple sphere intersection primitive. It should * always be preferred over sphere approximations modeled using triangles. - * - * \begin{xml}[caption={A sphere can either be configured using a linear - * \code{toWorld} transformation or the \code{center} and \code{radius} parameters (or both). + * + * \begin{xml}[caption={A sphere can either be configured using a linear + * \code{toWorld} transformation or the \code{center} and \code{radius} parameters (or both). * The above two declarations are equivalent.}, label=lst:sphere-basic] * * @@ -77,7 +77,7 @@ MTS_NAMESPACE_BEGIN * \end{xml} * When a \pluginref{sphere} shape is turned into an \pluginref{area} light source, * Mitsuba switches to an efficient sampling strategy \cite{Shirley91Direct} that - * has particularly low variance. This makes it a good default choice for lighting + * has particularly low variance. This makes it a good default choice for lighting * new scenes (\figref{spherelight}). * \renderings{ * \rendering{Spherical area light modeled using triangles} @@ -87,8 +87,8 @@ MTS_NAMESPACE_BEGIN * * \caption{ * \label{fig:spherelight} - * Area lights built from the combination of the \pluginref{area} - * and \pluginref{sphere} plugins produce renderings that have an + * Area lights built from the combination of the \pluginref{area} + * and \pluginref{sphere} plugins produce renderings that have an * overall lower variance. * } * } @@ -106,7 +106,7 @@ MTS_NAMESPACE_BEGIN class Sphere : public Shape { public: Sphere(const Properties &props) : Shape(props) { - m_objectToWorld = + m_objectToWorld = Transform::translate(Vector(props.getPoint("center", Point(0.0f)))); m_radius = props.getFloat("radius", 1.0f); @@ -114,9 +114,9 @@ public: Transform objectToWorld = props.getTransform("toWorld"); Float radius = objectToWorld(Vector(1,0,0)).length(); // Remove the scale from the object-to-world transform - m_objectToWorld = - objectToWorld - * Transform::scale(Vector(1/radius)) + m_objectToWorld = + objectToWorld + * Transform::scale(Vector(1/radius)) * m_objectToWorld; m_radius *= radius; } @@ -131,7 +131,7 @@ public: Log(EError, "Cannot create spheres of radius <= 0"); } - Sphere(Stream *stream, InstanceManager *manager) + Sphere(Stream *stream, InstanceManager *manager) : Shape(stream, manager) { m_objectToWorld = Transform(stream); m_radius = stream->readFloat(); @@ -177,7 +177,7 @@ public: if (nearT < mint) { if (farT > maxt) return false; - t = (Float) farT; + t = (Float) farT; } else { t = (Float) nearT; } @@ -205,10 +205,10 @@ public: return true; } - void fillIntersectionRecord(const Ray &ray, + void fillIntersectionRecord(const Ray &ray, const void *temp, Intersection &its) const { its.p = ray(its.t); - + #if defined(SINGLE_PRECISION) /* Re-project onto the sphere to limit cancellation effects */ its.p = m_center + normalize(its.p - m_center) * m_radius; @@ -261,7 +261,7 @@ public: if (m_flipNormals) pRec.n *= -1; - + pRec.pdf = m_invSurfaceArea; pRec.measure = EArea; } @@ -301,7 +301,7 @@ public: Warp::squareToUniformCone(cosAlpha, sample)); dRec.pdf = Warp::squareToUniformConePdf(cosAlpha); - /* Distance to the projection of the sphere center + /* Distance to the projection of the sphere center onto the ray (dRec.ref, dRec.d) */ const Float projDist = dot(refToCenter, dRec.d); @@ -310,7 +310,7 @@ public: with normal refToCenter which goes through the sphere's center */ const Float baseT = refDist2 / projDist; const Point query = dRec.ref + dRec.d * baseT; - + const Vector queryToCenter = m_center - query; const Float queryDist2 = queryToCenter.lengthSquared(); const Float queryProjDist = dot(queryToCenter, dRec.d); @@ -323,7 +323,7 @@ public: Float nearT, farT; if (!solveQuadratic(A, B, C, nearT, farT)) { /* The intersection couldn't be found due to roundoff errors.. - Don't give up -- one workaround is to project the closest + Don't give up -- one workaround is to project the closest ray position onto the sphere */ nearT = queryProjDist; } @@ -343,7 +343,7 @@ public: Float dist2 = dRec.d.lengthSquared(); dRec.dist = std::sqrt(dist2); dRec.d /= dRec.dist; - dRec.pdf = m_invSurfaceArea * dist2 + dRec.pdf = m_invSurfaceArea * dist2 / absDot(dRec.d, dRec.n); } @@ -369,7 +369,7 @@ public: if (dRec.measure == ESolidAngle) return pdfSA; else if (dRec.measure == EArea) - return pdfSA * absDot(dRec.d, dRec.n) + return pdfSA * absDot(dRec.d, dRec.n) / (dRec.dist*dRec.dist); else return 0.0f; @@ -470,7 +470,7 @@ public: << " radius = " << m_radius << ", " << endl << " center = " << m_center.toString() << ", " << endl << " bsdf = " << indent(m_bsdf.toString()) << "," << endl; - if (isMediumTransition()) + if (isMediumTransition()) oss << " interiorMedium = " << indent(m_interiorMedium.toString()) << "," << endl << " exteriorMedium = " << indent(m_exteriorMedium.toString()) << "," << endl; oss << " emitter = " << indent(m_emitter.toString()) << "," << endl diff --git a/src/subsurface/bluenoise.cpp b/src/subsurface/bluenoise.cpp index f4c73db9..7844bbbc 100644 --- a/src/subsurface/bluenoise.cpp +++ b/src/subsurface/bluenoise.cpp @@ -63,7 +63,7 @@ struct Cell { }; void blueNoisePointSet(const Scene *scene, const std::vector &shapes, - Float radius, PositionSampleVector *target, Float &sa, AABB &aabb, + Float radius, PositionSampleVector *target, Float &sa, AABB &aabb, const void *data) { int kmax = 8; /* Perform 8 trial runs */ @@ -175,7 +175,7 @@ void blueNoisePointSet(const Scene *scene, const std::vector &shapes, SLog(EInfo, " phase 4: establishing valid cells and phase groups .."); typedef boost::unordered_map CellMap; - + CellMap cells(samples.size()); std::vector > phaseGroups(27); for (int i=0; i<27; ++i) @@ -200,7 +200,7 @@ void blueNoisePointSet(const Scene *scene, const std::vector &shapes, } SLog(EInfo, " done (took %i ms), got %i cells, avg. samples per cell: %f", - timer->getMilliseconds(), (int) cells.size(), + timer->getMilliseconds(), (int) cells.size(), samples.size() / (Float) cells.size()); rep.update(4); timer->reset(); @@ -230,7 +230,7 @@ void blueNoisePointSet(const Scene *scene, const std::vector &shapes, for (int z=-2; z<3; ++z) { for (int y=-2; y<3; ++y) { for (int x=-2; x<3; ++x) { - int64_t neighborCellID = cellID + x + int64_t neighborCellID = cellID + x + (int64_t) cellCount[0] * (y + z * (int64_t) cellCount[1]); CellMap::iterator it = cells.find(neighborCellID); @@ -271,5 +271,5 @@ void blueNoisePointSet(const Scene *scene, const std::vector &shapes, SLog(EInfo, "Sampling finished (obtained %i blue noise samples)", (int) target->size()); } - + MTS_NAMESPACE_END diff --git a/src/subsurface/bluenoise.h b/src/subsurface/bluenoise.h index ae5f045e..d3517b20 100644 --- a/src/subsurface/bluenoise.h +++ b/src/subsurface/bluenoise.h @@ -26,7 +26,7 @@ MTS_NAMESPACE_BEGIN /** * \brief Generate a point set with blue noise properties * - * Based on the paper "Parallel Poisson Disk Sampling with + * Based on the paper "Parallel Poisson Disk Sampling with * Spectrum Analysis on Surfaces" by John Bowers, Rui Wang, * Li-Yi Wei and David Maletz. * @@ -46,8 +46,8 @@ MTS_NAMESPACE_BEGIN * Custom pointer that will be sent along with progress messages * (usually contains a pointer to the \ref RenderJob instance) */ -extern void blueNoisePointSet(const Scene *scene, - const std::vector &shapes, Float radius, +extern void blueNoisePointSet(const Scene *scene, + const std::vector &shapes, Float radius, PositionSampleVector *target, Float &sa, AABB &aabb, const void *data); diff --git a/src/subsurface/dipole.cpp b/src/subsurface/dipole.cpp index b43b3e47..ff467eb4 100644 --- a/src/subsurface/dipole.cpp +++ b/src/subsurface/dipole.cpp @@ -27,13 +27,13 @@ MTS_NAMESPACE_BEGIN /** - * Computes the combined diffuse radiant exitance + * Computes the combined diffuse radiant exitance * caused by a number of dipole sources */ struct IsotropicDipoleQuery { #if !defined(MTS_SSE) || SPECTRUM_SAMPLES != 3 - inline IsotropicDipoleQuery(const Spectrum &zr, const Spectrum &zv, - const Spectrum &sigmaTr, const Point &p) + inline IsotropicDipoleQuery(const Spectrum &zr, const Spectrum &zv, + const Spectrum &sigmaTr, const Point &p) : zr(zr), zv(zv), sigmaTr(sigmaTr), result(0.0f), p(p) { } @@ -64,7 +64,7 @@ struct IsotropicDipoleQuery { const Spectrum &zr, &zv, &sigmaTr; Spectrum result; #else - inline IsotropicDipoleQuery(const Spectrum &_zr, const Spectrum &_zv, + inline IsotropicDipoleQuery(const Spectrum &_zr, const Spectrum &_zv, const Spectrum &_sigmaTr, const Point &p) : p(p) { zr = _mm_set_ps(_zr[0], _zr[1], _zr[2], 0); zv = _mm_set_ps(_zv[0], _zv[1], _zv[2], 0); @@ -77,9 +77,9 @@ struct IsotropicDipoleQuery { inline void operator()(const IrradianceSample &sample) { /* Distance to the positive point source of the dipole */ const __m128 lengthSquared = _mm_set1_ps((p - sample.p).lengthSquared()), - drSqr = _mm_add_ps(zrSqr, lengthSquared), + drSqr = _mm_add_ps(zrSqr, lengthSquared), dvSqr = _mm_add_ps(zvSqr, lengthSquared), - dr = _mm_sqrt_ps(drSqr), dv = _mm_sqrt_ps(dvSqr), + dr = _mm_sqrt_ps(drSqr), dv = _mm_sqrt_ps(dvSqr), one = _mm_set1_ps(1.0f), factor = _mm_mul_ps(_mm_set1_ps(INV_FOURPI*sample.area), _mm_set_ps(sample.E[0], sample.E[1], sample.E[2], 0)), @@ -113,7 +113,7 @@ static int irrOctreeIndex = 0; /*!\plugin{dipole}{Dipole-based subsurface scattering model} * \parameters{ * \parameter{material}{\String}{ - * Name of a material preset, see + * Name of a material preset, see * \tblref{medium-coefficients}. \default{\texttt{skin1}} * } * \parameter{sigmaA, sigmaS}{\Spectrum}{ @@ -123,7 +123,7 @@ static int irrOctreeIndex = 0; * \default{configured based on \code{material}} * } * \parameter{sigmaT, albedo}{\Spectrum}{ - * Extinction coefficient in inverse scene units + * Extinction coefficient in inverse scene units * and a (unitless) single-scattering albedo. * These parameters are mutually exclusive with \code{sigmaA} and \code{sigmaS} * \default{configured based on \code{material}} @@ -143,23 +143,23 @@ static int irrOctreeIndex = 0; * } * * \renderings{ - * \rendering{The material test ball rendered with the \code{skimmilk} + * \rendering{The material test ball rendered with the \code{skimmilk} * material preset}{subsurface_dipole.jpg} - * \rendering{The material test ball rendered with the \code{skin1} + * \rendering{The material test ball rendered with the \code{skin1} * material preset}{subsurface_dipole_2.jpg} * } * \renderings{ * \rendering{\code{scale=1}}{subsurface_dipole_dragon.jpg} * \rendering{\code{scale=0.2}}{subsurface_dipole_dragon2.jpg} - * \caption{The dragon model rendered with the \code{skin2} + * \caption{The dragon model rendered with the \code{skin2} * material preset (model courtesy of XYZ RGB). The \code{scale} - * parameter is useful to communicate the relative size of + * parameter is useful to communicate the relative size of * an object to the viewer.} * } * This plugin implements the classic dipole subsurface scattering model - * from radiative transport and medical physics \cite{Eason1978Theory, - * Farrell1992Diffusion} in the form proposed by Jensen et al. + * from radiative transport and medical physics \cite{Eason1978Theory, + * Farrell1992Diffusion} in the form proposed by Jensen et al. * \cite{Jensen2001Practical}. It relies on the assumption that light entering * a material will undergo many (i.e. hundreds) of internal scattering * events, such that diffusion theory becomes applicable. In this @@ -170,30 +170,30 @@ static int irrOctreeIndex = 0; * that enables simulating this effect without having to account for the vast * numbers of internal scattering events individually. * - * For each \code{dipole} instance in the scene, the plugin adds a pre-process pass + * For each \code{dipole} instance in the scene, the plugin adds a pre-process pass * to the rendering that computes the irradiance on a large set of sample positions * spread uniformly over the surface in question. The locations of these - * points are chosen using a technique by Bowers et al. \cite{Bowers2010Parallel} - * that creates particularly well-distributed (blue noise) samples. Later during - * rendering, these illumination samples are convolved with the diffusion profile + * points are chosen using a technique by Bowers et al. \cite{Bowers2010Parallel} + * that creates particularly well-distributed (blue noise) samples. Later during + * rendering, these illumination samples are convolved with the diffusion profile * using a fast hierarchical technique proposed by Jensen and Buhler \cite{Jensen2005Rapid}. * - * There are several different ways of configuring the medium properties. - * Either, a material preset can be loaded using the \code{material} - * parameter---see \tblref{medium-coefficients} for details. Alternatively, - * when specifying parameters by hand, they can either be provided using - * the scattering and absorption coefficients, or by declaring the extinction - * coefficient and single scattering albedo (whichever is more convenient). + * There are several different ways of configuring the medium properties. + * Either, a material preset can be loaded using the \code{material} + * parameter---see \tblref{medium-coefficients} for details. Alternatively, + * when specifying parameters by hand, they can either be provided using + * the scattering and absorption coefficients, or by declaring the extinction + * coefficient and single scattering albedo (whichever is more convenient). * Mixing these parameter initialization methods is not allowed. * * All scattering parameters (named \code{sigma*}) should - * be provided in inverse scene units. For instance, when a world-space + * be provided in inverse scene units. For instance, when a world-space * distance of 1 unit corresponds to a meter, the scattering coefficents must * be in units of inverse meters. For convenience, the \code{scale} * parameter can be used to correct this. For instance, when the scene is - * in meters and the coefficients are in inverse millimeters, set + * in meters and the coefficients are in inverse millimeters, set * \code{scale=1000}. - * + * * Note that a subsurface integrator can be associated with an \code{id} * and shared by several shapes using the reference mechanism introduced in * \secref{format}. This can be useful when an object is made up of many @@ -216,14 +216,14 @@ static int irrOctreeIndex = 0; * \subsubsection*{Typical material setup} * To create a realistic material with subsurface scattering, it is necessary * to associate the underlying shape with an appropriately configured surface - * and subsurface scattering model. Both should be aware of the material's - * index of refraction. + * and subsurface scattering model. Both should be aware of the material's + * index of refraction. * * Because the \pluginref{dipole} plugin is responsible for all internal * scattering, the surface scattering model should only account for specular * reflection due to the index of refraction change. There are two models * in Mitsuba that can do this: \pluginref{plastic} and - * \pluginref{roughplastic} (for smooth and rough interfaces, respectively). + * \pluginref{roughplastic} (for smooth and rough interfaces, respectively). * An example is given on the next page. * \pagebreak * \begin{xml} @@ -247,37 +247,37 @@ static int irrOctreeIndex = 0; * * \remarks{ * \item This plugin only implements the multiple scattering component of - * the dipole model, i.e. single scattering is omitted. Furthermore, the + * the dipole model, i.e. single scattering is omitted. Furthermore, the * numerous assumptions built into the underlying theory can cause severe * inaccuracies. * - * For this reason, this plugin is the right choice for making pictures + * For this reason, this plugin is the right choice for making pictures * that ``look nice'', but it should be avoided when the output must hold - * up to real-world measurements. In this case, please use participating media + * up to real-world measurements. In this case, please use participating media * (\secref{media}). * * \item It is quite important that the \code{sigma*} parameters have the right units. * For instance: if the \code{sigmaT} parameter is accidentally set to a value that * is too small by a factor of 1000, the plugin will attempt to create - * one million times as many irradiance samples, which will likely cause + * one million times as many irradiance samples, which will likely cause * the rendering process to crash with an ``out of memory'' failure. * } */ class IsotropicDipole : public Subsurface { public: - IsotropicDipole(const Properties &props) + IsotropicDipole(const Properties &props) : Subsurface(props) { { LockGuard lock(irrOctreeMutex); m_octreeIndex = irrOctreeIndex++; } - /* How many samples should be taken when estimating + /* How many samples should be taken when estimating the irradiance at a given point in the scene? */ m_irrSamples = props.getInteger("irrSamples", 16); - /* When estimating the irradiance at a given point, + /* When estimating the irradiance at a given point, should indirect illumination be included in the final estimate? */ m_irrIndirect = props.getBoolean("irrIndirect", true); @@ -287,7 +287,7 @@ public: /* Error threshold - lower means better quality */ m_quality = props.getFloat("quality", 0.2f); - + /* Asymmetry parameter of the phase function */ m_g = props.getFloat("g", 0); m_ready = false; @@ -296,7 +296,7 @@ public: lookupMaterial(props, m_sigmaS, m_sigmaA, &m_eta); } - IsotropicDipole(Stream *stream, InstanceManager *manager) + IsotropicDipole(Stream *stream, InstanceManager *manager) : Subsurface(stream, manager) { m_sigmaS = Spectrum(stream); m_sigmaA = Spectrum(stream); @@ -370,7 +370,7 @@ public: m_sigmaTr = (m_sigmaA * m_sigmaTPrime * 3.0f).sqrt(); /* Distance of the two dipole point sources to the surface */ - m_zr = mfp; + m_zr = mfp; m_zv = mfp * (1.0f + 4.0f/3.0f * A); } @@ -399,7 +399,7 @@ public: /* 2. Gather irradiance in parallel */ const Sensor *sensor = scene->getSensor(); ref proc = new IrradianceSamplingProcess( - points, 1024, m_irrSamples, m_irrIndirect, + points, 1024, m_irrSamples, m_irrIndirect, sensor->getShutterOpen() + 0.5f * sensor->getShutterOpenTime(), job); /* Create a sampler instance for every core */ @@ -438,7 +438,7 @@ public: std::vector &samples = proc->getIrradianceSampleVector()->get(); sa /= samples.size(); - for (size_t i=0; iwakeup(NULL, m_resources); } - void process(const WorkUnit *workUnit, WorkResult *workResult, + void process(const WorkUnit *workUnit, WorkResult *workResult, const bool &stop) { const PositionSampleVector &positions = *static_cast(workUnit); IrradianceSampleVector *result = static_cast(workResult); @@ -147,14 +147,14 @@ std::string IrradianceSampleVector::toString() const { IrradianceSamplingProcess::IrradianceSamplingProcess(PositionSampleVector *positions, size_t granularity, int irrSamples, bool irrIndirect, Float time, - const void *data) + const void *data) : m_positionSamples(positions), m_granularity(granularity), m_irrSamples(irrSamples), m_irrIndirect(irrIndirect), m_time(time) { m_resultMutex = new Mutex(); m_irradianceSamples = new IrradianceSampleVector(); m_irradianceSamples->reserve(positions->size()); m_samplesRequested = 0; - m_progress = new ProgressReporter("Sampling irradiance", positions->size(), data); + m_progress = new ProgressReporter("Sampling irradiance", positions->size(), data); } IrradianceSamplingProcess::~IrradianceSamplingProcess() { @@ -177,7 +177,7 @@ ParallelProcess::EStatus IrradianceSamplingProcess::generateWork(WorkUnit *unit, const std::vector &source = m_positionSamples->get(); samples.clear(); - samples.insert(samples.begin(), + samples.insert(samples.begin(), source.begin() + m_samplesRequested, source.begin() + m_samplesRequested + workSize); m_samplesRequested += workSize; diff --git a/src/subsurface/irrproc.h b/src/subsurface/irrproc.h index 25cf158d..ea79cb0d 100644 --- a/src/subsurface/irrproc.h +++ b/src/subsurface/irrproc.h @@ -38,7 +38,7 @@ public: n = Normal(stream); shapeIndex = stream->readInt(); } - inline PositionSample(const Point &p, const Normal &n, int shapeIndex) + inline PositionSample(const Point &p, const Normal &n, int shapeIndex) : p(p), n(n), shapeIndex(shapeIndex) { } /// Serialize an position sample to a binary data stream @@ -55,7 +55,7 @@ public: /** * \brief This class stores a number of position samples, which can be sent - * over the wire as needed. + * over the wire as needed. * * Used to implement parallel irradiance sampling for the dipole BSSRDF. */ @@ -121,7 +121,7 @@ public: * \param p The sample point on the surface * \param E The irradiance value at this position */ - inline IrradianceSample(const Point &p, const Spectrum &E) + inline IrradianceSample(const Point &p, const Spectrum &E) : p(p), E(E) { } /// Serialize an irradiance sample to a binary data stream @@ -144,7 +144,7 @@ public: /** * \brief This class stores a number of irradiance samples, which can be sent - * over the wire as needed. + * over the wire as needed. * * Used to implement parallel irradiance sampling for the dipole BSSRDF. */ @@ -195,7 +195,7 @@ private: class IrradianceSamplingProcess : public ParallelProcess { public: IrradianceSamplingProcess(PositionSampleVector *positions, - size_t granularity, int irrSamples, bool irrIndirect, + size_t granularity, int irrSamples, bool irrIndirect, Float time, const void *data); inline IrradianceSampleVector *getIrradianceSampleVector() { @@ -211,7 +211,7 @@ public: } /* ParallelProcess implementation */ - ref createWorkProcessor() const; + ref createWorkProcessor() const; void processResult(const WorkResult *wr, bool cancelled); ParallelProcess::EStatus generateWork(WorkUnit *unit, int worker); diff --git a/src/subsurface/irrtree.cpp b/src/subsurface/irrtree.cpp index 21ac133e..26f45b7c 100644 --- a/src/subsurface/irrtree.cpp +++ b/src/subsurface/irrtree.cpp @@ -98,7 +98,7 @@ void IrradianceOctree::propagate(OctreeNode *node) { repr.E /= repr.area; if (weightSum != 0) repr.p /= weightSum; - + ++statsNumNodes; } diff --git a/src/subsurface/irrtree.h b/src/subsurface/irrtree.h index 92b18dc3..1fe06831 100644 --- a/src/subsurface/irrtree.h +++ b/src/subsurface/irrtree.h @@ -36,7 +36,7 @@ public: /// Serialize an octree to a binary data stream void serialize(Stream *stream, InstanceManager *manager) const; - + /// Query the octree using a customizable functor, while representatives for distant nodes template inline void performQuery(QueryType &query) const { performQuery(m_aabb, m_root, query); @@ -64,7 +64,7 @@ protected: for (int i=0; i<8; i++) { if (!node->children[i]) continue; - + AABB childAABB = childBounds(i, aabb, center); performQuery(childAABB, node->children[i], query); } diff --git a/src/tests/test_chisquare.cpp b/src/tests/test_chisquare.cpp index 602971c8..381853ca 100644 --- a/src/tests/test_chisquare.cpp +++ b/src/tests/test_chisquare.cpp @@ -24,12 +24,12 @@ #include /* Statistical significance level of the test. Set to - 1/4 percent by default -- we want there to be strong - evidence of an implementaiton error before failing + 1/4 percent by default -- we want there to be strong + evidence of an implementaiton error before failing a test case */ #define SIGNIFICANCE_LEVEL 0.0025f -/* Relative bound on what is still accepted as roundoff +/* Relative bound on what is still accepted as roundoff error -- be quite tolerant */ #if defined(SINGLE_PRECISION) #define ERROR_REQ 1e-2f @@ -40,8 +40,8 @@ MTS_NAMESPACE_BEGIN /** - * This testcase checks if the sampling methods of various BSDF & phase - * function & emitter implementations really do what they promise in + * This testcase checks if the sampling methods of various BSDF & phase + * function & emitter implementations really do what they promise in * their pdf() methods */ class TestChiSquare : public TestCase { @@ -78,7 +78,7 @@ public: void rewind() { m_sampleIndex = 0; } - + ref clone() { SLog(EError, "Not supported!"); return NULL; @@ -116,10 +116,10 @@ public: #if defined(MTS_DEBUG_FP) enableFPExceptions(); #endif - + Float pdfVal, sampledPDF; - /* Check the various sampling routines for agreement + /* Check the various sampling routines for agreement amongst each other */ m_fakeSampler->clear(); Spectrum sampled = m_bsdf->sample(bRec, sampledPDF, sample); @@ -162,9 +162,9 @@ public: if (!sampled.isValid() || !sampled2.isValid() || !manual.isValid()) { Log(EWarn, "Oops: sampled=%s, sampled2=%s, manual=%s, sampledPDF=%f, " - "pdf=%f, f=%s, bRec=%s, measure=%i", sampled.toString().c_str(), + "pdf=%f, f=%s, bRec=%s, measure=%i", sampled.toString().c_str(), sampled2.toString().c_str(), manual.toString().c_str(), - sampledPDF, pdfVal, f.toString().c_str(), bRec.toString().c_str(), + sampledPDF, pdfVal, f.toString().c_str(), bRec.toString().c_str(), measure); return boost::make_tuple(bRec.wo, 0.0f, ESolidAngle); } @@ -184,9 +184,9 @@ public: if (mismatch) Log(EWarn, "Potential inconsistency: sampled=%s, sampled2=%s, manual=%s, sampledPDF=%f, " - "pdf=%f, f=%s, bRec=%s, measure=%i", sampled.toString().c_str(), + "pdf=%f, f=%s, bRec=%s, measure=%i", sampled.toString().c_str(), sampled2.toString().c_str(), manual.toString().c_str(), - sampledPDF, pdfVal, f.toString().c_str(), bRec.toString().c_str(), + sampledPDF, pdfVal, f.toString().c_str(), bRec.toString().c_str(), measure); mismatch = false; @@ -208,7 +208,7 @@ public: return boost::make_tuple(bRec.wo, 1.0f, measure); } - + Float pdf(const Vector &wo, EMeasure measure) { BSDFSamplingRecord bRec(m_its, m_wi, wo); bRec.mode = EImportance; @@ -247,14 +247,14 @@ public: public: PhaseFunctionAdapter(const MediumSamplingRecord &mRec, const PhaseFunction *phase, Sampler *sampler, const Vector &wi) - : m_mRec(mRec), m_phase(phase), m_sampler(sampler), m_wi(wi), - m_largestWeight(0) { + : m_mRec(mRec), m_phase(phase), m_sampler(sampler), m_wi(wi), + m_largestWeight(0) { m_fakeSampler = new FakeSampler(m_sampler); } boost::tuple generateSample() { PhaseFunctionSamplingRecord pRec(m_mRec, m_wi); - + #if defined(MTS_DEBUG_FP) enableFPExceptions(); #endif @@ -279,7 +279,7 @@ public: bool mismatch = false; Float min = std::min(std::min(sampled, sampled2), manual); - Float err = std::max(std::max(std::abs(sampled - sampled2), + Float err = std::max(std::max(std::abs(sampled - sampled2), std::abs(sampled - manual)), std::abs(sampled2 - manual)); m_largestWeight = std::max(m_largestWeight, sampled); @@ -288,7 +288,7 @@ public: else if (min > ERROR_REQ && err/min > ERROR_REQ) // relative error threshold mismatch = true; - if (mismatch) + if (mismatch) Log(EWarn, "Potential inconsistency: sampled=%f, sampled2=%f, manual=%s, " "sampledPDF=%f, pdf=%f, f=%f, pRec=%s", sampled, sampled2, manual, sampledPDF, pdfVal, f, pRec.toString().c_str()); @@ -307,10 +307,10 @@ public: pdfVal, sampledPDF); - return boost::make_tuple(pRec.wo, + return boost::make_tuple(pRec.wo, sampled == 0 ? 0.0f : 1.0f, ESolidAngle); } - + Float pdf(const Vector &wo, EMeasure measure) const { if (measure != ESolidAngle) return 0.0f; @@ -360,11 +360,11 @@ public: return boost::make_tuple(dRec.d, 1.0f, dRec.measure); } - + Float pdf(const Vector &d, EMeasure measure) const { if (measure != ESolidAngle) return 0.0f; - + DirectSamplingRecord dRec(Point(0.0f), 0); dRec.d = d; dRec.measure = ESolidAngle; @@ -372,9 +372,9 @@ public: #if defined(MTS_DEBUG_FP) enableFPExceptions(); #endif - + Float result = m_emitter->pdfDirect(dRec); - + #if defined(MTS_DEBUG_FP) disableFPExceptions(); #endif @@ -394,7 +394,7 @@ public: const fs::path scenePath = resolver->resolveAbsolute("data/tests/test_bsdf.xml"); ref scene = loadScene(scenePath); - + const ref_vector &objects = scene->getReferencedObjects(); int thetaBins = 10, wiSamples = 20, failureCount = 0, testCount = 0; ref sampler = static_cast (PluginManager::getInstance()-> @@ -417,7 +417,7 @@ public: /* Test for a number of different incident directions */ for (int j=0; jgetType() & BSDF::EBackSide) wi = Warp::squareToUniformSphere(sampler->next2D()); else @@ -439,7 +439,7 @@ public: std::string filename = formatString("failure_%i.m", failureCount++); chiSqr->dumpTables(filename); failAndContinue(formatString("Uh oh, the chi-square test indicates a potential " - "issue for wi=%s. Dumped the contingency tables to '%s' for user analysis", + "issue for wi=%s. Dumped the contingency tables to '%s' for user analysis", wi.toString().c_str(), filename.c_str())); } else { succeed(); @@ -464,7 +464,7 @@ public: /* Test for a number of different incident directions */ for (int j=0; jgetType(comp) & BSDF::EBackSide) wi = Warp::squareToUniformSphere(sampler->next2D()); else @@ -487,7 +487,7 @@ public: std::string filename = formatString("failure_%i.m", failureCount++); chiSqr->dumpTables(filename); failAndContinue(formatString("Uh oh, the chi-square test indicates a potential " - "issue for wi=%s. Dumped the contingency tables to '%s' for user analysis", + "issue for wi=%s. Dumped the contingency tables to '%s' for user analysis", wi.toString().c_str(), filename.c_str())); } else { succeed(); @@ -511,7 +511,7 @@ public: const fs::path scenePath = resolver->resolveAbsolute("data/tests/test_phase.xml"); ref scene = loadScene(scenePath); - + const ref_vector &objects = scene->getReferencedObjects(); int thetaBins = 10, wiSamples = 20, failureCount = 0, testCount = 0; ref sampler = static_cast (PluginManager::getInstance()-> @@ -555,7 +555,7 @@ public: std::string filename = formatString("failure_%i.m", failureCount++); chiSqr->dumpTables(filename); failAndContinue(formatString("Uh oh, the chi-square test indicates a potential " - "issue for wi=%s. Dumped the contingency tables to '%s' for user analysis", + "issue for wi=%s. Dumped the contingency tables to '%s' for user analysis", wi.toString().c_str(), filename.c_str())); } else { succeed(); @@ -579,7 +579,7 @@ public: resolver->resolveAbsolute("data/tests/test_emitter.xml"); ref scene = loadScene(scenePath); scene->initialize(); - + const ref_vector &emitters = scene->getEmitters(); int thetaBins = 10, failureCount = 0, testCount = 0; ref sampler = static_cast (PluginManager::getInstance()-> @@ -608,7 +608,7 @@ public: std::string filename = formatString("failure_%i.m", failureCount++); chiSqr->dumpTables(filename); failAndContinue(formatString("Uh oh, the chi-square test indicates a potential " - "issue. Dumped the contingency tables to '%s' for user analysis", + "issue. Dumped the contingency tables to '%s' for user analysis", filename.c_str())); } else { succeed(); diff --git a/src/tests/test_dgeom.cpp b/src/tests/test_dgeom.cpp index 5f040720..c304b09d 100644 --- a/src/tests/test_dgeom.cpp +++ b/src/tests/test_dgeom.cpp @@ -81,7 +81,7 @@ public: normals[0] = Normal(-0.3f, 0, 1); normals[1] = Normal(0.3f, 0, 1); normals[2] = Normal(0, 0.3f, 1); - + uv[0] = Point2(0.1f, 0.1f); uv[1] = Point2(1.1f, 0.1f); uv[2] = Point2(0.1f, 0.9f); @@ -100,10 +100,10 @@ public: assertEqualsEpsilon(its.uv, Point2(0.2f, 0.26f), Epsilon); assertEquals(its.geoFrame.n, Normal(0, 0, 1)); - assertEqualsEpsilon(its.shFrame.n, + assertEqualsEpsilon(its.shFrame.n, normalize(normals[0]*.7f + normals[1]*.1f + normals[2]*.2f), Epsilon); - its.shFrame.s = normalize(its.dpdu - its.shFrame.n + its.shFrame.s = normalize(its.dpdu - its.shFrame.n * dot(its.shFrame.n, its.dpdu)); assertEqualsEpsilon(its.dpdu, vertices[1]-vertices[0], Epsilon); @@ -116,7 +116,7 @@ public: its.shape->getNormalDerivative(its, dndu, dndv, true); // From mathematica assertEqualsEpsilon(dndu, Vector(0.571048f, 0.00614519f, 0.10242f), 1e-4f); - assertEqualsEpsilon(dndv, Vector(0.288596f, 0.29679f, 0.0341399f), 1e-4f); + assertEqualsEpsilon(dndv, Vector(0.288596f, 0.29679f, 0.0341399f), 1e-4f); } void test03_trimesh_3() { @@ -134,7 +134,7 @@ public: normals[0] = Normal(-0.3f, 0, 1); normals[1] = Normal(0.3f, 0, 1); normals[2] = Normal(0, 0.3f, 1); - + uv[0] = Point2(0.0f, 0.0f); uv[1] = Point2(0.0f, 1.0f); uv[2] = Point2(1.0f, 0.0f); @@ -154,13 +154,13 @@ public: assertEqualsEpsilon(its.uv, Point2(0.2f, 0.1f), Epsilon); assertEquals(its.geoFrame.n, Normal(0, 0, 1)); - assertEqualsEpsilon(its.shFrame.n, + assertEqualsEpsilon(its.shFrame.n, normalize(normals[0]*.7f + normals[1]*.1f + normals[2]*.2f), Epsilon); assertEqualsEpsilon(its.shFrame.s, normalize(its.dpdu - its.shFrame.n * dot(its.dpdu, its.shFrame.n)), Epsilon); - its.shFrame.s = normalize(its.dpdu - its.shFrame.n + its.shFrame.s = normalize(its.dpdu - its.shFrame.n * dot(its.shFrame.n, its.dpdu)); assertEquals(its.dpdu, vertices[2]-vertices[0]); @@ -172,7 +172,7 @@ public: assertEquals(dndu, Vector(0.0f)); assertEquals(dndv, Vector(0.0f)); its.shape->getNormalDerivative(its, dndu, dndv, true); // From mathematica - assertEqualsEpsilon(dndu, Vector(0.288596f, 0.29679f, 0.0341399f), 1e-4f); + assertEqualsEpsilon(dndu, Vector(0.288596f, 0.29679f, 0.0341399f), 1e-4f); assertEqualsEpsilon(dndv, Vector(0.571048f, 0.00614519f, 0.10242f), 1e-4f); } @@ -205,7 +205,7 @@ public: sc.y *= INV_PI; assertEqualsEpsilon(its.uv, sc, Epsilon); - + // from mathematica assertEqualsEpsilon(its.dpdu, Vector(-3.6276f, 3.6276f, 0.0f)*radius, 1e-4f); assertEqualsEpsilon(its.dpdv, Vector(1.28255f, 1.28255f, -2.5651f)*radius, 1e-4f); diff --git a/src/tests/test_kd.cpp b/src/tests/test_kd.cpp index f2dc8858..eccfb8f8 100644 --- a/src/tests/test_kd.cpp +++ b/src/tests/test_kd.cpp @@ -56,7 +56,7 @@ public: )); assertFalse(clippedAABB.isValid()); - /* Verify that a no clipping whatsoever happens when + /* Verify that a no clipping whatsoever happens when the AABB fully contains a triangle */ clippedAABB = t.getClippedAABB(vertices, AABB( Point(-1, -1, -1), @@ -124,7 +124,7 @@ public: Float perc = nIntersections/(Float) nRays; Log(EInfo, " Found " SIZE_T_FMT " intersections (%.3f%%) in %i ms", nIntersections, perc, timer->getMilliseconds()); - Log(EInfo, " -> %.3f MRays/s", + Log(EInfo, " -> %.3f MRays/s", nRays / (timer->getMilliseconds() * (Float) 1000)); Log(EInfo, ""); } @@ -144,7 +144,7 @@ public: kdtree[i].setPosition(Point2(random->nextFloat(), random->nextFloat())); kdtree[i].setData(random->nextFloat()); } - + KDTree2::SearchResult results[11]; std::vector resultsBF; @@ -173,7 +173,7 @@ public: resultsBF.push_back(KDTree2::SearchResult((kdtree[j].getPosition()-p).lengthSquared(), (uint32_t) j)); std::sort(results, results + k, KDTree2::SearchResultComparator()); std::sort(resultsBF.begin(), resultsBF.end(), KDTree2::SearchResultComparator()); - for (int j=0; j B(b); Matrix<5, 1, Float> X; lu.luSolve(B, X, piv); @@ -121,7 +121,7 @@ public: Matrix<5, 1, Float> Xref(xref); assertEqualsEpsilon(X, Xref, 1e-5); } - + void test05_chol() { Float orig[5][5] = { {5.51302956379742, -1.36613599367125, -0.56818386886837, 1.43247259160815, -0.341242075046427}, diff --git a/src/tests/test_quad.cpp b/src/tests/test_quad.cpp index 34938723..70181dba 100644 --- a/src/tests/test_quad.cpp +++ b/src/tests/test_quad.cpp @@ -41,7 +41,7 @@ public: void testF2(const Float *in, Float *out) const { *out = std::sin(*in); } - + inline Float gauss3(Vector x, Float stddev) const { return math::fastexp(-0.5f * dot(x, x)/stddev)/(std::pow(2*M_PI * stddev, (Float) 3 / (Float) 2)); } @@ -49,7 +49,7 @@ public: void testF3(size_t nPoints, const Float *in, Float *out) const { for (size_t i=0; i #include - MTS_NAMESPACE_BEGIN - - namespace { // Small class which represents a binary 32x32 matrix, used for the rank test. @@ -229,7 +226,7 @@ public: } // No-op! - fake_iterator& operator++() { + fake_iterator& operator++() { return *this; } }; @@ -288,7 +285,7 @@ double chi_squared_pval( chi_squared += (delta * delta) / expected; ++df; } - + assert(restrictions < df); df -= restrictions; @@ -406,7 +403,7 @@ private: private: typedef std::vector::iterator iterator; - + std::vector m_bins; size_t m_count; }; @@ -540,7 +537,7 @@ void TestRandom::test02_helper(ref & rnd) void TestRandom::test02_range() { const int N = 1000; - + ref rnd = new Random; for (int i = 0; i < N*N; ++i) { test02_helper(rnd); @@ -684,7 +681,7 @@ double TestRandom::binary_rank_instance(ref & rnd, const double alpha, // Chi-squared P-value const double pval = chi_squared_pval(ranks.begin(), ranks.end(), expected); - + assertFalse(pval < alpha); return pval; } @@ -759,7 +756,7 @@ void TestRandom::test08_serialize() const int N = 2000; std::vector vec; typedef std::vector::const_iterator citerator; - + ref manager = new InstanceManager; ref s = new MemoryStream; { @@ -796,7 +793,7 @@ void TestRandom::test09_set() const int N = 1000000; ref rnd1 = new Random(1234); ref rnd2 = new Random(5678); - + for (int i = 0; i < N; ++i) { const uint64_t v1 = rnd1->nextULong(); const uint64_t v2 = rnd2->nextULong(); @@ -852,7 +849,7 @@ void TestRandom::benchmark() Log(EInfo, "Generated %.1fM random numbers in %.2f s (%.3f M-random/s)", 1e-6 * N, seconds, 1e-6 * N / seconds); estimate /= (N1+1); - assertEqualsEpsilon(estimate, static_cast(0.5), epsilon); + assertEqualsEpsilon(estimate, static_cast(0.5), epsilon); } diff --git a/src/tests/test_rtrans.cpp b/src/tests/test_rtrans.cpp index da80c379..49c98637 100644 --- a/src/tests/test_rtrans.cpp +++ b/src/tests/test_rtrans.cpp @@ -36,7 +36,7 @@ void transmittanceIntegrand(const BSDF *bsdf, const Vector &wi, size_t nPts, con } void diffTransmittanceIntegrand(Float *data, size_t resolution, size_t nPts, const Float *in, Float *out) { - for (size_t i=0; inextFloat(), (Float) 4.0f)*4; if (alpha < 1e-5) alpha = 1e-5f; - + Float refD = computeDiffuseTransmittance("beckmann", eta, alpha); Float datD = rtr.evalDiffuse(alpha, eta); @@ -227,7 +227,7 @@ public: cosTheta = 1e-5f; if (alpha < 1e-5) alpha = 1e-5f; - + Float ref = computeTransmittance("beckmann", eta, alpha, cosTheta); Float dat = rtr.eval(cosTheta, alpha, eta); @@ -272,7 +272,7 @@ public: Float cosTheta = random->nextFloat(); if (cosTheta < 1e-5) cosTheta = 1e-5f; - + Float ref = computeTransmittance("beckmann", eta, alpha, cosTheta); Float dat = rtr.eval(cosTheta, alpha, eta); diff --git a/src/tests/test_samplers.cpp b/src/tests/test_samplers.cpp index 12c86191..46c7d67c 100644 --- a/src/tests/test_samplers.cpp +++ b/src/tests/test_samplers.cpp @@ -70,7 +70,7 @@ public: int pos = 0; sampler->generate(Point2i(0)); for (int i=0; i<5; ++i) { - for (int j=0; j<6; ++j) + for (int j=0; j<6; ++j) assertEqualsEpsilon(sampler->next1D(), comparison[pos++], 1e-7); sampler->advance(); } diff --git a/src/tests/test_sh.cpp b/src/tests/test_sh.cpp index 2f4b8556..17f471ca 100644 --- a/src/tests/test_sh.cpp +++ b/src/tests/test_sh.cpp @@ -29,7 +29,7 @@ public: MTS_END_TESTCASE() void test01_shRotation() { - /* Generate a random SH expansion, rotate it and + /* Generate a random SH expansion, rotate it and spot-check 100 times against the original evaluated at appropriately rotated positions */ diff --git a/src/tests/test_spectrum.cpp b/src/tests/test_spectrum.cpp index 60dbbe06..6fa1f799 100644 --- a/src/tests/test_spectrum.cpp +++ b/src/tests/test_spectrum.cpp @@ -78,7 +78,7 @@ public: spec.append(500, 1); spec.append(700, 2); spec.append(800, 3); - + InterpolatedSpectrum spec2 = spec; assertEquals(spec.eval(499), 0.0f); @@ -110,7 +110,7 @@ public: assertEqualsEpsilon(z, 1.0f, 1e-3f); #if SPECTRUM_SAMPLES > 3 - spec2.clear(); + spec2.clear(); spec2.append(Spectrum::getBinCoverage(0).first, 0); spec2.append(Spectrum::getBinCoverage(1).first, 1); spec2.append(Spectrum::getBinCoverage(2).first, 1); @@ -129,11 +129,11 @@ public: /* Spot-check a 5000 Kelvin spectrum against values obtained at https://www.sensiac.org/external/resources/calculators/infrared_radiance_calculator.jsf - Mitsuba uses units of W * m^-2 * sr^-1 * nm^-1, whereas that + Mitsuba uses units of W * m^-2 * sr^-1 * nm^-1, whereas that page uses W * cm^-2 * sr^-1 * um^-1 --- this is the reason for the factor of 10-difference. */ - BlackBodySpectrum spec(5000); + BlackBodySpectrum spec(5000); assertEqualsEpsilon(spec.eval(400)/10, 874.f, .5f); assertEqualsEpsilon(spec.eval(500)/10, 1211.f, .5f); assertEqualsEpsilon(spec.eval(600)/10, 1276.f, .5f); diff --git a/src/textures/bitmap.cpp b/src/textures/bitmap.cpp index e27e9410..ba80bd21 100644 --- a/src/textures/bitmap.cpp +++ b/src/textures/bitmap.cpp @@ -30,7 +30,7 @@ #include MTS_NAMESPACE_BEGIN - + /*!\plugin{bitmap}{Bitmap texture} * \order{1} * \parameters{ @@ -46,13 +46,13 @@ MTS_NAMESPACE_BEGIN * \item \code{zero}: Switch to a zero-valued texture \vspace{-1mm} * \item \code{one}: Switch to a one-valued texture \vspace{-1mm} * \end{enumerate} - * Default: \code{repeat}. The parameter \code{wrapMode} is a shortcut for + * Default: \code{repeat}. The parameter \code{wrapMode} is a shortcut for * setting both \code{wrapModeU} and \code{wrapModeV} at the same time. * } * \parameter{gamma}{\Float}{ * Optional parameter to override the gamma value of the source bitmap, - * where 1 indicates a linear color space and the special value -1 - * corresponds to sRGB. \default{automatically detect based on the + * where 1 indicates a linear color space and the special value -1 + * corresponds to sRGB. \default{automatically detect based on the * image type and metadata} * } * \parameter{filterType}{\String}{ @@ -66,7 +66,7 @@ MTS_NAMESPACE_BEGIN * Default: \code{ewa}. * } * \parameter{maxAnisotropy}{\Float}{ - * Specific to \code{ewa} filtering, this parameter limits the + * Specific to \code{ewa} filtering, this parameter limits the * anisotropy (and thus the computational cost) of filtured texture lookups. The * default of 20 is a good compromise. * } @@ -83,23 +83,23 @@ MTS_NAMESPACE_BEGIN * } * } * This plugin provides a bitmap-backed texture source that supports \emph{filtered} - * texture lookups on\footnote{Some of these may not be available depending on how - * Mitsuba was compiled.} JPEG, PNG, OpenEXR, RGBE, TGA, and BMP files. Filtered - * lookups are useful to avoid aliasing when rendering textures that contain high + * texture lookups on\footnote{Some of these may not be available depending on how + * Mitsuba was compiled.} JPEG, PNG, OpenEXR, RGBE, TGA, and BMP files. Filtered + * lookups are useful to avoid aliasing when rendering textures that contain high * frequencies (see the next page for an example). * - * The plugin operates as follows: when loading a bitmap file, it is first converted + * The plugin operates as follows: when loading a bitmap file, it is first converted * into a linear color space. Following this, a MIP map is constructed that is necessary * to perform filtered lookups during rendering. A \emph{MIP map} is a hierarchy of * progressively lower resolution versions of the input image, where the resolution of * adjacent levels differs by a factor of two. Mitsuba creates this hierarchy using * Lanczos resampling to obtain very high quality results. * Note that textures may have an arbitrary resolution and are not limited to powers of two. - * Three different filtering modes are supported: + * Three different filtering modes are supported: * * \begin{enumerate}[(i)] - * \item Nearest neighbor lookups effectively disable filtering and always query the - * highest-resolution version of the texture without any kind of interpolation. This is + * \item Nearest neighbor lookups effectively disable filtering and always query the + * highest-resolution version of the texture without any kind of interpolation. This is * fast and requires little memory (no MIP map is created), but results in visible aliasing. * Only a single pixel value is accessed. * @@ -109,7 +109,7 @@ MTS_NAMESPACE_BEGIN * chooses blurring over aliasing (though note that (\textbf{b}) is an extreme case). * Only 8 pixel values are accessed. * - * \item The EWA filter performs anisotropicically filtered lookups on two adjacent MIP map levels + * \item The EWA filter performs anisotropicically filtered lookups on two adjacent MIP map levels * and blends them. This produces the best quality, but at the expense of computation time. * Generally, 20-40 pixel values must be read for a single EWA texture lookup. To limit * the number of pixel accesses, the \code{maxAnisotropy} parameter can be used to bound @@ -125,15 +125,15 @@ MTS_NAMESPACE_BEGIN * \rendering{EWA filter}{tex_bitmap_ewa} * \rendering{Ground truth (512 samples per pixel)}{tex_bitmap_gt} * \caption{A somewhat contrived comparison of the different filters when rendering a high-frequency - * checkerboard pattern using four samples per pixel. The EWA method (the default) - * pre-filters the texture anisotropically to limit blurring and aliasing, but has a + * checkerboard pattern using four samples per pixel. The EWA method (the default) + * pre-filters the texture anisotropically to limit blurring and aliasing, but has a * higher computational cost than the other filters.} * } * \paragraph{Caching and memory requirements:} - * When a texture is read, Mitsuba internally converts it into an uncompressed linear format + * When a texture is read, Mitsuba internally converts it into an uncompressed linear format * using a half precision (\code{float16})-based representation. This is convenient for - * rendering but means that textures require copious amounts of memory (in particular, the - * size of the occupied memory region might be orders of magnitude greater than that of the + * rendering but means that textures require copious amounts of memory (in particular, the + * size of the occupied memory region might be orders of magnitude greater than that of the * original input file). * * For instance, a basic 10 megapixel image requires as much as 76 MiB of memory! Loading, @@ -146,7 +146,7 @@ MTS_NAMESPACE_BEGIN * \begin{enumerate}[(i)] * \item MIP maps do not have to be regenerated in subsequent Mitsuba runs, * which substantially reduces scene loading times. - * \item Because the texture storage is entirely disk-backed and can be \emph{memory-mapped}, + * \item Because the texture storage is entirely disk-backed and can be \emph{memory-mapped}, * Mitsuba is able to work with truly massive textures that would otherwise exhaust the main system memory. * \end{enumerate} * @@ -161,7 +161,7 @@ MTS_NAMESPACE_BEGIN class BitmapTexture : public Texture2D { public: - /* Store texture data using half precision, but perform computations in + /* Store texture data using half precision, but perform computations in single/double precision based on compilation flags. The following generates efficient implementations for both luminance and RGB data */ typedef TSpectrum Color1; @@ -255,7 +255,7 @@ public: return; } - /* (Re)generate the MIP map hierarchy; downsample using a + /* (Re)generate the MIP map hierarchy; downsample using a 2-lobed Lanczos reconstruction filter */ Properties rfilterProps("lanczos"); rfilterProps.setInteger("lobes", 2); @@ -265,16 +265,16 @@ public: rfilter->configure(); /* Potentially create a new MIP map cache file */ - bool createCache = !cacheFile.empty() && props.getBoolean("cache", + bool createCache = !cacheFile.empty() && props.getBoolean("cache", bitmap->getSize().x * bitmap->getSize().y > 1024*1024); if (pixelFormat == Bitmap::ELuminance) m_mipmap1 = new MIPMap1(bitmap, pixelFormat, Bitmap::EFloat, - rfilter, m_wrapModeU, m_wrapModeV, m_filterType, m_maxAnisotropy, + rfilter, m_wrapModeU, m_wrapModeV, m_filterType, m_maxAnisotropy, createCache ? cacheFile : fs::path(), timestamp); else m_mipmap3 = new MIPMap3(bitmap, pixelFormat, Bitmap::EFloat, - rfilter, m_wrapModeU, m_wrapModeV, m_filterType, m_maxAnisotropy, + rfilter, m_wrapModeU, m_wrapModeV, m_filterType, m_maxAnisotropy, createCache ? cacheFile : fs::path(), timestamp); } } @@ -296,7 +296,7 @@ public: return ReconstructionFilter::EZero; // make gcc happy } - BitmapTexture(Stream *stream, InstanceManager *manager) + BitmapTexture(Stream *stream, InstanceManager *manager) : Texture2D(stream, manager) { m_filename = stream->readString(); Log(EDebug, "Unserializing texture \"%s\"", m_filename.filename().string().c_str()); @@ -339,11 +339,11 @@ public: if (pixelFormat == Bitmap::ELuminance) m_mipmap1 = new MIPMap1(bitmap, pixelFormat, Bitmap::EFloat, - rfilter, m_wrapModeU, m_wrapModeV, m_filterType, m_maxAnisotropy, + rfilter, m_wrapModeU, m_wrapModeV, m_filterType, m_maxAnisotropy, fs::path(), 0); else m_mipmap3 = new MIPMap3(bitmap, pixelFormat, Bitmap::EFloat, - rfilter, m_wrapModeU, m_wrapModeV, m_filterType, m_maxAnisotropy, + rfilter, m_wrapModeU, m_wrapModeV, m_filterType, m_maxAnisotropy, fs::path(), 0); } @@ -357,7 +357,7 @@ public: stream->writeFloat(m_maxAnisotropy); if (!m_filename.empty() && fs::exists(m_filename)) { - /* We still have access to the original image -- use that, since + /* We still have access to the original image -- use that, since it is probably much smaller than the in-memory representation */ ref is = new FileStream(m_filename, FileStream::EReadOnly); stream->writeSize(is->getSize()); @@ -366,7 +366,7 @@ public: /* No access to the original image anymore. Create an EXR image from the top MIP map level and serialize that */ ref mStream = new MemoryStream(); - ref bitmap = m_mipmap1.get() ? + ref bitmap = m_mipmap1.get() ? m_mipmap1->toBitmap() : m_mipmap3->toBitmap(); bitmap->write(Bitmap::EOpenEXR, mStream); @@ -376,9 +376,9 @@ public: } Spectrum eval(const Point2 &uv) const { - /* There are no ray differentials to do any kind of + /* There are no ray differentials to do any kind of prefiltering. Evaluate the full-resolution texture */ - + Spectrum result; if (m_mipmap3.get()) { Color3 value; @@ -484,7 +484,7 @@ public: oss << " mipmap = " << indent(m_mipmap3.toString()) << endl; else oss << " mipmap = " << indent(m_mipmap1.toString()) << endl; - + oss << "]"; return oss.str(); } @@ -502,36 +502,36 @@ protected: fs::path m_filename; }; -// ================ Hardware shader implementation ================ +// ================ Hardware shader implementation ================ class BitmapTextureShader : public Shader { public: - BitmapTextureShader(Renderer *renderer, const std::string &filename, + BitmapTextureShader(Renderer *renderer, const std::string &filename, const BitmapTexture::MIPMap1* mipmap1, const BitmapTexture::MIPMap3* mipmap3, - const Point2 &uvOffset, const Vector2 &uvScale, - ReconstructionFilter::EBoundaryCondition wrapModeU, - ReconstructionFilter::EBoundaryCondition wrapModeV, - Float maxAnisotropy) + const Point2 &uvOffset, const Vector2 &uvScale, + ReconstructionFilter::EBoundaryCondition wrapModeU, + ReconstructionFilter::EBoundaryCondition wrapModeV, + Float maxAnisotropy) : Shader(renderer, ETextureShader), m_uvOffset(uvOffset), m_uvScale(uvScale) { ref bitmap = mipmap1 ? mipmap1->toBitmap() : mipmap3->toBitmap(); m_gpuTexture = renderer->createGPUTexture(filename, bitmap); switch (wrapModeU) { - case ReconstructionFilter::EClamp: + case ReconstructionFilter::EClamp: m_gpuTexture->setWrapType(GPUTexture::EClampToEdge); break; - case ReconstructionFilter::EMirror: + case ReconstructionFilter::EMirror: m_gpuTexture->setWrapType(GPUTexture::EMirror); break; - case ReconstructionFilter::ERepeat: + case ReconstructionFilter::ERepeat: m_gpuTexture->setWrapType(GPUTexture::ERepeat); break; - case ReconstructionFilter::EZero: + case ReconstructionFilter::EZero: m_gpuTexture->setWrapType(GPUTexture::EClampToBorder); m_gpuTexture->setBorderColor(Color3(0.0f)); break; - case ReconstructionFilter::EOne: + case ReconstructionFilter::EOne: m_gpuTexture->setWrapType(GPUTexture::EClampToBorder); m_gpuTexture->setBorderColor(Color3(1.0f)); break; @@ -566,8 +566,8 @@ public: << endl << "vec3 " << evalName << "(vec2 uv) {" << endl << " return texture2D(" << evalName << "_texture, vec2(" << endl - << " uv.x * " << evalName << "_uvScale.x + " << evalName << "_uvOffset.x," << endl - << " uv.y * " << evalName << "_uvScale.y + " << evalName << "_uvOffset.y)).rgb;" << endl + << " uv.x * " << evalName << "_uvScale.x + " << evalName << "_uvOffset.x," << endl + << " uv.y * " << evalName << "_uvScale.y + " << evalName << "_uvOffset.y)).rgb;" << endl << "}" << endl; } @@ -577,7 +577,7 @@ public: parameterIDs.push_back(program->getParameterID(evalName + "_uvScale", false)); } - void bind(GPUProgram *program, const std::vector ¶meterIDs, + void bind(GPUProgram *program, const std::vector ¶meterIDs, int &textureUnitOffset) const { m_gpuTexture->bind(textureUnitOffset++); program->setParameter(parameterIDs[0], m_gpuTexture.get()); @@ -588,7 +588,7 @@ public: void unbind() const { m_gpuTexture->unbind(); } - + MTS_DECLARE_CLASS() private: ref m_gpuTexture; diff --git a/src/textures/checkerboard.cpp b/src/textures/checkerboard.cpp index 6ae55fdf..ba47871d 100644 --- a/src/textures/checkerboard.cpp +++ b/src/textures/checkerboard.cpp @@ -51,7 +51,7 @@ public: m_color1 = props.getSpectrum("color1", Spectrum(.2f)); } - Checkerboard(Stream *stream, InstanceManager *manager) + Checkerboard(Stream *stream, InstanceManager *manager) : Texture2D(stream, manager) { m_color0 = Spectrum(stream); m_color1 = Spectrum(stream); @@ -64,7 +64,7 @@ public: } inline Spectrum eval(const Point2 &uv) const { - int x = 2*modulo((int) (uv.x * 2), 2) - 1, + int x = 2*modulo((int) (uv.x * 2), 2) - 1, y = 2*modulo((int) (uv.y * 2), 2) - 1; if (x*y == 1) @@ -113,7 +113,7 @@ public: << "]"; return oss.str(); } - + Shader *createShader(Renderer *renderer) const; MTS_DECLARE_CLASS() @@ -122,14 +122,14 @@ protected: Spectrum m_color0; }; -// ================ Hardware shader implementation ================ +// ================ Hardware shader implementation ================ class CheckerboardShader : public Shader { public: - CheckerboardShader(Renderer *renderer, const Spectrum &color0, + CheckerboardShader(Renderer *renderer, const Spectrum &color0, const Spectrum &color1, const Point2 &uvOffset, const Vector2 &uvScale) : Shader(renderer, ETextureShader), - m_color0(color0), m_color1(color1), + m_color0(color0), m_color1(color1), m_uvOffset(uvOffset), m_uvScale(uvScale) { } @@ -160,14 +160,14 @@ public: parameterIDs.push_back(program->getParameterID(evalName + "_uvScale", false)); } - void bind(GPUProgram *program, const std::vector ¶meterIDs, + void bind(GPUProgram *program, const std::vector ¶meterIDs, int &textureUnitOffset) const { program->setParameter(parameterIDs[0], m_color0); program->setParameter(parameterIDs[1], m_color1); program->setParameter(parameterIDs[2], m_uvOffset); program->setParameter(parameterIDs[3], m_uvScale); } - + MTS_DECLARE_CLASS() private: Spectrum m_color0; @@ -177,10 +177,10 @@ private: }; Shader *Checkerboard::createShader(Renderer *renderer) const { - return new CheckerboardShader(renderer, m_color0, m_color1, + return new CheckerboardShader(renderer, m_color0, m_color1, m_uvOffset, m_uvScale); } - + MTS_IMPLEMENT_CLASS(CheckerboardShader, false, Shader) MTS_IMPLEMENT_CLASS_S(Checkerboard, false, Texture2D) MTS_EXPORT_PLUGIN(Checkerboard, "Checkerboard texture"); diff --git a/src/textures/curvature.cpp b/src/textures/curvature.cpp index eaba7971..4f5180e3 100644 --- a/src/textures/curvature.cpp +++ b/src/textures/curvature.cpp @@ -31,7 +31,7 @@ MTS_NAMESPACE_BEGIN * \code{mean} or \code{gaussian}. * } * \parameter{scale}{\Float}{ - * A scale factor to bring curvature values into the + * A scale factor to bring curvature values into the * displayable range [-1, 1]. Everything outside of this range * will be clamped. * } @@ -59,7 +59,7 @@ public: Log(EError, "Invalid 'curvature' parameter: must be set to 'gaussian' or ' mean'!"); } - Curvature(Stream *stream, InstanceManager *manager) + Curvature(Stream *stream, InstanceManager *manager) : Texture(stream, manager) { m_scale = stream->readFloat(); m_showK = stream->readBool(); @@ -126,11 +126,11 @@ private: bool m_showK; }; -// ================ Hardware shader implementation ================ +// ================ Hardware shader implementation ================ class CurvatureShader : public Shader { public: - CurvatureShader(Renderer *renderer, const Spectrum &value) + CurvatureShader(Renderer *renderer, const Spectrum &value) : Shader(renderer, ETextureShader), m_value(value) { } diff --git a/src/textures/gridtexture.cpp b/src/textures/gridtexture.cpp index a4ce1250..b3a4b379 100644 --- a/src/textures/gridtexture.cpp +++ b/src/textures/gridtexture.cpp @@ -58,7 +58,7 @@ public: m_lineWidth = props.getFloat("lineWidth", .01f); } - GridTexture(Stream *stream, InstanceManager *manager) + GridTexture(Stream *stream, InstanceManager *manager) : Texture2D(stream, manager) { m_color0 = Spectrum(stream); m_color1 = Spectrum(stream); @@ -86,7 +86,7 @@ public: else return m_color0; } - + Spectrum eval(const Point2 &uv, const Vector2 &d0, const Vector2 &d1) const { /* Filtering is currently not supported */ @@ -135,14 +135,14 @@ protected: Float m_lineWidth; }; -// ================ Hardware shader implementation ================ +// ================ Hardware shader implementation ================ class GridTextureShader : public Shader { public: - GridTextureShader(Renderer *renderer, const Spectrum &color0, + GridTextureShader(Renderer *renderer, const Spectrum &color0, const Spectrum &color1, Float lineWidth, const Point2 &uvOffset, const Vector2 &uvScale) : Shader(renderer, ETextureShader), - m_color0(color0), m_color1(color1), + m_color0(color0), m_color1(color1), m_lineWidth(lineWidth), m_uvOffset(uvOffset), m_uvScale(uvScale) { } @@ -178,7 +178,7 @@ public: parameterIDs.push_back(program->getParameterID(evalName + "_uvScale", false)); } - void bind(GPUProgram *program, const std::vector ¶meterIDs, + void bind(GPUProgram *program, const std::vector ¶meterIDs, int &textureUnitOffset) const { program->setParameter(parameterIDs[0], m_color0); program->setParameter(parameterIDs[1], m_color1); @@ -197,10 +197,10 @@ private: }; Shader *GridTexture::createShader(Renderer *renderer) const { - return new GridTextureShader(renderer, m_color0, m_color1, + return new GridTextureShader(renderer, m_color0, m_color1, m_lineWidth, m_uvOffset, m_uvScale); } - + MTS_IMPLEMENT_CLASS(GridTextureShader, false, Shader) MTS_IMPLEMENT_CLASS_S(GridTexture, false, Texture2D) MTS_EXPORT_PLUGIN(GridTexture, "Grid texture"); diff --git a/src/textures/scale.cpp b/src/textures/scale.cpp index 635532eb..852dbab8 100644 --- a/src/textures/scale.cpp +++ b/src/textures/scale.cpp @@ -33,7 +33,7 @@ MTS_NAMESPACE_BEGIN * } * } * - * This simple plugin wraps a nested texture plugin and multiplies its + * This simple plugin wraps a nested texture plugin and multiplies its * contents by a user-specified value. This can be quite useful when a * texture is too dark or too bright. The plugin can also be used to adjust * the height of a bump map when using the \pluginref{bump} plugin. @@ -64,7 +64,7 @@ public: Assert(m_scale.min() > 0); } - ScalingTexture(Stream *stream, InstanceManager *manager) + ScalingTexture(Stream *stream, InstanceManager *manager) : Texture(stream, manager) { m_nested = static_cast(manager->getInstance(stream)); m_scale = Spectrum(stream); @@ -129,11 +129,11 @@ protected: Spectrum m_scale; }; -// ================ Hardware shader implementation ================ +// ================ Hardware shader implementation ================ class ScalingTextureShader : public Shader { public: - ScalingTextureShader(Renderer *renderer, const Texture *nested, const Spectrum &scale) + ScalingTextureShader(Renderer *renderer, const Texture *nested, const Spectrum &scale) : Shader(renderer, ETextureShader), m_nested(nested), m_scale(scale) { m_nestedShader = renderer->registerShaderForResource(m_nested.get()); } diff --git a/src/textures/vertexcolors.cpp b/src/textures/vertexcolors.cpp index 893b27a0..1ed74322 100644 --- a/src/textures/vertexcolors.cpp +++ b/src/textures/vertexcolors.cpp @@ -28,12 +28,12 @@ MTS_NAMESPACE_BEGIN * this plugin exposes the underlying color data as a texture. * Currently, this is only supported by the \code{PLY} * file format loader. - * + * * Here is an example: * \begin{xml}[caption=Rendering a PLY file with vertex colors] * * - * + * * * * @@ -45,7 +45,7 @@ public: VertexColors(const Properties &props) : Texture(props) { } - VertexColors(Stream *stream, InstanceManager *manager) + VertexColors(Stream *stream, InstanceManager *manager) : Texture(stream, manager) { } @@ -91,7 +91,7 @@ protected: Spectrum m_reflectance; }; -// ================ Hardware shader implementation ================ +// ================ Hardware shader implementation ================ class VertexColorShader : public Shader { public: @@ -116,7 +116,7 @@ private: Shader *VertexColors::createShader(Renderer *renderer) const { return new VertexColorShader(renderer); } - + MTS_IMPLEMENT_CLASS(VertexColorShader, false, Shader) MTS_IMPLEMENT_CLASS_S(VertexColors, false, Texture) MTS_EXPORT_PLUGIN(VertexColors, "Vertex color texture"); diff --git a/src/textures/wireframe.cpp b/src/textures/wireframe.cpp index a2effa11..e0b216b5 100644 --- a/src/textures/wireframe.cpp +++ b/src/textures/wireframe.cpp @@ -39,7 +39,7 @@ MTS_NAMESPACE_BEGIN * \default{automatic} * } * \parameter{stepWidth}{\Float}{ - * Controls the width of of step function used for the + * Controls the width of of step function used for the * color transition. It is specified as a value between zero * and one (relative to the \code{lineWidth} parameter) * \default{0.5} @@ -49,7 +49,7 @@ MTS_NAMESPACE_BEGIN * \rendering{Wireframe texture applied to the material test object}{tex_wireframe} * } * - * This plugin implements a simple two-color wireframe texture map + * This plugin implements a simple two-color wireframe texture map * that reveals the structure of a triangular mesh. */ class WireFrame : public Texture { @@ -63,7 +63,7 @@ public: m_mutex = new Mutex(); } - WireFrame(Stream *stream, InstanceManager *manager) + WireFrame(Stream *stream, InstanceManager *manager) : Texture(stream, manager) { m_mutex = new Mutex(); m_edgeColor = Spectrum(stream); @@ -90,14 +90,14 @@ public: if (m_lineWidth == 0) { /* Somewhat hacky but probably helpful in many cases. This tries to find a suitable line width, which is set - to 10% of the average average edge length */ + to 10% of the average average edge length */ LockGuard lock(m_mutex); if (m_lineWidth == 0) { Float lineWidth = 0; for (size_t i=0; igetTriangleCount(); ++i) { const Triangle &tri = triMesh->getTriangles()[i]; for (int j=0; j<3; ++j) - lineWidth += (positions[tri.idx[j]] + lineWidth += (positions[tri.idx[j]] - positions[tri.idx[(j+1)%3]]).length(); } @@ -174,11 +174,11 @@ protected: Spectrum m_interiorColor; }; -// ================ Hardware shader implementation ================ +// ================ Hardware shader implementation ================ class WireFrameShader : public Shader { public: - WireFrameShader(Renderer *renderer, const Spectrum &value) + WireFrameShader(Renderer *renderer, const Spectrum &value) : Shader(renderer, ETextureShader), m_value(value) { } diff --git a/src/utils/addimages.cpp b/src/utils/addimages.cpp index d20a5abd..7f6a7b96 100644 --- a/src/utils/addimages.cpp +++ b/src/utils/addimages.cpp @@ -54,10 +54,10 @@ public: if (aBitmap->getSize() != bBitmap->getSize()) Log(EError, "Error: Input bitmaps have a different size!"); - ref outBitmap = new Bitmap(aBitmap->getPixelFormat(), + ref outBitmap = new Bitmap(aBitmap->getPixelFormat(), aBitmap->getComponentFormat(), aBitmap->getSize()); - size_t nEntries = + size_t nEntries = (size_t) aBitmap->getSize().x * (size_t) aBitmap->getSize().y * aBitmap->getChannelCount(); @@ -68,7 +68,7 @@ public: half *bData = bBitmap->getFloat16Data(); half *outData = outBitmap->getFloat16Data(); for (size_t i=0; igetFloat32Data(); float *outData = outBitmap->getFloat32Data(); for (size_t i=0; igetUInt32Data(); uint32_t *outData = outBitmap->getUInt32Data(); for (size_t i=0; isetColor(m_blue); @@ -246,7 +246,7 @@ public: m_renderer->drawLine(m_cylPos-cylD*1e4, m_cylPos+cylD*1e4); AABB clippedAABB; - clippedAABB.expandBy(intersectCylFace(0, + clippedAABB.expandBy(intersectCylFace(0, Point(aabb.min.x, aabb.min.y, aabb.min.z), Point(aabb.min.x, aabb.max.y, aabb.max.z), m_cylPos, cylD)); @@ -256,7 +256,7 @@ public: Point(aabb.max.x, aabb.max.y, aabb.max.z), m_cylPos, cylD)); - clippedAABB.expandBy(intersectCylFace(1, + clippedAABB.expandBy(intersectCylFace(1, Point(aabb.min.x, aabb.min.y, aabb.min.z), Point(aabb.max.x, aabb.min.y, aabb.max.z), m_cylPos, cylD)); @@ -266,7 +266,7 @@ public: Point(aabb.max.x, aabb.max.y, aabb.max.z), m_cylPos, cylD)); - clippedAABB.expandBy(intersectCylFace(2, + clippedAABB.expandBy(intersectCylFace(2, Point(aabb.min.x, aabb.min.y, aabb.min.z), Point(aabb.max.x, aabb.max.y, aabb.min.z), m_cylPos, cylD)); diff --git a/src/utils/kdbench.cpp b/src/utils/kdbench.cpp index 5b69b6e3..70a08ce2 100644 --- a/src/utils/kdbench.cpp +++ b/src/utils/kdbench.cpp @@ -80,45 +80,45 @@ public: return 0; } break; - case 'f': + case 'f': fitParameters = true; break; - case 'i': + case 'i': intersectionCost = (Float) strtod(optarg, &end_ptr); if (*end_ptr != '\0') SLog(EError, "Could not parse the intersection cost!"); break; - case 't': + case 't': traversalCost = (Float) strtod(optarg, &end_ptr); if (*end_ptr != '\0') SLog(EError, "Could not parse the traversal cost!"); break; - case 'e': + case 'e': emptySpaceBonus = (Float) strtod(optarg, &end_ptr); if (*end_ptr != '\0') SLog(EError, "Could not parse the empty space bonus!"); break; - case 'l': + case 'l': stopPrims = strtol(optarg, &end_ptr, 10); if (*end_ptr != '\0') SLog(EError, "Could not parse the stopping primitive count!"); break; - case 'd': + case 'd': maxDepth = strtol(optarg, &end_ptr, 10); if (*end_ptr != '\0') SLog(EError, "Could not parse the maximum depth!"); break; - case 'x': + case 'x': exactPrims = strtol(optarg, &end_ptr, 10); if (*end_ptr != '\0') SLog(EError, "Could not parse the -e parameter!"); break; - case 'b': + case 'b': minMaxBins = strtol(optarg, &end_ptr, 10); if (*end_ptr != '\0') SLog(EError, "Could not parse the min-max bins parameter!"); break; - case 'c': + case 'c': if (strcmp(optarg, "true") == 0) clip = true; else if (strcmp(optarg, "false") == 0) @@ -126,7 +126,7 @@ public: else SLog(EError, "Could not parse the clipping parameter!"); break; - case 'p': + case 'p': if (strcmp(optarg, "true") == 0) parallel = true; else if (strcmp(optarg, "false") == 0) @@ -134,7 +134,7 @@ public: else SLog(EError, "Could not parse the parallel build parameter!"); break; - case 'r': + case 'r': if (strcmp(optarg, "true") == 0) retract = true; else if (strcmp(optarg, "false") == 0) @@ -155,7 +155,7 @@ public: std::string lowercase = boost::to_lower_copy(std::string(argv[optind])); if (boost::ends_with(lowercase, ".xml")) { - fs::path + fs::path filename = fileResolver->resolve(argv[optind]), filePath = fs::absolute(filename).parent_path(), baseName = filename.stem(); diff --git a/src/utils/rdielprec.cpp b/src/utils/rdielprec.cpp index 45f36d6b..b8a50b5e 100644 --- a/src/utils/rdielprec.cpp +++ b/src/utils/rdielprec.cpp @@ -24,7 +24,7 @@ #include #include #include - + #define RESOLUTION_IOR 50 #define RESOLUTION_ROUGHNESS 30 #define RESOLUTION_THETA 100 @@ -50,20 +50,20 @@ void transmittanceIntegrand(const BSDF *bsdf, const Vector &wi, size_t nPts, con if (sample.y == 1) sample.y = 1-Epsilon; out[i] = bsdf->sample(bRec, sample)[0]; - if (std::isnan(out[i])) + if (std::isnan(out[i])) SLog(EError, "%s\n\nNaN!", bRec.toString().c_str()); } } void diffTransmittanceIntegrand(Float *data, size_t resolution, size_t nPts, const Float *in, Float *out) { #pragma omp parallel for - for (int i=0; i<(int) nPts; ++i) + for (int i=0; i<(int) nPts; ++i) out[i] = 2 * in[i] * interpCubic1D(std::pow(in[i], (Float) 0.25f), data, 0, 1, resolution); } class PrecomputeTransmittance : public Utility { public: - Float *computeTransmittance(const char *name, Float ior, Float alpha, + Float *computeTransmittance(const char *name, Float ior, Float alpha, size_t resolution, Float &diffTrans, int inverted) { Properties bsdfProps(alpha == 0 ? "dielectric" : "roughdielectric"); if (inverted) { @@ -89,7 +89,7 @@ public: Float t = i * stepSize; if (i == 0) /* Don't go all the way to zero */ t = stepSize/10; - + Float cosTheta = std::pow(t, (Float) 4.0f); Vector wi(math::safe_sqrt(1-cosTheta*cosTheta), 0, cosTheta); @@ -215,7 +215,7 @@ public: ref timer = new Timer(); // fit("beckmann", 0); -// fit("beckmann", 1); +// fit("beckmann", 1); fit("phong", 0); fit("phong", 1); // fit("ggx", 0); diff --git a/src/utils/tonemap.cpp b/src/utils/tonemap.cpp index 5d986714..ff8e5a9b 100644 --- a/src/utils/tonemap.cpp +++ b/src/utils/tonemap.cpp @@ -93,7 +93,7 @@ public: } break; - case 'g': + case 'g': gamma = (Float) strtod(optarg, &end_ptr); if (*end_ptr != '\0') SLog(EError, "Could not parse the gamma value!"); @@ -114,7 +114,7 @@ public: } break; - case 'm': + case 'm': multiplier = (Float) strtod(optarg, &end_ptr); if (*end_ptr != '\0') SLog(EError, "Could not parse the multiplier!"); @@ -188,7 +188,7 @@ public: } break; - case 'o': + case 'o': outputFilename = optarg; break; @@ -243,8 +243,8 @@ public: if (crop[2] != -1 && crop[3] != -1) input = input->crop(Point2i(crop[0], crop[1]), Vector2i(crop[2], crop[3])); - if (resize[0] != -1) - input = input->resample(rfilter, ReconstructionFilter::EClamp, + if (resize[0] != -1) + input = input->resample(rfilter, ReconstructionFilter::EClamp, ReconstructionFilter::EClamp, Vector2i(resize[0], resize[1])); if (cbal[0] != 1 || cbal[1] != 1 || cbal[2] != 1) @@ -253,17 +253,17 @@ public: if (tonemapper[0] != -1) { Float logAvgLuminance = 0, maxLuminance = 0; input->tonemapReinhard(logAvgLuminance, maxLuminance, tonemapper[0], tonemapper[1]); - Log(EInfo, "Tonemapper reports: log-average luminance = %f, max. luminance = %f", + Log(EInfo, "Tonemapper reports: log-average luminance = %f, max. luminance = %f", logAvgLuminance, maxLuminance); } ref output = input->convert(pixelFormat, Bitmap::EUInt8, gamma, multiplier); - + for (size_t i=0; idrawRect(Point2i(r[0], r[1]), Vector2i(r[2], r[3]), Spectrum(r[4]/255.0f)); } - + fs::path outputFile = inputFile; if (format == Bitmap::EPNG) outputFile.replace_extension(".png"); @@ -271,9 +271,9 @@ public: outputFile.replace_extension(".jpg"); else Log(EError, "Unknown target format!"); - + Log(EInfo, "Writing tonemapped image to \"%s\" ..", outputFile.string().c_str()); - + ref os = new FileStream(outputFile, FileStream::ETruncReadWrite); output->write(format, os); } @@ -288,8 +288,8 @@ public: if (crop[2] != -1 && crop[3] != -1) input = input->crop(Point2i(crop[0], crop[1]), Vector2i(crop[2], crop[3])); - if (resize[0] != -1) - input = input->resample(rfilter, ReconstructionFilter::EClamp, + if (resize[0] != -1) + input = input->resample(rfilter, ReconstructionFilter::EClamp, ReconstructionFilter::EClamp, Vector2i(resize[0], resize[1])); if (cbal[0] != 1 || cbal[1] != 1 || cbal[2] != 1) @@ -297,21 +297,21 @@ public: if (tonemapper[0] != -1) { input->tonemapReinhard(logAvgLuminance, maxLuminance, tonemapper[0], tonemapper[1]); - Log(EInfo, "Tonemapper reports: log-average luminance = %f, max. luminance = %f", + Log(EInfo, "Tonemapper reports: log-average luminance = %f, max. luminance = %f", logAvgLuminance, maxLuminance); if (!temporalCoherence) { logAvgLuminance = 0; maxLuminance = 0; } } - + ref output = input->convert(pixelFormat, Bitmap::EUInt8, gamma, multiplier); - + for (size_t i=0; idrawRect(Point2i(r[0], r[1]), Vector2i(r[2], r[3]), Spectrum(r[4]/255.0f)); } - + fs::path outputFile = inputFile; if (outputFilename == "") { if (format == Bitmap::EPNG) @@ -323,9 +323,9 @@ public: } else { outputFile = outputFilename; } - + Log(EInfo, "Writing tonemapped image to \"%s\" ..", outputFile.string().c_str()); - + ref os = new FileStream(outputFile, FileStream::ETruncReadWrite); output->write(format, os); } diff --git a/src/volume/constvolume.cpp b/src/volume/constvolume.cpp index 29509341..94608910 100644 --- a/src/volume/constvolume.cpp +++ b/src/volume/constvolume.cpp @@ -45,14 +45,14 @@ MTS_NAMESPACE_BEGIN * * * - * * * \end{xml} */ class ConstantDataSource : public VolumeDataSource { public: - ConstantDataSource(const Properties &props) + ConstantDataSource(const Properties &props) : VolumeDataSource(props) { m_type = props.getType("value"); @@ -103,7 +103,7 @@ public: Spectrum lookupSpectrum(const Point &p) const { return m_spectrum; } - + Vector lookupVector(const Point &p) const { return m_vector; } diff --git a/src/volume/gridvolume.cpp b/src/volume/gridvolume.cpp index 9c4754c3..77132d9e 100644 --- a/src/volume/gridvolume.cpp +++ b/src/volume/gridvolume.cpp @@ -51,7 +51,7 @@ MTS_NAMESPACE_BEGIN * } * } * - * This class implements access to memory-mapped volume data stored on a + * This class implements access to memory-mapped volume data stored on a * 3D grid using a simple binary exchange format. * The format uses a little endian encoding and is specified as * follows:\vspace{3mm} @@ -69,7 +69,7 @@ MTS_NAMESPACE_BEGIN * \item Dense \code{float32}-based representation * \item Dense \code{float16}-based representation (\emph{currently not supported by this implementation}) * \item Dense \code{uint8}-based representation (The range 0..255 will be mapped to 0..1) - * \item Dense quantized directions. The directions are stored in spherical + * \item Dense quantized directions. The directions are stored in spherical * coordinates with a total storage cost of 16 bit per entry. * \end{enumerate}\\ * Bytes 9-12 & Number of cells along the X axis (32 bit integer)\\ @@ -91,10 +91,10 @@ MTS_NAMESPACE_BEGIN * Note that Mitsuba expects that entries in direction volumes are either * zero or valid unit vectors. * - * When using this data source to represent floating point density volumes, - * please ensure that the values are all normalized to lie in the + * When using this data source to represent floating point density volumes, + * please ensure that the values are all normalized to lie in the * range $[0, 1]$---otherwise, the Woocock-Tracking integration method in - * \pluginref{heterogeneous} will produce incorrect results. + * \pluginref{heterogeneous} will produce incorrect results. */ class GridDataSource : public VolumeDataSource { public: @@ -105,35 +105,35 @@ public: EQuantizedDirections = 4 }; - GridDataSource(const Properties &props) + GridDataSource(const Properties &props) : VolumeDataSource(props) { m_volumeToWorld = props.getTransform("toWorld", Transform()); if (props.hasProperty("min") && props.hasProperty("max")) { - /* Optionally allow to use an AABB other than + /* Optionally allow to use an AABB other than the one specified by the grid file */ m_dataAABB.min = props.getPoint("min"); m_dataAABB.max = props.getPoint("max"); } /** - * When 'sendData' is set to false, only the filename - * is transmitted. A following unserialization of the - * stream causes the implementation to then look for - * the file (which had better exist if unserialization - * occurs on a remote machine). + * When 'sendData' is set to false, only the filename + * is transmitted. A following unserialization of the + * stream causes the implementation to then look for + * the file (which had better exist if unserialization + * occurs on a remote machine). */ m_sendData = props.getBoolean("sendData", false); loadFromFile(props.getString("filename")); } - GridDataSource(Stream *stream, InstanceManager *manager) + GridDataSource(Stream *stream, InstanceManager *manager) : VolumeDataSource(stream, manager) { m_volumeToWorld = Transform(stream); m_dataAABB = AABB(stream); m_sendData = stream->readBool(); - if (m_sendData) { + if (m_sendData) { m_volumeType = (EVolumeType) stream->readInt(); m_res = Vector3i(stream); m_channels = stream->readInt(); @@ -154,7 +154,7 @@ public: } size_t getVolumeSize() const { - size_t nEntries = (size_t) m_res.x + size_t nEntries = (size_t) m_res.x * (size_t) m_res.y * (size_t) m_res.z; switch (m_volumeType) { case EFloat32: return 4 * nEntries * m_channels; @@ -280,14 +280,14 @@ public: m_dataAABB = AABB(Point(xmin, ymin, zmin), Point(xmax, ymax, zmax)); } - Log(EDebug, "Mapped \"%s\" into memory: %ix%ix%i (%i channels, format = %s), %s, %s", + Log(EDebug, "Mapped \"%s\" into memory: %ix%ix%i (%i channels, format = %s), %s, %s", resolved.filename().string().c_str(), m_res.x, m_res.y, m_res.z, m_channels, format.c_str(), memString(m_mmap->getSize()).c_str(), m_dataAABB.toString().c_str()); m_data = (uint8_t *) (((float *) m_mmap->getData()) + 12); } /** - * This is needed since Mitsuba might be + * This is needed since Mitsuba might be * compiled with either single/double precision */ struct float3 { @@ -302,7 +302,7 @@ public: inline float3 operator*(Float v) const { return float3(value[0]*v, value[1]*v, value[2]*v); } - + inline float3 operator+(const float3 &f2) const { return float3(value[0]+f2.value[0], value[1]+f2.value[1], value[2]+f2.value[2]); } @@ -312,11 +312,11 @@ public: result.fromLinearRGB(value[0], value[1], value[2]); return result; } - + inline Vector toVector() const { return Vector(value[0], value[1], value[2]); } - + float operator[](int i) const { return value[i]; } @@ -338,7 +338,7 @@ public: x2 = x1+1, y2 = y1+1, z2 = z1+1; if (x1 < 0 || y1 < 0 || z1 < 0 || x2 >= m_res.x || - y2 >= m_res.y || z2 >= m_res.z) + y2 >= m_res.y || z2 >= m_res.z) return 0; const Float fx = p.x - x1, fy = p.y - y1, fz = p.z - z1, @@ -391,7 +391,7 @@ public: x2 = x1+1, y2 = y1+1, z2 = z1+1; if (x1 < 0 || y1 < 0 || z1 < 0 || x2 >= m_res.x || - y2 >= m_res.y || z2 >= m_res.z) + y2 >= m_res.y || z2 >= m_res.z) return Spectrum(0.0f); const Float fx = p.x - x1, fy = p.y - y1, fz = p.z - z1, @@ -468,7 +468,7 @@ public: x2 = x1+1, y2 = y1+1, z2 = z1+1; if (x1 < 0 || y1 < 0 || z1 < 0 || x2 >= m_res.x || - y2 >= m_res.y || z2 >= m_res.z) + y2 >= m_res.y || z2 >= m_res.z) return Vector(0.0f); const Float fx = p.x - x1, fy = p.y - y1, fz = p.z - z1; @@ -503,9 +503,9 @@ public: case EFloat32: { const float3 *vectorData = (float3 *) m_data; for (int k=0; k<8; ++k) { - uint32_t index = (((k & 4) ? z2 : z1) * m_res.y + + uint32_t index = (((k & 4) ? z2 : z1) * m_res.y + ((k & 2) ? y2 : y1)) * m_res.x + ((k & 1) ? x2 : x1); - Float factor = ((k & 1) ? fx : _fx) * ((k & 2) ? fy : _fy) + Float factor = ((k & 1) ? fx : _fx) * ((k & 2) ? fy : _fy) * ((k & 4) ? fz : _fz); Vector d = vectorData[index].toVector(); tensor(0, 0) += factor * d.x * d.x; @@ -519,9 +519,9 @@ public: break; case EQuantizedDirections: { for (int k=0; k<8; ++k) { - uint32_t index = (((k & 4) ? z2 : z1) * m_res.y + + uint32_t index = (((k & 4) ? z2 : z1) * m_res.y + ((k & 2) ? y2 : y1)) * m_res.x + ((k & 1) ? x2 : x1); - Float factor = ((k & 1) ? fx : _fx) * ((k & 2) ? fy : _fy) + Float factor = ((k & 1) ? fx : _fx) * ((k & 2) ? fy : _fy) * ((k & 4) ? fz : _fz); Vector d = lookupQuantizedDirection(index); tensor(0, 0) += factor * d.x * d.x; @@ -591,7 +591,7 @@ public: } MTS_DECLARE_CLASS() -protected: +protected: FINLINE Vector lookupQuantizedDirection(size_t index) const { uint8_t theta = m_data[2*index], phi = m_data[2*index+1]; return Vector( diff --git a/src/volume/hgridvolume.cpp b/src/volume/hgridvolume.cpp index f9fc8387..b449c0c0 100644 --- a/src/volume/hgridvolume.cpp +++ b/src/volume/hgridvolume.cpp @@ -31,7 +31,7 @@ MTS_NAMESPACE_BEGIN */ class HierarchicalGridDataSource : public VolumeDataSource { public: - HierarchicalGridDataSource(const Properties &props) + HierarchicalGridDataSource(const Properties &props) : VolumeDataSource(props) { m_volumeToWorld = props.getTransform("toWorld", Transform()); m_prefix = props.getString("prefix"); @@ -40,7 +40,7 @@ public: loadDictionary(filename); } - HierarchicalGridDataSource(Stream *stream, InstanceManager *manager) + HierarchicalGridDataSource(Stream *stream, InstanceManager *manager) : VolumeDataSource(stream, manager) { m_volumeToWorld = Transform(stream); std::string filename = stream->readString(); @@ -96,10 +96,10 @@ public: int numBlocks = 0; while (!stream->isEOF()) { Vector3i block = Vector3i(stream); - Assert(block.x >= 0 && block.y >= 0 && block.z >= 0 + Assert(block.x >= 0 && block.y >= 0 && block.z >= 0 && block.x < m_res.x && block.y < m_res.y && block.z < m_res.z); Properties props("gridvolume"); - props.setString("filename", formatString("%s%03i_%03i_%03i%s", + props.setString("filename", formatString("%s%03i_%03i_%03i%s", m_prefix.c_str(), block.x, block.y, block.z, m_postfix.c_str())); props.setTransform("toWorld", m_volumeToWorld); props.setBoolean("sendData", false); @@ -117,7 +117,7 @@ public: content->incRef(); ++numBlocks; } - Log(EInfo, "%i blocks total, %s, stepSize=%f, resolution=%s", numBlocks, + Log(EInfo, "%i blocks total, %s, stepSize=%f, resolution=%s", numBlocks, aabb.toString().c_str(), m_stepSize, m_res.toString().c_str()); m_aabb.reset(); @@ -148,7 +148,7 @@ public: z = floorToInt(p.z); if (x < 0 || x >= m_res.x || y < 0 || y >= m_res.y || - z < 0 || z >= m_res.z) + z < 0 || z >= m_res.z) return 0.0f; VolumeDataSource *block = m_blocks[((z * m_res.y) + y) * m_res.x + x]; diff --git a/src/volume/volcache.cpp b/src/volume/volcache.cpp index 23d141b4..31d896d8 100644 --- a/src/volume/volcache.cpp +++ b/src/volume/volcache.cpp @@ -46,7 +46,7 @@ struct Vector3iKeyOrder : public std::binary_function /*!\plugin{volcache}{Caching volume data source} * \parameters{ * \parameter{blockSize}{\Integer}{ - * Size of the individual cache blocks + * Size of the individual cache blocks * \default{8, i.e. $8\times8\times 8$} * } * \parameter{voxelWidth}{\Float}{ @@ -58,7 +58,7 @@ struct Vector3iKeyOrder : public std::binary_function * Maximum allowed memory usage in MiB. \default{1024, i.e. 1 GiB} * } * \parameter{toWorld}{\Transform}{ - * Optional linear transformation that should be applied + * Optional linear transformation that should be applied * to the volume data * } * \parameter{\Unnamed}{\Volume}{ @@ -66,12 +66,12 @@ struct Vector3iKeyOrder : public std::binary_function * } * } * - * This plugin can be added between the renderer and another - * data source, for which it caches all data lookups using a - * LRU scheme. This is useful when the nested volume data source + * This plugin can be added between the renderer and another + * data source, for which it caches all data lookups using a + * LRU scheme. This is useful when the nested volume data source * is expensive to evaluate. * - * The cache works by performing on-demand rasterization of subregions + * The cache works by performing on-demand rasterization of subregions * of the nested volume into blocks ($8\times 8 \times 8$ by default). * These are kept in memory until a user-specifiable threshold is exeeded, * after which point a \emph{least recently used} (LRU) policy removes @@ -81,7 +81,7 @@ class CachingDataSource : public VolumeDataSource { public: typedef LRUCache BlockCache; - CachingDataSource(const Properties &props) + CachingDataSource(const Properties &props) : VolumeDataSource(props) { /// Size of an individual block (must be a power of 2) m_blockSize = props.getInteger("blockSize", 8); @@ -89,7 +89,7 @@ public: if (!isPowerOfTwo(m_blockSize)) Log(EError, "Block size must be a power of two!"); - /* Width of an individual voxel. Will use the step size of the + /* Width of an individual voxel. Will use the step size of the nested medium by default */ m_voxelWidth = props.getFloat("voxelWidth", -1); @@ -101,7 +101,7 @@ public: m_volumeToWorld = props.getTransform("toWorld", Transform()); } - CachingDataSource(Stream *stream, InstanceManager *manager) + CachingDataSource(Stream *stream, InstanceManager *manager) : VolumeDataSource(stream, manager) { m_nested = static_cast(manager->getInstance(stream)); configure(); @@ -125,7 +125,7 @@ public: if (m_voxelWidth == -1) m_voxelWidth = m_nested->getStepSize(); - size_t memoryLimitPerCore = m_memoryLimit + size_t memoryLimitPerCore = m_memoryLimit / std::max((size_t) 1, Scheduler::getInstance()->getLocalWorkerCount()); Vector totalCells = m_aabb.getExtents() / m_voxelWidth; @@ -171,7 +171,7 @@ public: if (EXPECT_NOT_TAKEN( x < 0 || x >= m_cellCount.x || y < 0 || y >= m_cellCount.y || - z < 0 || z >= m_cellCount.z)) + z < 0 || z >= m_cellCount.z)) return 0.0f; BlockCache *cache = m_cache.get(); @@ -184,11 +184,11 @@ public: #if defined(VOLCACHE_DEBUG) if (cache->isFull()) { - /* For debugging: when the cache is full, dump locations + /* For debugging: when the cache is full, dump locations of all cache records into an OBJ file and exit */ std::vector keys; cache->get_keys(std::back_inserter(keys)); - + std::ofstream os("keys.obj"); os << "o Keys" << endl; for (size_t i=0; i> m_blockShift), hit); statsHitRate.incrementBase(); - if (hit) + if (hit) ++statsHitRate; - + if (blockData == NULL) return 0.0f; @@ -254,7 +254,7 @@ public: Vector lookupVector(const Point &_p) const { return Vector(0.0f); } - + bool supportsFloatLookups() const { return m_nested->supportsFloatLookups(); } @@ -279,7 +279,7 @@ public: VolumeDataSource::addChild(name, child); } } - + float *renderBlock(const Vector3i &blockIdx) const { float *result = new float[m_blockRes*m_blockRes*m_blockRes]; Point offset = m_aabb.min + Vector(