mmp / pbrt-v3

Source code for pbrt, the renderer described in the third edition of "Physically Based Rendering: From Theory To Implementation", by Matt Pharr, Wenzel Jakob, and Greg Humphreys.
http://pbrt.org
BSD 2-Clause "Simplified" License
4.88k stars 1.19k forks source link

Failure in geometry.h:242 #93

Closed pengsongyou closed 7 years ago

pengsongyou commented 7 years ago

I am trying to render the subusrface-spheres from pbrt-v3-scene. The .pbrt is like below:

Film "image" "integer xresolution" [240] "integer yresolution" [180]

Sampler "random" "integer pixelsamples" [1024]

LookAt 0 -6 3  0 0 0  0 0 1
Camera "perspective" "float fov" 40

Integrator "path"

WorldBegin

AttributeBegin
Rotate 90 0 0 1
Rotate -90 1 0 0
LightSource "infinite" "string mapname"
    "20060807_wells6_hd.exr"   "color scale" [2.5 2.5 2.5]
AttributeEnd

Translate .4 0 0

AttributeBegin
Translate -2.1 0 0
Material "subsurface" "string name" "Ketchup"
   "float uroughness" [0.05] "float vroughness" [0.05]
   "bool remaproughness" ["false"]
Shape "sphere" "float radius" 1
AttributeEnd

AttributeBegin
# front left
Translate .25 -.5 0
Material "subsurface" "string name" "Apple"
   "float uroughness" [0.05] "float vroughness" [0.05]
   "bool remaproughness" ["false"]
Shape "sphere" "float radius" 1
AttributeEnd

AttributeBegin
Translate -1 3 0
# back rightn
Material "subsurface" "string name" "Skin1"
   "float uroughness" [0.05] "float vroughness" [0.05]
   "bool remaproughness" ["false"]
Shape "sphere" "float radius" 1
AttributeEnd

AttributeBegin
Translate 2 2.25 0
# back left
Material "subsurface" "string name" "Coke"
   "float uroughness" [0.05] "float vroughness" [0.05]
   "bool remaproughness" ["false"]
Shape "sphere" "float radius" 1
AttributeEnd

AttributeBegin
Material "plastic" "color Kd" [.1 .1 .1]
  "color Ks" [.7 .7 .7] "float roughness" .1
Translate 0 0 -1
Shape "trianglemesh"
   "point P" [ -30 -30 0   30 -30 0   30 30 0 -30 30 0 ]
   "float uv" [ 0 0 1 0 1 1 0 1 ]
    "integer indices" [ 0 1 2 2 3 0]
AttributeEnd

WorldEnd

However, in the middle of rendering using pbrt, I got the error:

Rendering: [++++++++++++++++++               ]  (183.1s|149.8s)  F1108 12:39:00.385815 54763520 geometry.h:242] Check failed: f != 0 (0 vs. 0) 
*** Check failure stack trace: ***
    @        0x100225d51  google::LogMessage::Flush()
    @        0x100229c03  google::LogMessageFatal::~LogMessageFatal()
    @        0x1002266e9  google::LogMessageFatal::~LogMessageFatal()
    @        0x10017f3a1  Vector3<>::operator/<>()
    @        0x10002d69d  SurfaceInteraction::SurfaceInteraction()
    @        0x1001893e0  Triangle::Intersect()
    @        0x1000db5dd  GeometricPrimitive::Intersect()
    @        0x100126a94  BVHAccel::Intersect()
    @        0x100022275  SeparableBSSRDF::Sample_Sp()
    @        0x100021a08  SeparableBSSRDF::Sample_S()
    @        0x100145aff  PathIntegrator::Li()
    @        0x10002c8fa  std::__1::__function::__func<>::operator()()
    @        0x1000cda4d  workerThreadFunc()
    @        0x1000ce781  _ZNSt3__114__thread_proxyINS_5tupleIJPFviEiEEEEEPvS5_
    @     0x7fff8913e05a  _pthread_body
    @     0x7fff8913dfd7  _pthread_start
Abort trap 6

It works well when the pixelsamples is 512 or less, but when it is 1024, pbrt stops working.

Do you have any idea what happens here? Thank you very much!

mmp commented 7 years ago

Thanks for reporting this! It was an interesting bug to track down; it eventually led to a ">" test that should have been ">=". Should be fixed now.