#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <string>
#include <vector>
#include "error.h"
#include <malloc.h>
#include <alloca.h>
#include <assert.h>
#include <algorithm>
Go to the source code of this file.
Classes | |
struct | Options |
Defines | |
#define | _GNU_SOURCE 1 |
#define | ALLOCA(TYPE, COUNT) (TYPE *)alloca((COUNT) * sizeof(TYPE)) |
#define | PBRT_VERSION "2.0.0" |
#define | M_PI 3.14159265358979323846f |
#define | INV_PI 0.31830988618379067154f |
#define | INV_TWOPI 0.15915494309189533577f |
#define | INV_FOURPI 0.07957747154594766788f |
#define | INFINITY FLT_MAX |
#define | PBRT_L1_CACHE_LINE_SIZE 64 |
#define | Assert(expr) |
Typedefs | |
typedef RGBSpectrum | Spectrum |
Functions | |
float | Lerp (float t, float v1, float v2) |
float | Clamp (float val, float low, float high) |
int | Clamp (int val, int low, int high) |
int | Mod (int a, int b) |
float | Radians (float deg) |
float | Degrees (float rad) |
float | Log2 (float x) |
int | Floor2Int (float val) |
int | Log2Int (float v) |
bool | IsPowerOf2 (int v) |
uint32_t | RoundUpPow2 (uint32_t v) |
int | Round2Int (float val) |
int | Float2Int (float val) |
int | Ceil2Int (float val) |
bool | Quadratic (float A, float B, float C, float *t0, float *t1) |
Variables | |
Options | PbrtOptions |
#define ALLOCA | ( | TYPE, | |||
COUNT | ) | (TYPE *)alloca((COUNT) * sizeof(TYPE)) |
Definition at line 94 of file pbrt.h.
Referenced by ImageFilm::AddSample(), MetropolisRenderer::Lbidir(), LDPixelSample(), UseRadianceProbes::Li(), GlossyPRTIntegrator::Li(), MeasuredMaterial::MeasuredMaterial(), NURBSEvaluate(), NURBSEvaluateSurface(), BSDF::rho(), SHComputeDiffuseTransfer(), SHComputeTransferMatrix(), SHEvaluate(), PointLight::SHProject(), Light::SHProject(), InfiniteAreaLight::SHProject(), SHProjectCube(), SHProjectIncidentIndirectRadiance(), SHRotateZ(), SHWriteImage(), LoopSubdiv::weightBoundary(), and LoopSubdiv::weightOneRing().
#define Assert | ( | expr | ) |
((expr) ? (void)0 : \ Severe("Assertion \"%s\" failed in %s, line %d", \ #expr, __FILE__, __LINE__))
Definition at line 286 of file pbrt.h.
Referenced by AbsDot(), BSDF::Add(), ParamSet::AddBlackbodySpectrum(), ParamSet::AddRGBSpectrum(), ParamSet::AddSampledSpectrum(), ParamSet::AddXYZSpectrum(), AverageSpectrumSamples(), BSDFSample::BSDFSample(), KdTreeAccel::buildTree(), BVHAccel::BVHAccel(), CoefficientSpectrum< 3 >::Clamp(), CoefficientSpectrum< 3 >::CoefficientSpectrum(), ComputeLightSamplingCDF(), Sampler::ComputeSubWindow(), CreateHeightfieldShape(), CreateNURBSShape(), Cross(), Dot(), RWMutexLock::DowngradeToRead(), EPhoton(), BVHAccel::flattenBVHTree(), RGBSpectrum::FromRGB(), GridAccel::GridAccel(), InterpolateSpectrumSamples(), Voxel::Intersect(), Voxel::IntersectP(), KnotOffset(), legendrep(), SamplerRenderer::Li(), PhotonIntegrator::Li(), EmissionIntegrator::Li(), CreateRadianceProbes::Li(), LightSample::LightSample(), MakeCamera(), MeasuredMaterial::MeasuredMaterial(), MetropolisRenderer::MetropolisRenderer(), mutate(), Normal::Normal(), NumSystemCores(), NURBSEvaluate(), NURBSEvaluateSurface(), Transform::operator()(), CompareToBucket::operator()(), CoefficientSpectrum< 3 >::operator*(), operator*(), CoefficientSpectrum< 3 >::operator*=(), Vector::operator*=(), CoefficientSpectrum< 3 >::operator+(), Normal::operator+(), Point::operator+(), Vector::operator+(), CoefficientSpectrum< 3 >::operator+=(), Normal::operator+=(), Point::operator+=(), Vector::operator+=(), CoefficientSpectrum< 3 >::operator-(), Normal::operator-(), Point::operator-(), Vector::operator-(), Normal::operator-=(), Point::operator-=(), Vector::operator-=(), CoefficientSpectrum< 3 >::operator/(), Normal::operator/(), Vector::operator/(), CoefficientSpectrum< 3 >::operator/=(), Normal::operator/=(), Vector::operator/=(), Normal::operator=(), Point::operator=(), Vector::operator=(), BBox::operator[](), Normal::operator[](), Point::operator[](), Vector::operator[](), TransformSet::operator[](), pbrtObjectInstance(), pbrtShape(), Point::Point(), Pow(), RdToAlphap(), ReadFloatFile(), ReadImageTGA(), BVHAccel::recursiveBuild(), MetropolisRenderer::Render(), MIPMap< RGBSpectrum >::resampleWeights(), ComputeRadianceTask::Run(), MLTTask::Run(), CreateRadProbeTask::Run(), BSDF::Sample_f(), Distribution1D::SampleContinuous(), Distribution1D::SampleDiscrete(), VisibilityTester::SetRay(), VisibilityTester::SetSegment(), SHEvaluate(), SHRotateXPlus(), SHRotateZ(), Timer::Start(), Timer::Stop(), TasksCleanup(), MIPMap< T >::Texel(), RWMutexLock::UpgradeToWrite(), and Vector::Vector().
#define INFINITY FLT_MAX |
Definition at line 178 of file pbrt.h.
Referenced by BBox::BBox(), KdTreeAccel::buildTree(), MIPMap< RGBSpectrum >::clamp(), CreateAmbientOcclusionIntegrator(), EstimateDirect(), PerspectiveCamera::GenerateRay(), OrthoCamera::GenerateRay(), EnvironmentCamera::GenerateRay(), PerspectiveCamera::GenerateRayDifferential(), OrthoCamera::GenerateRayDifferential(), IrradianceCacheIntegrator::indirectLo(), AggregateVolume::IntersectP(), PhotonIntegrator::Li(), main(), InfiniteAreaCube::operator()(), CreateRadianceProbes::Render(), SurfacePointTask::Run(), ShapeSet::Sample(), SpotLight::Sample_L(), ProjectionLight::Sample_L(), PointLight::Sample_L(), InfiniteAreaLight::Sample_L(), GonioPhotometricLight::Sample_L(), DistantLight::Sample_L(), DiffuseAreaLight::Sample_L(), VisibilityTester::SetRay(), and SHProjectIncidentIndirectRadiance().
#define INV_FOURPI 0.07957747154594766788f |
#define INV_PI 0.31830988618379067154f |
Definition at line 174 of file pbrt.h.
Referenced by CosineHemispherePdf(), OrenNayar::f(), Lambertian::f(), kernel(), InfiniteAreaLight::Le(), UseRadianceProbes::Li(), DipoleSubsurfaceIntegrator::Li(), DiffusePRTIntegrator::Li(), LPhoton(), FresnelBlend::Pdf(), BxDF::Pdf(), InfiniteAreaLight::Pdf(), ComputeRadianceTask::Run(), GonioPhotometricLight::Scale(), and SphericalMapping2D::sphere().
#define INV_TWOPI 0.15915494309189533577f |
Definition at line 175 of file pbrt.h.
Referenced by Anisotropic::D(), Blinn::D(), Disk::Intersect(), InfiniteAreaLight::Le(), Anisotropic::Pdf(), InfiniteAreaLight::Pdf(), BxDF::rho(), Anisotropic::Sample_f(), DiffuseAreaLight::Sample_L(), GonioPhotometricLight::Scale(), SphericalMapping2D::sphere(), and UniformHemispherePdf().
#define M_PI 3.14159265358979323846f |
Definition at line 173 of file pbrt.h.
Referenced by BRDFRemap(), ConcentricSampleDisk(), CylindricalMapping2D::cylinder(), Degrees(), EPhoton(), RegularHalfangleBRDF::f(), FresnelBlend::f(), EnvironmentCamera::GenerateRay(), IrradianceCacheIntegrator::indirectLo(), InfiniteAreaLight::InfiniteAreaLight(), Sphere::Intersect(), Paraboloid::Intersect(), Hyperboloid::Intersect(), Disk::Intersect(), Cylinder::Intersect(), Cone::Intersect(), Sphere::IntersectP(), Paraboloid::IntersectP(), Hyperboloid::IntersectP(), Disk::IntersectP(), Cylinder::IntersectP(), Cone::IntersectP(), lambda(), Lanczos(), main(), DiffusionReflectance::operator()(), Blinn::Pdf(), InfiniteAreaLight::Pdf(), PhaseHG(), PhaseIsotropic(), PhaseMieHazy(), PhaseMieMurky(), PhaseRayleigh(), PhaseSchlick(), SpotLight::Power(), ProjectionLight::Power(), PointLight::Power(), InfiniteAreaLight::Power(), GonioPhotometricLight::Power(), DistantLight::Power(), DiffuseAreaLight::Power(), IGIIntegrator::Preprocess(), Radians(), LoopSubdiv::Refine(), BxDF::rho(), SurfacePointTask::Run(), Anisotropic::Sample_f(), Blinn::Sample_f(), InfiniteAreaLight::Sample_L(), DistantLight::Sample_L(), Anisotropic::sampleFirstQuadrant(), SampleHG(), InfiniteAreaLight::SHProject(), SHWriteImage(), LanczosSincFilter::Sinc1D(), SphericalPhi(), UniformConePdf(), UniformSampleCone(), UniformSampleDisk(), UniformSampleHemisphere(), UniformSampleSphere(), and UniformSpherePdf().
#define PBRT_L1_CACHE_LINE_SIZE 64 |
Definition at line 184 of file pbrt.h.
Referenced by AllocAligned(), RWMutex::Create(), and Mutex::Create().
typedef RGBSpectrum Spectrum |
int Ceil2Int | ( | float | val | ) | [inline] |
Definition at line 278 of file pbrt.h.
Referenced by ImageFilm::AddSample(), MIPMap< T >::EWA(), ImageFilm::ImageFilm(), SingleScatteringIntegrator::Li(), EmissionIntegrator::Li(), and CreateRadianceProbes::Render().
float Clamp | ( | float | val, | |
float | low, | |||
float | high | |||
) | [inline] |
Definition at line 205 of file pbrt.h.
Referenced by UseRadianceProbes::c_inXYZ(), MIPMap< RGBSpectrum >::clamp(), Cone::Cone(), CosPhi(), CreateImageFilm(), Cylinder::Cylinder(), VolumeGridDensity::D(), Disk::Disk(), FresnelDielectric::Evaluate(), MixMaterial::GetBSDF(), MatteMaterial::GetBSDF(), GridAccel::GridAccel(), Hyperboloid::Hyperboloid(), IrradianceCacheIntegrator::indirectLo(), Sphere::Intersect(), main(), MIPMap< T >::MIPMap(), Paraboloid::Paraboloid(), Distribution2D::Pdf(), GridAccel::posToVoxel(), SinPhi(), Slerp(), SmoothStep(), Sphere::Sphere(), SphericalTheta(), MIPMap< T >::Texel(), MIPMap< T >::triangle(), and ImageFilm::UpdateDisplay().
float Degrees | ( | float | rad | ) | [inline] |
Definition at line 232 of file pbrt.h.
References M_PI.
Referenced by IrradianceCacheIntegrator::IrradianceCacheIntegrator().
int Float2Int | ( | float | val | ) | [inline] |
Definition at line 273 of file pbrt.h.
Referenced by MIPMap< T >::EWA(), Distribution2D::Pdf(), and GridAccel::posToVoxel().
int Floor2Int | ( | float | val | ) | [inline] |
Definition at line 263 of file pbrt.h.
Referenced by ImageFilm::AddSample(), BestCandidateSampler::BestCandidateSampler(), Sampler::ComputeSubWindow(), VolumeGridDensity::Density(), UVTexture::Evaluate(), MarbleTexture::Evaluate(), DotsTexture< T >::Evaluate(), Checkerboard3DTexture< T >::Evaluate(), Checkerboard2DTexture< T >::Evaluate(), MIPMap< T >::EWA(), FBm(), ImageFilm::GetSampleExtent(), UseRadianceProbes::Li(), SingleScatteringIntegrator::Li(), PhotonIntegrator::Li(), Log2Int(), MIPMap< T >::Lookup(), Noise(), MIPMap< RGBSpectrum >::resampleWeights(), Round2Int(), BSDF::Sample_f(), ImageFilm::Splat(), MIPMap< T >::triangle(), Turbulence(), and UniformSampleOneLight().
bool IsPowerOf2 | ( | int | v | ) | [inline] |
Definition at line 249 of file pbrt.h.
Referenced by AdaptiveSampler::AdaptiveSampler(), LDSampler::LDSampler(), MIPMap< T >::MIPMap(), and MetropolisRenderer::Render().
float Lerp | ( | float | t, | |
float | v1, | |||
float | v2 | |||
) | [inline] |
Definition at line 200 of file pbrt.h.
Referenced by bloom(), Sampler::ComputeSubWindow(), VolumeGridDensity::Density(), SampledSpectrum::FromSampled(), PerspectiveCamera::GenerateRay(), OrthoCamera::GenerateRay(), EnvironmentCamera::GenerateRay(), PerspectiveCamera::GenerateRayDifferential(), OrthoCamera::GenerateRayDifferential(), StratifiedSampler::GetMoreSamples(), RandomSampler::GetMoreSamples(), HaltonSampler::GetMoreSamples(), BestCandidateSampler::GetMoreSamples(), SampledSpectrum::Init(), AnimatedTransform::Interpolate(), InterpolateSpectrumSamples(), LargeStep(), LDPixelSample(), UseRadianceProbes::Li(), AnimatedTransform::MotionBounds(), Noise(), NURBS::Refine(), MetropolisRenderer::Render(), AggregateTest::Render(), Cylinder::Sample(), and UniformSampleCone().
float Log2 | ( | float | x | ) | [inline] |
Definition at line 237 of file pbrt.h.
Referenced by FBm(), Log2Int(), MIPMap< T >::Lookup(), and Turbulence().
int Log2Int | ( | float | v | ) | [inline] |
Definition at line 244 of file pbrt.h.
References Floor2Int(), and Log2().
Referenced by KdTreeAccel::KdTreeAccel(), and MIPMap< T >::MIPMap().
int Mod | ( | int | a, | |
int | b | |||
) | [inline] |
Definition at line 219 of file pbrt.h.
Referenced by MIPMap< T >::MIPMap(), and MIPMap< T >::Texel().
bool Quadratic | ( | float | A, | |
float | B, | |||
float | C, | |||
float * | t0, | |||
float * | t1 | |||
) | [inline] |
Definition at line 291 of file pbrt.h.
Referenced by Sphere::Intersect(), Paraboloid::Intersect(), Hyperboloid::Intersect(), Cylinder::Intersect(), Cone::Intersect(), Sphere::IntersectP(), Paraboloid::IntersectP(), Hyperboloid::IntersectP(), Cylinder::IntersectP(), and Cone::IntersectP().
float Radians | ( | float | deg | ) | [inline] |
Definition at line 227 of file pbrt.h.
References M_PI.
Referenced by Cone::Cone(), Cylinder::Cylinder(), Disk::Disk(), Hyperboloid::Hyperboloid(), OrenNayar::OrenNayar(), Paraboloid::Paraboloid(), Perspective(), PhotonIntegrator::PhotonIntegrator(), ProjectionLight::ProjectionLight(), Rotate(), RotateX(), RotateY(), RotateZ(), Sphere::Sphere(), and SpotLight::SpotLight().
int Round2Int | ( | float | val | ) | [inline] |
Definition at line 268 of file pbrt.h.
References Floor2Int().
Referenced by GridAccel::GridAccel(), KdTreeAccel::KdTreeAccel(), and ProgressReporter::Update().
uint32_t RoundUpPow2 | ( | uint32_t | v | ) | [inline] |
Definition at line 254 of file pbrt.h.
Referenced by AdaptiveSampler::AdaptiveSampler(), AmbientOcclusionIntegrator::AmbientOcclusionIntegrator(), IGIIntegrator::IGIIntegrator(), LDSampler::LDSampler(), MetropolisRenderer::MetropolisRenderer(), MIPMap< T >::MIPMap(), DipoleSubsurfaceIntegrator::Preprocess(), SamplerRenderer::Render(), MetropolisRenderer::Render(), LDSampler::RoundSize(), BestCandidateSampler::RoundSize(), AdaptiveSampler::RoundSize(), Light::SHProject(), and SHProjectIncidentIndirectRadiance().
Definition at line 126 of file api.cpp.
Referenced by CreateAdaptiveSampler(), CreateAmbientOcclusionIntegrator(), CreateBestCandidateSampler(), CreateDiffuseAreaLight(), CreateDipoleSubsurfaceIntegrator(), CreateHaltonSampler(), CreateIGISurfaceIntegrator(), CreateImageFilm(), CreateInfiniteLight(), CreateIrradianceCacheIntegrator(), CreateLowDiscrepancySampler(), CreateMetropolisRenderer(), CreatePhotonMapSurfaceIntegrator(), CreateStratifiedSampler(), CreateSurfacePointsRenderer(), ProgressReporter::Done(), EnqueueTasks(), ImageFilm::ImageFilm(), Info(), NumSystemCores(), ProgressReporter::ProgressReporter(), SurfacePointsRenderer::Render(), TasksCleanup(), TasksInit(), ProgressReporter::Update(), WaitForAllTasks(), and Warning().