本文整理汇总了C++中ParamSet类的典型用法代码示例。如果您正苦于以下问题:C++ ParamSet类的具体用法?C++ ParamSet怎么用?C++ ParamSet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ParamSet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: StratifiedSampler
StratifiedSampler(const ParamSet& paramSet)
{
size_t desiredSampleCount = (size_t) paramSet.getInteger("sampleCount", 1);
size_t i = 1;
while (i * i < desiredSampleCount)
++i;
m_resolution = i;
m_sampleCount = m_resolution * m_resolution;
if (m_sampleCount != desiredSampleCount)
std::cout << "Sample count should be a perfect square -- rounding to "
<< m_sampleCount << std::endl;
m_depth = paramSet.getInteger("depth", 3);
m_permutations1D = new size_t*[m_depth];
m_permutations2D = new size_t*[m_depth];
for (int i = 0; i < m_depth; ++i)
{
m_permutations1D[i] = new size_t[m_sampleCount];
m_permutations2D[i] = new size_t[m_sampleCount];
}
m_invResolution = 1.0f / (float)m_resolution;
m_invResolutionSquare = 1.0f / (float) m_sampleCount;
m_random = new Random();
m_sampleIndex = 0;
}
示例2: HeterogeneousMedium
HeterogeneousMedium(const ParamSet& paramSet)
{
m_albedo = paramSet.getColor("albedo");
m_filename = paramSet.getString("filename");
m_densityMultiplier = paramSet.getFloat("densityMultiplier", 1.0f);
m_worldToMedium = paramSet.getTransform("toWorld", Transform()).inverse();
}
示例3: meshName
void LuxRenderer::createAreaLightMesh(mtlu_MayaObject *obj)
{
MString meshName("");
MFnDependencyNode depFn(obj->mobject);
MObject otherSideObj = getOtherSideNode(MString("mtlu_areaLight_geo"), obj->mobject);
if( otherSideObj != MObject::kNullObj)
{
}else{
int indices[6] = {0,1,2,2,3,0};
float floatPointArray[12] = {-1, -1, 0,
-1, 1, 0,
1, 1, 0,
1, -1, 0};
float floatNormalArray[12] = {0,0,-1,
0,0,-1,
0,0,-1,
0,0,-1};
ParamSet triParams = CreateParamSet();
triParams->AddInt("indices", indices, 6);
triParams->AddPoint("P", floatPointArray, 4);
triParams->AddNormal("N", floatNormalArray, 4);
lux->transformBegin();
float fm[16];
MMatrix tm = obj->transformMatrices[0];
setZUp(tm, fm);
this->lux->transform(fm);
this->lux->shape("trianglemesh", boost::get_pointer(triParams));
lux->transformEnd();
}
}
示例4: CreatePointLight
std::shared_ptr<PointLight> CreatePointLight(const Transform &light2world,
const Medium *medium,
const ParamSet ¶mSet) {
Spectrum I = paramSet.FindOneSpectrum("I", Spectrum(1.0));
Spectrum sc = paramSet.FindOneSpectrum("scale", Spectrum(1.0));
Point3f P = paramSet.FindOnePoint3f("from", Point3f(0, 0, 0));
Transform l2w = Translate(Vector3f(P.x, P.y, P.z)) * light2world;
return std::make_shared<PointLight>(l2w, medium, I * sc);
}
示例5: CreateGoniometricLight
std::shared_ptr<GonioPhotometricLight> CreateGoniometricLight(
const Transform &light2world, const Medium *medium,
const ParamSet ¶mSet) {
Spectrum I = paramSet.FindOneSpectrum("I", Spectrum(1.0));
Spectrum sc = paramSet.FindOneSpectrum("scale", Spectrum(1.0));
std::string texname = paramSet.FindOneFilename("mapname", "");
return std::make_shared<GonioPhotometricLight>(light2world, medium, I * sc,
texname);
}
示例6: CreateDistantLight
std::shared_ptr<DistantLight> CreateDistantLight(const Transform &light2world,
const ParamSet ¶mSet) {
Spectrum L = paramSet.FindOneSpectrum("L", Spectrum(1.0));
Spectrum sc = paramSet.FindOneSpectrum("scale", Spectrum(1.0));
Point3f from = paramSet.FindOnePoint3f("from", Point3f(0, 0, 0));
Point3f to = paramSet.FindOnePoint3f("to", Point3f(0, 0, 1));
Vector3f dir = from - to;
return std::make_shared<DistantLight>(light2world, L * sc, dir);
}
示例7: CreateInfiniteLight
std::shared_ptr<InfiniteAreaLight> CreateInfiniteLight(
const Transform &light2world, const ParamSet ¶mSet) {
Spectrum L = paramSet.FindOneSpectrum("L", Spectrum(1.0));
Spectrum sc = paramSet.FindOneSpectrum("scale", Spectrum(1.0));
std::string texmap = paramSet.FindOneFilename("mapname", "");
int nSamples = paramSet.FindOneInt("nsamples", 1);
if (PbrtOptions.quickRender) nSamples = std::max(1, nSamples / 4);
return std::make_shared<InfiniteAreaLight>(light2world, L * sc, nSamples,
texmap);
}
示例8: CreateProjectionLight
std::shared_ptr<ProjectionLight> CreateProjectionLight(
const Transform &light2world, const Medium *medium,
const ParamSet ¶mSet) {
Spectrum I = paramSet.FindOneSpectrum("I", Spectrum(1.0));
Spectrum sc = paramSet.FindOneSpectrum("scale", Spectrum(1.0));
Float fov = paramSet.FindOneFloat("fov", 45.);
std::string texname = paramSet.FindOneFilename("mapname", "");
return std::make_shared<ProjectionLight>(light2world, medium, I * sc,
texname, fov);
}
示例9: CreateHyperboloidShape
std::shared_ptr<Shape> CreateHyperboloidShape(const Transform *o2w,
const Transform *w2o,
bool reverseOrientation,
const ParamSet ¶ms) {
Point3f p1 = params.FindOnePoint3f("p1", Point3f(0, 0, 0));
Point3f p2 = params.FindOnePoint3f("p2", Point3f(1, 1, 1));
Float phimax = params.FindOneFloat("phimax", 360);
return std::make_shared<Hyperboloid>(o2w, w2o, reverseOrientation, p1, p2,
phimax);
}
示例10: CreateDiffuseAreaLight
std::shared_ptr<AreaLight> CreateDiffuseAreaLight(
const Transform &light2world, const Medium *medium,
const ParamSet ¶mSet, const std::shared_ptr<Shape> &shape) {
Spectrum L = paramSet.FindOneSpectrum("L", Spectrum(1.0));
Spectrum sc = paramSet.FindOneSpectrum("scale", Spectrum(1.0));
int nSamples = paramSet.FindOneInt("nsamples", 1);
if (PbrtOptions.quickRender) nSamples = std::max(1, nSamples / 4);
return std::make_shared<DiffuseAreaLight>(light2world, medium, L * sc,
nSamples, shape);
}
示例11: CreateCylinderShape
std::shared_ptr<Cylinder> CreateCylinderShape(const Transform *o2w,
const Transform *w2o,
bool reverseOrientation,
const ParamSet ¶ms) {
Float radius = params.FindOneFloat("radius", 1);
Float zmin = params.FindOneFloat("zmin", -1);
Float zmax = params.FindOneFloat("zmax", 1);
Float phimax = params.FindOneFloat("phimax", 360);
return std::make_shared<Cylinder>(o2w, w2o, reverseOrientation, radius,
zmin, zmax, phimax);
}
示例12: CreateDiskShape
std::shared_ptr<Disk> CreateDiskShape(const Transform *o2w,
const Transform *w2o,
bool reverseOrientation,
const ParamSet ¶ms) {
Float height = params.FindOneFloat("height", 0.);
Float radius = params.FindOneFloat("radius", 1);
Float inner_radius = params.FindOneFloat("innerradius", 0);
Float phimax = params.FindOneFloat("phimax", 360);
return std::make_shared<Disk>(o2w, w2o, reverseOrientation, height, radius,
inner_radius, phimax);
}
示例13: GaussianFilter
GaussianFilter(const ParamSet& paramSet)
{
float radius = paramSet.getFloat("radius", 2.0f);
m_size.x = m_size.y = radius;
float stddev = paramSet.getFloat("stddev", 0.5f);
m_alpha = 1.0f / (2.0f * stddev * stddev);
m_expX = exp(-m_alpha * m_size.x * m_size.x);
m_expY = exp(-m_alpha * m_size.y * m_size.y);
}
示例14: CreateSphereShape
std::shared_ptr<Shape> CreateSphereShape(const Transform *o2w,
const Transform *w2o,
bool reverseOrientation,
const ParamSet ¶ms) {
Float radius = params.FindOneFloat("radius", 1.f);
Float zmin = params.FindOneFloat("zmin", -radius);
Float zmax = params.FindOneFloat("zmax", radius);
Float phimax = params.FindOneFloat("phimax", 360.f);
return std::make_shared<Sphere>(o2w, w2o, reverseOrientation, radius, zmin,
zmax, phimax);
}
示例15: evaluatedOverrindingParams
inline ParamSet evaluatedOverrindingParams(ParamSet eventContext,
TaskInstance instance) const {
ParamSet overridingParams;
TaskInstancePseudoParamsProvider ppp = instance.pseudoParams();
ParamsProviderMerger ppm = ParamsProviderMerger(eventContext)(&ppp);
foreach (QString key, _overridingParams.keys())
overridingParams.setValue(key, _overridingParams.value(key, &ppm));
//Log::fatal() << "******************* " << eventContext << overridingParams
// << _overridingParams;
return overridingParams;
}