NeroReflex

Untitled

Nov 7th, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.79 KB | None | 0 0
  1. void updateTLASLeaf(const uint indexOfLeafInTLAS) {
  2.     uint indexOfLastUpdatedNodeInTLAS = ((1 << expOfTwo_maxModels) - 1) + indexOfLeafInTLAS;
  3.  
  4.     tlas.tree[indexOfLastUpdatedNodeInTLAS].aabb = tlasBLAS[indexOfLeafInTLAS].tree[0].aabb;
  5.  
  6.     /*tlas.tree[indexOfLastUpdatedNodeInTLAS].aabb = transformAABB(tlasBLAS[indexOfLeafInTLAS].tree[0].aabb, tlasBLAS[indexOfLeafInTLAS].ModelMatrix);
  7.  
  8.     while (!isRootNode(indexOfLastUpdatedNodeInTLAS)) {
  9.         memoryBarrier();
  10.  
  11.         // Target the parent node for update
  12.         indexOfLastUpdatedNodeInTLAS = parentNode(indexOfLastUpdatedNodeInTLAS);
  13.  
  14.         // Update the current node
  15.         tlas.tree[indexOfLastUpdatedNodeInTLAS].aabb = joinAABBs(
  16.                 tlas.tree[leftNode(indexOfLastUpdatedNodeInTLAS)].aabb,
  17.                 tlas.tree[rightNode(indexOfLastUpdatedNodeInTLAS)].aabb);
  18.     }*/
  19. }
Advertisement
Add Comment
Please, Sign In to add comment