From 96353c94db3e4f575b87537b8ef90ba22cb8d2de Mon Sep 17 00:00:00 2001 From: Edgar Velazquez-Armendariz Date: Fri, 22 Mar 2013 23:51:06 -0400 Subject: [PATCH 1/7] Fix the number of dimensions for TVector4 --- include/mitsuba/core/vector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/mitsuba/core/vector.h b/include/mitsuba/core/vector.h index d080688b..1cb4168a 100644 --- a/include/mitsuba/core/vector.h +++ b/include/mitsuba/core/vector.h @@ -660,7 +660,7 @@ template struct TVector4 { T x, y, z, w; /// Number of dimensions - const static int dim = 3; + const static int dim = 4; /** \brief Construct a new vector without initializing it. From e1baae3fdd68337541c5fe58c80fa64f55306f09 Mon Sep 17 00:00:00 2001 From: Edgar Velazquez-Armendariz Date: Sat, 23 Mar 2013 00:43:48 -0400 Subject: [PATCH 2/7] Factorized the paired action of writing the section header and calling 'process' --- doc/gendoc.py | 50 ++++++++++++++++++++++---------------------------- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/doc/gendoc.py b/doc/gendoc.py index b7f23123..a47122e3 100755 --- a/doc/gendoc.py +++ b/doc/gendoc.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#!/usr/bin/env python # # This script walks through all plugin files and # extracts documentation that should go into the @@ -61,34 +61,28 @@ def process(path, target): for entry in ordering: extract(target, entry[1]) +def process_src(target, src_subdir, section=None): + if section is None: + section = "section_" + src_subdir + target.write('\input{{{0}}}\n'.format(section)) + process('../src/{0}'.format(src_subdir), target) + os.chdir(os.path.dirname(__file__)) -f = open('plugins_generated.tex', 'w') -f.write('\input{section_shapes}\n') -process('../src/shapes', f) -f.write('\input{section_bsdf}\n') -process('../src/bsdfs', f) -f.write('\input{section_textures}\n') -process('../src/textures', f) -f.write('\input{section_subsurface}\n') -process('../src/subsurface', f) -f.write('\input{section_media}\n') -process('../src/medium', f) -f.write('\input{section_phase}\n') -process('../src/phase', f) -f.write('\input{section_volumes}\n') -process('../src/volume', f) -f.write('\input{section_emitters}\n') -process('../src/emitters', f) -f.write('\input{section_sensors}\n') -process('../src/sensors', f) -f.write('\input{section_integrators}\n') -process('../src/integrators', f) -f.write('\input{section_samplers}\n') -process('../src/samplers', f) -f.write('\input{section_films}\n') -process('../src/films', f) -f.write('\input{section_rfilters}\n') -f.close() +with open('plugins_generated.tex', 'w') as f: + process_src(f, 'shapes') + process_src(f, 'bsdfs', 'section_bsdf') + process_src(f, 'textures') + process_src(f, 'subsurface') + process_src(f, 'medium', 'section_media') + process_src(f, 'phase') + process_src(f, 'volume', 'section_volumes') + process_src(f, 'emitters') + process_src(f, 'sensors') + process_src(f, 'integrators') + process_src(f, 'samplers') + process_src(f, 'films') + process_src(f, 'rfilters') + os.system('bibtex main.aux') os.system('pdflatex main.tex') #os.system('pdflatex main.tex | grep -i warning | grep -v "Package \(typearea\|hyperref\)"') From ac3a076004562eac0e940783fa6431ff1e7874a2 Mon Sep 17 00:00:00 2001 From: Edgar Velazquez-Armendariz Date: Sat, 23 Mar 2013 00:44:06 -0400 Subject: [PATCH 3/7] Added a 'clean' target for the documentation --- doc/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/Makefile b/doc/Makefile index c64ad654..41c41ab1 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,2 +1,7 @@ all: ./gendoc.py + +clean: + $(RM) main.pdf + $(RM) plugins_generated.tex + $(RM) *.aux main.bbl main.blg main.log main.out main.toc From bd0c3d54c058d5c6bbe09dfabf6513594800e921 Mon Sep 17 00:00:00 2001 From: Edgar Velazquez-Armendariz Date: Sat, 23 Mar 2013 00:48:56 -0400 Subject: [PATCH 4/7] Added extra pdflatex commands to generate documentation from scratch --- doc/gendoc.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/gendoc.py b/doc/gendoc.py index a47122e3..af79f56a 100755 --- a/doc/gendoc.py +++ b/doc/gendoc.py @@ -83,6 +83,8 @@ with open('plugins_generated.tex', 'w') as f: process_src(f, 'films') process_src(f, 'rfilters') +os.system('pdflatex main.tex') os.system('bibtex main.aux') os.system('pdflatex main.tex') +os.system('pdflatex main.tex') #os.system('pdflatex main.tex | grep -i warning | grep -v "Package \(typearea\|hyperref\)"') From f5e6c8072774cb863af87bdb22cc015b7abd02e7 Mon Sep 17 00:00:00 2001 From: Edgar Velazquez-Armendariz Date: Sat, 23 Mar 2013 01:31:41 -0400 Subject: [PATCH 5/7] Factorized steps to generate the pdf, using the subprocess module --- doc/gendoc.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/doc/gendoc.py b/doc/gendoc.py index af79f56a..858956db 100755 --- a/doc/gendoc.py +++ b/doc/gendoc.py @@ -66,8 +66,22 @@ def process_src(target, src_subdir, section=None): section = "section_" + src_subdir target.write('\input{{{0}}}\n'.format(section)) process('../src/{0}'.format(src_subdir), target) + +def texify(texfile): + from subprocess import Popen, PIPE, check_call + version = Popen(["pdflatex", "-version"], stdout=PIPE).communicate()[0] + # Call decode() to convert from bytes to string, required in Python 3 + if re.match('.*MiKTeX.*', version.decode()): + # MiKTeX's "texify" calls latex/bibtex in tandem automatically + print("Running texify on {0}...".format(texfile)) + check_call(['texify', '-pq', texfile]) + else: + check_call(['pdflatex', texfile]) + check_call(['bibtex', texfile.replace('.tex', '.aux')]) + check_call(['pdflatex', texfile]) + check_call(['pdflatex', texfile]) -os.chdir(os.path.dirname(__file__)) +os.chdir(os.path.dirname(os.path.abspath(__file__))) with open('plugins_generated.tex', 'w') as f: process_src(f, 'shapes') process_src(f, 'bsdfs', 'section_bsdf') @@ -83,8 +97,5 @@ with open('plugins_generated.tex', 'w') as f: process_src(f, 'films') process_src(f, 'rfilters') -os.system('pdflatex main.tex') -os.system('bibtex main.aux') -os.system('pdflatex main.tex') -os.system('pdflatex main.tex') +texify('main.tex') #os.system('pdflatex main.tex | grep -i warning | grep -v "Package \(typearea\|hyperref\)"') From 9215e22c16704d23c678dd19d6a99415b425a591 Mon Sep 17 00:00:00 2001 From: Edgar Velazquez-Armendariz Date: Thu, 20 Jun 2013 03:28:28 -0400 Subject: [PATCH 6/7] Require also GL_EXT_gpu_shader4 for enabling geometry shaders. This fixes issues with Ivy Bridge graphics which support GL_EXT_geometry_shader4 and GL_ARB_geometry_shader4 but not GL_EXT_gpu_shader4 when using GLSL 1.2. The syntax for geometry shaders in OpenGL 3.2 Core/GLSL 1.5 is quite different and would require extra porting effort. --- src/libhw/glrenderer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libhw/glrenderer.cpp b/src/libhw/glrenderer.cpp index 1c8c6083..cbe01eec 100644 --- a/src/libhw/glrenderer.cpp +++ b/src/libhw/glrenderer.cpp @@ -157,7 +157,7 @@ void GLRenderer::init(Device *device, Renderer *other) { Log(m_warnLogLevel, "Capabilities: Vertex buffer objects are NOT supported!"); } - if (glewIsSupported("GL_EXT_geometry_shader4")) { + if (glewIsSupported("GL_EXT_geometry_shader4") && glewIsSupported("GL_EXT_gpu_shader4")) { m_capabilities->setSupported( RendererCapabilities::EGeometryShaders, true); Log(m_logLevel, "Capabilities: Geometry shaders are supported."); From 6b6237069a7f8656ff5e89f79157a66485e4e1c3 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Thu, 6 Jun 2013 10:16:21 +0200 Subject: [PATCH 7/7] bugfix for an issue reported by Yoran Bosman --- src/textures/bitmap.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/textures/bitmap.cpp b/src/textures/bitmap.cpp index 86d77b23..301d95f7 100644 --- a/src/textures/bitmap.cpp +++ b/src/textures/bitmap.cpp @@ -381,12 +381,12 @@ public: stream->writeUInt(m_wrapModeV); stream->writeFloat(m_gamma); stream->writeFloat(m_maxAnisotropy); - stream->writeBool(m_separateAlpha); if (!m_filename.empty() && fs::exists(m_filename)) { /* We still have access to the original image -- use that, since it is probably much smaller than the in-memory representation */ ref is = new FileStream(m_filename, FileStream::EReadOnly); + stream->writeBool(m_separateAlpha); stream->writeSize(is->getSize()); is->copyTo(stream); } else { @@ -397,6 +397,7 @@ public: m_mipmap1->toBitmap() : m_mipmap3->toBitmap(); bitmap->write(Bitmap::EOpenEXR, mStream); + stream->writeBool(false); /* separateAlpha */ stream->writeSize(mStream->getSize()); stream->write(mStream->getData(), mStream->getSize()); }