rweyrauch / PBrtJ

Port of PBRT v3 to Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong recursion stop case.

attiju opened this issue · comments

Shouldn't you stop recursion when the number of primitives in current node is equal or bellow maxPrimsInNode ?

In the current version, end == start + 1 then the for loop is useless.

I suppose you wanted the if condition to be if (nPrimitives <= maxPrimsInNode) { ... }

if (nPrimitives == 1) {