Space Sim
Loading...
Searching...
No Matches
tree.comp File Reference

Constructs an LBVH over the radix sorted mortons. More...

Go to the source code of this file.

Data Structures

struct  MortonEntry
struct  Node

Macros

#define WORKGROUP_SIZE   128
#define RADIX_SORT_BINS   128
#define SUBGROUP_SIZE   32
#define BODY_COUNT   15000
#define MAX_NODES   45000
#define MAX_DEPTH   64

Functions

 layout (local_size_x=WORKGROUP_SIZE) in
 layout (std430, binding=2) buffer MortonData
int shared_prefix (uint m0, uint pid0, uint m1, uint pid1)
int delta (int a, int b)
void main ()

Detailed Description

Constructs an LBVH over the radix sorted mortons.

Definition in file tree.comp.


Data Structure Documentation

◆ MortonEntry

struct MortonEntry

Definition at line 29 of file bounds.comp.

Data Fields
uint pid
uint morton

◆ Node

struct Node

Definition at line 108 of file types.h.

Data Fields
vec3 center_of_mass
vec3 center
float mass
int first_child
bool subdivided
float half_size
int body_index
vec4 com_m
vec4 min
vec3 max
int next
ivec4 lrpd

Macro Definition Documentation

◆ WORKGROUP_SIZE

#define WORKGROUP_SIZE   128

Definition at line 8 of file tree.comp.

◆ RADIX_SORT_BINS

#define RADIX_SORT_BINS   128

Definition at line 9 of file tree.comp.

◆ SUBGROUP_SIZE

#define SUBGROUP_SIZE   32

Definition at line 10 of file tree.comp.

◆ BODY_COUNT

#define BODY_COUNT   15000

Definition at line 12 of file tree.comp.

◆ MAX_NODES

#define MAX_NODES   45000

Definition at line 13 of file tree.comp.

◆ MAX_DEPTH

#define MAX_DEPTH   64

Definition at line 38 of file tree.comp.

Function Documentation

◆ layout() [1/2]

layout ( local_size_x = WORKGROUP_SIZE)

◆ layout() [2/2]

layout ( std430 ,
binding = 2 )

Definition at line 23 of file tree.comp.

References layout().

◆ shared_prefix()

int shared_prefix ( uint m0,
uint pid0,
uint m1,
uint pid1 )

Definition at line 50 of file tree.comp.

References shared_prefix().

Referenced by delta(), main(), and shared_prefix().

◆ delta()

int delta ( int a,
int b )

Definition at line 71 of file tree.comp.

References BODY_COUNT, delta, morton(), and shared_prefix().

◆ main()

void main ( )

Definition at line 77 of file tree.comp.

References BODY_COUNT, delta, main(), morton(), shared_prefix(), and t.