Skip to content

Commit

Permalink
Minor update.
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsy committed Aug 30, 2018
1 parent ecf559a commit e8ae0bd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
11 changes: 10 additions & 1 deletion scripts/image_monitor.py
Expand Up @@ -8,6 +8,7 @@

import matplotlib.pyplot as plt
from matplotlib import animation
from matplotlib.ticker import NullLocator

def animate(filename, ax, tm_method):
_, ext = os.path.splitext(filename)
Expand All @@ -26,6 +27,8 @@ def animate(filename, ax, tm_method):
else:
maxval = 1.0
img = np.power(img / maxval, 1.0 / 2.2)
else:
img = (img / 255.0).astype('float32')

img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
img = np.clip(img, 0.0, 1.0)
Expand All @@ -48,9 +51,15 @@ def main():

height, width, dims = img.shape

fig = plt.figure()
dpi = 72
figsize = ((width + dpi - 1) // dpi, (height + dpi - 1) // dpi)
fig = plt.figure(dpi=dpi, figsize=figsize)
plt.axis('off')
plt.title(os.path.abspath(args.input))
ax = plt.imshow(np.zeros((height, width, dims)))
plt.gca().xaxis.set_major_locator(NullLocator())
plt.gca().yaxis.set_major_locator(NullLocator())
fig.tight_layout()

init_fn = lambda : animate(args.input, ax, args.tonemap)
anim_fn = lambda i: animate(args.input, ax, args.tonemap)
Expand Down
2 changes: 1 addition & 1 deletion sources/bsdfs/roughconductor.cc
Expand Up @@ -29,7 +29,7 @@ RoughConductor::RoughConductor(const std::shared_ptr<Texture<Spectrum>> &Ks,
}

RoughConductor::RoughConductor(RenderParams &params)
: RoughConductor{std::static_pointer_cast<Texture<Spectrum>>(params.getTexture("specularReflectance", Spectrum(1.0))),
: RoughConductor{std::static_pointer_cast<Texture<Spectrum>>(params.getTexture("specularReflectance", Spectrum(1.0), true)),
std::static_pointer_cast<Texture<Spectrum>>(params.getTexture("eta", true)),
std::static_pointer_cast<Texture<Spectrum>>(params.getTexture("k", true)),
std::static_pointer_cast<Texture<Spectrum>>(params.getTexture("alpha", Spectrum(0.1))),
Expand Down
2 changes: 1 addition & 1 deletion sources/integrators/sppm/sppm.cc
Expand Up @@ -235,7 +235,7 @@ void SPPMIntegrator::traceRays(const std::shared_ptr<const Camera> &camera,
printf("\nFinish !!\n");

// Construct hash grid
constructHashGrid(hpoints, width, height, params.getDouble("globalLookupRadius", 1.0));
constructHashGrid(hpoints, width, height, params.getDouble("lookupRadius", 1.0));
std::cout << "Hash grid constructed !!" << std::endl;
}

Expand Down
2 changes: 1 addition & 1 deletion sources/lights/envmap.cc
Expand Up @@ -48,7 +48,7 @@ Envmap::Envmap(const BSphere& worldSphere, const Image& texmap, const Transform&

Envmap::Envmap(RenderParams &params)
: Envmap{BSphere(params.getPoint3d("worldCenter", Point3d(0.0, 0.0, 0.0), true),
params.getDouble("worldRadius", 2.0, true)),
params.getDouble("worldRadius", 100.0, true)),
Image::fromFile(params.getString("filename", true)),
params.getTransform("toWorld", Transform{}, true),
params.getDouble("scale", 1.0, true)} {
Expand Down

0 comments on commit e8ae0bd

Please sign in to comment.