提交 ef9ccce7 编写于 作者: G Gon Solo

Merge branch 'master' into fullscreen

......@@ -39,6 +39,7 @@ Rendering options:
--debugstart <values> Inform the Integrator where to start rendering for
faster debugging. (<values> are Integrator-specific
and come from error message text.)
--disable-image-textures Always return the average value of image textures.
--disable-pixel-jitter Always sample pixels at their centers.
--disable-texture-filtering Point-sample all textures.
--disable-wavelength-jitter Always sample the same %d wavelengths of light.
......@@ -161,6 +162,8 @@ int main(int argc, char *argv[]) {
ParseArg(&iter, args.end(), "gpu-device", &options.gpuDevice, onError) ||
#endif
ParseArg(&iter, args.end(), "debugstart", &options.debugStart, onError) ||
ParseArg(&iter, args.end(), "disable-image-textures",
&options.disableImageTextures, onError) ||
ParseArg(&iter, args.end(), "disable-pixel-jitter",
&options.disablePixelJitter, onError) ||
ParseArg(&iter, args.end(), "disable-texture-filtering",
......
......@@ -35,19 +35,19 @@ std::string ToString(const RenderingCoordinateSystem &r) {
std::string PBRTOptions::ToString() const {
return StringPrintf(
"[ PBRTOptions seed: %s quiet: %s disablePixelJitter: %s "
"disableWavelengthJitter: %s disableTextureFiltering: %s forceDiffuse: %s "
"useGPU: %s wavefront: %s interactive: %s fullscreen: %s renderingSpace: %s nThreads: %s "
"logLevel: %s logFile: "
"%s logUtilization: %s writePartialImages: %s recordPixelStatistics: %s "
"disableWavelengthJitter: %s disableTextureFiltering: %s disableImageTextures: %s "
"forceDiffuse: %s useGPU: %s wavefront: %s interactive: %s fullscreen %s "
"renderingSpace: %s nThreads: %s logLevel: %s logFile: %s logUtilization: %s "
"writePartialImages: %s recordPixelStatistics: %s "
"printStatistics: %s pixelSamples: %s gpuDevice: %s quickRender: %s upgrade: %s "
"imageFile: %s mseReferenceImage: %s mseReferenceOutput: %s debugStart: %s "
"displayServer: %s cropWindow: %s pixelBounds: %s pixelMaterial: %s "
"displacementEdgeScale: %f ]",
seed, quiet, disablePixelJitter, disableWavelengthJitter, disableTextureFiltering,
forceDiffuse, useGPU, wavefront, interactive, fullscreen, renderingSpace, nThreads, logLevel,
logFile, logUtilization, writePartialImages, recordPixelStatistics,
printStatistics, pixelSamples, gpuDevice, quickRender, upgrade, imageFile,
mseReferenceImage, mseReferenceOutput, debugStart, displayServer, cropWindow,
disableImageTextures, forceDiffuse, useGPU, wavefront, interactive, fullscreen,
renderingSpace, nThreads, logLevel, logFile, logUtilization, writePartialImages,
recordPixelStatistics, printStatistics, pixelSamples, gpuDevice, quickRender, upgrade,
imageFile, mseReferenceImage, mseReferenceOutput, debugStart, displayServer, cropWindow,
pixelBounds, pixelMaterial, displacementEdgeScale);
}
......
......@@ -24,6 +24,7 @@ struct BasicPBRTOptions {
bool quiet = false;
bool disablePixelJitter = false, disableWavelengthJitter = false;
bool disableTextureFiltering = false;
bool disableImageTextures = false;
bool forceDiffuse = false;
bool useGPU = false;
bool wavefront = false;
......
......@@ -4,6 +4,7 @@
#include <pbrt/util/mipmap.h>
#include <pbrt/options.h>
#include <pbrt/util/check.h>
#include <pbrt/util/color.h>
#include <pbrt/util/colorspace.h>
......@@ -195,6 +196,11 @@ MIPMap::MIPMap(Image image, const RGBColorSpace *colorSpace, WrapMode wrapMode,
: colorSpace(colorSpace), wrapMode(wrapMode), options(options) {
CHECK(colorSpace);
pyramid = Image::GeneratePyramid(std::move(image), wrapMode, alloc);
if (Options->disableImageTextures) {
Image top = pyramid.back();
pyramid.clear();
pyramid.push_back(top);
}
std::for_each(pyramid.begin(), pyramid.end(),
[](const Image &im) { imageMapBytes += im.BytesUsed(); });
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册