提交 24d5abf6 编写于 作者: M Matt Pharr

Fix a few more nits from -Wall

上级 37cf605f
......@@ -1431,8 +1431,6 @@ retry:
// Compute coordinate frame based on true geometry, not shading
// geometry.
Normal3f n = FaceForward(isect.n, -ray.d);
Vector3f s = Normalize(isect.dpdu);
Vector3f t = Cross(isect.n, s);
Vector3f wi;
Float pdf;
......@@ -2797,7 +2795,7 @@ void SPPMIntegrator::Render() {
// Allocate per-thread _ScratchBuffer_s for SPPM rendering
ThreadLocal<ScratchBuffer> threadScratchBuffers(
[nPixels]() { return ScratchBuffer(1024 * 1024); });
[]() { return ScratchBuffer(1024 * 1024); });
// Allocate samplers for SPPM rendering
ThreadLocal<Sampler> threadSamplers(
......
......@@ -234,13 +234,13 @@ struct alignas(32) LightBVHNode {
PBRT_CPU_GPU
static LightBVHNode MakeLeaf(unsigned int lightIndex, const CompactLightBounds &cb) {
return LightBVHNode{cb, lightIndex, 1};
return LightBVHNode{cb, {lightIndex, 1}};
}
PBRT_CPU_GPU
static LightBVHNode MakeInterior(unsigned int child1Index,
const CompactLightBounds &cb) {
return LightBVHNode{cb, child1Index, 0};
return LightBVHNode{cb, {child1Index, 0}};
}
PBRT_CPU_GPU
......
......@@ -581,7 +581,6 @@ class FloatImageTexture : public ImageTextureBase {
assert(!"Should not be called in GPU code");
return 0;
#else
Vector2f dstdx, dstdy;
TexCoord2D c = mapping.Map(ctx);
// Texture coordinates are (0,0) in the lower left corner, but
// image coordinates are (0,0) in the upper left.
......
......@@ -1601,25 +1601,25 @@ PBRT_CPU_GPU inline pstd::optional<SquareMatrix<4>> Inverse(const SquareMatrix<4
return {};
Float s = 1 / determinant;
Float inv[4][4] = {s * InnerProduct(m[1][1], c5, m[1][3], c3, -m[1][2], c4),
s * InnerProduct(-m[0][1], c5, m[0][2], c4, -m[0][3], c3),
s * InnerProduct(m[3][1], s5, m[3][3], s3, -m[3][2], s4),
s * InnerProduct(-m[2][1], s5, m[2][2], s4, -m[2][3], s3),
s * InnerProduct(-m[1][0], c5, m[1][2], c2, -m[1][3], c1),
s * InnerProduct(m[0][0], c5, m[0][3], c1, -m[0][2], c2),
s * InnerProduct(-m[3][0], s5, m[3][2], s2, -m[3][3], s1),
s * InnerProduct(m[2][0], s5, m[2][3], s1, -m[2][2], s2),
s * InnerProduct(m[1][0], c4, m[1][3], c0, -m[1][1], c2),
s * InnerProduct(-m[0][0], c4, m[0][1], c2, -m[0][3], c0),
s * InnerProduct(m[3][0], s4, m[3][3], s0, -m[3][1], s2),
s * InnerProduct(-m[2][0], s4, m[2][1], s2, -m[2][3], s0),
s * InnerProduct(-m[1][0], c3, m[1][1], c1, -m[1][2], c0),
s * InnerProduct(m[0][0], c3, m[0][2], c0, -m[0][1], c1),
s * InnerProduct(-m[3][0], s3, m[3][1], s1, -m[3][2], s0),
s * InnerProduct(m[2][0], s3, m[2][2], s0, -m[2][1], s1)};
Float inv[4][4] = {{s * InnerProduct(m[1][1], c5, m[1][3], c3, -m[1][2], c4),
s * InnerProduct(-m[0][1], c5, m[0][2], c4, -m[0][3], c3),
s * InnerProduct(m[3][1], s5, m[3][3], s3, -m[3][2], s4),
s * InnerProduct(-m[2][1], s5, m[2][2], s4, -m[2][3], s3)},
{s * InnerProduct(-m[1][0], c5, m[1][2], c2, -m[1][3], c1),
s * InnerProduct(m[0][0], c5, m[0][3], c1, -m[0][2], c2),
s * InnerProduct(-m[3][0], s5, m[3][2], s2, -m[3][3], s1),
s * InnerProduct(m[2][0], s5, m[2][3], s1, -m[2][2], s2)},
{s * InnerProduct(m[1][0], c4, m[1][3], c0, -m[1][1], c2),
s * InnerProduct(-m[0][0], c4, m[0][1], c2, -m[0][3], c0),
s * InnerProduct(m[3][0], s4, m[3][3], s0, -m[3][1], s2),
s * InnerProduct(-m[2][0], s4, m[2][1], s2, -m[2][3], s0)},
{s * InnerProduct(-m[1][0], c3, m[1][1], c1, -m[1][2], c0),
s * InnerProduct(m[0][0], c3, m[0][2], c0, -m[0][1], c1),
s * InnerProduct(-m[3][0], s3, m[3][1], s1, -m[3][2], s0),
s * InnerProduct(m[2][0], s3, m[2][2], s0, -m[2][1], s1)}};
return SquareMatrix<4>(inv);
}
......
......@@ -268,8 +268,6 @@ namespace {
constexpr int nCIESamples = 471;
extern const Float CIE_lambda[nCIESamples];
const Float CIE_lambdaStart = CIE_lambda[0];
const Float CIE_lambdaEnd = CIE_lambda[nCIESamples - 1];
// Spectral Data
const Float CIE_X[nCIESamples] = {
......@@ -1443,58 +1441,6 @@ const Float GlassSF11_eta[] = {
// PhysLight code and measurements contributed by Anders Langlands and Luca Fascione
// Copyright (c) 2020, Weta Digital, Ltd.
// SPDX-License-Identifier: Apache-2.0
const Float Canon_eos5dmkii_lambda[] = {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};
const Float Canon_eos5dmkii_R[] = {
0.0008013842, 0.0006220757, 0.001637148, 0.0038748426, 0.0085357673, 0.0061490957,
0.0028872172, 0.0024148706, 0.0022508639, 0.0040032296, 0.0068301998, 0.0092928829,
0.0152933769, 0.0305241911, 0.0916499483, 0.1336909081, 0.1509614473, 0.130782838,
0.1628188126, 0.2568271304, 0.3849123031, 0.4693487229, 0.4692466342, 0.4421441869,
0.3902777211, 0.317328307, 0.2623859635, 0.1707236556, 0.122806183, 0.0916867133,
0.051765637, 0.0147074911, 0.0025296982, 0.0016901259, 0.0008906563};
const Float Canon_eos5dmkii_G[] = {
0.001320931, 0.0009869984, 0.0029762197, 0.0101720847, 0.0322943739, 0.0390348509,
0.0598052544, 0.0750923329, 0.0912708802, 0.2487049523, 0.4731934541, 0.603250544,
0.7303841968, 0.71503, 1.0, 0.8266072352, 0.7706404757, 0.7397716484,
0.7017391188, 0.5729864943, 0.4713093699, 0.3557909148, 0.2270881614, 0.1267125616,
0.0609366683, 0.035822907, 0.0229253792, 0.0122726601, 0.0088821173, 0.0086322805,
0.0068405787, 0.0027319055, 0.000806291, 0.0005819094, 0.0003689315};
const Float Canon_eos5dmkii_B[] = {
0.0010193366, 0.0019387474, 0.0184137527, 0.0880872372, 0.324456777, 0.4733696468,
0.5952254136, 0.719627943, 0.7247913875, 0.765651266, 0.7369036376, 0.5623063473,
0.4416055734, 0.2567925877, 0.1963973281, 0.0897441872, 0.051141812, 0.0322256091,
0.0210614803, 0.0139621978, 0.0114102512, 0.0094738362, 0.0071171351, 0.0046852384,
0.0038326684, 0.0032847416, 0.0035606685, 0.0026451065, 0.0025273598, 0.0022779309,
0.0014565188, 0.0004733991, 0.0001661569, 0.0001275188, 9.09883e-05};
const Float Canon_eos5dmkiifg_lambda[] = {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};
const Float Canon_eos5dmkiifg_R[] = {
0.0008013842, 0.0006220757, 0.001637148, 0.0038748426, 0.0085357673, 0.0061490957,
0.0028872172, 0.0024148706, 0.0022508639, 0.0040032296, 0.0068301998, 0.0092928829,
0.0152933769, 0.0305241911, 0.0916499483, 0.1336909081, 0.1509614473, 0.130782838,
0.1628188126, 0.2568271304, 0.3849123031, 0.4693487229, 0.4692466342, 0.4421441869,
0.3902777211, 0.317328307, 0.2623859635, 0.1707236556, 0.122806183, 0.0916867133,
0.051765637, 0.0147074911, 0.0025296982, 0.0016901259, 0.0008906563};
const Float Canon_eos5dmkiifg_G[] = {
0.001320931, 0.0009869984, 0.0029762197, 0.0101720847, 0.0322943739, 0.0390348509,
0.0598052544, 0.0750923329, 0.0912708802, 0.2487049523, 0.4731934541, 0.603250544,
0.7303841968, 0.928899999922, 1.0, 0.8266072352, 0.7706404757, 0.7397716484,
0.7017391188, 0.5729864943, 0.4713093699, 0.3557909148, 0.2270881614, 0.1267125616,
0.0609366683, 0.035822907, 0.0229253792, 0.0122726601, 0.0088821173, 0.0086322805,
0.0068405787, 0.0027319055, 0.000806291, 0.0005819094, 0.0003689315};
const Float Canon_eos5dmkiifg_B[] = {
0.0010193366, 0.0019387474, 0.0184137527, 0.0880872372, 0.324456777, 0.4733696468,
0.5952254136, 0.719627943, 0.7247913875, 0.765651266, 0.7369036376, 0.5623063473,
0.4416055734, 0.2567925877, 0.1963973281, 0.0897441872, 0.051141812, 0.0322256091,
0.0210614803, 0.0139621978, 0.0114102512, 0.0094738362, 0.0071171351, 0.0046852384,
0.0038326684, 0.0032847416, 0.0035606685, 0.0026451065, 0.0025273598, 0.0022779309,
0.0014565188, 0.0004733991, 0.0001661569, 0.0001275188, 9.09883e-05};
const Float canon_eos_100d_r[] = {
380.0, 0.0010345340999999945, 390.0, 0.0009932282000000006,
400.0, 0.0018438642000000011, 410.0, 0.01028051149999999,
......
......@@ -101,17 +101,6 @@ WavefrontPathIntegrator::WavefrontPathIntegrator(
if (!shape.insideMedium.empty() || !shape.outsideMedium.empty())
haveMedia = true;
auto findMedium = [&](const std::string &s, const FileLoc *loc) -> Medium {
if (s.empty())
return nullptr;
auto iter = media.find(s);
if (iter == media.end())
ErrorExit(loc, "%s: medium not defined", s);
haveMedia = true;
return iter->second;
};
// Textures
LOG_VERBOSE("Starting to create textures");
NamedTextures textures = scene.CreateTextures();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册