Skip to content

Apparently bug in 'buildRadixTree' #2

@vtushevskiy

Description

@vtushevskiy

In the kernel:

__kernel void buildRadixTree(__global struct BVHNode* nodeBuffer,__global uint2* mortonBuffer, uint leafCount)
{
	uint idx = get_global_id(0);
	if (idx < leafCount-2)
		constructNode(nodeBuffer,mortonBuffer,leafCount, get_global_id(0));
} 

it seems it should be "leafCount-1".
Otherwise there will be crash when you have one triangle on certain big distance in positive direction. In that case this triangle will be last element in morton code array.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions