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

Computes mortons over each particle in the simulation for LBVH construction. More...

Go to the source code of this file.

Data Structures

struct  Particle
struct  MortonEntry

Macros

#define BODY_COUNT   15000
#define MAX_NODES   45000
#define WORKGROUP_SIZE   128

Functions

 layout (local_size_x=WORKGROUP_SIZE) in
 layout (std430, binding=1) buffer ParticleData
uint expand_bits (uint v)
uint morton (uint x, uint y, uint z)
float orderedUintToFloat (uint u)
void main ()

Detailed Description

Computes mortons over each particle in the simulation for LBVH construction.

Definition in file morton.comp.


Data Structure Documentation

◆ Particle

struct Particle

Definition at line 7 of file main.h.

Data Fields
vec3 pos
vec3 vel
vec4 p_m
vec4 mat
vec4 vel
vec4 acc

◆ MortonEntry

struct MortonEntry

Definition at line 29 of file bounds.comp.

Data Fields
uint pid
uint morton

Macro Definition Documentation

◆ BODY_COUNT

#define BODY_COUNT   15000

Definition at line 9 of file morton.comp.

◆ MAX_NODES

#define MAX_NODES   45000

Definition at line 10 of file morton.comp.

◆ WORKGROUP_SIZE

#define WORKGROUP_SIZE   128

Definition at line 11 of file morton.comp.

Function Documentation

◆ layout() [1/2]

layout ( local_size_x = WORKGROUP_SIZE)

◆ layout() [2/2]

layout ( std430 ,
binding = 1 )

Definition at line 23 of file morton.comp.

References BODY_COUNT, and layout().

◆ expand_bits()

uint expand_bits ( uint v)

Definition at line 59 of file morton.comp.

References expand_bits().

Referenced by expand_bits(), expand_bits(), morton(), and morton().

◆ morton()

uint morton ( uint x,
uint y,
uint z )

Definition at line 68 of file morton.comp.

References expand_bits(), and morton().

Referenced by delta(), layout(), main(), morton(), and morton().

◆ orderedUintToFloat()

float orderedUintToFloat ( uint u)

Definition at line 72 of file morton.comp.

References orderedUintToFloat().

Referenced by main(), and orderedUintToFloat().

◆ main()

void main ( )

Definition at line 77 of file morton.comp.

References BODY_COUNT, clamp(), main(), morton(), and orderedUintToFloat().