From billconan at gmail.com Mon Jan 28 20:49:37 2008 From: billconan at gmail.com (Bill Conan) Date: Mon, 28 Jan 2008 17:49:37 -0800 Subject: [Pbrt-discuss] help! plugin problem. Message-ID: <555ee1790801281749u7ba230cai79285b1f52fd28fe@mail.gmail.com> hello guys, i wrote a accelerator plugin for pbrt. the code was modified directly from grid.cpp, however weird problem happened when i tried to run it. this is the problematic part: extern "C" DLLEXPORT Primitive *CreateAccelerator(const vector > &prims,const ParamSet &ps) { printf("%d",prims.size()); if(!prims[0]) printf("kkkkk"); return new GridTreeAccel(prims); } i tried to render areapot.pbrt the prims.size() is 105, however prims[0] is NULL, i will get access violation. why does this happen? i can't see any difference with grid.cpp. thank you. From dneilson at cs.ualberta.ca Mon Jan 28 22:03:48 2008 From: dneilson at cs.ualberta.ca (Daniel Neilson) Date: Mon, 28 Jan 2008 21:03:48 -0600 Subject: [Pbrt-discuss] help! plugin problem. In-Reply-To: <555ee1790801281749u7ba230cai79285b1f52fd28fe@mail.gmail.com> References: <555ee1790801281749u7ba230cai79285b1f52fd28fe@mail.gmail.com> Message-ID: <479E9794.3070109@cs.ualberta.ca> This may seem like an odd question but, did you try inserting the same printf()'s into grid.cpp to see whether they return the same results if you use a grid rather than your own plugin? It's been forever since I tried to do any pbrt coding so, I don't remember whether what you're seeing is "normal". -Daniel Bill Conan wrote: > hello guys, > > i wrote a accelerator plugin for pbrt. the code was modified directly > from grid.cpp, however weird problem happened when i tried to run it. > > this is the problematic part: > > extern "C" DLLEXPORT Primitive *CreateAccelerator(const > vector > &prims,const ParamSet &ps) > { > printf("%d",prims.size()); > if(!prims[0]) printf("kkkkk"); > return new GridTreeAccel(prims); > } > > i tried to render areapot.pbrt > the prims.size() is 105, however prims[0] is NULL, i will get access violation. > > why does this happen? i can't see any difference with grid.cpp. > > thank you. > _______________________________________________ > pbrt-discuss mailing list > pbrt-discuss at pbrt.org > http://six.pairlist.net/mailman/listinfo/pbrt-discuss -- Daniel Neilson | "As far as the laws of mathematics refer to dneilson at cs.ualberta.ca| reality, they are not certain; and as far as PhD Candidate | they are certain, they do not refer to reality" M.Sc, B.C.Sc(Hon) | -Albert Einstein From billconan at gmail.com Mon Jan 28 22:36:18 2008 From: billconan at gmail.com (Bill Conan) Date: Mon, 28 Jan 2008 19:36:18 -0800 Subject: [Pbrt-discuss] help! plugin problem. In-Reply-To: <479E9794.3070109@cs.ualberta.ca> References: <555ee1790801281749u7ba230cai79285b1f52fd28fe@mail.gmail.com> <479E9794.3070109@cs.ualberta.ca> Message-ID: <555ee1790801281936k5cc72436sfa314b36d499f1bc@mail.gmail.com> hi, thank you, i solved the problem. the problematic part is somewhere else. but i don't know why i got this weird error message. i don't like plugin architecture. it's hard to debug sometime. thank you. On Jan 28, 2008 7:03 PM, Daniel Neilson wrote: > > This may seem like an odd question but, did you try inserting the same > printf()'s into grid.cpp to see whether they return the same results if > you use a grid rather than your own plugin? It's been forever since I > tried to do any pbrt coding so, I don't remember whether what you're > seeing is "normal". > > -Daniel > > > > Bill Conan wrote: > > hello guys, > > > > i wrote a accelerator plugin for pbrt. the code was modified directly > > from grid.cpp, however weird problem happened when i tried to run it. > > > > this is the problematic part: > > > > extern "C" DLLEXPORT Primitive *CreateAccelerator(const > > vector > &prims,const ParamSet &ps) > > { > > printf("%d",prims.size()); > > if(!prims[0]) printf("kkkkk"); > > return new GridTreeAccel(prims); > > } > > > > i tried to render areapot.pbrt > > the prims.size() is 105, however prims[0] is NULL, i will get access violation. > > > > why does this happen? i can't see any difference with grid.cpp. > > > > thank you. > > _______________________________________________ > > pbrt-discuss mailing list > > pbrt-discuss at pbrt.org > > http://six.pairlist.net/mailman/listinfo/pbrt-discuss > > -- > Daniel Neilson | "As far as the laws of mathematics refer to > dneilson at cs.ualberta.ca| reality, they are not certain; and as far as > PhD Candidate | they are certain, they do not refer to reality" > M.Sc, B.C.Sc(Hon) | -Albert Einstein > > _______________________________________________ > pbrt-discuss mailing list > pbrt-discuss at pbrt.org > http://six.pairlist.net/mailman/listinfo/pbrt-discuss >