DavidBrainard / RenderToolbox3

Matlab toolbox for managing graphics rendering for psychophysics
MIT License
11 stars 4 forks source link

PBRT errors and warnings. #15

Closed benjamin-heasly closed 11 years ago

benjamin-heasly commented 11 years ago

Andy Lin got some errors and warnings when trying to render the Dragon scene:

??? Error using ==> BatchRender at 268 PBRT rendering failed Dragon-001.pbrt pbrt version 2.0.0 of Jan 9 2013 at 03:44:44 [Detected 8 core(s)] Copyright (c)1998-2010 Matt Pharr and Greg Humphreys. The source code to pbrt (but not the book contents) is covered by the GNU GPL. See the file COPYING.txt for the conditions of the license. Dragon-001.pbrt(20): Warning: This version of pbrt fixes a bug in the LookAt transformation. If your rendered images unexpectedly change, add a "Scale -1 1 1" to the start of your scene file. Dragon-001.pbrt(42): Error: Illegal character: : (0x3a) Dragon-001.pbrt(42): Error: Illegal character: : (0x3a) Dragon-001.pbrt(48): Error: Illegal character: : (0x3a) Dragon-001.pbrt(48): Error: Illegal character: : (0x3a) Dragon-001.pbrt(54): Error: Illegal character: : (0x3a) Dragon-001.pbrt(54): Error: Illegal character: : (0x3a) Dragon-001.pbrt(166): Warning: Scaling detected in world to light transformation! The system has numerous assumptions, implicit and explicit, that this transform will have no scale factors in it. Proceed at your own risk; your image may have errors or the system may crash as a result of this. Dragon-001.pbrt(188): Warning: Scaling detected in world to light transformation! The system has numerous assumptions, implicit and explicit, that this transform will have no scale factors in it. Proceed at your own risk; your image may have errors or the system may crash as a result of this.

conversionMatrixFilename:

Dragon-001.pbrt(225): Error: Unable to open file "" Dragon-001.pbrt(225): Warning: Unable to read conversion matrix file "". Using identity matrix.

in constructor!!

I recognize the Illegal Character error from my machines, but the error didn't seem to matter for me.

This is the line that is causing the error in the PBRT file:

MakeNamedMaterial "FloorMaterial-material" "string type" "matte" "spectrum Kd" [300:0.5 800:0.5] "float sigma" [0]

Andy notes that PBRT doesn't like the colons, and spaces instead of colons would probably work.

benjamin-heasly commented 11 years ago

I think it would be straightforward to replace colons with spaces during mappings processing, probably in ApplyPBRTObjects().

benjamin-heasly commented 11 years ago

Since this is about low-level PBRT syntax, it might make more sense to filter out the colons in WritePBRTFile() or PrintPBRTStatement().

benjamin-heasly commented 11 years ago

As of 7bd5a0b0abce6263d806f04eaa00e597fa5c01d8, PrintPBRTStatement() replaces colon delimiters with spaces, for numeric sampled spectra.

benjamin-heasly commented 11 years ago

The warning about "Scaling detected in world to light transformation" seems to be a deep issue with how PBRT implements area lights. I don't think there will be a syntax-level fix.

This forum suggests a workaround at the Blender level: http://blenderartists.org/forum/showthread.php?182763-Apply-Object-Mode-transformations-to-the-mesh-in-edit-mode

I used this suggestion in the Dragon scene: for each area light, with Control-A, I applied the object scale transformation to the object mesh data. That way PBRT won't have to apply the scaling itself, and it does not need to complain.

benjamin-heasly commented 11 years ago

Now the Dragon scene renders without "Illegal character" errors or "Scaling detected" warnings.